Java program to find max ( X , Y ) / min ( X , Y ) after P turns
import java . util . * ; class Even_odd { public static int findValue ( int X , int Y , int P ) { if ( P % 2 == 0 ) return ( Math . max ( X , Y ) / Math . min ( X , Y ) ) ; else return ( Math . max ( 2 * X , Y ) / Math . min ( 2 * X , Y ) ) ; }