

Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 点
問題文
整数 が与えられます。 以下の正の整数の組 であって、 がすべて の倍数であるようなものの個数を求めてください。 ただし、 の順番を入れ替えただけの組も異なるものとして数えます。また、 の中に同じものがあっても構いません。
制約
- は整数である
入力
入力は以下の形式で標準入力から与えられる。
出力
以下の正の整数の組 であって、 がすべて の倍数であるようなものの個数を出力せよ。
入力例 1Copy
3 2
出力例 1Copy
9
が条件を満たします。
入力例 2Copy
5 3
出力例 2Copy
1
入力例 3Copy
31415 9265
出力例 3Copy
27
入力例 4Copy
35897 932
出力例 4Copy
114191
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 .
Sample Input 1Copy
3 2
Sample Output 1Copy
9
and satisfy the condition.
Sample Input 2Copy
5 3
Sample Output 2Copy
1
Sample Input 3Copy
31415 9265
Sample Output 3Copy
27
Sample Input 4Copy
35897 932
Sample Output 4Copy
114191