Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. import java.io.BufferedReader;
  2. import java.io.InputStreamReader;
  3.  
  4. public class Bus {
  5.  
  6. public static void main(String[] args) throws Exception {
  7. int i,j,k;
  8.  
  9. BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  10.  
  11. int adults = Integer.parseInt(br.readLine());
  12. int children = Integer.parseInt(br.readLine());
  13.  
  14. br.close();
  15. int minimum=0,maksimum=0,price=100;
  16. if(children<=adults)
  17. {
  18. minimum=price*adults;
  19. maksimum=price*(adults+children-1);
  20. if(children==0)
  21. {
  22. maksimum=price*adults;
  23. }
  24. }
  25. if(children>adults)
  26. {
  27. minimum=price*children;
  28. maksimum=price*(children+adults-1);
  29. }
  30. System.out.println(minimum);
  31. System.out.println(maksimum);
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement