#include <iostream>
#include <string.h>
#include <stdio.h> using namespace std;
typedef long long LL; LL work(LL n)
{
LL ans = ;
for(int k = ; k <= n / ; k++)
ans += (n - * k) / + ;
return ans;
} int main()
{
LL n;
while(cin>>n)
cout<<work(n)<<endl;
return ;
}

#include <iostream>
#include <string.h>
#include <stdio.h> using namespace std;
typedef long long LL; LL work(LL n)
{
LL k = n / ;
LL t = (k + ) * n - * k * (k + ) / ;
LL ans = k + ;
if(k & ) t -= (k + ) / ;
else if(n & ) t -= (k / + );
else t -= k / ;
t >>= ;
return ans + t;
} int main()
{
LL n;
while(cin>>n)
cout << work(n) << endl;
return ;
}

最新文章

  1. Docker搭建Java Web运行环境
  2. 自我反思--table的简单数据分页
  3. flash cs6导入某些mp3不能的解决办法
  4. [uboot]E9-i.MX6Q-uboot移植
  5. python 循环定时器
  6. POI Excel导出样式设置
  7. ubuntu ll命令
  8. PL/SQL database character set(AL32UTF8) and Client character set(ZHS16GBK) are different
  9. 将 Android* x86 NDK 供 Eclipse* 而移植 NDK 演示示例应用程序
  10. python 数据驱动(ddt)
  11. LeetCode第[15]题(Java):3Sum 标签:Array
  12. 备忘录之 —— .bashrc(IC工具篇)
  13. 测者的性能测试手册:JVM的监控利器
  14. PageHelper 自动去掉排序参数问题
  15. Vmware Workstation添加centos 7系统网络问题(无IP情况)
  16. [luogu4005]小Y和地铁【搜索+树状数组】
  17. Maven教程3(依赖管理)
  18. php中cal_days_in_month不可用时的替代方法(计算一个月的天数)
  19. 力扣(LeetCode) 905. 按奇偶排序数组
  20. Spring源码解析 - ListableBeanFactory

热门文章

  1. CCF 201512-3 画图 (DFS搜索+模拟)
  2. Tomcat 容器的安全认证和鉴权
  3. throw UnsupportedOperationException
  4. 删除链表中的倒数第n个元素
  5. Codeforces 174B【模拟构造】
  6. (十二)SpringBoot 设置定时任务
  7. D. Pair Of Lines( Educational Codeforces Round 41 (Rated for Div. 2))
  8. Python 杂集
  9. 洛谷 P1067 多项式输出
  10. SNMP消息传输机制