http://codeforces.com/contest/382/problem/B

题意:给你Aa,b,w,x,c,然后每经过1秒,c=c-1;  如果b>=x,b=b-x;否则 a=a-1,b=w-(x-b);  问经过多少秒c<=a;

 #include <cstdio>
#include <cstring>
#include <algorithm>
#define ll __int64
using namespace std; ll a,b,w,x,c; int main()
{
while(scanf("%I64d%I64d%I64d%I64d%I64d",&a,&b,&w,&x,&c)!=EOF)
{
ll l=,r=;
if(c<=a)
{
printf("0\n");
continue;
}
b=w-b-;
while(l<r)
{
ll mid=(l+r)/;
ll aa=a-(b+mid*x)/w;
ll cc=c-mid;
if(cc<=aa) r=mid;
else l=mid+;
}
printf("%I64d\n",l);
}
}

最新文章

  1. Model Validation in ASP.NET Web API
  2. C# EF增删改查
  3. Shanghai Regional Online Contest 1004
  4. JSON字符串和对象之间的转换
  5. 【WPF】Winform调用WPF窗体注意事项
  6. zookeeper监控告警
  7. Ubuntu安装samba服务器
  8. beforefieldinit释义(2)
  9. 解读QML之三
  10. javascript中构造StringBuffer实例
  11. 设计模式-策略模式(strategy pattern)
  12. UWP中实现大爆炸效果(二)
  13. Win 10中使用图片查看器
  14. 图解CSS3核心技术与案例实战(1)
  15. MachineLN博客目录
  16. JMeter采用NON GUI模式时如何记录并查看错误
  17. SWD and JTAG selection mechanism
  18. spring定时任务详解(@Scheduled注解)多线程讲解
  19. vue 混入的理解
  20. ruby md5 sha1 base64加密

热门文章

  1. 对vpn的认识
  2. Notepad++如何安装并使用source code pro 字体 转
  3. 利用systemtap学习Linux路由代码
  4. TCP/IP协议原理与应用笔记02:断点续传
  5. C#使用框架,打开新选项卡
  6. iOS将产品进行多语言发布,开发
  7. 关于 ASP.NET 验证码
  8. How to handle the DbEntityValidationException in C#
  9. hdoj 1176(可转化为数塔)
  10. ccui.ScrollView 扩展