题目链接:点击打开链接
题意:
给定a,b
对于一个数x,若x是nice number,则满足(x/b)/(x%b) == [1,a](即结果在1-a之间)
问:
输出一个数表示 所有nice number的和。
推一推公式就好。。
结果就是
b*(b-1)/2 * (a + b*( (1+a)*a/2 ) )
#include#include #include #include #include #include
题目链接:点击打开链接
题意:
给定a,b
对于一个数x,若x是nice number,则满足(x/b)/(x%b) == [1,a](即结果在1-a之间)
问:
输出一个数表示 所有nice number的和。
推一推公式就好。。
结果就是
b*(b-1)/2 * (a + b*( (1+a)*a/2 ) )
#include#include #include #include #include #include