atcoder#ARC102A. [ABC108C] Triangular Relationship
[ABC108C] Triangular Relationship
Score : points
Problem Statement
You are given integers and . Find the number of triples of positive integers not greater than such that and are all multiples of . The order of does matter, and some of them can be the same.
Constraints
- and are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of triples of positive integers not greater than such that and are all multiples of .
3 2
9
$(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1)$ and satisfy the condition.
5 3
1
31415 9265
27
35897 932
114191