[HAOI2011] Problem b (arithmetical functions + convolution)

 

【HAOI2011】 Problem b

Title Description

Interrogation given for n, each seeking the number of the number of (x, y), satisfying a≤x≤b, c≤y≤d, and gcd (x, y) = k, gcd (x, y ) as a function of the greatest common divisor of x and y.

Input Format

The first line n an integer, the next five lines each integer n, respectively, a, b, c, d, k

Output Format

A total of n lines, each line an integer number satisfying the requirements of the number of the (x, y) of

Description / Tips

100% data satisfies: 1≤n≤50000,1≤a≤b≤50000,1≤c≤d≤50000,1≤k≤50000

 

View Code

 

 

Guess you like

Origin www.cnblogs.com/rentu/p/11256350.html