注册
登录
帮助
首页
题库
运行状态
比赛
用户
题解系统
QQ群: 181873520
[B] GCD
时间限制: 2000 ms 内存限制: 65535 K
问题描述
Given an integer n(1 <= n <= 400000), you need to calculator the sum of all gcd(i, j) for 1 <= i < j <= n.
输入
Each test case contains an integer n.
The last line contains 0, you need not to process it.
输出
For each test case, print the sum of of all gcd(i, j) for 1 <= i < j <= n.
样例输入
3 12452
样例输出
3 424642359
提示
无
来源
Alex@NBUT
操作
题目 Problems
A - XorXor
[11 / 24 (45.83%)]
B - GCD
[1 / 9 (11.11%)]
C - A Magic Number
[4 / 13 (30.77%)]
状态 Status
统计 Statistics
排名 Rank
报名参赛 SIGN UP
显示春菜