Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Jedi {
- public static void main(String[] args) {
- Scanner scanner=new Scanner(System.in);
- int n= Integer.parseInt(scanner.nextLine());
- int m= Integer.parseInt(scanner.nextLine());
- byte y= Byte.parseByte(scanner.nextLine());
- int z=n;
- int countPoked=0;
- boolean flag=false;
- while(m<z){
- z=z-m;
- countPoked++;
- if (z==m && n%2==0){
- n=z/y;
- flag=true;
- System.out.println(n);
- System.out.println(countPoked);
- break;
- }else if (z==m && n%2!=0){
- flag=false;
- continue;
- }
- }
- if(flag==false){
- System.out.println(z);
- System.out.println(countPoked);}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement