「BZOJ3529」[SDOI2014] 数表

2015年1月13日7,1842

Description

    有一张N×m的数表,其第i行第j列(1 < =i < =礼,1 < =j < =m)的数值为
能同时整除i和j的所有自然数之和。给定a,计算数表中不大于a的数之和。

Input

    输入包含多组数据。
输入的第一行一个整数Q表示测试点内的数据组数,接下来Q行,每行三个整数n,m,a(|a| < =10^9)描述一组数据。

Output

    对每组数据,输出一行一个整数,表示答案模2^31的值。

Sample Input

2
4 4 3
10 10 5

Sample Output

20
148

HINT

1 < =N.m < =10^5  , 1 < =Q < =2×10^4

题解

我们一起去膜拜popoQQQ

http://wenku.baidu.com/view/fbec9c63ba1aa8114431d9ac.html

 

avatar
1 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
hzwer Recent comment authors
  Subscribe  
提醒
邹雨恒

Orzorzorzorzorzorzorzorz