[链接] 我是链接,点我呀:) [题意] 让你求出所有x的和 其中 (x div b)是(x mod b)的倍数 且x mod b不等于0 且(x div b)除(x mod b)的值(假设为k),k∈[1..a] [题解] 枚举k从1~a 这样k就固定了 n = x / b; m = x % b; n = mk ····① x = bn + m x = (bk+1)m 而m∈[1..b-1] 所以求和一下就是∑x = (bk+1)( b*(b-1)/2) 这里我们m属于1..b-1,显然由①式…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output A magic island Geraldion, where Gerald lives, has its own currency system. It uses banknotes of several values. But the problem is, the system i…