Time limit
2s
Memory limit
128 MB
Given three integers a, b, and d, count the number of ordered pairs of positive integers (x, y) that satisfy all of the following conditions:
Several queries are given in one input file. The first line contains the number of queries N. Each of the next N lines contains three integers a, b, and d describing one query.
For each query, print its answer on its own line.
For the first query in the visible test case, there are three ordered pairs: (2, 2), (2, 4), and (4, 2). For the second query, there are two ordered pairs: (3, 3) and (6, 3).