Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class MineralWater {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int small = Integer.parseInt(scanner.nextLine());
- int big = Integer.parseInt(scanner.nextLine());
- int capacity = Integer.parseInt(scanner.nextLine());
- int result = -1;
- big = big * 5;
- if (capacity == big) {
- result = 0;
- System.out.println(result);
- }
- else if( capacity > big + small){
- System.out.println(result);
- }
- else {
- result = small;
- System.out.println(result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement