题解 | #KiKi和酸奶#

KiKi和酸奶

http://www.nowcoder.com/practice/c7721f3a1b1a47a783974453e82cadbb

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
		String[] strs = str.split(" ");
        int n = Integer.parseInt(strs[0]);
        int h = Integer.parseInt(strs[1]);
        int m = Integer.parseInt(strs[2]);
        int remainder = n - (m + h - 1) / h;//喝完一盒后另一盒立即打开
        System.out.println(remainder);
    }
}
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务