java写的,ac了 public static void main(String[] args) { Scanner cin = new Scanner(System.in); while (cin.hasNextInt()) { int a = cin.nextInt(); int b = cin.nextInt(); int k = cin.nextInt(); int v = cin.nextInt(); int res=0; while(a>0){ if(b>=k-1){ b=b-(k-1); a-=k*v; }else if(b<(k-1) && b!=0){ a-=v*(b+1); b=0; }else{ a-=v; } res++; } System.out.println(res); } }
1 10

相关推荐

10-28 10:48
已编辑
门头沟学院 Java
孩子我想要offer:发笔试后还没笔试把我挂了,然后邮箱一直让我测评没测,后面不知道干嘛又给我捞起来下轮笔试,做完测评笔试又挂了😅
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务