Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import javax.swing.*;
- import java.beans.IntrospectionException;
- 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 count = 0;
- double halfOfOriginalValue = n /2.0;
- while (n >= m) {
- n-=m;
- if (n == halfOfOriginalValue && y > 0) {
- n /= y;
- }
- count++;
- }
- System.out.println(n);
- System.out.println(count);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement