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

相关推荐

05-08 14:40
广东白云学院
各位大佬方狠狠批评吧
凌offer:投私企,政治面貌不是党员或者预备党员就不要写了,什么族感觉也没啥要写的必要
点赞 评论 收藏
分享
吴offer选手:我卡在笔试才是最好笑的,甚至没给我发过笔试链接
投递哔哩哔哩等公司6个岗位
点赞 评论 收藏
分享
牛客网
牛客企业服务