Advertisement
Guest User

Untitled

a guest
Oct 13th, 2022
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class MineralWater {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. int small = Integer.parseInt(scanner.nextLine());
  7. int big = Integer.parseInt(scanner.nextLine());
  8. int capacity = Integer.parseInt(scanner.nextLine());
  9. int result = -1;
  10.  
  11.  
  12. big = big * 5;
  13.  
  14. if (capacity == big) {
  15. result = 0;
  16. System.out.println(result);
  17. }
  18. else if( capacity > big + small){
  19. System.out.println(result);
  20. }
  21. else {
  22. result = small;
  23. System.out.println(result);
  24. }
  25.  
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement