valdo222

pokemon

Feb 3rd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class PokeMon {
  4. public static void main(String[] args) {
  5.  
  6. Scanner scanner = new Scanner(System.in);
  7.  
  8. long nPokePower = Integer.parseInt(scanner.nextLine());
  9. int mDistance = Integer.parseInt(scanner.nextLine());
  10. int yExhaustion = Integer.parseInt(scanner.nextLine());
  11. int count = 0;
  12. long exhaustionRaiting=0;
  13. if (nPokePower%2==0) {
  14. exhaustionRaiting = nPokePower / 2;
  15. }
  16. while (mDistance<=nPokePower){
  17. count++;
  18. nPokePower-=mDistance;
  19. if (nPokePower==exhaustionRaiting&&nPokePower>=yExhaustion&&yExhaustion!=0){
  20. nPokePower/=yExhaustion;
  21.  
  22. }
  23. }
  24. System.out.println(nPokePower);
  25. System.out.println(count);
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment