Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = Integer.parseInt(scanner.nextLine());
- int m = Integer.parseInt(scanner.nextLine());
- int y = Integer.parseInt(scanner.nextLine());
- int a = n / 2;
- int poke = 0;
- while (n >= m) {
- n -= m;
- if (a == n && n > 0) {
- n /= y;
- }
- poke++;
- }
- System.out.println(n);
- System.out.println(poke);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement