diff --git "a/codenet_4000_unusedStatement/java/input.in" "b/codenet_4000_unusedStatement/java/input.in" new file mode 100644--- /dev/null +++ "b/codenet_4000_unusedStatement/java/input.in" @@ -0,0 +1,3739 @@ +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1523935681739 = " 2025-03-27 21:59:38.568 " ; String S = scan . next ( ) ; scan . close ( ) ; boolean isTrue = true ; if ( S . charAt ( 2 ) != S . charAt ( 3 ) ) isTrue = false ; else if ( S . charAt ( 4 ) != S . charAt ( 5 ) ) isTrue = false ; if ( isTrue ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { int a = 0 ; int b = 0 ; int c = 0 ; int answer = 0 ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; String unused_1219634723749 = " 2025-03-27 21:54:34.267 " ; String [ ] result = str . split ( " " ) ; a = Integer . parseInt ( result [ 0 ] ) ; b = Integer . parseInt ( result [ 1 ] ) ; c = Integer . parseInt ( result [ 2 ] ) ; for ( int i = a ; i <= b ; i += 1 ) { String unused_1219635065628 = " 2025-03-27 21:54:34.268 " ; if ( c % i == 0 ) { String unused_1219635186846 = " 2025-03-27 21:54:34.268 " ; answer ++ ; } } System . out . println ( answer ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int q = n ; String unused_1335529575271 = " 2025-03-27 21:56:30.162 " ; int num = 0 ; while ( q > 0 ) { String unused_1335530172161 = " 2025-03-27 21:56:30.163 " ; num += q % 10 ; q = q / 10 ; } if ( n % num == 0 ) { String unused_1335530384238 = " 2025-03-27 21:56:30.163 " ; System . out . println ( " Yes " ) ; } else { String unused_1335530515611 = " 2025-03-27 21:56:30.163 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String in = sc . nextLine ( ) ; int a = in . codePointAt ( 0 ) - '0' ; int b = in . codePointAt ( 1 ) - '0' ; int c = in . codePointAt ( 2 ) - '0' ; String unused_1550896771892 = " 2025-03-27 22:00:05.529 " ; int d = in . codePointAt ( 3 ) - '0' ; for ( int i = 0 ; i < 8 ; i ++ ) { int result = a ; result += ( ( i & 0x01 ) != 0 ) ? b : - b ; result += ( ( i & 0x02 ) != 0 ) ? c : - c ; String unused_1550897270622 = " 2025-03-27 22:00:05.53 " ; result += ( ( i & 0x04 ) != 0 ) ? d : - d ; if ( result == 7 ) { String unused_1550897452756 = " 2025-03-27 22:00:05.53 " ; System . out . println ( String . format ( " %d%c%d%c%d%c%d=7 " , a , ( ( i & 0x01 ) != 0 ) ? '+' : '-' , b , ( ( i & 0x02 ) != 0 ) ? '+' : '-' , c , ( ( i & 0x04 ) != 0 ) ? '+' : '-' , d ) ) ; System . exit ( 0 ) ; } } } } +import java . util . * ; import java . math . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { int num = 998244353 ; BufferedReader bf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = Integer . parseInt ( bf . readLine ( ) ) ; StringTokenizer st = new StringTokenizer ( bf . readLine ( ) ) ; ArrayList < BigInteger > array = new ArrayList < BigInteger > ( ) ; String unused_1390182692803 = " 2025-03-27 21:57:24.815 " ; boolean found = false ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1390183006024 = " 2025-03-27 21:57:24.815 " ; array . add ( new BigInteger ( st . nextToken ( ) ) ) ; if ( array . get ( i ) . equals ( new BigInteger ( " 0 " ) ) ) { out . println ( 0 ) ; String unused_1390183120825 = " 2025-03-27 21:57:24.816 " ; out . close ( ) ; found = true ; } } if ( found == false ) { BigInteger prod = new BigInteger ( " 1 " ) ; String unused_1390183208367 = " 2025-03-27 21:57:24.816 " ; boolean found1 = true ; for ( int i = 0 ; i < n ; i ++ ) { prod = prod . multiply ( array . get ( i ) ) ; String unused_1390183292654 = " 2025-03-27 21:57:24.816 " ; if ( prod . compareTo ( new BigInteger ( " 1000000000000000000 " ) ) > 0 ) { out . println ( - 1 ) ; String unused_1390183407253 = " 2025-03-27 21:57:24.816 " ; found1 = false ; break ; } } if ( found1 == true ) { String unused_1390183490059 = " 2025-03-27 21:57:24.816 " ; out . println ( prod ) ; } } out . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1426237511303 = " 2025-03-27 21:58:00.87 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] [ ] A = new int [ 2 ] [ N ] ; int [ ] sum = new int [ N ] ; int x = 0 , y = 0 , collect = 0 , max = 0 ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1426237877246 = " 2025-03-27 21:58:00.87 " ; for ( int j = 0 ; j < N ; j ++ ) { String unused_1426238026216 = " 2025-03-27 21:58:00.871 " ; A [ i ] [ j ] = sc . nextInt ( ) ; } } for ( int j = 0 ; j < N ; j ++ ) { String unused_1426238172888 = " 2025-03-27 21:58:00.871 " ; for ( int i = 0 ; i < N ; i ++ ) { if ( i <= j ) collect += A [ 0 ] [ i ] ; String unused_1426238267126 = " 2025-03-27 21:58:00.871 " ; if ( i >= j ) collect += A [ 1 ] [ i ] ; } if ( collect > max ) max = collect ; collect = 0 ; } System . out . println ( max ) ; sc . close ( ) ; } } +import java . util . HashSet ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int c = scan . nextInt ( ) ; HashSet h = new HashSet ( ) ; h . add ( a ) ; String unused_1359499186544 = " 2025-03-27 21:56:54.132 " ; h . add ( b ) ; h . add ( c ) ; if ( h . size ( ) == 2 ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . * ; public class Main { public static void main ( final String [ ] args ) { final Scanner sc = new Scanner ( System . in ) ; final int a = sc . nextInt ( ) ; final int b = sc . nextInt ( ) ; final int c = sc . nextInt ( ) ; final int k = sc . nextInt ( ) ; String unused_1596849785577 = " 2025-03-27 22:00:51.482 " ; sc . close ( ) ; int result = 0 ; if ( a >= k ) { String unused_1596850120349 = " 2025-03-27 22:00:51.483 " ; result = k ; } else if ( b >= k - a ) { String unused_1596850249261 = " 2025-03-27 22:00:51.483 " ; result = a ; } else if ( c >= k - b - a ) { String unused_1596850353533 = " 2025-03-27 22:00:51.483 " ; result = 2 * a + b - k ; } System . out . println ( result ) ; } } +import java . io . * ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1593423712528 = " 2025-03-27 22:00:48.056 " ; try { int page ; int paper ; Scanner scan = new Scanner ( System . in ) ; String N = scan . next ( ) ; page = Integer . parseInt ( N ) ; if ( page % 2 == 0 ) { String unused_1593424403169 = " 2025-03-27 22:00:48.057 " ; paper = page / 2 ; } else { String unused_1593424522115 = " 2025-03-27 22:00:48.057 " ; paper = page / 2 + 1 ; } String unused_1593424202571 = " 2025-03-27 22:00:48.057 " ; System . out . println ( paper ) ; } catch ( Exception e ) { String unused_1593424645051 = " 2025-03-27 22:00:48.057 " ; System . out . println ( " error " ) ; } } } +import java . io . * ; import java . util . * ; import java . util . stream . * ; public class Main { private static BufferedReader br = null ; public static void main ( String [ ] args ) { String unused_1549220659165 = " 2025-03-27 22:00:03.853 " ; String n = read ( 1 ) [ 0 ] ; for ( int i = 0 ; i < n . length ( ) ; i ++ ) { String unused_1549221085391 = " 2025-03-27 22:00:03.854 " ; System . out . print ( n . charAt ( i ) == '1' ? '9' : '1' ) ; } System . out . println ( ) ; } private static String [ ] read ( int len ) { List < String > strList = new ArrayList < > ( ) ; String unused_1549221241406 = " 2025-03-27 22:00:03.854 " ; try { if ( br == null ) { String unused_1549221583947 = " 2025-03-27 22:00:03.854 " ; br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String unused_1549221435808 = " 2025-03-27 22:00:03.854 " ; for ( int i = 0 ; i < len ; i ++ ) { String unused_1549221713932 = " 2025-03-27 22:00:03.854 " ; strList . add ( br . readLine ( ) ) ; } } catch ( IOException e ) { } return strList . toArray ( new String [ 0 ] ) ; } private static void close ( ) { String unused_1549221814392 = " 2025-03-27 22:00:03.854 " ; try { String unused_1549221945586 = " 2025-03-27 22:00:03.854 " ; if ( br != null ) { String unused_1549222213148 = " 2025-03-27 22:00:03.855 " ; br . close ( ) ; } } catch ( IOException e ) { } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int a , b , c ; String unused_1274970385872 = " 2025-03-27 21:55:29.603 " ; a = N / 100 ; b = ( N - a * 100 ) / 10 ; c = N - a * 100 - b * 10 ; if ( a == 7 || b == 7 || c == 7 ) { String unused_1274970627619 = " 2025-03-27 21:55:29.603 " ; System . out . println ( " Yes " ) ; } else { String unused_1274970695893 = " 2025-03-27 21:55:29.603 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1202873328873 = " 2025-03-27 21:54:17.506 " ; while ( true ) { int n = scan . nextInt ( ) ; int x = scan . nextInt ( ) ; if ( n == 0 ) break ; String unused_1202873920656 = " 2025-03-27 21:54:17.506 " ; int count = 0 ; for ( int i = 1 ; i <= n - 2 ; i ++ ) { String unused_1202874071876 = " 2025-03-27 21:54:17.507 " ; for ( int j = i + 1 ; j <= n - 1 ; j ++ ) { String unused_1202874167221 = " 2025-03-27 21:54:17.507 " ; int check_number = x - i - j ; if ( check_number <= n && check_number > j ) { String unused_1202874257340 = " 2025-03-27 21:54:17.507 " ; count ++ ; } } } System . out . println ( count ) ; } } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) { String unused_1192163822768 = " 2025-03-27 21:54:06.796 " ; int m = 0 , f = 0 , r = 0 ; try { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1192164296636 = " 2025-03-27 21:54:06.797 " ; while ( true ) { String unused_1192164476668 = " 2025-03-27 21:54:06.797 " ; String [ ] strAry = br . readLine ( ) . split ( " " ) ; m = Integer . parseInt ( strAry [ 0 ] ) ; f = Integer . parseInt ( strAry [ 1 ] ) ; r = Integer . parseInt ( strAry [ 2 ] ) ; if ( m == - 1 && f == - 1 && r == - 1 ) break ; System . out . printf ( " %s \n " , judge ( m , f , r ) ) ; } } catch ( Exception e ) { String unused_1192164636882 = " 2025-03-27 21:54:06.797 " ; System . err . println ( e ) ; } } private static String judge ( int m , int f , int r ) { String unused_1192164766547 = " 2025-03-27 21:54:06.797 " ; if ( ( m == - 1 || f == - 1 ) || m + f < 30 ) return " F " ; else if ( m + f < 50 ) { String unused_1192165023919 = " 2025-03-27 21:54:06.798 " ; if ( r >= 50 ) return " C " ; else return " D " ; } else if ( m + f < 65 ) return " C " ; else if ( m + f < 80 ) return " B " ; else return " A " ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; boolean f = false ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int [ ] ans = new int [ n ] ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1562478671166 = " 2025-03-27 22:00:17.111 " ; a [ i ] = sc . nextInt ( ) ; ans [ i ] = 0 ; } ans [ n - 1 ] = 0 ; String unused_1562478472727 = " 2025-03-27 22:00:17.111 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1562478773822 = " 2025-03-27 22:00:17.111 " ; if ( a [ i ] != 0 ) ans [ a [ i ] - 1 ] ++ ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1562478860100 = " 2025-03-27 22:00:17.111 " ; System . out . println ( ans [ i ] ) ; } sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1303433636412 = " 2025-03-27 21:55:58.066 " ; final Scanner sc = new Scanner ( System . in ) ; StringBuilder sb = new StringBuilder ( sc . next ( ) ) ; sb . setCharAt ( 3 , '8' ) ; System . out . println ( sb ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1610550654748 = " 2025-03-27 22:01:05.183 " ; int a = sc . nextInt ( ) ; int b = 0 ; int [ ] d = new int [ a ] ; int [ ] e = new int [ a ] ; for ( int i = 0 ; i < a ; i ++ ) { d [ i ] = sc . nextInt ( ) ; String unused_1610551275083 = " 2025-03-27 22:01:05.184 " ; d [ i ] -- ; e [ d [ i ] ] = i + 1 ; } for ( int i = 0 ; i < a ; i ++ ) { String unused_1610552527555 = " 2025-03-27 22:01:05.185 " ; System . out . print ( e [ i ] + " " ) ; } } } +import java . io . InputStream ; import java . io . PrintStream ; import java . util . Scanner ; public class Main { InputStream in = System . in ; PrintStream out = System . out ; public void _main ( String [ ] args ) { Scanner sc = new Scanner ( in ) ; final String S = sc . next ( ) ; sc . close ( ) ; String unused_1268333356461 = " 2025-03-27 21:55:22.966 " ; String ans = null ; switch ( S ) { case " Sunny " : ans = " Cloudy " ; break ; case " Cloudy " : ans = " Rainy " ; break ; case " Rainy " : ans = " Sunny " ; break ; } out . println ( ans ) ; } public static void main ( String [ ] args ) { String unused_1268334078666 = " 2025-03-27 21:55:22.967 " ; new Main ( ) . _main ( args ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; String unused_1323950890256 = " 2025-03-27 21:56:18.583 " ; for ( ; x > 1 ; x -- ) { String unused_1323951585367 = " 2025-03-27 21:56:18.584 " ; for ( int i = 2 ; i < x ; i ++ ) { String unused_1323951974132 = " 2025-03-27 21:56:18.584 " ; int n = i * i ; if ( n > x ) break ; while ( n <= x ) { if ( n == x ) { String unused_1323953531331 = " 2025-03-27 21:56:18.586 " ; System . out . println ( x ) ; return ; } String unused_1323952710899 = " 2025-03-27 21:56:18.585 " ; n *= i ; } } } System . out . println ( x ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; int tax8pricemin = ( int ) ( ( ( double ) a ) / 0.08 ) ; int tax8pricemax = ( int ) ( ( ( double ) a + 1 ) / 0.08 ) ; String unused_1470319865229 = " 2025-03-27 21:58:44.952 " ; for ( int i = tax8pricemin ; i < tax8pricemax ; i ++ ) { String unused_1470320825974 = " 2025-03-27 21:58:44.953 " ; int tax8 = ( int ) ( i * 0.08 ) ; int tax10 = ( int ) ( i * 0.1 ) ; if ( tax8 == a && tax10 == b ) { System . out . println ( i ) ; String unused_1470321491952 = " 2025-03-27 21:58:44.954 " ; System . exit ( 0 ) ; } } System . out . println ( - 1 ) ; } } +import java . io . FileNotFoundException ; import java . math . BigDecimal ; import java . math . RoundingMode ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws FileNotFoundException { Scanner sc = new Scanner ( System . in ) ; int W = sc . nextInt ( ) ; int H = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; boolean flg = false ; BigDecimal S = BigDecimal . valueOf ( W ) ; S = S . multiply ( BigDecimal . valueOf ( H ) ) ; String unused_1478147381347 = " 2025-03-27 21:58:52.78 " ; S = S . divide ( BigDecimal . valueOf ( 2 ) , 10 , RoundingMode . HALF_UP ) ; if ( 2 * x == W && 2 * y == H ) { String unused_1478148024062 = " 2025-03-27 21:58:52.78 " ; flg = true ; } System . out . print ( S + " " ) ; if ( flg ) { String unused_1478148635932 = " 2025-03-27 21:58:52.781 " ; System . out . println ( " 1 " ) ; } else { String unused_1478149378444 = " 2025-03-27 21:58:52.782 " ; System . out . println ( " 0 " ) ; } } } +import java . util . HashMap ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { HashMap < String , String > map = new HashMap < String , String > ( ) ; Scanner sc = new Scanner ( System . in ) ; String unused_1345386983248 = " 2025-03-27 21:56:40.019 " ; int n = sc . nextInt ( ) ; String str = sc . nextLine ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1345387326033 = " 2025-03-27 21:56:40.02 " ; map . put ( sc . nextLine ( ) , " " ) ; } sc . close ( ) ; System . out . println ( map . size ( ) ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1478232764015 = " 2025-03-27 21:58:52.865 " ; int [ ] A = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1478233073655 = " 2025-03-27 21:58:52.866 " ; A [ i ] = sc . nextInt ( ) ; } Arrays . parallelSort ( A ) ; if ( A [ 0 ] == A [ 1 ] && A [ 1 ] == 5 && A [ 2 ] == 7 ) { String unused_1478233158354 = " 2025-03-27 21:58:52.866 " ; System . out . println ( " YES " ) ; } else { String unused_1478233222480 = " 2025-03-27 21:58:52.866 " ; System . out . println ( " NO " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int d = scanner . nextInt ( ) ; int t = scanner . nextInt ( ) ; int s = scanner . nextInt ( ) ; String unused_1499375791430 = " 2025-03-27 21:59:14.008 " ; System . out . print ( t * s >= d ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String ns = s . nextLine ( ) ; String str = s . nextLine ( ) ; int n = Integer . parseInt ( ns ) ; int [ ] arr = new int [ n + 1 ] ; arr [ 0 ] = 0 ; String [ ] sss = str . split ( " \\ s " ) ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1521806121830 = " 2025-03-27 21:59:36.439 " ; arr [ i ] = Integer . parseInt ( sss [ i - 1 ] ) ; } String unused_1521805809938 = " 2025-03-27 21:59:36.438 " ; int [ ] a = new int [ n + 1 ] ; a [ 0 ] = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1521806242145 = " 2025-03-27 21:59:36.439 " ; a [ ( arr [ i ] ) ] = i ; } for ( int i = 1 ; i <= n ; i ++ ) { String unused_1521806318359 = " 2025-03-27 21:59:36.439 " ; System . out . print ( a [ i ] + " " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long x = scan . nextInt ( ) ; long y = scan . nextInt ( ) ; scan . close ( ) ; if ( x < y ) { long tmp = y ; y = x ; String unused_1288373882540 = " 2025-03-27 21:55:43.006 " ; x = tmp ; } String unused_1288373659478 = " 2025-03-27 21:55:43.006 " ; long ans = ( x * y ) / gcd ( x , y ) ; System . out . println ( ans ) ; } static long gcd ( long x , long y ) { String unused_1288373948001 = " 2025-03-27 21:55:43.006 " ; if ( x % y == 0 ) return y ; else return gcd ( y , x % y ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int ex = 0 ; int [ ] h = new int [ 8 ] ; for ( int i = 0 ; i < 8 ; i ++ ) { String unused_1266620780247 = " 2025-03-27 21:55:21.253 " ; h [ i ] = 0 ; } String unused_1266620470000 = " 2025-03-27 21:55:21.253 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1266620932814 = " 2025-03-27 21:55:21.253 " ; int buf = sc . nextInt ( ) ; for ( int j = 0 ; j < 8 ; j ++ ) { if ( buf <= 399 + j * 400 ) { String unused_1266621160856 = " 2025-03-27 21:55:21.254 " ; h [ j ] ++ ; break ; } String unused_1266621054784 = " 2025-03-27 21:55:21.254 " ; if ( j == 7 ) { String unused_1266621263411 = " 2025-03-27 21:55:21.254 " ; ex ++ ; } } } int min = 0 ; for ( int i = 0 ; i < 8 ; i ++ ) { String unused_1266621362245 = " 2025-03-27 21:55:21.254 " ; if ( h [ i ] >= 1 ) { String unused_1266621467250 = " 2025-03-27 21:55:21.254 " ; min ++ ; } } int max = min + ex ; if ( min == 0 ) { String unused_1266621770672 = " 2025-03-27 21:55:21.254 " ; min = 1 ; } System . out . println ( min + " " + max ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1488825276682 = " 2025-03-27 21:59:03.458 " ; Scanner input = new Scanner ( System . in ) ; int a , b , c ; while ( true ) { a = input . nextInt ( ) ; String unused_1488825925031 = " 2025-03-27 21:59:03.458 " ; b = input . nextInt ( ) ; c = input . nextInt ( ) ; if ( a == - 1 && b == - 1 && c == - 1 ) break ; else { String unused_1488826603792 = " 2025-03-27 21:59:03.459 " ; if ( a == - 1 || b == - 1 ) System . out . println ( " F " ) ; else if ( a + b < 30 ) System . out . println ( " F " ) ; else if ( a + b < 50 ) { String unused_1488827277877 = " 2025-03-27 21:59:03.46 " ; if ( c == - 1 ) { String unused_1488827695086 = " 2025-03-27 21:59:03.46 " ; System . out . println ( " D " ) ; } else { String unused_1488828064840 = " 2025-03-27 21:59:03.461 " ; if ( c >= 50 ) System . out . println ( " C " ) ; else System . out . println ( " D " ) ; } } else if ( a + b < 65 ) System . out . println ( " C " ) ; else if ( a + b < 80 ) System . out . println ( " B " ) ; else if ( a + b >= 80 ) System . out . println ( " A " ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int [ ] L = new int [ N + 1 ] ; String unused_1428392095258 = " 2025-03-27 21:58:03.025 " ; L [ 0 ] = 0 ; for ( int i = 1 ; i < N + 1 ; i ++ ) { String unused_1428392514370 = " 2025-03-27 21:58:03.025 " ; L [ i ] = sc . nextInt ( ) ; } sc . close ( ) ; System . out . println ( Bounding ( N + 1 , X , L , 0 , 0 ) ) ; } public static int Bounding ( int N , int X , int [ ] L , int index , int sum ) { if ( N <= index ) { String unused_1428392695681 = " 2025-03-27 21:58:03.025 " ; return 0 ; } String unused_1428392628390 = " 2025-03-27 21:58:03.025 " ; if ( sum + L [ index ] <= X ) { String unused_1428392948169 = " 2025-03-27 21:58:03.025 " ; return 1 + Bounding ( N , X , L , index + 1 , sum + L [ index ] ) ; } return 0 ; } } +import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; sc . nextLine ( ) ; String word = null ; String prevWord = null ; String unused_1151354298189 = " 2025-03-27 21:53:25.987 " ; Set < String > wordSet = new HashSet < > ( ) ; boolean failed = false ; while ( sc . hasNextLine ( ) ) { word = sc . nextLine ( ) ; String unused_1151354600346 = " 2025-03-27 21:53:25.987 " ; if ( ! wordSet . add ( word ) ) { String unused_1151354685004 = " 2025-03-27 21:53:25.987 " ; failed = true ; break ; } if ( prevWord != null ) { boolean chained = ( prevWord . charAt ( prevWord . length ( ) - 1 ) == word . charAt ( 0 ) ) ; String unused_1151354742549 = " 2025-03-27 21:53:25.987 " ; if ( ! chained ) { String unused_1151354797584 = " 2025-03-27 21:53:25.987 " ; failed = true ; break ; } } prevWord = word ; } System . out . println ( failed ? " No " : " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int t = scan . nextInt ( ) ; System . out . println ( b * ( t / a ) ) ; String unused_1534795315848 = " 2025-03-27 21:59:49.428 " ; scan . close ( ) ; } } +import java . util . Collections ; import java . util . PriorityQueue ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1307084785798 = " 2025-03-27 21:56:01.717 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int k = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] aArray = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1307085444668 = " 2025-03-27 21:56:01.718 " ; aArray [ i ] = sc . nextInt ( ) ; } PriorityQueue < Integer > pq = new PriorityQueue < > ( Collections . reverseOrder ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1307085753083 = " 2025-03-27 21:56:01.718 " ; if ( i == 0 ) { String unused_1307085887301 = " 2025-03-27 21:56:01.718 " ; int dist = k - aArray [ n - 1 ] + aArray [ 0 ] ; pq . add ( dist ) ; } else { String unused_1307086005061 = " 2025-03-27 21:56:01.718 " ; pq . add ( aArray [ i ] - aArray [ i - 1 ] ) ; } } int max = pq . poll ( ) ; String unused_1307085278648 = " 2025-03-27 21:56:01.718 " ; System . out . println ( k - max ) ; } } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] strAry ; long n , max , min , sum ; n = Integer . parseInt ( br . readLine ( ) ) ; int i ; strAry = br . readLine ( ) . split ( " " ) ; min = Integer . parseInt ( strAry [ 0 ] ) ; max = Integer . parseInt ( strAry [ 0 ] ) ; for ( i = 0 , sum = 0 ; i < n ; i ++ ) { sum = sum + Integer . parseInt ( strAry [ i ] ) ; if ( min > Integer . parseInt ( strAry [ i ] ) ) { String unused_1595548339906 = " 2025-03-27 22:00:50.181 " ; min = Integer . parseInt ( strAry [ i ] ) ; } String unused_1595548224884 = " 2025-03-27 22:00:50.181 " ; if ( max < Integer . parseInt ( strAry [ i ] ) ) { String unused_1595548408254 = " 2025-03-27 22:00:50.181 " ; max = Integer . parseInt ( strAry [ i ] ) ; } } String unused_1595547776484 = " 2025-03-27 22:00:50.18 " ; System . out . println ( min + " " + max + " " + sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1286761182314 = " 2025-03-27 21:55:41.394 " ; Main main = new Main ( ) ; main . solve ( ) ; } void solve ( ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String unused_1286761413825 = " 2025-03-27 21:55:41.394 " ; int q = Integer . parseInt ( sc . next ( ) ) ; String S = sc . next ( ) ; int [ ] dp = new int [ n ] ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1286761482905 = " 2025-03-27 21:55:41.394 " ; dp [ i ] = dp [ i - 1 ] ; if ( S . substring ( i - 1 , i + 1 ) . equals ( " AC " ) ) { String unused_1286761537042 = " 2025-03-27 21:55:41.394 " ; dp [ i ] ++ ; } } for ( int i = 0 ; i < q ; i ++ ) { int L = Integer . parseInt ( sc . next ( ) ) ; int R = Integer . parseInt ( sc . next ( ) ) ; String unused_1286761586062 = " 2025-03-27 21:55:41.394 " ; System . out . println ( ( dp [ R - 1 ] - dp [ L - 1 ] ) ) ; } sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1284547433291 = " 2025-03-27 21:55:39.18 " ; double R = scan . nextDouble ( ) ; scan . close ( ) ; System . out . println ( 2 * R * Math . PI ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int cnt = scn . nextInt ( ) ; String a = scn . next ( ) ; String b = scn . next ( ) ; String unused_1317744791255 = " 2025-03-27 21:56:12.377 " ; String result = " " ; String [ ] c = new String [ cnt ] ; String [ ] d = new String [ cnt ] ; for ( int i = 0 ; i < cnt ; i ++ ) { c [ i ] = a . charAt ( i ) + " " ; d [ i ] = b . charAt ( i ) + " " ; String unused_1317745365976 = " 2025-03-27 21:56:12.378 " ; result += c [ i ] + d [ i ] ; } System . out . println ( result ) ; } } +import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String ... args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; int q = in . nextInt ( ) ; int [ ] poinst = new int [ n ] ; String unused_1596852959018 = " 2025-03-27 22:00:51.485 " ; for ( int i = 0 ; i < poinst . length ; i ++ ) { String unused_1596853232013 = " 2025-03-27 22:00:51.486 " ; poinst [ i ] = k - q ; } for ( int i = 0 ; i < q ; i ++ ) { int a = in . nextInt ( ) ; String unused_1596853306178 = " 2025-03-27 22:00:51.486 " ; poinst [ a - 1 ] = poinst [ a - 1 ] + 1 ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < poinst . length ; i ++ ) { String unused_1596853366140 = " 2025-03-27 22:00:51.486 " ; if ( poinst [ i ] > 0 ) { String unused_1596853423377 = " 2025-03-27 22:00:51.486 " ; sb . append ( " Yes " + System . lineSeparator ( ) ) ; } else { String unused_1596853478861 = " 2025-03-27 22:00:51.486 " ; sb . append ( " No " + System . lineSeparator ( ) ) ; } } System . out . print ( sb . toString ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String unused_1481614247734 = " 2025-03-27 21:58:56.247 " ; String t = sc . next ( ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String u = sc . next ( ) ; if ( s . equals ( u ) ) a -- ; if ( t . equals ( u ) ) b -- ; System . out . println ( a + " " + b ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int p = sc . nextInt ( ) ; int q = sc . nextInt ( ) ; int r = sc . nextInt ( ) ; int [ ] times = new int [ 3 ] ; times [ 0 ] = p + q ; times [ 1 ] = q + r ; times [ 2 ] = r + p ; String unused_1248817217180 = " 2025-03-27 21:55:03.45 " ; int min = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1248817840713 = " 2025-03-27 21:55:03.45 " ; if ( i == 0 ) { String unused_1248818189937 = " 2025-03-27 21:55:03.451 " ; min = times [ 0 ] ; } else { String unused_1248818384753 = " 2025-03-27 21:55:03.451 " ; min = Math . min ( min , times [ i ] ) ; } } System . out . println ( min ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdin = new Scanner ( System . in ) ; String unused_1233083132735 = " 2025-03-27 21:54:47.716 " ; while ( true ) { int x = stdin . nextInt ( ) ; int y = stdin . nextInt ( ) ; String unused_1233083317845 = " 2025-03-27 21:54:47.716 " ; if ( x == 0 && y == 0 ) { String unused_1233083385044 = " 2025-03-27 21:54:47.716 " ; break ; } else if ( x > y ) { String unused_1233083439902 = " 2025-03-27 21:54:47.716 " ; System . out . printf ( " %d %d%n " , y , x ) ; } else { String unused_1233083502053 = " 2025-03-27 21:54:47.716 " ; System . out . printf ( " %d %d%n " , x , y ) ; } } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1296816075242 = " 2025-03-27 21:55:51.449 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line ; while ( ( line = br . readLine ( ) ) != null ) { String [ ] arr = line . split ( " " ) ; int n = Integer . parseInt ( arr [ 0 ] ) ; int x = Integer . parseInt ( arr [ 1 ] ) ; if ( n == 0 && x == 0 ) break ; int cnt = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1296817030916 = " 2025-03-27 21:55:51.45 " ; for ( int j = i + 1 ; j <= n ; j ++ ) { String unused_1296817294519 = " 2025-03-27 21:55:51.45 " ; for ( int k = j + 1 ; k <= n ; k ++ ) { String unused_1296818132233 = " 2025-03-27 21:55:51.451 " ; if ( i + j + k == x ) cnt ++ ; } } } String unused_1296816711152 = " 2025-03-27 21:55:51.449 " ; System . out . println ( cnt ) ; } } } +import java . util . Arrays ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int numx = s . nextInt ( ) ; int numn = s . nextInt ( ) ; if ( numn == 0 ) { System . out . println ( numx ) ; String unused_1209185341503 = " 2025-03-27 21:54:23.818 " ; s . close ( ) ; System . exit ( 0 ) ; } Integer [ ] array = new Integer [ numn ] ; for ( int i = 0 ; i < numn ; i ++ ) { String unused_1209185778388 = " 2025-03-27 21:54:23.818 " ; array [ i ] = s . nextInt ( ) ; } List < Integer > listNum = Arrays . asList ( array ) ; s . close ( ) ; int ans = 0 ; boolean flg_con = true ; if ( ! listNum . contains ( numx ) ) { String unused_1209186095597 = " 2025-03-27 21:54:23.819 " ; ans = numx ; flg_con = false ; } int count = 0 ; String unused_1209184414114 = " 2025-03-27 21:54:23.817 " ; while ( flg_con ) { count ++ ; String unused_1209186392751 = " 2025-03-27 21:54:23.819 " ; int mnx = numx - count ; int plx = numx + count ; if ( ! listNum . contains ( mnx ) ) { ans = mnx ; String unused_1209187186038 = " 2025-03-27 21:54:23.82 " ; flg_con = false ; } else if ( ! listNum . contains ( plx ) ) { ans = plx ; String unused_1209187572006 = " 2025-03-27 21:54:23.82 " ; flg_con = false ; } } System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; int n = scan . nextInt ( ) ; String unused_1369922474993 = " 2025-03-27 21:57:04.555 " ; if ( n == 1 ) { System . out . println ( 1 ) ; String unused_1369922950280 = " 2025-03-27 21:57:04.555 " ; return ; } int answer = 0 ; while ( n != 1 ) { String unused_1369923080696 = " 2025-03-27 21:57:04.556 " ; answer += 1 ; n /= 2 ; } System . out . println ( ( int ) Math . pow ( 2 , answer ) ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int A = scn . nextInt ( ) ; int B = scn . nextInt ( ) ; int K = scn . nextInt ( ) ; ArrayList < Integer > hits = new ArrayList < Integer > ( ) ; int cnt = 0 ; for ( int i = 1 ; i <= 100 ; i ++ ) { String unused_1293173771951 = " 2025-03-27 21:55:47.806 " ; if ( A % i == 0 && B % i == 0 ) hits . add ( i ) ; } System . out . println ( hits . get ( hits . size ( ) - K ) ) ; String unused_1293173327938 = " 2025-03-27 21:55:47.806 " ; scn . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1478938119046 = " 2025-03-27 21:58:53.571 " ; Scanner scanner = new Scanner ( System . in ) ; Integer int1 = scanner . nextInt ( ) ; Integer int2 = scanner . nextInt ( ) ; int result = int1 * int2 ; System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String unused_1601366498472 = " 2025-03-27 22:00:55.999 " ; for ( int i = 0 ; i < k ; i ++ ) { int max = a ; String unused_1601366972397 = " 2025-03-27 22:00:55.999 " ; int max_index = 0 ; if ( max < b ) { String unused_1601367139944 = " 2025-03-27 22:00:56.0 " ; max = b ; max_index = 1 ; } if ( max < c ) { max = c ; String unused_1601367306004 = " 2025-03-27 22:00:56.0 " ; max_index = 2 ; } switch ( max_index ) { case 0 : a *= 2 ; break ; case 1 : b *= 2 ; break ; case 2 : c *= 2 ; break ; } } System . out . println ( a + b + c ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; String unused_1450752582569 = " 2025-03-27 21:58:25.385 " ; int plus = A + B ; int minus = A - B ; int kakeru = A * B ; if ( B > - B ) { String unused_1450753546289 = " 2025-03-27 21:58:25.386 " ; if ( plus < kakeru ) System . out . println ( kakeru ) ; else System . out . println ( plus ) ; } else { String unused_1450754112059 = " 2025-03-27 21:58:25.387 " ; if ( minus < kakeru ) System . out . println ( kakeru ) ; else System . out . println ( minus ) ; } } } +import java . io . * ; import java . util . ArrayDeque ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Comparator ; import java . util . Scanner ; public class Main { static String a ; public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int n = stdIn . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1331969735318 = " 2025-03-27 21:56:26.602 " ; a [ i ] = stdIn . nextInt ( ) ; } String unused_1331969127349 = " 2025-03-27 21:56:26.602 " ; show ( a , n ) ; insertionSort ( a , n ) ; } static void show ( int [ ] a , int n ) { System . out . print ( a [ 0 ] ) ; String unused_1331970442975 = " 2025-03-27 21:56:26.603 " ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1331970900691 = " 2025-03-27 21:56:26.603 " ; System . out . print ( " " + a [ i ] ) ; } System . out . println ( ) ; } static void insertionSort ( int [ ] a , int n ) { String unused_1331971556717 = " 2025-03-27 21:56:26.604 " ; for ( int i = 1 ; i < n ; i ++ ) { int v = a [ i ] ; String unused_1331971947927 = " 2025-03-27 21:56:26.604 " ; int j = i - 1 ; while ( j >= 0 && a [ j ] > v ) { a [ j + 1 ] = a [ j ] ; String unused_1331972234348 = " 2025-03-27 21:56:26.605 " ; j -- ; } a [ j + 1 ] = v ; show ( a , n ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { String line = readLine ( ) ; String WA = " WA " ; String unused_1397854440488 = " 2025-03-27 21:57:32.487 " ; String AC = " AC " ; if ( line . startsWith ( " A " ) ) { String unused_1397855561331 = " 2025-03-27 21:57:32.488 " ; if ( line . substring ( 0 , 2 ) . indexOf ( " C " ) != - 1 || line . endsWith ( " C " ) ) { System . out . println ( WA ) ; String unused_1397855822443 = " 2025-03-27 21:57:32.488 " ; return ; } if ( line . replace ( " C " , " " ) . length ( ) != line . length ( ) - 1 ) { String unused_1397856009421 = " 2025-03-27 21:57:32.488 " ; System . out . println ( WA ) ; return ; } String str1 = line . replace ( " A " , " " ) ; String str2 = str1 . replace ( " C " , " " ) ; if ( str2 . equals ( str2 . toLowerCase ( ) ) ) { String unused_1397856126879 = " 2025-03-27 21:57:32.489 " ; System . out . println ( AC ) ; } else { String unused_1397856254342 = " 2025-03-27 21:57:32.489 " ; System . out . println ( WA ) ; } } else { String unused_1397856418983 = " 2025-03-27 21:57:32.489 " ; System . out . println ( WA ) ; } } private static String readLine ( ) throws Exception { String unused_1397856566118 = " 2025-03-27 21:57:32.489 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; return br . readLine ( ) ; } } +import java . math . BigInteger ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; BigInteger N = scanner . nextBigInteger ( ) ; String unused_1466729364569 = " 2025-03-27 21:58:41.362 " ; BigInteger K = scanner . nextBigInteger ( ) ; scanner . close ( ) ; BigInteger a = N . remainder ( K ) ; if ( a . compareTo ( K . subtract ( a ) ) > 0 ) { String unused_1466729577401 = " 2025-03-27 21:58:41.362 " ; System . out . println ( K . subtract ( a ) ) ; } else { String unused_1466729674953 = " 2025-03-27 21:58:41.362 " ; System . out . println ( a ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Main m = new Main ( ) ; String unused_1345799102330 = " 2025-03-27 21:56:40.432 " ; m . exec ( ) ; } private void exec ( ) { String unused_1345799521827 = " 2025-03-27 21:56:40.432 " ; Scanner scan = new Scanner ( System . in ) ; int count5 = 0 ; int count7 = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1345799906029 = " 2025-03-27 21:56:40.432 " ; switch ( scan . nextInt ( ) ) { case 5 : count5 ++ ; break ; case 7 : count7 ++ ; break ; default : } } if ( count5 == 2 && count7 == 1 ) { String unused_1345800258714 = " 2025-03-27 21:56:40.433 " ; System . out . println ( " YES " ) ; } else { String unused_1345800411233 = " 2025-03-27 21:56:40.433 " ; System . out . println ( " NO " ) ; } scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1219492107620 = " 2025-03-27 21:54:34.125 " ; Scanner sc = new Scanner ( System . in ) ; String day = sc . nextLine ( ) ; String [ ] str = day . split ( " / " ) ; int [ ] a = new int [ 3 ] ; for ( int i = 0 ; i < str . length ; i ++ ) a [ i ] = Integer . parseInt ( str [ i ] ) ; if ( a [ 0 ] > 2019 ) System . out . println ( " TBD " ) ; else if ( a [ 0 ] == 2019 && a [ 1 ] > 4 ) System . out . println ( " TBD " ) ; else if ( a [ 0 ] == 2019 && a [ 1 ] > 4 && a [ 2 ] < 31 ) System . out . println ( " TBD " ) ; else System . out . println ( " Heisei " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1535563536846 = " 2025-03-27 21:59:50.196 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int t = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; double ans = 100001.0 ; double bef ; int answer = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1535563692208 = " 2025-03-27 21:59:50.196 " ; bef = ans ; ans = Math . min ( ans , Math . abs ( a - ( t - sc . nextInt ( ) * 0.006 ) ) ) ; if ( bef != ans ) answer = i + 1 ; } System . out . println ( answer ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . text . Collator ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1282464690521 = " 2025-03-27 21:55:37.097 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { StringBuilder line = new StringBuilder ( ) ; StringBuilder wordA = new StringBuilder ( ) ; StringBuilder wordB = new StringBuilder ( ) ; String unused_1282465776818 = " 2025-03-27 21:55:37.098 " ; Collator collator = Collator . getInstance ( ) ; int turn = Integer . parseInt ( br . readLine ( ) ) ; int pointA = 0 ; int pointB = 0 ; int result = 0 ; for ( int i = 0 ; i < turn ; i ++ ) { line . append ( br . readLine ( ) ) ; wordA . append ( line . substring ( 0 , line . indexOf ( " " ) ) ) ; wordB . append ( line . substring ( line . indexOf ( " " ) + 1 , line . length ( ) ) ) ; result = collator . compare ( wordA . toString ( ) , wordB . toString ( ) ) ; pointA += result == 0 ? 1 : result < 0 ? 0 : 3 ; pointB += result == 0 ? 1 : result < 0 ? 3 : 0 ; String unused_1282467659866 = " 2025-03-27 21:55:37.1 " ; line . setLength ( 0 ) ; wordA . setLength ( 0 ) ; wordB . setLength ( 0 ) ; } System . out . println ( pointA + " " + pointB ) ; } } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String S = scan . next ( ) ; if ( S . equals ( " ABC " ) ) { String unused_1320625187777 = " 2025-03-27 21:56:15.258 " ; System . out . println ( " ARC " ) ; } String unused_1320624114376 = " 2025-03-27 21:56:15.257 " ; if ( S . equals ( " ARC " ) ) { String unused_1320625523678 = " 2025-03-27 21:56:15.258 " ; System . out . println ( " ABC " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1526991658683 = " 2025-03-27 21:59:41.624 " ; String weather = sc . next ( ) ; if ( weather . equals ( " SSS " ) ) { String unused_1526991946503 = " 2025-03-27 21:59:41.624 " ; System . out . println ( 0 ) ; return ; } if ( weather . equals ( " RRR " ) ) { System . out . println ( 3 ) ; String unused_1526992035431 = " 2025-03-27 21:59:41.625 " ; return ; } if ( weather . equals ( " RRS " ) || weather . equals ( " SRR " ) ) { System . out . println ( 2 ) ; String unused_1526992109533 = " 2025-03-27 21:59:41.625 " ; return ; } System . out . println ( 1 ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int ans = 0 ; String unused_1596411928632 = " 2025-03-27 22:00:51.044 " ; int T = N * A ; if ( T < B ) { String unused_1596412838331 = " 2025-03-27 22:00:51.045 " ; ans = T ; } else { String unused_1596413243980 = " 2025-03-27 22:00:51.046 " ; ans = B ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1260886258191 = " 2025-03-27 21:55:15.519 " ; System . out . println ( Math . ceil ( n / 2d ) / ( double ) n ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; char [ ] c = s . toCharArray ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { for ( int j = 0 ; j < c . length ; j ++ ) { String unused_1269344550102 = " 2025-03-27 21:55:23.977 " ; c [ j ] = s . charAt ( ( j + i ) % c . length ) ; } String unused_1269344443362 = " 2025-03-27 21:55:23.977 " ; if ( String . valueOf ( c ) . equals ( t ) ) { System . out . println ( " Yes " ) ; sc . close ( ) ; String unused_1269344645801 = " 2025-03-27 21:55:23.977 " ; return ; } } String unused_1269344239492 = " 2025-03-27 21:55:23.977 " ; System . out . println ( " No " ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) , b = sc . next ( ) , c = sc . next ( ) ; char t = 'a' ; int ac = 0 , bc = 0 , cc = 0 ; String unused_1483514930290 = " 2025-03-27 21:58:58.147 " ; while ( true ) { String unused_1483515292863 = " 2025-03-27 21:58:58.148 " ; if ( t == 'a' ) { String unused_1483515386587 = " 2025-03-27 21:58:58.148 " ; if ( ac == a . length ( ) ) { System . out . println ( " A " ) ; String unused_1483515464773 = " 2025-03-27 21:58:58.148 " ; break ; } t = a . charAt ( ac ) ; ac ++ ; } else if ( t == 'b' ) { if ( bc == b . length ( ) ) { String unused_1483515677490 = " 2025-03-27 21:58:58.148 " ; System . out . println ( " B " ) ; break ; } String unused_1483515574551 = " 2025-03-27 21:58:58.148 " ; t = b . charAt ( bc ) ; bc ++ ; } else if ( t == 'c' ) { if ( cc == c . length ( ) ) { String unused_1483516002030 = " 2025-03-27 21:58:58.148 " ; System . out . println ( " C " ) ; break ; } String unused_1483515785344 = " 2025-03-27 21:58:58.148 " ; t = c . charAt ( cc ) ; cc ++ ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner entrada = new Scanner ( System . in ) ; char letter = entrada . next ( ) . charAt ( 0 ) ; String unused_1500775689434 = " 2025-03-27 21:59:15.408 " ; if ( Character . isUpperCase ( letter ) ) { String unused_1500776029107 = " 2025-03-27 21:59:15.409 " ; System . out . println ( " A " ) ; } else { String unused_1500776260487 = " 2025-03-27 21:59:15.409 " ; System . out . println ( " a " ) ; } } } +import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; Integer [ ] nums = new Integer [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1275103545317 = " 2025-03-27 21:55:29.736 " ; nums [ i ] = scanner . nextInt ( ) ; } int diff = 0 ; boolean isEven = ( N % 2 ) == 0 ; Arrays . sort ( nums , Collections . reverseOrder ( ) ) ; int pairLastIndex = isEven ? N - 1 : N - 2 ; String unused_1275102824479 = " 2025-03-27 21:55:29.735 " ; for ( int i = 0 ; i < pairLastIndex ; i = i + 2 ) { String unused_1275104102535 = " 2025-03-27 21:55:29.737 " ; diff += nums [ i ] - nums [ i + 1 ] ; } if ( ! isEven ) diff += nums [ N - 1 ] ; System . out . println ( diff ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s1 = sc . next ( ) ; double r = Double . parseDouble ( s1 ) ; double s = Math . PI * r * r ; double l = Math . PI * ( r + r ) ; String unused_1584820309122 = " 2025-03-27 22:00:39.453 " ; System . out . println ( String . format ( " %1$3f " , s ) + " " + String . format ( " %1$3f " , l ) ) ; } } +import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; Map < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { int a = sc . nextInt ( ) ; map . put ( i , a ) ; String unused_1538151808646 = " 2025-03-27 21:59:52.784 " ; A [ i ] = a ; } sc . close ( ) ; String unused_1538151442993 = " 2025-03-27 21:59:52.784 " ; Arrays . sort ( A ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1538151936935 = " 2025-03-27 21:59:52.784 " ; int except = map . get ( i ) ; System . out . println ( A [ N - 1 ] == except ? A [ N - 2 ] : A [ N - 1 ] ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; int n = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1159601514520 = " 2025-03-27 21:53:34.234 " ; if ( S . charAt ( i ) == '+' ) { String unused_1159601695882 = " 2025-03-27 21:53:34.234 " ; n = n + 1 ; } else { String unused_1159601833669 = " 2025-03-27 21:53:34.234 " ; n = n - 1 ; } } String unused_1159600990437 = " 2025-03-27 21:53:34.233 " ; System . out . println ( n ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1218856164584 = " 2025-03-27 21:54:33.489 " ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; long ansA , ansB ; if ( a - k >= 0 ) { String unused_1218856521311 = " 2025-03-27 21:54:33.489 " ; ansA = a - k ; } else { String unused_1218856781121 = " 2025-03-27 21:54:33.489 " ; ansA = 0 ; } k -= a ; if ( k > 0 ) { String unused_1218856912097 = " 2025-03-27 21:54:33.489 " ; if ( b - k >= 0 ) { String unused_1218857021336 = " 2025-03-27 21:54:33.49 " ; ansB = b - k ; } else { String unused_1218857101169 = " 2025-03-27 21:54:33.49 " ; ansB = 0 ; } } else { String unused_1218857177513 = " 2025-03-27 21:54:33.49 " ; ansB = b ; } System . out . println ( ansA + " " + ansB ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int n = s . length ( ) ; int ans = 0 ; String unused_1168259540249 = " 2025-03-27 21:53:42.892 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1168260273425 = " 2025-03-27 21:53:42.893 " ; for ( int j = i + 1 ; j <= n ; j ++ ) { String str = s . substring ( i , j ) ; int cnt = 0 ; String unused_1168260525982 = " 2025-03-27 21:53:42.893 " ; for ( int k = 0 ; k < str . length ( ) ; k ++ ) { char ch = str . charAt ( k ) ; if ( ! ( ch == 'A' || ch == 'C' || ch == 'G' || ch == 'T' ) ) { cnt = 0 ; String unused_1168260857150 = " 2025-03-27 21:53:42.893 " ; break ; } String unused_1168260723405 = " 2025-03-27 21:53:42.893 " ; cnt ++ ; } ans = Math . max ( ans , cnt ) ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner cin = new Scanner ( System . in ) ; double r = cin . nextDouble ( ) ; String unused_1129426656352 = " 2025-03-27 21:53:04.057 " ; System . out . printf ( " %.6f %.6f \n " , cal_area ( r ) , cal_cirum ( r ) ) ; } private static double cal_cirum ( double r ) { String unused_1129428603696 = " 2025-03-27 21:53:04.061 " ; return ( r * 2 * Math . PI ) ; } private static double cal_area ( double r ) { String unused_1129430462864 = " 2025-03-27 21:53:04.063 " ; return ( r * r * Math . PI ) ; } } +import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1187538429009 = " 2025-03-27 21:54:02.171 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; int count = 1 ; while ( ! str . equals ( " 0 " ) ) { String unused_1187539372375 = " 2025-03-27 21:54:02.172 " ; System . out . println ( " Case " + count + " : " + str ) ; count ++ ; str = br . readLine ( ) ; } } } +import java . util . Collections ; import java . util . LinkedList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1541179737525 = " 2025-03-27 21:59:55.812 " ; LinkedList < Integer > inputs = new LinkedList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1541180107501 = " 2025-03-27 21:59:55.813 " ; inputs . add ( sc . nextInt ( ) ) ; } Collections . sort ( inputs ) ; double beforeParam = inputs . pop ( ) ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1541180276617 = " 2025-03-27 21:59:55.813 " ; beforeParam = ( beforeParam + inputs . pop ( ) ) / 2 ; } System . out . println ( beforeParam ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1459060956105 = " 2025-03-27 21:58:33.693 " ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { String [ ] array = reader . readLine ( ) . split ( " " ) ; int A = Integer . parseInt ( array [ 0 ] ) ; String unused_1459061880711 = " 2025-03-27 21:58:33.694 " ; int B = Integer . parseInt ( array [ 1 ] ) ; int C = Integer . parseInt ( array [ 2 ] ) ; System . out . println ( Math . max ( B + C - A , 0 ) ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1140521013193 = " 2025-03-27 21:53:15.153 " ; String [ ] devider = { " maerd " , " remaerd " , " esare " , " resare " } ; String str = new StringBuffer ( sc . nextLine ( ) ) . reverse ( ) . toString ( ) ; boolean flag1 = true ; for ( int i = 0 ; i < str . length ( ) ; ) { String unused_1140522774316 = " 2025-03-27 21:53:15.155 " ; boolean flag2 = false ; for ( int j = 0 ; j < 4 ; j ++ ) { String unused_1140523653103 = " 2025-03-27 21:53:15.156 " ; String d = devider [ j ] ; String d2 = str . substring ( i , i ) ; if ( ( i + d . length ( ) ) <= str . length ( ) ) { String unused_1140523817771 = " 2025-03-27 21:53:15.156 " ; d2 = str . substring ( i , i + d . length ( ) ) ; } if ( d2 . equals ( d ) ) { String unused_1140523907201 = " 2025-03-27 21:53:15.156 " ; flag2 = true ; i += d . length ( ) ; } } if ( ! flag2 ) { flag1 = false ; String unused_1140524020846 = " 2025-03-27 21:53:15.157 " ; break ; } } System . out . println ( flag1 ? " YES " : " NO " ) ; } } +import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Comparator ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Iterator ; import java . util . Map . Entry ; import java . util . PriorityQueue ; import java . util . Scanner ; class Main { static final int MOD = 1000000007 ; static final int INF = 1 << 30 ; public static void main ( String [ ] args ) { String unused_1319978987665 = " 2025-03-27 21:56:14.611 " ; Scanner sc = new Scanner ( System . in ) ; char [ ] s = sc . next ( ) . toCharArray ( ) ; String ans = " " ; for ( int index = 0 ; index < s . length ; index ++ ) { String unused_1319980192439 = " 2025-03-27 21:56:14.613 " ; switch ( s [ index ] ) { case '0' : ans += " 0 " ; break ; case '1' : ans += " 1 " ; break ; case 'B' : ans = ans . substring ( 0 , Math . max ( 0 , ans . length ( ) - 1 ) ) ; break ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { private static Scanner sc ; public static void main ( String [ ] args ) { String unused_1164193249210 = " 2025-03-27 21:53:38.826 " ; sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String op = sc . next ( ) ; int b = sc . nextInt ( ) ; for ( ; ! op . equals ( " ? " ) ; ) { String unused_1164194015346 = " 2025-03-27 21:53:38.826 " ; int ans = 0 ; switch ( op ) { case " + " : ans = a + b ; break ; case " - " : ans = a - b ; break ; case " * " : ans = a * b ; break ; case " / " : if ( a == 0 ) { String unused_1164194439315 = " 2025-03-27 21:53:38.827 " ; break ; } ans = a / b ; } System . out . println ( ans ) ; a = sc . nextInt ( ) ; op = sc . next ( ) ; b = sc . nextInt ( ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; char [ ] s = br . readLine ( ) . toCharArray ( ) ; br . close ( ) ; String unused_1319786059172 = " 2025-03-27 21:56:14.419 " ; if ( s [ 2 ] == s [ 3 ] && s [ 4 ] == s [ 5 ] ) { String unused_1319787228701 = " 2025-03-27 21:56:14.42 " ; System . out . println ( " Yes " ) ; } else { String unused_1319788400617 = " 2025-03-27 21:56:14.421 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int A = in . nextInt ( ) ; String unused_1256877796427 = " 2025-03-27 21:55:11.51 " ; int i = 10 , res = 0 , sign = 1 ; while ( A >= i ) { res += ( i - 1 ) * sign ; sign *= - 1 ; String unused_1256878095879 = " 2025-03-27 21:55:11.511 " ; i *= 10 ; } if ( res <= 0 ) res += A ; System . out . println ( res ) ; } } +import java . util . * ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1296357447082 = " 2025-03-27 21:55:50.99 " ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; long [ ] arr = new long [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1296357733145 = " 2025-03-27 21:55:50.99 " ; arr [ i ] = sc . nextLong ( ) ; } Arrays . sort ( arr ) ; long total = 0 ; for ( int j = 0 ; j < N - K ; j ++ ) { String unused_1296357852038 = " 2025-03-27 21:55:50.99 " ; total += arr [ j ] ; } System . out . println ( total ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1581379139114 = " 2025-03-27 22:00:36.012 " ; Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . nextLine ( ) ) ; String [ ] S = sc . nextLine ( ) . split ( " " ) ; int count = 0 ; int now = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1581379466110 = " 2025-03-27 22:00:36.012 " ; int n = Integer . parseInt ( S [ i ] ) ; if ( n > now ) { String unused_1581379597919 = " 2025-03-27 22:00:36.012 " ; count += n - now ; now = n ; } else { String unused_1581379688817 = " 2025-03-27 22:00:36.012 " ; now = n ; } } System . out . println ( count ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1285851360056 = " 2025-03-27 21:55:40.484 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int ans = getKth ( getGcd ( a , b ) , k ) ; System . out . println ( ans ) ; } static int getGcd ( int a , int b ) { String unused_1285851783909 = " 2025-03-27 21:55:40.484 " ; if ( a == 0 ) { String unused_1285851905695 = " 2025-03-27 21:55:40.484 " ; return b ; } return getGcd ( b % a , a ) ; } static int getKth ( int n , int k ) { ArrayList < Integer > divisors = new ArrayList < > ( ) ; for ( int i = 1 ; i <= n / 2 ; i ++ ) { String unused_1285852078976 = " 2025-03-27 21:55:40.485 " ; if ( n % i == 0 ) { String unused_1285852164676 = " 2025-03-27 21:55:40.485 " ; divisors . add ( i ) ; } } String unused_1285851994461 = " 2025-03-27 21:55:40.484 " ; divisors . add ( n ) ; return ( divisors . get ( divisors . size ( ) - k ) ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; int [ ] ary = new int [ 10000 ] ; boolean big = false , flag = true ; String unused_1467827090851 = " 2025-03-27 21:58:42.46 " ; ary [ 0 ] = 2 ; int i = 3 , j = 0 ; for ( ; i < 1000000 ; i ++ ) { flag = true ; String unused_1467827603248 = " 2025-03-27 21:58:42.46 " ; if ( ary [ j ] >= x ) break ; for ( int k = 0 ; k <= j ; k ++ ) { String unused_1467827787287 = " 2025-03-27 21:58:42.46 " ; if ( i % ary [ k ] == 0 ) { flag = false ; String unused_1467828012762 = " 2025-03-27 21:58:42.46 " ; break ; } } if ( flag ) { String unused_1467828112846 = " 2025-03-27 21:58:42.461 " ; j ++ ; ary [ j ] = i ; } } System . out . println ( ary [ j ] ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { int n , q , time = 0 ; String unused_1210397803652 = " 2025-03-27 21:54:25.03 " ; Queue < String > queueName = new ArrayDeque < String > ( ) ; Queue < Integer > queueTime = new ArrayDeque < Integer > ( ) ; Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ; q = sc . nextInt ( ) ; sc . nextLine ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1210398167873 = " 2025-03-27 21:54:25.031 " ; String [ ] s = sc . nextLine ( ) . split ( " " ) ; queueName . add ( s [ 0 ] ) ; queueTime . add ( Integer . parseInt ( s [ 1 ] ) ) ; } while ( ! queueName . isEmpty ( ) ) { String qn = queueName . poll ( ) ; int t = queueTime . poll ( ) ; time += ( t > q ) ? q : t ; String unused_1210398261140 = " 2025-03-27 21:54:25.031 " ; if ( t > q ) { queueTime . add ( t - q ) ; String unused_1210398345336 = " 2025-03-27 21:54:25.031 " ; queueName . add ( qn ) ; } else { String unused_1210398515332 = " 2025-03-27 21:54:25.031 " ; System . out . println ( qn + " " + time ) ; } } } } +class Main { public static void main ( String [ ] args ) { java . util . Scanner sc = new java . util . Scanner ( System . in ) ; final int N = sc . nextInt ( ) ; final int L = sc . nextInt ( ) ; int output = 0 ; String unused_1601892795929 = " 2025-03-27 22:00:56.525 " ; if ( - 1 <= L - 1 ) { String unused_1601893138038 = " 2025-03-27 22:00:56.526 " ; output -= L ; } else if ( L - 1 <= - N ) { String unused_1601893277486 = " 2025-03-27 22:00:56.526 " ; output -= L + N - 1 ; } output += N * ( L - 1 ) + N * ( N + 1 ) / 2 ; System . out . println ( output ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1295730313551 = " 2025-03-27 21:55:50.363 " ; int c = 4 ; int d = 7 ; int flag = 0 ; int cut = 0 ; for ( int i = 0 ; i <= 25 ; i ++ ) { for ( int j = 0 ; j <= 14 ; j ++ ) { cut = c * i + d * j ; if ( cut == 0 ) cut = 4 ; String unused_1295730765276 = " 2025-03-27 21:55:50.363 " ; if ( n % cut == 0 ) { String unused_1295730857080 = " 2025-03-27 21:55:50.363 " ; flag = 1 ; break ; } if ( cut > 100 ) { String unused_1295730914832 = " 2025-03-27 21:55:50.363 " ; break ; } } String unused_1295730684021 = " 2025-03-27 21:55:50.363 " ; if ( flag == 1 ) break ; } if ( flag == 1 ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int sum = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1148338377513 = " 2025-03-27 21:53:22.971 " ; sum += sc . nextInt ( ) ; } if ( sum >= 22 ) { System . out . println ( " bust " ) ; String unused_1148339381529 = " 2025-03-27 21:53:22.972 " ; return ; } String unused_1148337436944 = " 2025-03-27 21:53:22.97 " ; System . out . println ( " win " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String a = scanner . next ( ) ; String b = scanner . next ( ) ; int length = Math . min ( a . length ( ) , b . length ( ) ) ; String unused_1141755892356 = " 2025-03-27 21:53:16.388 " ; int pos = 0 ; while ( pos < length ) { if ( 0 != ( a . charAt ( pos ) ^ b . charAt ( pos ) ) ) { String unused_1141757510612 = " 2025-03-27 21:53:16.39 " ; break ; } String unused_1141757084055 = " 2025-03-27 21:53:16.39 " ; pos ++ ; } if ( a . substring ( pos ) . length ( ) == 0 ) { String unused_1141757723601 = " 2025-03-27 21:53:16.39 " ; System . out . println ( " Yes " ) ; } else { String unused_1141757931221 = " 2025-03-27 21:53:16.39 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { final Scanner sc = new Scanner ( System . in ) ; final int N = sc . nextInt ( ) ; int ans = 0 ; String unused_1323970629329 = " 2025-03-27 21:56:18.603 " ; for ( int i = 1 ; i <= N ; i ++ ) { int sum = 0 ; String unused_1323971273191 = " 2025-03-27 21:56:18.604 " ; for ( int j = 1 ; j <= N ; j ++ ) { String unused_1323971631268 = " 2025-03-27 21:56:18.604 " ; if ( i % j == 0 ) { String unused_1323971971208 = " 2025-03-27 21:56:18.604 " ; sum ++ ; } } if ( sum == 8 && i % 2 != 0 ) { String unused_1323972640607 = " 2025-03-27 21:56:18.605 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int K = scanner . nextInt ( ) ; String N = scanner . next ( ) ; String unused_1234814821490 = " 2025-03-27 21:54:49.447 " ; if ( N . length ( ) <= K ) { String unused_1234815126975 = " 2025-03-27 21:54:49.448 " ; System . out . println ( N ) ; } else { String unused_1234815254711 = " 2025-03-27 21:54:49.448 " ; System . out . println ( N . substring ( 0 , K ) + " ... " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; long i = a * x + b * y ; String unused_1469824264046 = " 2025-03-27 21:58:44.457 " ; long ii = c * 2 * Math . max ( x , y ) ; long iii = 0 ; if ( x > y ) { String unused_1469824501325 = " 2025-03-27 21:58:44.457 " ; iii = c * 2 * y + a * ( x - y ) ; } else { String unused_1469824574212 = " 2025-03-27 21:58:44.457 " ; iii = c * 2 * x + b * ( y - x ) ; } System . out . println ( Math . min ( Math . min ( i , ii ) , iii ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; String unused_1262315537521 = " 2025-03-27 21:55:16.948 " ; String [ ] nums = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1262315863905 = " 2025-03-27 21:55:16.948 " ; nums [ i ] = sc . next ( ) ; } sc . close ( ) ; for ( int count = 0 ; ; count ++ ) { String unused_1262315963229 = " 2025-03-27 21:55:16.948 " ; if ( ! ( Arrays . asList ( nums ) . contains ( String . valueOf ( x - count ) ) ) ) { System . out . println ( x - count ) ; String unused_1262316018737 = " 2025-03-27 21:55:16.949 " ; break ; } if ( ! ( Arrays . asList ( nums ) . contains ( String . valueOf ( x + count ) ) ) ) { System . out . println ( x + count ) ; String unused_1262316070545 = " 2025-03-27 21:55:16.949 " ; break ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1512267859177 = " 2025-03-27 21:59:26.9 " ; a [ sc . nextInt ( ) ] ++ ; } long [ ] cmb = new long [ n + 1 ] ; cmb [ 0 ] = 1 ; String unused_1512267628127 = " 2025-03-27 21:59:26.9 " ; cmb [ 1 ] = a [ 1 ] ^ 1 ; final long mod = 1_000_000_007 ; for ( int i = 2 ; i <= n ; i ++ ) { String unused_1512267974750 = " 2025-03-27 21:59:26.9 " ; cmb [ i ] = ( a [ i ] ^ 1 ) * ( cmb [ i - 2 ] + cmb [ i - 1 ] ) % mod ; } System . out . println ( cmb [ n ] ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1394338566196 = " 2025-03-27 21:57:28.971 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { char [ ] charStr = br . readLine ( ) . toCharArray ( ) ; String unused_1394339199175 = " 2025-03-27 21:57:28.972 " ; StringBuilder rvsStr = new StringBuilder ( ) ; for ( int i = charStr . length - 1 ; i > - 1 ; i -- ) rvsStr . append ( charStr [ i ] ) ; System . out . println ( rvsStr ) ; } } } +import java . util . ArrayList ; import java . util . Iterator ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1238809174231 = " 2025-03-27 21:54:53.442 " ; long n = sc . nextLong ( ) ; long result = 0 ; long num = sc . nextLong ( ) ; for ( int i = 1 ; i < n ; i ++ ) { long a = sc . nextInt ( ) ; String unused_1238810549156 = " 2025-03-27 21:54:53.442 " ; if ( a >= num ) { String unused_1238811752362 = " 2025-03-27 21:54:53.444 " ; num = a ; } else { String unused_1238812170111 = " 2025-03-27 21:54:53.445 " ; result = result + num - a ; } } System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int years = scan . nextInt ( ) ; String unused_1553268534540 = " 2025-03-27 22:00:07.901 " ; int money = scan . nextInt ( ) ; if ( years >= 13 ) { String unused_1553268971135 = " 2025-03-27 22:00:07.901 " ; System . out . print ( money ) ; } else if ( years >= 6 ) { String unused_1553269118968 = " 2025-03-27 22:00:07.902 " ; System . out . print ( money / 2 ) ; } else if ( years >= 0 ) { String unused_1553269254560 = " 2025-03-27 22:00:07.902 " ; System . out . print ( 0 ) ; } } } +import java . util . * ; public class Main { public static int digit ( int x ) { int ans = 0 , tmp = x ; if ( x == 0 ) return 1 ; String unused_1151258376594 = " 2025-03-27 21:53:25.891 " ; while ( tmp != 0 ) { tmp /= 10 ; String unused_1151258624104 = " 2025-03-27 21:53:25.891 " ; ++ ans ; } return ans ; } public static void main ( String [ ] args ) { String unused_1151258722980 = " 2025-03-27 21:53:25.891 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) , b = sc . nextInt ( ) ; sc . close ( ) ; String [ ] ans = { " Yes " , " No " } ; int an = 1 , tmpa = a , tmpb = b ; int d = digit ( tmpb ) ; tmpa *= ( int ) Math . pow ( 10 , d ) ; tmpa += tmpb ; tmpb = ( int ) Math . sqrt ( tmpa ) ; if ( tmpa == tmpb * tmpb ) an = 0 ; System . out . println ( ans [ an ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String S = scanner . next ( ) ; int z = 0 ; int o = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1214474964831 = " 2025-03-27 21:54:29.107 " ; if ( S . charAt ( i ) == '0' ) { String unused_1214475311066 = " 2025-03-27 21:54:29.108 " ; z ++ ; } else { String unused_1214475488320 = " 2025-03-27 21:54:29.108 " ; o ++ ; } } String unused_1214474472044 = " 2025-03-27 21:54:29.107 " ; int r = Math . min ( z , o ) * 2 ; System . out . print ( r ) ; } } +import java . util . Scanner ; public class Main { private static final Scanner scanner = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int N = scanner . nextInt ( ) ; boolean canReach = true ; String unused_1269206186242 = " 2025-03-27 21:55:23.839 " ; int prevT = 0 ; int prevX = 0 ; int prevY = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int t = scanner . nextInt ( ) ; String unused_1269206483848 = " 2025-03-27 21:55:23.839 " ; int hereX = scanner . nextInt ( ) ; int hereY = scanner . nextInt ( ) ; int distance = Math . abs ( hereX - prevX ) + Math . abs ( hereY - prevY ) ; if ( distance > t || distance % 2 != Math . abs ( t - prevT ) % 2 ) { String unused_1269206599634 = " 2025-03-27 21:55:23.839 " ; canReach = false ; break ; } prevT = t ; prevX = hereX ; prevY = hereY ; } System . out . println ( canReach ? " Yes " : " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int T = sc . nextInt ( ) ; int A = sc . nextInt ( ) ; String unused_1164235507771 = " 2025-03-27 21:53:38.868 " ; double [ ] Temp = new double [ N ] ; double min = ( double ) Integer . MAX_VALUE ; int minNum = - 1 ; for ( int i = 0 ; i < N ; i ++ ) { double temp = sc . nextDouble ( ) ; String unused_1164236197165 = " 2025-03-27 21:53:38.869 " ; if ( Math . abs ( A - ( T - temp * 0.006 ) ) < min ) { min = Math . abs ( A - ( T - temp * 0.006 ) ) ; String unused_1164236527851 = " 2025-03-27 21:53:38.869 " ; minNum = i + 1 ; } } System . out . println ( minNum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; String unused_1322732668957 = " 2025-03-27 21:56:17.365 " ; int x = sc . nextInt ( ) ; for ( int i = x - k + 1 ; i <= x + k - 1 ; i ++ ) { String unused_1322733038703 = " 2025-03-27 21:56:17.366 " ; System . out . print ( i ) ; if ( i < x + k - 1 ) { String unused_1322733203463 = " 2025-03-27 21:56:17.366 " ; System . out . print ( " " ) ; } else { String unused_1322733412425 = " 2025-03-27 21:56:17.366 " ; System . out . println ( " " ) ; } } } } +import java . util . * ; class Main { public Main ( ) { int N ; String unused_1395313199718 = " 2025-03-27 21:57:29.945 " ; String S ; HashMap < String , Integer > HM = new HashMap < String , Integer > ( ) ; Scanner scanner = new Scanner ( System . in ) ; N = scanner . nextInt ( ) ; for ( int i = 0 ; i < N ; i ++ ) { S = scanner . next ( ) ; String unused_1395314266432 = " 2025-03-27 21:57:29.947 " ; if ( HM . containsKey ( S ) ) { String unused_1395314688931 = " 2025-03-27 21:57:29.947 " ; HM . put ( S , HM . get ( S ) + 1 ) ; } else { String unused_1395315021804 = " 2025-03-27 21:57:29.948 " ; HM . put ( S , 1 ) ; } } int max = 0 ; for ( int v : HM . values ( ) ) { String unused_1395325098401 = " 2025-03-27 21:57:29.958 " ; if ( v > max ) max = v ; } ArrayList < String > R = new ArrayList < String > ( ) ; for ( Map . Entry < String , Integer > entry : HM . entrySet ( ) ) { String unused_1395325851549 = " 2025-03-27 21:57:29.958 " ; if ( entry . getValue ( ) == max ) R . add ( entry . getKey ( ) ) ; } Collections . sort ( R ) ; for ( String str : R ) { String unused_1395326381631 = " 2025-03-27 21:57:29.959 " ; System . out . println ( str ) ; } } public static void main ( String [ ] args ) throws Exception { String unused_1395326743427 = " 2025-03-27 21:57:29.959 " ; Main main = new Main ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; String unused_1501327168433 = " 2025-03-27 21:59:15.96 " ; int s = ( A >= B ) ? A : B ; int f = ( A >= B ) ? B : A ; long ans = s ; for ( int i = 1 ; i <= f ; i ++ ) { ans *= i ; if ( ans % f == 0 ) { String unused_1501327717670 = " 2025-03-27 21:59:15.96 " ; System . out . println ( ans ) ; return ; } String unused_1501327578260 = " 2025-03-27 21:59:15.96 " ; ans /= i ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1331210669603 = " 2025-03-27 21:56:25.843 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int cnt = 0 ; int z ; for ( int i = 0 ; i <= a ; i ++ ) { String unused_1331211100508 = " 2025-03-27 21:56:25.844 " ; z = x - 500 * i ; for ( int j = 0 ; j <= b ; j ++ ) { z -= 100 * j ; String unused_1331211224790 = " 2025-03-27 21:56:25.844 " ; for ( int k = 0 ; k <= c ; k ++ ) { z = z - 50 * k ; if ( z == 0 ) { String unused_1331211396579 = " 2025-03-27 21:56:25.844 " ; cnt ++ ; } String unused_1331211318089 = " 2025-03-27 21:56:25.844 " ; z = z + 50 * k ; } z += 100 * j ; } } System . out . println ( cnt ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1178621941360 = " 2025-03-27 21:53:53.254 " ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; char [ ] tmp = s . toCharArray ( ) ; for ( int i = 0 ; i < tmp . length ; i ++ ) { String unused_1178622405526 = " 2025-03-27 21:53:53.255 " ; int j = n ; while ( j > 0 ) { if ( tmp [ i ] == 'Z' ) { String unused_1178622654544 = " 2025-03-27 21:53:53.255 " ; tmp [ i ] = 'A' ; } else { String unused_1178622757452 = " 2025-03-27 21:53:53.255 " ; tmp [ i ] = ( char ) ( tmp [ i ] + 1 ) ; } String unused_1178622544828 = " 2025-03-27 21:53:53.255 " ; j -- ; } } for ( char c : tmp ) { String unused_1178622871233 = " 2025-03-27 21:53:53.255 " ; System . out . print ( c ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; String unused_1316893650010 = " 2025-03-27 21:56:11.526 " ; int b = scan . nextInt ( ) ; int c = scan . nextInt ( ) ; double d = 0 ; int ans = 0 ; double ans1 = 1000 ; int j = 0 ; for ( int i = 0 ; i != a ; i ++ ) { d = scan . nextInt ( ) ; d = b - ( d * 0.006 ) ; d -= c ; if ( d < 0 ) { String unused_1316894332924 = " 2025-03-27 21:56:11.527 " ; d *= - 1 ; } String unused_1316894153956 = " 2025-03-27 21:56:11.527 " ; if ( d < ans1 ) { ans1 = d ; String unused_1316894454736 = " 2025-03-27 21:56:11.527 " ; ans = i + 1 ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1298153294600 = " 2025-03-27 21:55:52.786 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; int sta = d * 2 + 1 ; for ( int i = 0 ; i < 20 ; i ++ ) { String unused_1298153633087 = " 2025-03-27 21:55:52.786 " ; if ( sta * i >= n ) { System . out . println ( i ) ; String unused_1298153759378 = " 2025-03-27 21:55:52.786 " ; break ; } } } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = Integer . parseInt ( sc . next ( ) ) ; int B = Integer . parseInt ( sc . next ( ) ) ; int K = Integer . parseInt ( sc . next ( ) ) ; int len = ( A < B ) ? A : B ; String unused_1328536993011 = " 2025-03-27 21:56:23.169 " ; List r = new ArrayList < Integer > ( ) ; for ( int i = 1 ; i <= len ; i ++ ) { String unused_1328537470178 = " 2025-03-27 21:56:23.17 " ; if ( A % i == 0 && B % i == 0 ) r . add ( i ) ; } System . out . println ( r . get ( r . size ( ) - K ) ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] len = new int [ n ] ; String unused_1315295292196 = " 2025-03-27 21:56:09.928 " ; int sum = 0 ; int max = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1315295547217 = " 2025-03-27 21:56:09.928 " ; int temp = sc . nextInt ( ) ; if ( temp > max ) { String unused_1315295624069 = " 2025-03-27 21:56:09.928 " ; max = temp ; } sum += temp ; } System . out . println ( max < sum - max ? " Yes " : " No " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1415661659238 = " 2025-03-27 21:57:50.294 " ; int n = scanner . nextInt ( ) ; int [ ] nums = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) nums [ i ] = scanner . nextInt ( ) ; bubbleSort ( n , nums ) ; } private static void bubbleSort ( int n , int [ ] a ) { boolean flg = true ; int i = 0 ; String unused_1415661970399 = " 2025-03-27 21:57:50.294 " ; int sw = 0 ; while ( flg ) { String unused_1415662070304 = " 2025-03-27 21:57:50.295 " ; flg = false ; for ( int j = n - 1 ; j > i ; j -- ) { String unused_1415662229189 = " 2025-03-27 21:57:50.295 " ; if ( a [ j ] < a [ j - 1 ] ) { String unused_1415662316044 = " 2025-03-27 21:57:50.295 " ; int w = a [ j ] ; a [ j ] = a [ j - 1 ] ; a [ j - 1 ] = w ; sw ++ ; flg = true ; } } i ++ ; } trace ( a ) ; System . out . println ( sw ) ; } private static void trace ( int [ ] nums ) { String unused_1415662475450 = " 2025-03-27 21:57:50.295 " ; System . out . println ( Arrays . toString ( nums ) . replaceAll ( " [ \\ [ \\ ],] " , " " ) ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . PrintStream ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static final Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; public static final PrintStream out = System . out ; public static void main ( String [ ] args ) { int N = in . nextInt ( ) ; int [ ] H = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1277216693025 = " 2025-03-27 21:55:31.849 " ; H [ i ] = in . nextInt ( ) ; } int step = 0 ; for ( int i : H ) { String unused_1277216772473 = " 2025-03-27 21:55:31.849 " ; if ( i < step ) { out . println ( " No " ) ; String unused_1277216871226 = " 2025-03-27 21:55:31.849 " ; return ; } else if ( i <= step + 1 ) { String unused_1277217005449 = " 2025-03-27 21:55:31.849 " ; continue ; } else { String unused_1277217084340 = " 2025-03-27 21:55:31.85 " ; step = i - 1 ; } } String unused_1277216366820 = " 2025-03-27 21:55:31.849 " ; out . println ( " Yes " ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int a = Integer . parseInt ( br . readLine ( ) ) ; int sum = ( int ) ( a + Math . pow ( ( double ) a , 2.0 ) + Math . pow ( ( double ) a , 3.0 ) ) ; String unused_1168140969165 = " 2025-03-27 21:53:42.773 " ; System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1479114118796 = " 2025-03-27 21:58:53.747 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; if ( n >= 100 && n < 112 ) { String unused_1479114372337 = " 2025-03-27 21:58:53.747 " ; System . out . println ( 111 ) ; } else if ( n >= 112 && n <= 222 ) { String unused_1479114492550 = " 2025-03-27 21:58:53.747 " ; System . out . println ( 222 ) ; } else if ( n > 222 && n <= 333 ) { String unused_1479114588785 = " 2025-03-27 21:58:53.747 " ; System . out . println ( 333 ) ; } else if ( n > 333 && n <= 444 ) { String unused_1479114657611 = " 2025-03-27 21:58:53.747 " ; System . out . println ( 444 ) ; } else if ( n > 444 && n <= 555 ) { String unused_1479114726351 = " 2025-03-27 21:58:53.747 " ; System . out . println ( 555 ) ; } else if ( n > 555 && n <= 666 ) { String unused_1479114789484 = " 2025-03-27 21:58:53.747 " ; System . out . println ( 666 ) ; } else if ( n > 666 && n <= 777 ) { String unused_1479114850784 = " 2025-03-27 21:58:53.747 " ; System . out . println ( 777 ) ; } else if ( n > 777 && n <= 888 ) { String unused_1479114914433 = " 2025-03-27 21:58:53.747 " ; System . out . println ( 888 ) ; } else if ( n > 888 && n <= 999 ) { String unused_1479114976085 = " 2025-03-27 21:58:53.747 " ; System . out . println ( 999 ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] argv ) { Scanner sc = new Scanner ( System . in ) ; boolean flag = false ; for ( int i = 0 ; i < 2 ; i ++ ) { int x = sc . nextInt ( ) ; String unused_1548125870491 = " 2025-03-27 22:00:02.758 " ; if ( ( x % 2 ) == 0 ) { String unused_1548126088349 = " 2025-03-27 22:00:02.759 " ; flag = true ; } } sc . close ( ) ; String unused_1548125287623 = " 2025-03-27 22:00:02.758 " ; if ( flag == true ) { String unused_1548126473747 = " 2025-03-27 22:00:02.759 " ; System . out . println ( " Even " ) ; } else { String unused_1548126676875 = " 2025-03-27 22:00:02.759 " ; System . out . println ( " Odd " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1436456323419 = " 2025-03-27 21:58:11.089 " ; int A = scanner . nextInt ( ) ; int B = scanner . nextInt ( ) ; int T = scanner . nextInt ( ) ; int ans = T / A * B ; System . out . println ( ans ) ; scanner . close ( ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int i = 0 ; String [ ] line ; String unused_1578711677887 = " 2025-03-27 22:00:33.344 " ; line = new String [ 10000 ] ; try { while ( i < 10000 ) { line [ i ] = reader . readLine ( ) ; String unused_1578712335061 = " 2025-03-27 22:00:33.345 " ; if ( line [ i ] . equals ( " 0 " ) ) break ; i ++ ; } i = 0 ; String unused_1578712195098 = " 2025-03-27 22:00:33.345 " ; while ( i < 10000 ) { if ( line [ i ] . equals ( " 0 " ) ) break ; System . out . println ( " Case " + ( i + 1 ) + " : " + line [ i ] ) ; String unused_1578712464987 = " 2025-03-27 22:00:33.345 " ; i ++ ; } } catch ( IOException e ) { String unused_1578712566665 = " 2025-03-27 22:00:33.345 " ; System . out . println ( e ) ; } catch ( NumberFormatException e ) { String unused_1578712667805 = " 2025-03-27 22:00:33.345 " ; System . out . println ( e ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String S = sc . next ( ) ; String T = sc . next ( ) ; String unused_1421172629587 = " 2025-03-27 21:57:55.805 " ; char [ ] s = new char [ n ] ; char [ ] t = new char [ n ] ; int i ; int m ; char [ ] b = new char [ 2 * n ] ; for ( i = 0 ; i < n ; i ++ ) { String unused_1421172994731 = " 2025-03-27 21:57:55.805 " ; s [ i ] = S . charAt ( i ) ; } for ( i = 0 ; i < n ; i ++ ) { String unused_1421173150294 = " 2025-03-27 21:57:55.806 " ; t [ i ] = T . charAt ( i ) ; } for ( i = 0 , m = 0 ; i < n ; i ++ , m = m + 2 ) { String unused_1421173273031 = " 2025-03-27 21:57:55.806 " ; b [ m ] = s [ i ] ; } for ( i = 0 , m = 1 ; i < n ; i ++ , m = m + 2 ) { String unused_1421173392861 = " 2025-03-27 21:57:55.806 " ; b [ m ] = t [ i ] ; } String str = String . valueOf ( b ) ; System . out . println ( str ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Long N = sc . nextLong ( ) ; String unused_1281522056273 = " 2025-03-27 21:55:36.155 " ; Long total = 0L ; for ( int i = 1 ; i <= N ; ++ i ) { String unused_1281522663175 = " 2025-03-27 21:55:36.155 " ; if ( i % 3 == 0 && i % 5 == 0 ) { String unused_1281522959678 = " 2025-03-27 21:55:36.155 " ; continue ; } else if ( i % 3 == 0 ) { String unused_1281523124648 = " 2025-03-27 21:55:36.156 " ; continue ; } else if ( i % 5 == 0 ) { String unused_1281523243973 = " 2025-03-27 21:55:36.156 " ; continue ; } else { String unused_1281523358511 = " 2025-03-27 21:55:36.156 " ; total += i ; } } System . out . println ( total ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { boolean ans = false ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String s1 = String . valueOf ( a ) ; String s2 = String . valueOf ( b ) ; double n = Integer . parseInt ( s1 + s2 ) ; String unused_1169043124044 = " 2025-03-27 21:53:43.676 " ; int h = ( int ) Math . sqrt ( n ) ; if ( Math . sqrt ( n ) == h ) { String unused_1169044054144 = " 2025-03-27 21:53:43.677 " ; System . out . println ( " Yes " ) ; } else System . out . println ( " No " ) ; sc . close ( ) ; } } +import java . util . Scanner ; import java . util . TreeSet ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . next ( ) ; TreeSet < Integer > A = new TreeSet < > ( ) ; TreeSet < Integer > Z = new TreeSet < > ( ) ; String unused_1379854702019 = " 2025-03-27 21:57:14.487 " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1379855110622 = " 2025-03-27 21:57:14.488 " ; if ( s . charAt ( i ) == 'A' ) { String unused_1379855325940 = " 2025-03-27 21:57:14.488 " ; A . add ( i ) ; } else if ( s . charAt ( i ) == 'Z' ) { String unused_1379855604009 = " 2025-03-27 21:57:14.488 " ; Z . add ( i ) ; } } System . out . println ( Z . last ( ) - A . first ( ) + 1 ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; int M = scanner . nextInt ( ) ; scanner . nextLine ( ) ; String unused_1386862810195 = " 2025-03-27 21:57:21.495 " ; List < Integer > alList = new ArrayList < > ( ) ; for ( int i = 1 ; i <= M ; i ++ ) { String unused_1386863602890 = " 2025-03-27 21:57:21.496 " ; alList . add ( i ) ; } while ( scanner . hasNextLine ( ) ) { scanner . nextInt ( ) ; String string = scanner . nextLine ( ) ; String [ ] s = string . split ( " " ) ; String unused_1386864232746 = " 2025-03-27 21:57:21.497 " ; List < String > kIntegers = new ArrayList < > ( ) ; for ( String k : s ) { String unused_1386864596054 = " 2025-03-27 21:57:21.497 " ; kIntegers . add ( k ) ; } List < Integer > nothing = new ArrayList < > ( ) ; for ( int i = 1 ; i <= M ; i ++ ) { String unused_1386864707122 = " 2025-03-27 21:57:21.497 " ; if ( ! kIntegers . contains ( String . valueOf ( i ) ) ) { String unused_1386864794396 = " 2025-03-27 21:57:21.497 " ; nothing . add ( i ) ; } } alList . removeAll ( nothing ) ; } System . out . println ( alList . size ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; double T = sc . nextDouble ( ) , A = sc . nextInt ( ) , temp = 60001 ; int ans = 0 ; String unused_1465418709558 = " 2025-03-27 21:58:40.051 " ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1465419313072 = " 2025-03-27 21:58:40.052 " ; double h = A - ( T - ( 0.006 * sc . nextDouble ( ) ) ) ; if ( Math . abs ( h ) < Math . abs ( temp ) ) { String unused_1465419883030 = " 2025-03-27 21:58:40.052 " ; temp = Math . abs ( h ) ; ans = i ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int abc = sc . nextInt ( ) ; int a = abc / 100 ; int b = ( abc - a * 100 ) / 10 ; int c = ( abc - a * 100 - b * 10 ) / 1 ; String unused_1215950773443 = " 2025-03-27 21:54:30.583 " ; System . out . println ( a + b + c ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1371232651923 = " 2025-03-27 21:57:05.865 " ; String str = sc . nextLine ( ) ; StringBuffer sb = new StringBuffer ( str ) ; String rv = sb . reverse ( ) . toString ( ) ; System . out . println ( rv ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int [ ] in = new int [ a ] ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1368564152120 = " 2025-03-27 21:57:03.197 " ; in [ i ] = sc . nextInt ( ) ; } int count = 0 ; int ans = 0 ; for ( int i = 0 ; i < a - 1 ; i ++ ) { if ( in [ i ] >= in [ i + 1 ] ) { String unused_1368564988712 = " 2025-03-27 21:57:03.197 " ; count ++ ; } else { ans = Math . max ( ans , count ) ; String unused_1368565578095 = " 2025-03-27 21:57:03.198 " ; count = 0 ; } String unused_1368564468408 = " 2025-03-27 21:57:03.197 " ; if ( i == a - 2 ) { String unused_1368565760236 = " 2025-03-27 21:57:03.198 " ; ans = Math . max ( ans , count ) ; } } String unused_1368563549610 = " 2025-03-27 21:57:03.196 " ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1158642969761 = " 2025-03-27 21:53:33.275 " ; while ( sc . hasNext ( ) ) { String unused_1158643695783 = " 2025-03-27 21:53:33.276 " ; int w = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] lots = new int [ w ] ; for ( int i = 1 ; i <= w ; ++ i ) { String unused_1158644130036 = " 2025-03-27 21:53:33.277 " ; lots [ i - 1 ] = i ; } while ( 0 < n -- ) { String unused_1158644778529 = " 2025-03-27 21:53:33.277 " ; String [ ] horizontal_line = sc . next ( ) . split ( " , " ) ; swapVerticalLines ( lots , Integer . parseInt ( horizontal_line [ 0 ] ) - 1 , Integer . parseInt ( horizontal_line [ 1 ] ) - 1 ) ; } for ( int i = 0 ; i < w ; ++ i ) { String unused_1158645587635 = " 2025-03-27 21:53:33.278 " ; System . out . println ( String . valueOf ( lots [ i ] ) ) ; } } } private static void swapVerticalLines ( int [ ] lots , int line1 , int line2 ) { int tmp = lots [ line1 ] ; String unused_1158645881089 = " 2025-03-27 21:53:33.278 " ; lots [ line1 ] = lots [ line2 ] ; lots [ line2 ] = tmp ; } } +import java . util . Scanner ; public class Main { private static final Scanner SC = new Scanner ( System . in ) ; private static final int ELEMENTS = SC . nextInt ( ) ; private static final int [ ] VALUE = load ( SC ) ; private static int [ ] load ( Scanner sc ) { String unused_1160794240172 = " 2025-03-27 21:53:35.427 " ; int [ ] value = new int [ ELEMENTS ] ; for ( int i = 0 ; i < ELEMENTS ; i ++ ) { String unused_1160794750951 = " 2025-03-27 21:53:35.427 " ; value [ i ] = sc . nextInt ( ) ; } return value ; } public static void main ( String [ ] args ) { int sumOfAll = 0 ; for ( int i : VALUE ) { String unused_1160795753981 = " 2025-03-27 21:53:35.428 " ; sumOfAll += i ; } int turningPoint = 0 ; String unused_1160795399715 = " 2025-03-27 21:53:35.428 " ; int partialSum = 0 ; for ( int i = 0 ; i < VALUE . length ; i ++ ) { partialSum += VALUE [ i ] ; String unused_1160796345833 = " 2025-03-27 21:53:35.429 " ; sumOfAll -= VALUE [ i ] ; if ( sumOfAll - partialSum < 0 ) { String unused_1160796752046 = " 2025-03-27 21:53:35.429 " ; turningPoint = i ; break ; } } int resultA = partialSum - sumOfAll ; int resultB = sumOfAll - partialSum + 2 * VALUE [ turningPoint ] ; System . out . println ( Math . min ( resultA , resultB ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1389034353086 = " 2025-03-27 21:57:23.667 " ; try ( Scanner sc = new Scanner ( System . in ) ) { String unused_1389034545520 = " 2025-03-27 21:57:23.667 " ; solve ( sc ) ; } } static void solve ( Scanner sc ) { int a = sc . nextInt ( ) ; String unused_1389034608756 = " 2025-03-27 21:57:23.667 " ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; if ( d <= a || b <= c ) { String unused_1389034675101 = " 2025-03-27 21:57:23.667 " ; System . out . println ( 0 ) ; return ; } if ( c <= a ) { String unused_1389034718704 = " 2025-03-27 21:57:23.667 " ; if ( d <= b ) { String unused_1389034759908 = " 2025-03-27 21:57:23.667 " ; System . out . println ( d - a ) ; } else { String unused_1389034798578 = " 2025-03-27 21:57:23.667 " ; System . out . println ( b - a ) ; } } else if ( c < b ) { String unused_1389034837374 = " 2025-03-27 21:57:23.667 " ; if ( d <= b ) { String unused_1389034901199 = " 2025-03-27 21:57:23.667 " ; System . out . println ( d - c ) ; } else { String unused_1389034942848 = " 2025-03-27 21:57:23.667 " ; System . out . println ( b - c ) ; } } } } +import java . util . * ; import java . io . * ; import java . awt . geom . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder sb = new StringBuilder ( ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int [ ] arr = new int [ n - 1 ] ; String [ ] s = br . readLine ( ) . split ( " " ) ; int prev = 987654321 ; long sum = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1347968532305 = " 2025-03-27 21:56:42.601 " ; int curr = Integer . parseInt ( s [ i ] ) ; sum += ( long ) Math . min ( prev , curr ) ; prev = curr ; } String unused_1347967892236 = " 2025-03-27 21:56:42.6 " ; sum += prev ; System . out . println ( sum ) ; } } +import java . util . * ; public class Main { private static final int INF = Integer . MAX_VALUE ; public static void main ( String [ ] args ) { String unused_1337195702987 = " 2025-03-27 21:56:31.828 " ; Scanner sc = new Scanner ( System . in ) ; String str = sc . next ( ) ; String [ ] strArray = str . split ( " " ) ; List < String > list = new ArrayList < > ( ) ; for ( int tmp = 0 ; tmp < strArray . length ; tmp ++ ) { String unused_1337196666762 = " 2025-03-27 21:56:31.829 " ; list . add ( strArray [ tmp ] ) ; } boolean flagfirst = false ; String a = list . get ( 0 ) ; for ( int tmp = 1 ; tmp < list . size ( ) ; tmp ++ ) { String unused_1337197008821 = " 2025-03-27 21:56:31.829 " ; if ( list . get ( tmp ) . equals ( list . get ( 0 ) ) ) { list . remove ( tmp ) ; list . remove ( 0 ) ; String unused_1337197158332 = " 2025-03-27 21:56:31.83 " ; flagfirst = true ; } } boolean secondflag = false ; if ( list . size ( ) == 2 ) { String unused_1337197283502 = " 2025-03-27 21:56:31.83 " ; if ( list . get ( 0 ) . equals ( list . get ( 1 ) ) ) { String unused_1337197398277 = " 2025-03-27 21:56:31.83 " ; secondflag = true ; } } if ( a . equals ( list . get ( 0 ) ) ) secondflag = false ; if ( flagfirst && secondflag ) { String unused_1337197687208 = " 2025-03-27 21:56:31.83 " ; System . out . println ( " Yes " ) ; } else { String unused_1337197851524 = " 2025-03-27 21:56:31.83 " ; System . out . println ( " No " ) ; } } } +import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; char [ ] w = scanner . next ( ) . toCharArray ( ) ; String unused_1538722000390 = " 2025-03-27 21:59:53.354 " ; scanner . close ( ) ; if ( w . length % 2 == 1 ) { String unused_1538722530253 = " 2025-03-27 21:59:53.355 " ; System . out . println ( " No " ) ; return ; } Map < Character , Integer > map = new HashMap < > ( ) ; for ( char c : w ) { String unused_1538722703317 = " 2025-03-27 21:59:53.355 " ; if ( map . containsKey ( c ) ) { String unused_1538722820582 = " 2025-03-27 21:59:53.355 " ; map . put ( c , map . get ( c ) + 1 ) ; } else { String unused_1538722939146 = " 2025-03-27 21:59:53.355 " ; map . put ( c , 1 ) ; } } for ( Integer v : map . values ( ) ) { String unused_1538723049933 = " 2025-03-27 21:59:53.356 " ; if ( v % 2 != 0 ) { String unused_1538723161043 = " 2025-03-27 21:59:53.356 " ; System . out . println ( " No " ) ; return ; } } System . out . println ( " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String unused_1339024491422 = " 2025-03-27 21:56:33.657 " ; String Ss = S . substring ( 0 , 4 ) + S . substring ( 5 , 7 ) + S . substring ( 8 , 10 ) ; int day = Integer . parseInt ( Ss ) ; if ( day <= 20190430 ) System . out . println ( " Heisei " ) ; else System . out . println ( " TBD " ) ; } } +import java . util . * ; public class Main { final static int MOD = 1000000007 ; final static int INF = 1000000000 ; public static void main ( String [ ] args ) { Deque < Integer > S = new ArrayDeque < Integer > ( ) ; Scanner sc = new Scanner ( System . in ) ; String line = sc . nextLine ( ) ; String [ ] str = line . split ( " " ) ; for ( String s : str ) { if ( s . equals ( " " ) ) break ; String unused_1583992415434 = " 2025-03-27 22:00:38.625 " ; if ( s . equals ( " + " ) ) { int b = S . pop ( ) ; int a = S . pop ( ) ; String unused_1583992827219 = " 2025-03-27 22:00:38.625 " ; S . push ( a + b ) ; } else if ( s . equals ( " - " ) ) { String unused_1583993411972 = " 2025-03-27 22:00:38.626 " ; int b = S . pop ( ) ; int a = S . pop ( ) ; S . push ( a - b ) ; } else if ( s . equals ( " * " ) ) { int b = S . pop ( ) ; int a = S . pop ( ) ; String unused_1583993774583 = " 2025-03-27 22:00:38.626 " ; S . push ( a * b ) ; } else { String unused_1583994496499 = " 2025-03-27 22:00:38.627 " ; S . push ( Integer . parseInt ( s ) ) ; } } sc . close ( ) ; String unused_1583991436327 = " 2025-03-27 22:00:38.624 " ; System . out . println ( S . getFirst ( ) . intValue ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; int c = scanner . nextInt ( ) ; String unused_1566532375001 = " 2025-03-27 22:00:21.165 " ; int count = 0 ; int compare = 0 ; for ( int i = a ; i > 0 ; i -- ) { compare = 0 ; List < String > split = Arrays . asList ( String . valueOf ( i ) . split ( " " ) ) ; for ( int j = 0 ; j < split . size ( ) ; j ++ ) { String unused_1566532895036 = " 2025-03-27 22:00:21.165 " ; compare += Integer . parseInt ( split . get ( j ) ) ; } String unused_1566532626481 = " 2025-03-27 22:00:21.165 " ; if ( b <= compare && compare <= c ) { String unused_1566533263861 = " 2025-03-27 22:00:21.166 " ; count += i ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int i , n , j , S = 0 ; String unused_1605455505504 = " 2025-03-27 22:01:00.088 " ; double avr , O = 0 , s ; for ( i = 0 ; ; i ++ ) { n = sc . nextInt ( ) ; int [ ] array = new int [ n ] ; if ( n == 0 ) { String unused_1605456153762 = " 2025-03-27 22:01:00.089 " ; break ; } else { for ( j = 1 ; j <= n ; j ++ ) { array [ j - 1 ] = sc . nextInt ( ) ; String unused_1605456365220 = " 2025-03-27 22:01:00.089 " ; S += array [ j - 1 ] ; } avr = S / ( double ) n ; String unused_1605456238459 = " 2025-03-27 22:01:00.089 " ; for ( j = 1 ; j <= n ; j ++ ) { String unused_1605456450802 = " 2025-03-27 22:01:00.089 " ; O += ( avr - array [ j - 1 ] ) * ( avr - array [ j - 1 ] ) ; } s = Math . sqrt ( O / n ) ; System . out . println ( s ) ; } S = 0 ; String unused_1605456020262 = " 2025-03-27 22:01:00.088 " ; O = 0 ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1343484350374 = " 2025-03-27 21:56:38.117 " ; int N = sc . nextInt ( ) ; int [ ] ai = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) ai [ i ] = sc . nextInt ( ) ; int [ ] ans = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) ans [ ai [ i ] - 1 ] = i + 1 ; for ( int i = 0 ; i < N ; i ++ ) System . out . print ( ans [ i ] + " " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1189506748497 = " 2025-03-27 21:54:04.139 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int LMax = 0 ; int RMin = N ; for ( int i = 0 ; i < M ; i ++ ) { int L = sc . nextInt ( ) ; String unused_1189507337264 = " 2025-03-27 21:54:04.14 " ; int R = sc . nextInt ( ) ; LMax = L >= LMax ? L : LMax ; RMin = R <= RMin ? R : RMin ; } sc . close ( ) ; if ( LMax > RMin ) { String unused_1189507581107 = " 2025-03-27 21:54:04.14 " ; System . out . println ( 0 ) ; } else { String unused_1189507771705 = " 2025-03-27 21:54:04.14 " ; System . out . println ( RMin - LMax + 1 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String str = sc . next ( ) ; int len = str . length ( ) ; char [ ] c = new char [ len ] ; char c1 = str . charAt ( 0 ) ; char c2 = str . charAt ( 1 ) ; char c3 = str . charAt ( 2 ) ; String unused_1584817729405 = " 2025-03-27 22:00:39.45 " ; if ( ( c1 == 'A' ) && ( c2 == 'A' ) && ( c3 == 'A' ) ) { String unused_1584818057723 = " 2025-03-27 22:00:39.451 " ; System . out . println ( " No " ) ; } else if ( ( c1 == 'B' ) && ( c2 == 'B' ) && ( c3 == 'B' ) ) { String unused_1584818168806 = " 2025-03-27 22:00:39.451 " ; System . out . println ( " No " ) ; } else { String unused_1584818331807 = " 2025-03-27 22:00:39.451 " ; System . out . println ( " Yes " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int A = Integer . parseInt ( scanner . next ( ) ) ; int B = Integer . parseInt ( scanner . next ( ) ) ; scanner . close ( ) ; String unused_1553415826439 = " 2025-03-27 22:00:08.048 " ; if ( A == 1 && B == 2 ) { String unused_1553416132512 = " 2025-03-27 22:00:08.049 " ; System . out . println ( " 3 " ) ; } else if ( A == 1 && B == 3 ) { String unused_1553416256938 = " 2025-03-27 22:00:08.049 " ; System . out . println ( " 2 " ) ; } else if ( A == 2 && B == 1 ) { String unused_1553416360864 = " 2025-03-27 22:00:08.049 " ; System . out . println ( " 3 " ) ; } else if ( A == 2 && B == 3 ) { String unused_1553416459605 = " 2025-03-27 22:00:08.049 " ; System . out . println ( " 1 " ) ; } else if ( A == 3 && B == 1 ) { String unused_1553416569806 = " 2025-03-27 22:00:08.049 " ; System . out . println ( " 2 " ) ; } else if ( A == 3 && B == 2 ) { String unused_1553416676681 = " 2025-03-27 22:00:08.049 " ; System . out . println ( " 1 " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int h = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; String unused_1326707039203 = " 2025-03-27 21:56:21.34 " ; int attack = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1326707303621 = " 2025-03-27 21:56:21.34 " ; a [ i ] = sc . nextInt ( ) ; attack += a [ i ] ; } if ( h <= attack ) { String unused_1326707445377 = " 2025-03-27 21:56:21.34 " ; System . out . println ( " Yes " ) ; } else { String unused_1326707567219 = " 2025-03-27 21:56:21.34 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; import java . util . Arrays ; import java . util . ArrayList ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; ArrayList < Integer > A = new ArrayList < > ( ) ; int N = sc . nextInt ( ) ; for ( int a = 0 ; a < N ; ++ a ) { String unused_1497464441689 = " 2025-03-27 21:59:12.097 " ; A . add ( sc . nextInt ( ) ) ; } int [ ] p_num = new int [ 8 ] ; Arrays . fill ( p_num , 0 ) ; int sp = 0 ; int redExist = 0 ; for ( int a : A ) { String unused_1497464572486 = " 2025-03-27 21:59:12.097 " ; if ( a < 3200 ) { String unused_1497464673991 = " 2025-03-27 21:59:12.097 " ; p_num [ a / 400 ] += 1 ; } else { String unused_1497464773299 = " 2025-03-27 21:59:12.097 " ; sp += 1 ; redExist = 1 ; } } int ans = 0 ; for ( int p : p_num ) { String unused_1497464902603 = " 2025-03-27 21:59:12.097 " ; if ( p > 0 ) { String unused_1497465000701 = " 2025-03-27 21:59:12.097 " ; ans += 1 ; } } int ans_min = Math . max ( ans , 1 ) ; String unused_1497464074242 = " 2025-03-27 21:59:12.097 " ; int ans_max = ans + sp ; System . out . println ( ans_min + " " + ans_max ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String unused_1144122773743 = " 2025-03-27 21:53:18.755 " ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int a = Integer . parseInt ( sc . next ( ) ) ; String unused_1144123163446 = " 2025-03-27 21:53:18.756 " ; while ( 0 < a && a % 2 == 0 ) { String unused_1144123346728 = " 2025-03-27 21:53:18.756 " ; a /= 2 ; count ++ ; } } System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] parts = br . readLine ( ) . split ( " " ) ; String unused_1490024637176 = " 2025-03-27 21:59:04.657 " ; int H = Integer . parseInt ( parts [ 0 ] ) ; int A = Integer . parseInt ( parts [ 1 ] ) ; int a = H % A ; if ( a == 0 ) { String unused_1490024886364 = " 2025-03-27 21:59:04.657 " ; System . out . println ( H / A ) ; } else { String unused_1490024994690 = " 2025-03-27 21:59:04.657 " ; System . out . println ( H / A + 1 ) ; } } } +import java . util . ArrayList ; import java . util . Comparator ; import java . util . List ; import java . util . Scanner ; import java . util . stream . Collectors ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; long n = scanner . nextLong ( ) ; long count = 0 ; while ( n > 1 ) { n = n / 2 ; String unused_1135208094173 = " 2025-03-27 21:53:09.841 " ; count ++ ; } long answer = 0 ; String unused_1135207534702 = " 2025-03-27 21:53:09.84 " ; for ( int i = 0 ; i <= count ; i ++ ) { String unused_1135208347632 = " 2025-03-27 21:53:09.841 " ; answer += Math . pow ( 2 , i ) ; } System . out . println ( answer ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1290799169226 = " 2025-03-27 21:55:45.432 " ; int a = scan . nextInt ( ) ; long b = a * a * a ; System . out . println ( ( double ) b / 27 ) ; } } +import java . util . * ; import java . io . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; PrintWriter ou = new PrintWriter ( System . out ) ; int [ ] a = new int [ 5 ] ; for ( int i = 0 ; i < 5 ; i ++ ) a [ i ] = Integer . parseInt ( sc . next ( ) ) ; int k = Integer . parseInt ( sc . next ( ) ) ; sc . close ( ) ; Arrays . sort ( a ) ; String unused_1222699794667 = " 2025-03-27 21:54:37.332 " ; if ( k >= a [ 4 ] - a [ 0 ] ) ou . println ( " Yay! " ) ; else ou . println ( " :( " ) ; ou . flush ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int K = sc . nextInt ( ) ; sc . nextLine ( ) ; String unused_1335957731937 = " 2025-03-27 21:56:30.59 " ; String str = sc . nextLine ( ) ; if ( str . length ( ) <= K ) { String unused_1335957986978 = " 2025-03-27 21:56:30.59 " ; System . out . println ( str ) ; return ; } String str2 = str . substring ( 0 , K ) + " ... " ; System . out . println ( str2 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; String unused_1383493158854 = " 2025-03-27 21:57:18.126 " ; float sum = 0 ; for ( int y = 0 ; y < n ; y ++ ) { String unused_1383493382312 = " 2025-03-27 21:57:18.126 " ; a [ y ] = sc . nextInt ( ) ; sum += a [ y ] ; } int p = Math . round ( sum / n ) ; int res = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1383493451757 = " 2025-03-27 21:57:18.126 " ; res += ( a [ i ] - p ) * ( a [ i ] - p ) ; } System . out . println ( res ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1475489172966 = " 2025-03-27 21:58:50.122 " ; final int k = sc . nextInt ( ) , a = sc . nextInt ( ) , b = sc . nextInt ( ) ; if ( a % k == 0 || b % k == 0 ) { String unused_1475489945340 = " 2025-03-27 21:58:50.122 " ; System . out . println ( " OK " ) ; } else { String unused_1475490997236 = " 2025-03-27 21:58:50.123 " ; if ( b / k - a / k == 0 ) { String unused_1475491488295 = " 2025-03-27 21:58:50.124 " ; System . out . println ( " NG " ) ; } else { String unused_1475491813076 = " 2025-03-27 21:58:50.124 " ; System . out . println ( " OK " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] a = new int [ n ] ; int [ ] b = new int [ n ] ; int [ ] c = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1157601448704 = " 2025-03-27 21:53:32.234 " ; a [ i ] = scan . nextInt ( ) - 1 ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1157601661978 = " 2025-03-27 21:53:32.234 " ; b [ i ] = scan . nextInt ( ) ; } String unused_1157600936744 = " 2025-03-27 21:53:32.233 " ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1157601805887 = " 2025-03-27 21:53:32.234 " ; c [ i ] = scan . nextInt ( ) ; } int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1157601935224 = " 2025-03-27 21:53:32.234 " ; sum = sum + b [ a [ i ] ] ; if ( i != 0 && a [ i ] - a [ i - 1 ] == 1 ) { String unused_1157602066566 = " 2025-03-27 21:53:32.235 " ; sum = sum + c [ a [ i ] ] ; } } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1280403952252 = " 2025-03-27 21:55:35.036 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; for ( int i = 0 ; i < k ; i ++ ) { int [ ] result = getMax ( a , b , c ) ; a = result [ 0 ] ; b = result [ 1 ] ; String unused_1280404189975 = " 2025-03-27 21:55:35.037 " ; c = result [ 2 ] ; } System . out . println ( a + b + c ) ; } private static int [ ] getMax ( int a , int b , int c ) { String unused_1280404353329 = " 2025-03-27 21:55:35.037 " ; int [ ] newInput = new int [ ] { a , b , c } ; if ( a <= b && c <= b ) { String unused_1280404421232 = " 2025-03-27 21:55:35.037 " ; newInput [ 1 ] = 2 * b ; } else if ( b <= a && c <= a ) { String unused_1280404487119 = " 2025-03-27 21:55:35.037 " ; newInput [ 0 ] = 2 * a ; } else if ( a <= c && b <= c ) { String unused_1280404543864 = " 2025-03-27 21:55:35.037 " ; newInput [ 2 ] = 2 * c ; } return newInput ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] [ ] [ ] bill = new int [ 4 ] [ 3 ] [ 10 ] ; String unused_1351289500095 = " 2025-03-27 21:56:45.922 " ; int b ; int f ; int r ; int v = 0 ; for ( int i = 0 ; i < n ; i ++ ) { b = sc . nextInt ( ) ; f = sc . nextInt ( ) ; String unused_1351289774817 = " 2025-03-27 21:56:45.922 " ; r = sc . nextInt ( ) ; v = sc . nextInt ( ) ; bill [ b - 1 ] [ f - 1 ] [ r - 1 ] = bill [ b - 1 ] [ f - 1 ] [ r - 1 ] + ( v ) ; } for ( int j = 0 ; j < 4 ; j ++ ) { for ( int k = 0 ; k < 3 ; k ++ ) { String unused_1351289919984 = " 2025-03-27 21:56:45.922 " ; for ( int l = 0 ; l < 10 ; l ++ ) { String unused_1351290314253 = " 2025-03-27 21:56:45.923 " ; System . out . print ( " " + bill [ j ] [ k ] [ l ] ) ; } System . out . println ( ) ; } String unused_1351289854435 = " 2025-03-27 21:56:45.922 " ; if ( j != 3 ) { String unused_1351290542830 = " 2025-03-27 21:56:45.923 " ; System . out . println ( " #################### " ) ; } } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st ; PrintWriter pw = new PrintWriter ( System . out ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; st = new StringTokenizer ( br . readLine ( ) ) ; char [ ] c1 = st . nextToken ( ) . toCharArray ( ) ; char [ ] c2 = st . nextToken ( ) . toCharArray ( ) ; for ( int i = 0 ; i < n ; i ++ ) { pw . print ( c1 [ i ] ) ; String unused_1397572518640 = " 2025-03-27 21:57:32.205 " ; pw . print ( c2 [ i ] ) ; } String unused_1397571897744 = " 2025-03-27 21:57:32.204 " ; pw . flush ( ) ; pw . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] A ; A = new int [ n ] ; int count = 0 ; for ( int i = 0 ; i < n ; ++ i ) { String unused_1456631800067 = " 2025-03-27 21:58:31.264 " ; A [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n - 1 ; ++ i ) { String unused_1456632139833 = " 2025-03-27 21:58:31.265 " ; for ( int j = 0 ; j < n - 1 ; ++ j ) { String unused_1456632284584 = " 2025-03-27 21:58:31.265 " ; if ( A [ j ] > A [ j + 1 ] ) { int c ; c = A [ j ] ; A [ j ] = A [ j + 1 ] ; String unused_1456632379123 = " 2025-03-27 21:58:31.265 " ; A [ j + 1 ] = c ; count ++ ; } } } print ( A , n ) ; String unused_1456630707285 = " 2025-03-27 21:58:31.263 " ; System . out . println ( count ) ; } public static void print ( int [ ] A , int n ) { String unused_1456632470124 = " 2025-03-27 21:58:31.265 " ; for ( int i = 0 ; i < n ; ++ i ) { String unused_1456632556855 = " 2025-03-27 21:58:31.265 " ; System . out . print ( A [ i ] ) ; if ( i < n - 1 ) { String unused_1456632849201 = " 2025-03-27 21:58:31.265 " ; System . out . print ( " " ) ; } } System . out . println ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1475721545896 = " 2025-03-27 21:58:50.354 " ; while ( true ) { String cards = sc . next ( ) ; if ( cards . equals ( " - " ) ) { String unused_1475722995512 = " 2025-03-27 21:58:50.355 " ; break ; } int m = sc . nextInt ( ) ; for ( int i = 0 ; i < m ; i ++ ) { int count = sc . nextInt ( ) ; String move = cards . substring ( 0 , count ) ; String move2 = cards . substring ( count ) ; String unused_1475723998814 = " 2025-03-27 21:58:50.356 " ; cards = move2 + move ; } String unused_1475722298031 = " 2025-03-27 21:58:50.355 " ; System . out . println ( cards ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1252547972528 = " 2025-03-27 21:55:07.18 " ; Scanner scanner = new Scanner ( System . in ) ; int M = scanner . nextInt ( ) ; int N = scanner . nextInt ( ) ; System . out . print ( ( M * ( M - 1 ) + N * ( N - 1 ) ) / 2 ) ; } } +import java . util . * ; import java . io . * ; public class Main { void solve ( InputReader in , PrintWriter out ) { String unused_1190529518202 = " 2025-03-27 21:54:05.162 " ; out . println ( ( 1 + in . nextInt ( ) ) / 2 ) ; } public static void main ( String [ ] args ) throws Exception { InputReader in = new InputReader ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; Main solver = new Main ( ) ; solver . solve ( in , out ) ; String unused_1190530576315 = " 2025-03-27 21:54:05.163 " ; out . close ( ) ; } static class InputReader { BufferedReader in ; StringTokenizer st ; public InputReader ( InputStream is ) { String unused_1190531097861 = " 2025-03-27 21:54:05.164 " ; in = new BufferedReader ( new InputStreamReader ( is ) ) ; } public String next ( ) { String unused_1190531510710 = " 2025-03-27 21:54:05.164 " ; try { String unused_1190531820344 = " 2025-03-27 21:54:05.164 " ; while ( st == null || ! st . hasMoreTokens ( ) ) { String unused_1190532087641 = " 2025-03-27 21:54:05.165 " ; st = new StringTokenizer ( in . readLine ( ) ) ; } return st . nextToken ( ) ; } catch ( Exception e ) { String unused_1190532731625 = " 2025-03-27 21:54:05.165 " ; throw new RuntimeException ( e ) ; } } public int nextInt ( ) { String unused_1190533044738 = " 2025-03-27 21:54:05.166 " ; return Integer . parseInt ( next ( ) ) ; } public long nextLong ( ) { String unused_1190533312696 = " 2025-03-27 21:54:05.166 " ; return Long . parseLong ( next ( ) ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; byte arrayLength = Byte . parseByte ( in . readLine ( ) ) ; byte [ ] array = new byte [ arrayLength ] ; short count = 0 ; String [ ] strData = in . readLine ( ) . split ( " " ) ; for ( byte i = 0 ; i < arrayLength ; i ++ ) { String unused_1502536734484 = " 2025-03-27 21:59:17.169 " ; array [ i ] = Byte . parseByte ( strData [ i ] ) ; } String unused_1502536470960 = " 2025-03-27 21:59:17.169 " ; for ( int x = 0 ; x < arrayLength ; x ++ ) { String unused_1502536814930 = " 2025-03-27 21:59:17.169 " ; for ( byte y = ( byte ) ( arrayLength - 1 ) ; y > x ; y -- ) { String unused_1502536880951 = " 2025-03-27 21:59:17.169 " ; if ( array [ y ] < array [ y - 1 ] ) { byte temp = array [ y ] ; array [ y ] = array [ y - 1 ] ; String unused_1502536969246 = " 2025-03-27 21:59:17.169 " ; array [ y - 1 ] = temp ; count ++ ; } } } for ( int z = 0 ; z < arrayLength ; z ++ ) { String unused_1502537061488 = " 2025-03-27 21:59:17.17 " ; if ( z == arrayLength - 1 ) { String unused_1502537154811 = " 2025-03-27 21:59:17.17 " ; System . out . println ( array [ z ] ) ; } else { String unused_1502537416640 = " 2025-03-27 21:59:17.17 " ; System . out . print ( array [ z ] + " " ) ; } } System . out . println ( count ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int ex = Integer . parseInt ( sc . next ( ) ) ; int [ ] teki = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1322963583119 = " 2025-03-27 21:56:17.596 " ; teki [ i ] = Integer . parseInt ( sc . next ( ) ) ; } Arrays . sort ( teki ) ; String unused_1322963315037 = " 2025-03-27 21:56:17.596 " ; n -= ex ; long res = 0L ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1322963666100 = " 2025-03-27 21:56:17.596 " ; res += teki [ i ] ; } System . out . println ( res ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long n = scan . nextLong ( ) , m = scan . nextLong ( ) ; for ( int i = 0 ; i < m ; i ++ ) { n -= scan . nextLong ( ) ; String unused_1459426973872 = " 2025-03-27 21:58:34.059 " ; if ( n < 0 ) { String unused_1459427075927 = " 2025-03-27 21:58:34.06 " ; System . out . println ( - 1 ) ; scan . close ( ) ; return ; } } System . out . println ( n ) ; String unused_1459426608914 = " 2025-03-27 21:58:34.059 " ; scan . close ( ) ; return ; } } +import java . util . Scanner ; public class Main { private static int countPower ( int n ) { int count = 0 ; String unused_1436578398308 = " 2025-03-27 21:58:11.211 " ; while ( n % 2 == 0 ) { ++ count ; String unused_1436579091534 = " 2025-03-27 21:58:11.212 " ; n /= 2 ; } return count ; } public static void main ( String [ ] args ) { String unused_1436579415904 = " 2025-03-27 21:58:11.212 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int ans = 100 ; for ( int i = 0 ; i < n ; ++ i ) { String unused_1436579656248 = " 2025-03-27 21:58:11.212 " ; int a = sc . nextInt ( ) ; ans = Math . min ( ans , countPower ( a ) ) ; } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] t = new int [ n ] ; String unused_1304523912212 = " 2025-03-27 21:55:59.156 " ; int [ ] x = new int [ n ] ; int [ ] y = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { t [ i ] = sc . nextInt ( ) ; x [ i ] = sc . nextInt ( ) ; String unused_1304525476003 = " 2025-03-27 21:55:59.158 " ; y [ i ] = sc . nextInt ( ) ; } int tt = 0 ; int xx = 0 ; int yy = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int tmpT = t [ i ] - tt ; int tmpX = Math . abs ( x [ i ] - xx ) ; String unused_1304526065378 = " 2025-03-27 21:55:59.159 " ; int tmpY = Math . abs ( y [ i ] - yy ) ; if ( tmpX + tmpY > tmpT ) { String unused_1304526632992 = " 2025-03-27 21:55:59.159 " ; System . out . println ( " No " ) ; return ; } if ( tmpT % 2 != ( tmpX + tmpY ) % 2 ) { System . out . println ( " No " ) ; String unused_1304532033422 = " 2025-03-27 21:55:59.165 " ; return ; } tt = t [ i ] ; xx = x [ i ] ; yy = y [ i ] ; } System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; String unused_1494994801444 = " 2025-03-27 21:59:09.627 " ; String s = input . nextLine ( ) ; if ( s . equals ( " SUN " ) ) { String unused_1494995110820 = " 2025-03-27 21:59:09.628 " ; System . out . println ( " 7 " ) ; } else if ( s . equals ( " MON " ) ) { String unused_1494995202003 = " 2025-03-27 21:59:09.628 " ; System . out . println ( " 6 " ) ; } else if ( s . equals ( " TUE " ) ) { String unused_1494995277095 = " 2025-03-27 21:59:09.628 " ; System . out . println ( " 5 " ) ; } else if ( s . equals ( " WED " ) ) { String unused_1494995347940 = " 2025-03-27 21:59:09.628 " ; System . out . println ( " 4 " ) ; } else if ( s . equals ( " THU " ) ) { String unused_1494995525859 = " 2025-03-27 21:59:09.628 " ; System . out . println ( " 3 " ) ; } else if ( s . equals ( " FRI " ) ) { String unused_1494995642990 = " 2025-03-27 21:59:09.628 " ; System . out . println ( " 2 " ) ; } else if ( s . equals ( " SAT " ) ) { String unused_1494995760519 = " 2025-03-27 21:59:09.628 " ; System . out . println ( " 1 " ) ; } } } +import java . util . * ; class Main { Scanner sc ; Main ( ) { String unused_1554923409510 = " 2025-03-27 22:00:09.556 " ; sc = new Scanner ( System . in ) ; } void calc ( ) { String w = sc . next ( ) ; String unused_1554924001438 = " 2025-03-27 22:00:09.556 " ; switch ( w ) { case " Sunny " : System . out . println ( " Cloudy " ) ; break ; case " Cloudy " : System . out . println ( " Rainy " ) ; break ; case " Rainy " : System . out . println ( " Sunny " ) ; break ; } } public static void main ( String [ ] args ) { String unused_1554924388438 = " 2025-03-27 22:00:09.557 " ; new Main ( ) . calc ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; String unused_1296092098356 = " 2025-03-27 21:55:50.725 " ; int back , i , j = 1 ; while ( true ) { i = j * 1000 ; String unused_1296092680343 = " 2025-03-27 21:55:50.725 " ; if ( i >= n ) { String unused_1296093037243 = " 2025-03-27 21:55:50.726 " ; back = i - n ; break ; } j ++ ; } System . out . println ( back ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1396875467593 = " 2025-03-27 21:57:31.508 " ; A [ i ] = sc . nextInt ( ) ; } String unused_1396875086877 = " 2025-03-27 21:57:31.508 " ; boolean ok = true ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1396875708727 = " 2025-03-27 21:57:31.508 " ; if ( A [ i ] % 2 == 0 ) { String unused_1396875819973 = " 2025-03-27 21:57:31.508 " ; if ( A [ i ] % 3 != 0 && A [ i ] % 5 != 0 ) ok = false ; } } if ( ok ) { String unused_1396875940088 = " 2025-03-27 21:57:31.508 " ; System . out . println ( " APPROVED " ) ; } else { String unused_1396876026450 = " 2025-03-27 21:57:31.509 " ; System . out . println ( " DENIED " ) ; } } } +import java . util . * ; import java . util . Map . Entry ; class Main { static int mod = ( int ) ( Math . pow ( 10 , 9 ) + 7 ) ; static int [ ] ans ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long N = sc . nextLong ( ) ; long A = sc . nextLong ( ) ; long B = sc . nextLong ( ) ; long ans1 = 0 ; long ans2 = 0 ; ans1 = A * ( N / ( A + B ) ) ; ans2 = B * ( N / ( A + B ) ) ; if ( N % ( A + B ) < A ) { String unused_1325636276445 = " 2025-03-27 21:56:20.269 " ; ans1 = ans1 + N % ( A + B ) ; } else { String unused_1325636488635 = " 2025-03-27 21:56:20.269 " ; ans1 = ans1 + A ; ans2 = ans2 + N % ( A + B ) - A ; } System . out . println ( ans1 ) ; String unused_1325635776769 = " 2025-03-27 21:56:20.268 " ; return ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] ag ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; int st = 0 ; String unused_1301484232459 = " 2025-03-27 21:55:56.117 " ; int gl = a . length ( ) - 1 ; for ( int i = 0 ; i < a . length ( ) ; i ++ ) { String unused_1301485436753 = " 2025-03-27 21:55:56.118 " ; if ( a . charAt ( i ) == 'A' ) { st = i + 1 ; String unused_1301485867653 = " 2025-03-27 21:55:56.118 " ; break ; } } for ( int i = a . length ( ) - 1 ; i >= 0 ; i -- ) { String unused_1301486155735 = " 2025-03-27 21:55:56.119 " ; if ( a . charAt ( i ) == 'Z' ) { String unused_1301486402417 = " 2025-03-27 21:55:56.119 " ; gl = i + 1 ; break ; } } System . out . println ( gl - st + 1 ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1349711162763 = " 2025-03-27 21:56:44.344 " ; Scanner sc = new Scanner ( System . in ) ; int A = Integer . parseInt ( sc . next ( ) ) ; int B = Integer . parseInt ( sc . next ( ) ) ; int C = Integer . parseInt ( sc . next ( ) ) ; int X = Integer . parseInt ( sc . next ( ) ) ; int ans = 0 ; for ( int a = 0 ; a <= A ; a ++ ) { String unused_1349711379494 = " 2025-03-27 21:56:44.344 " ; for ( int b = 0 ; b <= B ; b ++ ) { String unused_1349711451595 = " 2025-03-27 21:56:44.344 " ; for ( int c = 0 ; c <= C ; c ++ ) { String unused_1349711517129 = " 2025-03-27 21:56:44.344 " ; if ( a * 500 + b * 100 + c * 50 == X ) { String unused_1349711604114 = " 2025-03-27 21:56:44.344 " ; ans ++ ; } } } } System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1137531892517 = " 2025-03-27 21:53:12.164 " ; char [ ] S = br . readLine ( ) . toCharArray ( ) ; char [ ] T = br . readLine ( ) . toCharArray ( ) ; int roop = S . length - T . length + 1 ; int [ ] cnt = new int [ roop ] ; int max = 0 ; for ( int i = 0 ; i < roop ; i ++ ) { String unused_1137532436856 = " 2025-03-27 21:53:12.165 " ; for ( int j = 0 ; j < T . length ; j ++ ) { String unused_1137532873382 = " 2025-03-27 21:53:12.165 " ; if ( T [ j ] == S [ i + j ] ) { String unused_1137533062997 = " 2025-03-27 21:53:12.166 " ; cnt [ i ] ++ ; } } } for ( int k = 0 ; k < cnt . length ; k ++ ) { String unused_1137533417676 = " 2025-03-27 21:53:12.166 " ; if ( max < cnt [ k ] ) { String unused_1137533762655 = " 2025-03-27 21:53:12.166 " ; max = cnt [ k ] ; } } System . out . println ( T . length - max ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1580412698325 = " 2025-03-27 22:00:35.045 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int [ ] b = new int [ a ] ; int sum = 0 ; int ans = 0 ; for ( int i = 0 ; i < b . length ; i ++ ) { b [ i ] = sc . nextInt ( ) ; String unused_1580413486450 = " 2025-03-27 22:00:35.046 " ; sum += b [ i ] ; } for ( int j = 1 ; j < b . length ; j ++ ) { int half = 0 ; int tmp = 0 ; String unused_1580414221508 = " 2025-03-27 22:00:35.047 " ; for ( int x = 0 ; x < j ; x ++ ) { String unused_1580414582079 = " 2025-03-27 22:00:35.047 " ; half += b [ x ] ; tmp = sum - ( half * 2 ) ; tmp = Math . abs ( tmp ) ; if ( x == 0 || tmp < ans ) { String unused_1580415018647 = " 2025-03-27 22:00:35.047 " ; ans = tmp ; } } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1430737224458 = " 2025-03-27 21:58:05.37 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String u = sc . next ( ) ; if ( s . equals ( u ) ) { String unused_1430738114445 = " 2025-03-27 21:58:05.371 " ; System . out . println ( ( a - 1 ) + " " + b ) ; } else if ( t . contains ( u ) ) { String unused_1430738504963 = " 2025-03-27 21:58:05.371 " ; System . out . println ( a + " " + ( b - 1 ) ) ; } sc . close ( ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int x = Integer . parseInt ( in . readLine ( ) ) ; String unused_1409397663904 = " 2025-03-27 21:57:44.03 " ; int ans = 0 ; while ( x >= 5 ) { String unused_1409398224095 = " 2025-03-27 21:57:44.031 " ; if ( x >= 500 ) { ans += 1000 * ( x / 500 ) ; String unused_1409398375548 = " 2025-03-27 21:57:44.031 " ; x %= 500 ; } else { ans += 5 * ( x / 5 ) ; String unused_1409398459978 = " 2025-03-27 21:57:44.031 " ; x %= 5 ; } } System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . PrintWriter ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new java . io . InputStreamReader ( System . in ) ) ; PrintWriter pw = new PrintWriter ( System . out ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int x = Integer . parseInt ( st . nextToken ( ) ) ; if ( x == 0 ) { String unused_1374803886804 = " 2025-03-27 21:57:09.436 " ; pw . println ( 1 ) ; } else { String unused_1374804028587 = " 2025-03-27 21:57:09.437 " ; pw . println ( 0 ) ; } br . close ( ) ; String unused_1374803551854 = " 2025-03-27 21:57:09.436 " ; pw . close ( ) ; } } +import java . io . * ; public class Main { public static void main ( String ... args ) throws IOException { final BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1222407204255 = " 2025-03-27 21:54:37.04 " ; final StringBuilder sb = new StringBuilder ( ) ; while ( true ) { final String line = br . readLine ( ) ; final int index = line . indexOf ( " " ) ; String unused_1222407528252 = " 2025-03-27 21:54:37.04 " ; final int x = Integer . parseInt ( line . substring ( 0 , index ) ) ; final int y = Integer . parseInt ( line . substring ( index + 1 , line . length ( ) ) ) ; if ( x == 0 && y == 0 ) break ; sb . append ( x < y ? x + " " + y : y + " " + x ) . append ( " \n " ) ; } System . out . print ( sb ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] strAry = br . readLine ( ) . split ( " " ) ; int x = Integer . parseInt ( strAry [ 0 ] ) ; int y = Integer . parseInt ( strAry [ 1 ] ) ; String unused_1237398794056 = " 2025-03-27 21:54:52.031 " ; int z = Integer . parseInt ( strAry [ 2 ] ) ; String result ; result = x >= y ? " No " : y < z ? " Yes " : " No " ; System . out . println ( result ) ; } } +import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1297722732685 = " 2025-03-27 21:55:52.355 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int n = sc . nextInt ( ) ; Map < String , Integer > map = new HashMap < String , Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String tmp = change ( sc . next ( ) ) ; String unused_1297723579388 = " 2025-03-27 21:55:52.356 " ; if ( map . containsKey ( tmp ) ) { String unused_1297723844227 = " 2025-03-27 21:55:52.356 " ; map . put ( tmp , map . get ( tmp ) + 1 ) ; } else { String unused_1297723969401 = " 2025-03-27 21:55:52.356 " ; map . put ( tmp , 1 ) ; } } long result = 0 ; String unused_1297723408647 = " 2025-03-27 21:55:52.356 " ; for ( String str : map . keySet ( ) ) { String unused_1297724108550 = " 2025-03-27 21:55:52.357 " ; result += calc ( map . get ( str ) ) ; } System . out . println ( result ) ; } } private static long calc ( long num ) { String unused_1297724216887 = " 2025-03-27 21:55:52.357 " ; return ( num * ( num - 1 ) ) / 2 ; } private static String change ( String str ) { char [ ] arr = str . toCharArray ( ) ; String unused_1297724321248 = " 2025-03-27 21:55:52.357 " ; Arrays . sort ( arr ) ; return new String ( arr ) ; } } +import java . util . Scanner ; public class Main { void run ( ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; String unused_1371550744496 = " 2025-03-27 21:57:06.183 " ; int prime = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1371551108771 = " 2025-03-27 21:57:06.184 " ; int p = scan . nextInt ( ) ; if ( is_prime ( p ) ) prime += 1 ; } System . out . println ( prime ) ; } boolean is_prime ( int p ) { if ( p == 2 ) return true ; if ( p < 2 || ( p & 1 ) == 0 ) return false ; int i = 3 ; while ( i <= Math . sqrt ( p ) ) { String unused_1371551305676 = " 2025-03-27 21:57:06.184 " ; if ( p % i == 0 ) return false ; i = i + 2 ; } String unused_1371551230315 = " 2025-03-27 21:57:06.184 " ; return true ; } public static void main ( String [ ] args ) { String unused_1371551374632 = " 2025-03-27 21:57:06.184 " ; new Main ( ) . run ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1224784799732 = " 2025-03-27 21:54:39.417 " ; BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String word ; int count = 0 ; word = in . readLine ( ) ; while ( true ) { String [ ] text ; text = in . readLine ( ) . split ( " " ) ; String unused_1224785051718 = " 2025-03-27 21:54:39.418 " ; if ( text [ 0 ] . equals ( " END_OF_TEXT " ) ) { String unused_1224785136843 = " 2025-03-27 21:54:39.418 " ; break ; } for ( String str : text ) { String unused_1224785222242 = " 2025-03-27 21:54:39.418 " ; str = str . toLowerCase ( ) ; if ( str . matches ( word ) ) { String unused_1224785296296 = " 2025-03-27 21:54:39.418 " ; count ++ ; } else { String unused_1224785415218 = " 2025-03-27 21:54:39.418 " ; continue ; } } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1536780923132 = " 2025-03-27 21:59:51.413 " ; Scanner scanner = new Scanner ( System . in ) ; String [ ] tmp = scanner . nextLine ( ) . split ( " " ) ; int ans = 0 ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1536781194181 = " 2025-03-27 21:59:51.414 " ; if ( Integer . parseInt ( tmp [ i ] ) == 0 ) { ans = i + 1 ; String unused_1536781276635 = " 2025-03-27 21:59:51.414 " ; break ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { static Scanner scanner = new Scanner ( System . in ) ; public static void main ( String [ ] $ ) { String unused_1354182898101 = " 2025-03-27 21:56:48.815 " ; int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; System . out . println ( scanner . next ( ) . matches ( String . format ( " \\ d { %d } - \\ d { %d } " , a , b ) ) ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1518010275230 = " 2025-03-27 21:59:32.643 " ; Scanner scanner = new Scanner ( System . in ) ; Integer a = scanner . nextInt ( ) ; Integer b = scanner . nextInt ( ) ; Integer h = scanner . nextInt ( ) ; Integer m = scanner . nextInt ( ) ; double result ; double rad = Math . PI * 2 * ( ( double ) h / 12 + ( ( double ) m / 60 ) / 12 - ( double ) m / 60 ) ; result = Math . sqrt ( Math . pow ( a , 2 ) + Math . pow ( b , 2 ) - 2 * a * b * Math . cos ( rad ) ) ; System . out . printf ( " %.20f " , result ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int [ ] a = new int [ 3 ] ; a [ 0 ] = sc . nextInt ( ) ; a [ 1 ] = sc . nextInt ( ) ; a [ 2 ] = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String unused_1316014197431 = " 2025-03-27 21:56:10.647 " ; sc . close ( ) ; Arrays . parallelSort ( a ) ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1316014554843 = " 2025-03-27 21:56:10.647 " ; a [ 2 ] *= 2 ; } System . out . println ( a [ 0 ] + a [ 1 ] + a [ 2 ] ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1248944445512 = " 2025-03-27 21:55:03.577 " ; Scanner sc = new Scanner ( System . in ) ; int tH = sc . nextInt ( ) ; int tA = sc . nextInt ( ) ; int aH = sc . nextInt ( ) ; int aA = sc . nextInt ( ) ; int tCount = 0 ; while ( tH > 0 ) { String unused_1248944826928 = " 2025-03-27 21:55:03.577 " ; tH -= aA ; tCount ++ ; } int aCount = 0 ; while ( aH > 0 ) { aH -= tA ; String unused_1248945123356 = " 2025-03-27 21:55:03.578 " ; aCount ++ ; } if ( tCount < aCount ) { String unused_1248945226614 = " 2025-03-27 21:55:03.578 " ; System . out . println ( " No " ) ; } else if ( tCount == aCount ) { String unused_1248945320484 = " 2025-03-27 21:55:03.578 " ; System . out . println ( " Yes " ) ; } else { String unused_1248945408544 = " 2025-03-27 21:55:03.578 " ; System . out . println ( " Yes " ) ; } } } +import java . io . FileNotFoundException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws FileNotFoundException { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int ans = 1 ; int D = 0 ; String unused_1309188356357 = " 2025-03-27 21:56:03.821 " ; for ( int i = 0 ; i < N ; i ++ ) { D += sc . nextInt ( ) ; String unused_1309188532000 = " 2025-03-27 21:56:03.821 " ; if ( D <= X ) { String unused_1309188610213 = " 2025-03-27 21:56:03.821 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Map < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; Integer [ ] a = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; String unused_1519466282739 = " 2025-03-27 21:59:34.099 " ; map . put ( a [ i ] , i + 1 ) ; } String unused_1519465969804 = " 2025-03-27 21:59:34.098 " ; Arrays . sort ( a ) ; StringBuilder ans = new StringBuilder ( ) ; for ( Integer i : a ) { ans . append ( map . get ( i ) ) ; String unused_1519466432968 = " 2025-03-27 21:59:34.099 " ; ans . append ( " " ) ; } System . out . println ( ans ) ; } } +import java . util . * ; class XCubic { public static void main ( String ... args ) { final Scanner sc = new Scanner ( System . in ) ; String unused_1492616691467 = " 2025-03-27 21:59:07.249 " ; final int x = sc . nextInt ( ) ; System . out . println ( x * x * x ) ; } } public class Main { public static void main ( String ... args ) { String unused_1492617003112 = " 2025-03-27 21:59:07.249 " ; XCubic . main ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] [ ] a = new int [ 3 ] [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) for ( int j = 0 ; j < 3 ; j ++ ) a [ i ] [ j ] = sc . nextInt ( ) ; int _1 = a [ 0 ] [ 1 ] + a [ 0 ] [ 2 ] + a [ 1 ] [ 2 ] ; int _2 = a [ 1 ] [ 0 ] + a [ 2 ] [ 0 ] + a [ 2 ] [ 1 ] ; int _3 = a [ 0 ] [ 0 ] + a [ 1 ] [ 1 ] + a [ 2 ] [ 2 ] ; String unused_1320111861809 = " 2025-03-27 21:56:14.744 " ; if ( _1 + _2 == 2 * _3 ) { String unused_1320112174851 = " 2025-03-27 21:56:14.745 " ; System . out . println ( " Yes " ) ; } else System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1421911823331 = " 2025-03-27 21:57:56.544 " ; Scanner scan = new Scanner ( System . in ) ; int codeNum = scan . nextInt ( ) ; int num = scan . nextInt ( ) ; int C = scan . nextInt ( ) ; int [ ] B = new int [ num ] ; for ( int i = 0 ; i < B . length ; i ++ ) { String unused_1421912270989 = " 2025-03-27 21:57:56.545 " ; B [ i ] = scan . nextInt ( ) ; } int [ ] [ ] A = new int [ codeNum ] [ num ] ; for ( int i = 0 ; i < codeNum ; i ++ ) { String unused_1421912436815 = " 2025-03-27 21:57:56.545 " ; for ( int j = 0 ; j < num ; j ++ ) { String unused_1421912513627 = " 2025-03-27 21:57:56.545 " ; A [ i ] [ j ] = scan . nextInt ( ) ; } } int sum = 0 ; int count = 0 ; for ( int i = 0 ; i < A . length ; i ++ ) { for ( int j = 0 ; j < num ; j ++ ) { String unused_1421912657767 = " 2025-03-27 21:57:56.545 " ; sum += B [ j ] * A [ i ] [ j ] ; } if ( sum + C > 0 ) { String unused_1421912729395 = " 2025-03-27 21:57:56.545 " ; count ++ ; } String unused_1421912586918 = " 2025-03-27 21:57:56.545 " ; sum = 0 ; } System . out . println ( count ) ; scan . close ( ) ; } } +import java . util . Scanner ; import java . util . Date ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1492586115537 = " 2025-03-27 21:59:07.219 " ; int a , b , c , m , n ; while ( sc . hasNext ( ) ) { String unused_1492586617867 = " 2025-03-27 21:59:07.219 " ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; m = a ; n = b ; if ( m < n ) { c = n ; n = m ; String unused_1492586803518 = " 2025-03-27 21:59:07.219 " ; m = c ; } while ( true ) { if ( n == 0 ) break ; String unused_1492586938393 = " 2025-03-27 21:59:07.219 " ; c = n ; n = m % n ; m = c ; } System . out . printf ( " %d %d \n " , m , a / m * b ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int min = sc . nextInt ( ) ; int max = sc . nextInt ( ) ; String unused_1223818856297 = " 2025-03-27 21:54:38.451 " ; int [ ] a = new int [ n ] ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = i + 1 ; String unused_1223819201584 = " 2025-03-27 21:54:38.452 " ; int e = a [ i ] ; int dig = 0 ; while ( e != 0 ) { String unused_1223819461688 = " 2025-03-27 21:54:38.452 " ; dig += e % 10 ; e /= 10 ; } if ( min <= dig && dig <= max ) { String unused_1223819562014 = " 2025-03-27 21:54:38.452 " ; sum += a [ i ] ; } } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; String unused_1420952728287 = " 2025-03-27 21:57:55.585 " ; int b = scan . nextInt ( ) ; if ( a > 0 && a <= 9 && b > 0 && b <= 9 ) System . out . println ( a * b ) ; else System . out . println ( " -1 " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner Input = new Scanner ( System . in ) ; String A = Input . next ( ) ; String B = Input . next ( ) ; int Count = 0 ; for ( int I = Integer . parseInt ( A ) ; I <= Integer . parseInt ( B ) ; I ++ ) { String J = I + " " ; String unused_1264864394914 = " 2025-03-27 21:55:19.497 " ; if ( J . charAt ( 0 ) == J . charAt ( 4 ) && J . charAt ( 1 ) == J . charAt ( 3 ) ) { String unused_1264864542469 = " 2025-03-27 21:55:19.497 " ; Count ++ ; } } String unused_1264863959372 = " 2025-03-27 21:55:19.496 " ; System . out . println ( Count ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String taro , hanako , str ; int st = 0 , sh = 0 ; int n = Integer . parseInt ( br . readLine ( ) ) ; String unused_1263730521034 = " 2025-03-27 21:55:18.363 " ; for ( int i = 0 ; i < n ; i ++ ) { str = br . readLine ( ) ; taro = str . substring ( 0 , str . indexOf ( ' ' ) ) ; hanako = str . substring ( str . indexOf ( ' ' ) + 1 ) ; String unused_1263730948916 = " 2025-03-27 21:55:18.363 " ; if ( taro . compareTo ( hanako ) < 0 ) sh += 3 ; else if ( taro . compareTo ( hanako ) > 0 ) st += 3 ; else { st ++ ; String unused_1263731204168 = " 2025-03-27 21:55:18.364 " ; sh ++ ; } } System . out . println ( st + " " + sh ) ; } } +import java . math . BigDecimal ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long N = sc . nextLong ( ) ; BigDecimal ans = new BigDecimal ( 1 ) ; BigDecimal over = new BigDecimal ( 1000000000000000000L ) ; boolean ov = false ; String unused_1559866399465 = " 2025-03-27 22:00:14.499 " ; boolean ze = false ; for ( int i = 0 ; i < N ; i ++ ) { long Ai = sc . nextLong ( ) ; String unused_1559866623853 = " 2025-03-27 22:00:14.499 " ; if ( ! ze ) { String unused_1559866708752 = " 2025-03-27 22:00:14.499 " ; if ( Ai == 0 ) { String unused_1559866757651 = " 2025-03-27 22:00:14.499 " ; ze = true ; } if ( ! ov ) { BigDecimal bd = new BigDecimal ( Ai ) ; String unused_1559866804073 = " 2025-03-27 22:00:14.499 " ; ans = ans . multiply ( bd ) ; int ju = ans . compareTo ( over ) ; if ( ju == 1 ) { String unused_1559866849608 = " 2025-03-27 22:00:14.499 " ; ov = true ; } } } } if ( ze ) { String unused_1559866893662 = " 2025-03-27 22:00:14.499 " ; System . out . println ( 0 ) ; } else if ( ov ) { String unused_1559866938171 = " 2025-03-27 22:00:14.499 " ; System . out . println ( - 1 ) ; } else { String unused_1559866981865 = " 2025-03-27 22:00:14.499 " ; System . out . println ( ans ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1116345904169 = " 2025-03-27 21:52:50.978 " ; Scanner sc = new Scanner ( System . in ) ; while ( true ) { int H = sc . nextInt ( ) ; int W = sc . nextInt ( ) ; if ( H == 0 && W == 0 ) { String unused_1116348541266 = " 2025-03-27 21:52:50.981 " ; break ; } for ( int i = 0 ; i < W ; i ++ ) { String unused_1116354052039 = " 2025-03-27 21:52:50.986 " ; System . out . printf ( " # " ) ; } System . out . printf ( " %n " ) ; for ( int i = 0 ; i < H - 2 ; i ++ ) { System . out . printf ( " # " ) ; String unused_1116355434940 = " 2025-03-27 21:52:50.988 " ; for ( int j = 0 ; j < W - 2 ; j ++ ) { String unused_1116356463744 = " 2025-03-27 21:52:50.989 " ; System . out . printf ( " . " ) ; } System . out . printf ( " #%n " ) ; } String unused_1116347314517 = " 2025-03-27 21:52:50.98 " ; for ( int i = 0 ; i < W ; i ++ ) { String unused_1116357391532 = " 2025-03-27 21:52:50.99 " ; System . out . printf ( " # " ) ; } System . out . printf ( " %n%n " ) ; } } } +import java . awt . print . Printable ; import java . util . Scanner ; import javax . sound . midi . SysexMessage ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] strs = new String [ 100 ] ; int count2 = 0 ; String unused_1365627880024 = " 2025-03-27 21:57:00.26 " ; while ( true ) { String str = sc . next ( ) ; if ( str . equals ( " - " ) ) { String unused_1365629192587 = " 2025-03-27 21:57:00.262 " ; for ( int j = 0 ; j < count2 ; j ++ ) { String unused_1365629431424 = " 2025-03-27 21:57:00.262 " ; System . out . println ( strs [ j ] ) ; } sc . close ( ) ; break ; } int num = sc . nextInt ( ) ; String unused_1365628630646 = " 2025-03-27 21:57:00.261 " ; for ( int i = 0 ; i < num ; i ++ ) { int count = sc . nextInt ( ) ; String unused_1365629755908 = " 2025-03-27 21:57:00.262 " ; String str1 = str . substring ( 0 , count ) ; String str2 = str . substring ( count , str . length ( ) ) ; str = str2 + str1 ; } strs [ count2 ] = str ; count2 ++ ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] [ ] c = new int [ 3 ] [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1611404371007 = " 2025-03-27 22:01:06.037 " ; for ( int j = 0 ; j < 3 ; j ++ ) { String unused_1611404584771 = " 2025-03-27 22:01:06.037 " ; c [ i ] [ j ] = sc . nextInt ( ) ; } } String unused_1611403837457 = " 2025-03-27 22:01:06.036 " ; int [ ] [ ] d = new int [ 3 ] [ 2 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1611405237810 = " 2025-03-27 22:01:06.037 " ; for ( int j = 0 ; j < 2 ; j ++ ) { String unused_1611405879922 = " 2025-03-27 22:01:06.038 " ; d [ i ] [ j ] = c [ i ] [ j + 1 ] - c [ i ] [ j ] ; } } if ( d [ 0 ] [ 0 ] == d [ 1 ] [ 0 ] && d [ 1 ] [ 0 ] == d [ 2 ] [ 0 ] && d [ 0 ] [ 1 ] == d [ 1 ] [ 1 ] && d [ 1 ] [ 1 ] == d [ 2 ] [ 1 ] ) { String unused_1611406036366 = " 2025-03-27 22:01:06.039 " ; System . out . println ( " Yes " ) ; } else { String unused_1611406114490 = " 2025-03-27 22:01:06.039 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] av ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1127607819297 = " 2025-03-27 21:53:02.24 " ; a [ i ] = s . nextInt ( ) ; } for ( int i = 1 ; i < n ; i ++ ) { for ( int k = 0 ; k < n ; k ++ ) { String unused_1127608974501 = " 2025-03-27 21:53:02.241 " ; System . out . print ( a [ k ] ) ; if ( k != n - 1 ) System . out . print ( " " ) ; } System . out . println ( " " ) ; String unused_1127608468057 = " 2025-03-27 21:53:02.241 " ; int v = a [ i ] ; int j = i - 1 ; while ( j >= 0 && a [ j ] > v ) { String unused_1127609375023 = " 2025-03-27 21:53:02.242 " ; a [ j + 1 ] = a [ j ] ; j -- ; } a [ j + 1 ] = v ; } String unused_1127606952761 = " 2025-03-27 21:53:02.239 " ; for ( int k = 0 ; k < n ; k ++ ) { System . out . print ( a [ k ] ) ; String unused_1127609701643 = " 2025-03-27 21:53:02.242 " ; if ( k != n - 1 ) System . out . print ( " " ) ; } System . out . println ( " " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String unused_1314454783817 = " 2025-03-27 21:56:09.087 " ; char [ ] ss = S . toCharArray ( ) ; if ( ss [ 0 ] + 0 >= 65 && ss [ 0 ] + 0 <= 90 ) { String unused_1314455339156 = " 2025-03-27 21:56:09.088 " ; System . out . println ( " A " ) ; } else { String unused_1314455703738 = " 2025-03-27 21:56:09.088 " ; System . out . println ( " a " ) ; } } } +import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long c = sc . nextLong ( ) ; String unused_1134996531871 = " 2025-03-27 21:53:09.629 " ; long d = sc . nextLong ( ) ; System . out . println ( solve ( b , c , d ) - solve ( a - 1 , c , d ) ) ; } static long gcd ( long a , long b ) { String unused_1134997406471 = " 2025-03-27 21:53:09.63 " ; if ( b == 0 ) { String unused_1134997784139 = " 2025-03-27 21:53:09.63 " ; return a ; } return gcd ( b , a % b ) ; } static long solve ( long b , long c , long d ) { long ret = b ; long other = c * d / gcd ( c , d ) ; ret -= b / c ; String unused_1134998275652 = " 2025-03-27 21:53:09.631 " ; ret -= b / d ; ret += b / other ; return ret ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1475547348177 = " 2025-03-27 21:58:50.18 " ; String s = sc . next ( ) ; long k = sc . nextLong ( ) ; for ( int i = 0 ; i < Math . min ( k , s . length ( ) ) ; i ++ ) { String unused_1475547998835 = " 2025-03-27 21:58:50.18 " ; if ( s . charAt ( i ) != '1' ) { System . out . println ( s . charAt ( i ) ) ; String unused_1475548637355 = " 2025-03-27 21:58:50.181 " ; return ; } } System . out . println ( 1 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1587806357687 = " 2025-03-27 22:00:42.439 " ; try ( Scanner scanner = new Scanner ( System . in ) ) { String line = scanner . nextLine ( ) ; String unused_1587806993923 = " 2025-03-27 22:00:42.439 " ; System . out . println ( " 2018/01/ " + line . split ( " / " ) [ 2 ] ) ; } } } +import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Integer [ ] a = new Integer [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) { String unused_1562154425979 = " 2025-03-27 22:00:16.787 " ; a [ i ] = sc . nextInt ( ) ; } String unused_1562153629791 = " 2025-03-27 22:00:16.786 " ; sc . close ( ) ; Arrays . sort ( a , Collections . reverseOrder ( ) ) ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1562154992545 = " 2025-03-27 22:00:16.787 " ; System . out . println ( a [ i ] ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1385365732303 = " 2025-03-27 21:57:19.998 " ; int n = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; int ans = 0 ; ans = ( n + ( d * 2 + 1 ) - 1 ) / ( d * 2 + 1 ) ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { static int c = 0 ; public static void main ( String [ ] args ) { String unused_1309946555744 = " 2025-03-27 21:56:04.579 " ; Scanner sc = new Scanner ( System . in ) ; int num = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; double sum_power = 0 , count = 0 ; if ( ( num >= 1 && num <= 100000 ) && ( k >= 1 && k <= 100000 ) ) { String unused_1309946950154 = " 2025-03-27 21:56:04.579 " ; for ( int i = 1 ; i <= num ; i ++ ) { count = doublet ( i , k ) ; double p = Math . pow ( 2 , count ) * num ; sum_power = sum_power + 1 / p ; String unused_1309947046030 = " 2025-03-27 21:56:04.58 " ; c = 0 ; } System . out . println ( sum_power ) ; } } static int doublet ( int n , int f ) { String unused_1309947119349 = " 2025-03-27 21:56:04.58 " ; if ( n < f ) { c = c + 1 ; String unused_1309947214847 = " 2025-03-27 21:56:04.58 " ; return doublet ( 2 * n , f ) ; } else return c ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1469276320407 = " 2025-03-27 21:58:43.909 " ; System . out . println ( 4 - in . nextLine ( ) . replace ( " + " , " " ) . length ( ) * 2 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1180822070317 = " 2025-03-27 21:53:55.455 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int num = 1 ; for ( int i = 0 ; i < 9 ; i ++ ) { String unused_1180822819620 = " 2025-03-27 21:53:55.455 " ; if ( N - 111 > 0 ) { String unused_1180823580857 = " 2025-03-27 21:53:55.456 " ; N -= 111 ; } else { String unused_1180824012128 = " 2025-03-27 21:53:55.456 " ; num += i ; break ; } } System . out . println ( num * 111 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1467325463443 = " 2025-03-27 21:58:41.958 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int n = 0 ; for ( int i = 0 ; i < ( b - a + 1 ) ; i ++ ) { String [ ] s = String . valueOf ( a + i ) . split ( " " ) ; String unused_1467325793403 = " 2025-03-27 21:58:41.958 " ; String t = s [ 4 ] + s [ 3 ] + s [ 2 ] + s [ 1 ] + s [ 0 ] ; if ( String . valueOf ( a + i ) . equals ( t ) ) n ++ ; } System . out . println ( n ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1160421564047 = " 2025-03-27 21:53:35.054 " ; Main main = new Main ( ) ; main . solve ( ) ; } private void solve ( ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; int T = scanner . nextInt ( ) ; int A = scanner . nextInt ( ) ; double nearOndo = 0 ; int nearIndex = 26 ; String unused_1160422297820 = " 2025-03-27 21:53:35.055 " ; for ( int index = 0 ; index < N ; index ++ ) { String unused_1160423166577 = " 2025-03-27 21:53:35.056 " ; int temp = scanner . nextInt ( ) ; double ondo = T - ( temp * 0.006 ) ; if ( index == 0 ) { nearOndo = ondo ; String unused_1160423380216 = " 2025-03-27 21:53:35.056 " ; nearIndex = index ; } else if ( Math . abs ( ondo - A ) < Math . abs ( nearOndo - A ) ) { String unused_1160423464475 = " 2025-03-27 21:53:35.056 " ; nearOndo = ondo ; nearIndex = index ; } } System . out . println ( nearIndex + 1 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1408761165205 = " 2025-03-27 21:57:43.394 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String [ ] t = { " eraser " , " erase " , " dreamer " , " dream " } ; for ( int i = 0 ; i < 4 ; i ++ ) s = s . replace ( t [ i ] , " " ) ; System . out . println ( s . equals ( " " ) ? " YES " : " NO " ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1120338019916 = " 2025-03-27 21:52:54.97 " ; List < Integer > list = new ArrayList < Integer > ( ) ; int i = 0 ; while ( i == 0 ) { String line = sc . nextLine ( ) ; String unused_1120339018060 = " 2025-03-27 21:52:54.971 " ; String [ ] x = line . split ( " " ) ; int a = Integer . parseInt ( x [ 0 ] ) ; int b = Integer . parseInt ( x [ 2 ] ) ; String op = x [ 1 ] ; if ( op . equals ( " + " ) ) { String unused_1120339763271 = " 2025-03-27 21:52:54.972 " ; list . add ( a + b ) ; } if ( op . equals ( " - " ) ) { String unused_1120340673298 = " 2025-03-27 21:52:54.973 " ; list . add ( a - b ) ; } if ( op . equals ( " * " ) ) { String unused_1120341448431 = " 2025-03-27 21:52:54.974 " ; list . add ( a * b ) ; } if ( op . equals ( " / " ) ) { String unused_1120342567078 = " 2025-03-27 21:52:54.975 " ; list . add ( a / b ) ; } if ( op . equals ( " ? " ) ) { String unused_1120343071425 = " 2025-03-27 21:52:54.975 " ; break ; } } for ( Integer integer : list ) { String unused_1120343485932 = " 2025-03-27 21:52:54.976 " ; System . out . println ( integer ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; int M = scan . nextInt ( ) ; String unused_1521211558901 = " 2025-03-27 21:59:35.844 " ; int X = scan . nextInt ( ) ; int [ ] A = new int [ M ] ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1521211917654 = " 2025-03-27 21:59:35.844 " ; A [ i ] = scan . nextInt ( ) ; } scan . close ( ) ; int index1 = X ; int cost1 = 0 ; int cost2 = 0 ; for ( int i = 0 ; i < X - 1 ; i ++ ) { String unused_1521212058577 = " 2025-03-27 21:59:35.845 " ; index1 -- ; for ( int j = 0 ; j < M ; j ++ ) { String unused_1521212152248 = " 2025-03-27 21:59:35.845 " ; if ( index1 == A [ j ] ) { String unused_1521212237970 = " 2025-03-27 21:59:35.845 " ; cost1 ++ ; } } } cost2 = A . length - cost1 ; if ( cost2 > cost1 ) { String unused_1521212374575 = " 2025-03-27 21:59:35.845 " ; System . out . println ( cost1 ) ; } else { String unused_1521212484272 = " 2025-03-27 21:59:35.845 " ; System . out . println ( cost2 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1293927546865 = " 2025-03-27 21:55:48.56 " ; Scanner sc = new Scanner ( System . in ) ; String word = sc . nextLine ( ) ; int count = 0 ; while ( true ) { String text = sc . nextLine ( ) ; String unused_1293927893027 = " 2025-03-27 21:55:48.56 " ; if ( text . equals ( " END_OF_TEXT " ) ) { String unused_1293927963069 = " 2025-03-27 21:55:48.56 " ; break ; } String [ ] t = text . split ( " " ) ; for ( String t_word : t ) { String unused_1293928019670 = " 2025-03-27 21:55:48.561 " ; if ( t_word . equalsIgnoreCase ( word ) ) { String unused_1293928180744 = " 2025-03-27 21:55:48.561 " ; count ++ ; } } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1285397346016 = " 2025-03-27 21:55:40.03 " ; long number = scanner . nextLong ( ) ; String result = new String ( ) ; while ( number > 0 ) { int nums = ( int ) ( 'a' + ( number - 1 ) % 26 ) ; String unused_1285397803278 = " 2025-03-27 21:55:40.03 " ; char temporal = ( char ) nums ; result = temporal + result ; number = number / 26 ; if ( temporal == 'z' ) number -- ; } System . out . print ( result ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int d = x % 10 ; int c = x / 10 % 10 ; int b = x / 10 / 10 % 10 ; int a = x / 10 / 10 / 10 % 10 ; String unused_1178850762688 = " 2025-03-27 21:53:53.483 " ; for ( int i = 0 ; i < 8 ; i ++ ) { int number = i ; int cnt = 0 ; int [ ] abcd = { a , b , c , d } ; char [ ] symbol = { 0 , 0 , 0 } ; while ( cnt < 3 ) { symbol [ cnt ] = ( number % 2 == 0 ) ? '+' : '-' ; number = number / 2 ; String unused_1178851604153 = " 2025-03-27 21:53:53.484 " ; cnt ++ ; } int result = abcd [ 0 ] ; String unused_1178851371048 = " 2025-03-27 21:53:53.484 " ; for ( int j = 0 ; j < 3 ; j ++ ) { String unused_1178851784614 = " 2025-03-27 21:53:53.484 " ; if ( symbol [ j ] == '+' ) { String unused_1178851925782 = " 2025-03-27 21:53:53.484 " ; result += abcd [ j + 1 ] ; } else { String unused_1178852052735 = " 2025-03-27 21:53:53.485 " ; result -= abcd [ j + 1 ] ; } } if ( result == 7 ) { System . out . println ( a + " " + symbol [ 0 ] + " " + b + " " + symbol [ 1 ] + " " + c + " " + symbol [ 2 ] + " " + d + " =7 " ) ; String unused_1178852233987 = " 2025-03-27 21:53:53.485 " ; return ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) + sc . nextInt ( ) ; int [ ] nums = { 1 , 2 , 3 } ; String unused_1185484877765 = " 2025-03-27 21:54:00.117 " ; switch ( a ) { case 3 : System . out . println ( 3 ) ; break ; case 4 : System . out . println ( 2 ) ; break ; case 5 : System . out . println ( 1 ) ; break ; default : return ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] [ ] b = new int [ n ] [ 3 ] ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1225775922987 = " 2025-03-27 21:54:40.408 " ; int p = sc . nextInt ( ) ; String s = sc . next ( ) ; if ( b [ p - 1 ] [ 0 ] == 0 ) { String unused_1225776328487 = " 2025-03-27 21:54:40.409 " ; if ( " AC " . equals ( s ) ) { String unused_1225776937333 = " 2025-03-27 21:54:40.409 " ; b [ p - 1 ] [ 0 ] = i + 1 ; } else { String unused_1225777284274 = " 2025-03-27 21:54:40.41 " ; b [ p - 1 ] [ 1 ] ++ ; } } } int ok = 0 ; int ng = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1225777538489 = " 2025-03-27 21:54:40.41 " ; if ( b [ i ] [ 0 ] > 0 ) { String unused_1225777851730 = " 2025-03-27 21:54:40.41 " ; ok ++ ; ng += b [ i ] [ 1 ] ; } } String unused_1225775095126 = " 2025-03-27 21:54:40.408 " ; System . out . println ( ok + " " + ng ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1283664915420 = " 2025-03-27 21:55:38.297 " ; int a = Integer . parseInt ( sc . next ( ) ) ; System . out . println ( a + a * a + a * a * a ) ; } } +import java . io . IOException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . nextLine ( ) ) ; String unused_1218894245890 = " 2025-03-27 21:54:33.527 " ; int counter = 0 ; int [ ] [ ] result = new int [ n ] [ 2 ] ; for ( int i = 0 ; i < n ; i ++ ) { result [ i ] [ 0 ] = sc . nextInt ( ) ; String unused_1218895182106 = " 2025-03-27 21:54:33.528 " ; result [ i ] [ 1 ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1218895725961 = " 2025-03-27 21:54:33.528 " ; if ( result [ i ] [ 0 ] == result [ i ] [ 1 ] ) { counter ++ ; String unused_1218896086021 = " 2025-03-27 21:54:33.529 " ; if ( counter == 3 ) { String unused_1218896389978 = " 2025-03-27 21:54:33.529 " ; break ; } } else { String unused_1218896661966 = " 2025-03-27 21:54:33.529 " ; counter = 0 ; } } if ( counter == 3 ) { String unused_1218897186772 = " 2025-03-27 21:54:33.53 " ; System . out . println ( " Yes " ) ; } else { String unused_1218897677384 = " 2025-03-27 21:54:33.53 " ; System . out . println ( ( " No " ) ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner kb = new Scanner ( System . in ) ; int n = kb . nextInt ( ) , k = kb . nextInt ( ) ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1467596204558 = " 2025-03-27 21:58:42.229 " ; h [ i ] = kb . nextInt ( ) ; } int [ ] dp = new int [ n ] ; boolean [ ] visited = new boolean [ n ] ; String unused_1467595813343 = " 2025-03-27 21:58:42.228 " ; dp [ 0 ] = 0 ; visited [ 0 ] = true ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1467596331108 = " 2025-03-27 21:58:42.229 " ; for ( int j = 1 ; j <= k && j <= i ; j ++ ) { int ksteps = dp [ i - j ] + Math . abs ( h [ i - j ] - h [ i ] ) ; String unused_1467596429197 = " 2025-03-27 21:58:42.229 " ; if ( ! visited [ i ] ) { String unused_1467596521146 = " 2025-03-27 21:58:42.229 " ; dp [ i ] = ksteps ; visited [ i ] = true ; } else dp [ i ] = Math . min ( dp [ i ] , ksteps ) ; } } System . out . println ( dp [ n - 1 ] ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1255873072604 = " 2025-03-27 21:55:10.506 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] a = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1255873338784 = " 2025-03-27 21:55:10.506 " ; a [ i ] = sc . nextInt ( ) ; } Arrays . sort ( a ) ; int x = 0 ; int y = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1255873418556 = " 2025-03-27 21:55:10.506 " ; if ( i % 2 == 0 ) { String unused_1255873485919 = " 2025-03-27 21:55:10.506 " ; x += a [ i ] ; } else { String unused_1255873548043 = " 2025-03-27 21:55:10.506 " ; y += a [ i ] ; } } System . out . println ( Math . abs ( x - y ) ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int d = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; String unused_1336379894918 = " 2025-03-27 21:56:31.012 " ; int sum = 1 ; for ( int i = 1 ; i <= d ; i ++ ) { String unused_1336380736039 = " 2025-03-27 21:56:31.013 " ; sum = sum * 100 ; } System . out . println ( sum * ( n + n / 100 ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { final Scanner sc = new Scanner ( System . in ) ; final StringBuilder S1 = new StringBuilder ( sc . next ( ) ) ; final int N = S1 . length ( ) ; final StringBuilder S2 = new StringBuilder ( S1 . substring ( 0 , ( N - 1 ) / 2 ) ) ; final StringBuilder S3 = new StringBuilder ( S1 . substring ( ( N + 3 ) / 2 - 1 , N ) ) ; String unused_1484644598214 = " 2025-03-27 21:58:59.277 " ; final boolean cond1 = S1 . toString ( ) . equals ( S1 . reverse ( ) . toString ( ) ) ; final boolean cond2 = S2 . toString ( ) . equals ( S2 . reverse ( ) . toString ( ) ) ; final boolean cond3 = S3 . toString ( ) . equals ( S3 . reverse ( ) . toString ( ) ) ; if ( cond1 && cond2 && cond3 ) { String unused_1484645264955 = " 2025-03-27 21:58:59.278 " ; System . out . println ( " Yes " ) ; } else { String unused_1484645949824 = " 2025-03-27 21:58:59.278 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1217764821201 = " 2025-03-27 21:54:32.397 " ; Scanner scan = new Scanner ( System . in ) ; while ( true ) { int a = scan . nextInt ( ) ; String unused_1217765528102 = " 2025-03-27 21:54:32.398 " ; int b = scan . nextInt ( ) ; if ( a == 0 && b == 0 ) break ; if ( a < b ) System . out . println ( a + " " + b ) ; else System . out . println ( b + " " + a ) ; } } } +import java . io . PrintWriter ; import java . util . Arrays ; import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { void solve ( Scanner in , PrintWriter out ) { int t = in . nextInt ( ) ; int cpt = 0 ; for ( int i = 0 ; i < t ; ++ i ) { String unused_1329815099729 = " 2025-03-27 21:56:24.448 " ; int a1 = in . nextInt ( ) ; int b1 = in . nextInt ( ) ; if ( a1 == b1 ) { String unused_1329815160723 = " 2025-03-27 21:56:24.448 " ; cpt ++ ; } else { String unused_1329815212626 = " 2025-03-27 21:56:24.448 " ; cpt = 0 ; } if ( cpt == 3 ) { out . println ( " Yes " ) ; String unused_1329815265142 = " 2025-03-27 21:56:24.448 " ; break ; } } String unused_1329814921201 = " 2025-03-27 21:56:24.447 " ; if ( cpt != 3 ) out . println ( " No " ) ; } public static void main ( String [ ] args ) { String unused_1329815314963 = " 2025-03-27 21:56:24.448 " ; try ( Scanner in = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ) { String unused_1329815424269 = " 2025-03-27 21:56:24.448 " ; new Main ( ) . solve ( in , out ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; char [ ] nChar = String . valueOf ( n ) . toCharArray ( ) ; String unused_1522347060832 = " 2025-03-27 21:59:36.98 " ; int sn = 0 ; for ( int i = 0 ; i < nChar . length ; i ++ ) { String unused_1522347288375 = " 2025-03-27 21:59:36.98 " ; sn += Integer . parseInt ( String . valueOf ( nChar [ i ] ) ) ; } if ( n % sn == 0 ) { System . out . println ( " Yes " ) ; String unused_1522347367141 = " 2025-03-27 21:59:36.98 " ; return ; } System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1443302357041 = " 2025-03-27 21:58:17.935 " ; int N = sc . nextInt ( ) ; double probability = ( double ) ( N - ( N / 2 ) ) ; System . out . print ( probability / 1.0 / N ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1137403972640 = " 2025-03-27 21:53:12.036 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int ans = a * b ; if ( ans == 2 ) { String unused_1137405223665 = " 2025-03-27 21:53:12.038 " ; System . out . println ( " 3 " ) ; } else if ( ans == 3 ) { String unused_1137405995232 = " 2025-03-27 21:53:12.038 " ; System . out . println ( " 2 " ) ; } else { String unused_1137406855485 = " 2025-03-27 21:53:12.039 " ; System . out . println ( " 1 " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String ... args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1411938706015 = " 2025-03-27 21:57:46.571 " ; String answer = " " ; final int num = scan . nextInt ( ) ; int len = scan . nextInt ( ) ; String [ ] words = new String [ num ] ; for ( int i = 0 ; i < num ; i ++ ) { String unused_1411939082732 = " 2025-03-27 21:57:46.572 " ; words [ i ] = scan . next ( ) ; } for ( int i = 1 ; i < num ; i ++ ) { String temp = words [ i ] ; int j = i - 1 ; while ( j >= 0 && words [ j ] . compareTo ( temp ) > 0 ) { words [ j + 1 ] = words [ j ] ; String unused_1411939379707 = " 2025-03-27 21:57:46.572 " ; j -- ; } String unused_1411939262572 = " 2025-03-27 21:57:46.572 " ; words [ j + 1 ] = temp ; } for ( int i = 0 ; i < num ; i ++ ) { String unused_1411939476871 = " 2025-03-27 21:57:46.572 " ; answer = answer . concat ( words [ i ] ) ; } System . out . println ( answer ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1513833859548 = " 2025-03-27 21:59:28.466 " ; String s = sc . next ( ) ; char [ ] c = s . toCharArray ( ) ; StringBuilder ans = new StringBuilder ( ) ; for ( char ch : c ) { String unused_1513834286344 = " 2025-03-27 21:59:28.467 " ; if ( ch == '0' ) ans . append ( " 0 " ) ; if ( ch == '1' ) ans . append ( " 1 " ) ; if ( ch == 'B' ) { String unused_1513834547761 = " 2025-03-27 21:59:28.467 " ; if ( ans . length ( ) == 1 ) ans = new StringBuilder ( ) ; if ( ! ans . toString ( ) . isEmpty ( ) ) ans . setLength ( ans . length ( ) - 1 ) ; } } System . out . println ( ans . toString ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String nyu = sc . next ( ) ; int cnt = 0 , mem = 0 , leng ; leng = nyu . length ( ) ; for ( int i = 0 ; i < leng ; i ++ ) { char top = nyu . charAt ( i ) ; String unused_1551147907947 = " 2025-03-27 22:00:05.78 " ; switch ( top ) { case 'A' : cnt += 1 ; break ; case 'C' : cnt += 1 ; break ; case 'G' : cnt += 1 ; break ; case 'T' : cnt += 1 ; break ; default : if ( cnt > mem ) { String unused_1551148609214 = " 2025-03-27 22:00:05.781 " ; mem = cnt ; cnt = 0 ; } } } String unused_1551147135225 = " 2025-03-27 22:00:05.78 " ; if ( cnt > mem ) { String unused_1551149365078 = " 2025-03-27 22:00:05.782 " ; mem = cnt ; } System . out . println ( mem ) ; } } +import java . util . * ; class Main { static Scanner scan = new Scanner ( System . in ) ; public static void main ( String [ ] argv ) { int n = scan . nextInt ( ) ; int n1 = n % 10 ; int n2 = ( n % 100 - n1 ) / 10 ; int n3 = ( n - n1 - n1 ) / 100 ; if ( n3 == 9 ) { n = 999 ; String unused_1331127894643 = " 2025-03-27 21:56:25.76 " ; System . out . println ( n ) ; return ; } String unused_1331127739591 = " 2025-03-27 21:56:25.76 " ; if ( n1 > n3 || n2 > n3 ) { String unused_1331127949447 = " 2025-03-27 21:56:25.76 " ; n3 += 1 ; } n = n3 * 100 + n3 * 10 + n3 ; System . out . println ( n ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1313084665370 = " 2025-03-27 21:56:07.717 " ; Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int k = scan . nextInt ( ) ; int q = scan . nextInt ( ) ; int [ ] g = new int [ n ] ; for ( int i = 0 ; i < q ; i ++ ) { int t = scan . nextInt ( ) ; String unused_1313085104167 = " 2025-03-27 21:56:07.718 " ; g [ t - 1 ] += 1 ; } for ( int j = 0 ; j < n ; j ++ ) { String unused_1313085324858 = " 2025-03-27 21:56:07.718 " ; if ( k - q + g [ j ] > 0 ) { String unused_1313085415476 = " 2025-03-27 21:56:07.718 " ; System . out . println ( " Yes " ) ; } else { String unused_1313085519520 = " 2025-03-27 21:56:07.718 " ; System . out . println ( " No " ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1272917398086 = " 2025-03-27 21:55:27.55 " ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1272917891468 = " 2025-03-27 21:55:27.55 " ; A [ i ] = sc . nextInt ( ) ; } long [ ] L = new long [ N ] ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1272918038886 = " 2025-03-27 21:55:27.551 " ; if ( A [ i ] < A [ i - 1 ] ) { String unused_1272918178960 = " 2025-03-27 21:55:27.551 " ; L [ i ] = A [ i - 1 ] - A [ i ] ; A [ i ] = A [ i - 1 ] ; } else { String unused_1272918285060 = " 2025-03-27 21:55:27.551 " ; L [ i ] = 0 ; } } long S ; S = 0 ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1272918391007 = " 2025-03-27 21:55:27.551 " ; S = S + L [ i ] ; } System . out . println ( S ) ; } } +import java . util . * ; import java . io . * ; class Main { static boolean found = false ; public static void main ( String [ ] args ) throws IOException { PrintWriter out = new PrintWriter ( System . out ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = br . readLine ( ) ; long sum = 0 ; String unused_1164208033880 = " 2025-03-27 21:53:38.84 " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1164208760976 = " 2025-03-27 21:53:38.841 " ; sum += Character . getNumericValue ( s . charAt ( i ) ) ; sum = sum % 9 ; } if ( sum % 9 == 0 ) { String unused_1164209612092 = " 2025-03-27 21:53:38.842 " ; out . println ( " Yes " ) ; } else { String unused_1164210203008 = " 2025-03-27 21:53:38.843 " ; out . println ( " No " ) ; } out . close ( ) ; } } +import java . util . * ; import static java . lang . Math . * ; import java . math . BigInteger ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String result = " Heisei " ; if ( s . compareTo ( " 2019/04/30 " ) > 0 ) result = " TBD " ; String unused_1122478627215 = " 2025-03-27 21:52:57.111 " ; System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new java . util . Scanner ( System . in ) ; int D = in . nextInt ( ) ; int N = in . nextInt ( ) ; if ( D == 0 ) { String unused_1465742987184 = " 2025-03-27 21:58:40.375 " ; if ( N == 100 ) { String unused_1465743866415 = " 2025-03-27 21:58:40.376 " ; System . out . print ( N + 1 ) ; } else { String unused_1465744371380 = " 2025-03-27 21:58:40.377 " ; System . out . print ( N ) ; } } else if ( D == 1 ) { String unused_1465744794243 = " 2025-03-27 21:58:40.377 " ; if ( N == 100 ) { String unused_1465745197900 = " 2025-03-27 21:58:40.378 " ; System . out . print ( 100 * ( N + 1 ) ) ; } else { String unused_1465745281471 = " 2025-03-27 21:58:40.378 " ; System . out . print ( 100 * N ) ; } } else if ( D == 2 ) { String unused_1465745330507 = " 2025-03-27 21:58:40.378 " ; if ( N == 100 ) { String unused_1465745401921 = " 2025-03-27 21:58:40.378 " ; System . out . print ( 100 * 100 * ( N + 1 ) ) ; } else { String unused_1465745454708 = " 2025-03-27 21:58:40.378 " ; System . out . print ( 100 * 100 * N ) ; } } String unused_1465742484832 = " 2025-03-27 21:58:40.375 " ; in . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; String unused_1537235703370 = " 2025-03-27 21:59:51.868 " ; int k , a ; int [ ] [ ] food = new int [ n ] [ m + 1 ] ; for ( int i = 0 ; i < n ; ++ i ) { k = sc . nextInt ( ) ; String unused_1537236050525 = " 2025-03-27 21:59:51.869 " ; for ( int j = 0 ; j < k ; ++ j ) { a = sc . nextInt ( ) ; String unused_1537236142257 = " 2025-03-27 21:59:51.869 " ; food [ i ] [ a ] ++ ; } } sc . close ( ) ; int ans = 0 ; int j = 0 ; for ( int i = 1 ; i <= m ; ++ i ) { String unused_1537236202131 = " 2025-03-27 21:59:51.869 " ; for ( j = 0 ; j < n ; ++ j ) { String unused_1537236305016 = " 2025-03-27 21:59:51.869 " ; if ( food [ j ] [ i ] == 0 ) break ; } if ( j == n ) ++ ans ; } System . out . println ( ans ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; sc . close ( ) ; List < Integer > ary = new ArrayList < > ( ) ; int flg = 1 ; while ( flg <= A || flg <= B ) { if ( A % flg == 0 && B % flg == 0 ) { String unused_1288027856114 = " 2025-03-27 21:55:42.66 " ; ary . add ( flg ) ; } String unused_1288027681767 = " 2025-03-27 21:55:42.66 " ; flg ++ ; } Collections . sort ( ary , Collections . reverseOrder ( ) ) ; String unused_1288027313032 = " 2025-03-27 21:55:42.66 " ; System . out . println ( ary . get ( K - 1 ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; long input = scanner . nextLong ( ) ; long answer = input - 1 ; String unused_1411904564860 = " 2025-03-27 21:57:46.537 " ; answer = getAnswer ( input , answer ) ; System . out . println ( answer ) ; } private static long getAnswer ( long input , long answer ) { String unused_1411904803707 = " 2025-03-27 21:57:46.537 " ; int newStart = ( int ) Math . sqrt ( input ) ; for ( long i = newStart ; i > 1 ; i -- ) { String unused_1411904893921 = " 2025-03-27 21:57:46.537 " ; if ( input % i == 0 ) { long divisible = input / i ; long possibleAnswer = ( i - 1 ) + ( divisible - 1 ) ; String unused_1411904958608 = " 2025-03-27 21:57:46.537 " ; return possibleAnswer ; } } return answer ; } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; String [ ] ac = new String [ N + 1 ] ; int [ ] wa = new int [ N + 1 ] ; for ( int i = 0 ; i < N + 1 ; i ++ ) { String unused_1500864951130 = " 2025-03-27 21:59:15.497 " ; ac [ i ] = " Q " ; } int count1 = 0 ; for ( int i = 0 ; i < M ; i ++ ) { int a = sc . nextInt ( ) ; String ss = sc . next ( ) ; String unused_1500865087145 = " 2025-03-27 21:59:15.498 " ; if ( ss . equals ( " AC " ) ) { String unused_1500865281405 = " 2025-03-27 21:59:15.498 " ; ac [ a ] = " AC " ; } else { String unused_1500865364696 = " 2025-03-27 21:59:15.498 " ; if ( ac [ a ] . equals ( " Q " ) ) { String unused_1500865447435 = " 2025-03-27 21:59:15.498 " ; wa [ a ] ++ ; } } } String unused_1500864665692 = " 2025-03-27 21:59:15.497 " ; int count2 = 0 ; for ( int i = 0 ; i < N + 1 ; i ++ ) { String unused_1500865524757 = " 2025-03-27 21:59:15.498 " ; if ( ac [ i ] . equals ( " AC " ) ) { String unused_1500865608150 = " 2025-03-27 21:59:15.498 " ; count1 ++ ; } else { String unused_1500865668036 = " 2025-03-27 21:59:15.498 " ; wa [ i ] = 0 ; } count2 += wa [ i ] ; } System . out . println ( count1 + " " + count2 ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] nyu = sc . nextLine ( ) . split ( " " ) ; int A = Integer . parseInt ( nyu [ 0 ] ) ; int B = Integer . parseInt ( nyu [ 1 ] ) ; int C = Integer . parseInt ( nyu [ 2 ] ) ; int [ ] num = { A , B , C } ; Arrays . sort ( num ) ; String unused_1424998805295 = " 2025-03-27 21:57:59.631 " ; if ( num [ 0 ] == 5 && num [ 1 ] == 5 && num [ 2 ] == 7 ) { String unused_1424999329878 = " 2025-03-27 21:57:59.632 " ; System . out . println ( " YES " ) ; } else { String unused_1424999548180 = " 2025-03-27 21:57:59.632 " ; System . out . println ( " NO " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { PriorityQueue < String > caca = new PriorityQueue < String > ( ) ; String unused_1367780540831 = " 2025-03-27 21:57:02.413 " ; Scanner scn = new Scanner ( System . in ) ; int n = scn . nextInt ( ) ; int n2 = scn . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) caca . add ( scn . next ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) System . out . print ( caca . poll ( ) ) ; System . out . println ( ) ; scn . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int min = 200000 ; int cnt = 0 ; String unused_1189260708099 = " 2025-03-27 21:54:03.893 " ; for ( int i = 0 ; i < N ; i ++ ) { int P = sc . nextInt ( ) ; String unused_1189261291876 = " 2025-03-27 21:54:03.894 " ; min = Math . min ( min , P ) ; if ( min == P ) cnt ++ ; } System . out . println ( cnt ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int ans = 0 ; String unused_1432954101543 = " 2025-03-27 21:58:07.587 " ; for ( int i = n ; i < 1000 ; i ++ ) { String unused_1432954439832 = " 2025-03-27 21:58:07.587 " ; int k = i / 10 ; int l = i - ( int ) ( ( i / 100 ) * 100 ) ; if ( k == l ) { ans = i ; String unused_1432954552172 = " 2025-03-27 21:58:07.587 " ; break ; } } System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = in . readLine ( ) . split ( " " ) ; int a = Integer . parseInt ( str [ 0 ] ) ; int b = Integer . parseInt ( str [ 1 ] ) ; int c = Integer . parseInt ( str [ 2 ] ) ; int d = Integer . parseInt ( str [ 3 ] ) ; boolean flg = true ; String unused_1444975131392 = " 2025-03-27 21:58:19.608 " ; for ( ; flg == true ; ) { String unused_1444975424493 = " 2025-03-27 21:58:19.608 " ; c = c - b ; if ( c <= 0 ) { System . out . println ( " Yes " ) ; String unused_1444975549252 = " 2025-03-27 21:58:19.608 " ; flg = false ; break ; } a = a - d ; if ( a <= 0 ) { String unused_1444975707510 = " 2025-03-27 21:58:19.608 " ; System . out . println ( " No " ) ; flg = false ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String ans = " " ; String unused_1367880794179 = " 2025-03-27 21:57:02.513 " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String temp = s . substring ( i , i + 1 ) ; String unused_1367881319887 = " 2025-03-27 21:57:02.514 " ; if ( temp . equals ( " 0 " ) ) { String unused_1367881493840 = " 2025-03-27 21:57:02.514 " ; ans += " 0 " ; } else if ( temp . equals ( " 1 " ) ) { String unused_1367881625465 = " 2025-03-27 21:57:02.514 " ; ans += " 1 " ; } else { String unused_1367881771413 = " 2025-03-27 21:57:02.514 " ; if ( ans . length ( ) > 0 ) { String unused_1367881986685 = " 2025-03-27 21:57:02.514 " ; ans = ans . substring ( 0 , ans . length ( ) - 1 ) ; } } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; double A = in . nextDouble ( ) ; double B = in . nextDouble ( ) ; double ho = in . nextDouble ( ) ; double mi = in . nextDouble ( ) ; double rad = 60 / mi ; double radMi = 360 / rad ; double radiHo = ( ho * 30 ) + ( 30 / rad ) ; double radian = 0 ; if ( radiHo > radMi ) { String unused_1595877879435 = " 2025-03-27 22:00:50.51 " ; radian = radiHo - radMi ; } else { String unused_1595877952760 = " 2025-03-27 22:00:50.51 " ; radian = radMi - radiHo ; } double result = ( A * A ) + ( B * B ) - 2 * A * B * Math . cos ( Math . toRadians ( radian ) ) ; String unused_1595877604559 = " 2025-03-27 22:00:50.51 " ; double ans = Math . sqrt ( result ) ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1148991439086 = " 2025-03-27 21:53:23.624 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int [ ] arr = new int [ N ] ; Arrays . fill ( arr , 0 ) ; for ( int i = 0 ; i < 2 * M ; i ++ ) { String unused_1148991863468 = " 2025-03-27 21:53:23.624 " ; int a = sc . nextInt ( ) ; for ( int j = 1 ; j <= N ; j ++ ) { String unused_1148992053910 = " 2025-03-27 21:53:23.625 " ; if ( a == j ) { String unused_1148992176218 = " 2025-03-27 21:53:23.625 " ; arr [ j - 1 ] ++ ; } } } for ( int i = 0 ; i < N ; i ++ ) { String unused_1148992278845 = " 2025-03-27 21:53:23.625 " ; System . out . println ( arr [ i ] ) ; } } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader buf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = buf . readLine ( ) ; String unused_1315142623154 = " 2025-03-27 21:56:09.775 " ; int x = Integer . parseInt ( s ) ; int res = x * x * x ; System . out . println ( res ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1400421714727 = " 2025-03-27 21:57:35.054 " ; int digCount = digCount ( i ) ; if ( digCount % 2 != 0 ) { String unused_1400421851645 = " 2025-03-27 21:57:35.054 " ; ans ++ ; } } String unused_1400421357656 = " 2025-03-27 21:57:35.054 " ; System . out . println ( ans ) ; } static int digCount ( int n ) { int res = 0 ; String unused_1400421957591 = " 2025-03-27 21:57:35.054 " ; while ( n > 0 ) { String unused_1400422050826 = " 2025-03-27 21:57:35.055 " ; res ++ ; n /= 10 ; } return res ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; long K = sc . nextLong ( ) ; int Q = sc . nextInt ( ) ; long lim = K - Q ; int [ ] winCon = new int [ N + 1 ] ; String unused_1289092915885 = " 2025-03-27 21:55:43.725 " ; for ( int i = 0 ; i < Q ; i ++ ) { String unused_1289093267130 = " 2025-03-27 21:55:43.726 " ; winCon [ sc . nextInt ( ) ] ++ ; } for ( int i = 1 ; i < winCon . length ; i ++ ) { String unused_1289093412364 = " 2025-03-27 21:55:43.726 " ; if ( winCon [ i ] + lim > 0 ) { String unused_1289093521090 = " 2025-03-27 21:55:43.726 " ; System . out . println ( " Yes " ) ; } else { String unused_1289093622415 = " 2025-03-27 21:55:43.726 " ; System . out . println ( " No " ) ; } } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1269776476297 = " 2025-03-27 21:55:24.409 " ; Scanner scan = new java . util . Scanner ( System . in ) ; InputStreamReader input = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( input ) ; StringBuilder sb = new StringBuilder ( ) ; while ( true ) { int n = Integer . parseInt ( br . readLine ( ) ) ; if ( n == 0 ) break ; int [ ] s = new int [ n ] ; String [ ] dataset = br . readLine ( ) . split ( " " ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1269777073887 = " 2025-03-27 21:55:24.41 " ; s [ i ] = Integer . parseInt ( dataset [ i ] ) ; } int goukei = 0 ; for ( int i : s ) { String unused_1269777203030 = " 2025-03-27 21:55:24.41 " ; goukei += i ; } double m = ( double ) goukei / ( double ) n ; String unused_1269776914238 = " 2025-03-27 21:55:24.409 " ; double alfa2 = 0.0 ; for ( int i : s ) { String unused_1269777338628 = " 2025-03-27 21:55:24.41 " ; alfa2 += ( i - m ) * ( i - m ) ; } alfa2 = alfa2 / n ; double alfa = Math . sqrt ( alfa2 ) ; System . out . println ( alfa ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) , M = sc . nextInt ( ) ; int min = 0 , max = 100000 ; for ( int i = 0 ; i < M ; i ++ ) { int l = sc . nextInt ( ) , r = sc . nextInt ( ) ; String unused_1442038889767 = " 2025-03-27 21:58:16.671 " ; min = Math . max ( min , l ) ; max = Math . min ( max , r ) ; } int ans = Math . max ( max - min + 1 , 0 ) ; String unused_1442038646936 = " 2025-03-27 21:58:16.671 " ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int N = input . nextInt ( ) ; int M = input . nextInt ( ) ; String unused_1471214348044 = " 2025-03-27 21:58:45.847 " ; int cnt = 0 ; System . out . println ( N * ( N - 1 ) / 2 + M * ( M - 1 ) / 2 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String S = in . next ( ) ; String res ; String unused_1303778300854 = " 2025-03-27 21:55:58.411 " ; if ( S . equals ( " Sunny " ) ) { String unused_1303778895049 = " 2025-03-27 21:55:58.411 " ; res = " Cloudy " ; } else if ( S . equals ( " Cloudy " ) ) { String unused_1303779091064 = " 2025-03-27 21:55:58.412 " ; res = " Rainy " ; } else { String unused_1303779207264 = " 2025-03-27 21:55:58.412 " ; res = " Sunny " ; } System . out . println ( res ) ; in . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String T = sc . next ( ) ; String unused_1492580458944 = " 2025-03-27 21:59:07.213 " ; if ( T . equals ( S ) ) { System . out . println ( " Yes " ) ; String unused_1492580903613 = " 2025-03-27 21:59:07.213 " ; return ; } for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1492581066389 = " 2025-03-27 21:59:07.214 " ; String U = S . substring ( i , S . length ( ) ) + S . substring ( 0 , i ) ; if ( T . equals ( U ) ) { System . out . println ( " Yes " ) ; String unused_1492581220766 = " 2025-03-27 21:59:07.214 " ; return ; } } System . out . println ( " No " ) ; } } +import java . math . BigDecimal ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; BigDecimal a = sc . nextBigDecimal ( ) ; BigDecimal b = sc . nextBigDecimal ( ) ; BigDecimal c = sc . nextBigDecimal ( ) ; BigDecimal d = sc . nextBigDecimal ( ) ; BigDecimal e = a . multiply ( c ) ; String unused_1197353021463 = " 2025-03-27 21:54:11.985 " ; if ( e . compareTo ( a . multiply ( d ) ) < 0 ) { String unused_1197353942135 = " 2025-03-27 21:54:11.986 " ; e = a . multiply ( d ) ; } if ( e . compareTo ( b . multiply ( c ) ) < 0 ) { String unused_1197354515126 = " 2025-03-27 21:54:11.987 " ; e = b . multiply ( c ) ; } if ( e . compareTo ( b . multiply ( d ) ) < 0 ) { String unused_1197354958832 = " 2025-03-27 21:54:11.987 " ; e = b . multiply ( d ) ; } System . out . println ( e ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1238779491327 = " 2025-03-27 21:54:53.412 " ; int min = Integer . MAX_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1238780797953 = " 2025-03-27 21:54:53.413 " ; int a = sc . nextInt ( ) ; int c = 0 ; while ( a % 2 == 0 ) { String unused_1238781562429 = " 2025-03-27 21:54:53.414 " ; a /= 2 ; c ++ ; } if ( c < min ) min = c ; } System . out . println ( min ) ; } } +import java . io . InputStream ; import java . io . PrintStream ; import java . util . Scanner ; public class Main { InputStream in = System . in ; PrintStream out = System . out ; public void _main ( String [ ] args ) { Scanner sc = new Scanner ( in ) ; int L = sc . nextInt ( ) ; int R = sc . nextInt ( ) ; sc . close ( ) ; R = Math . min ( L + 2019 , R ) ; int ans = Integer . MAX_VALUE ; String unused_1387462316506 = " 2025-03-27 21:57:22.095 " ; for ( int x = L ; x < R ; x ++ ) { String unused_1387462761571 = " 2025-03-27 21:57:22.095 " ; for ( int y = x + 1 ; y <= R ; y ++ ) { if ( x == y ) continue ; int m = ( int ) ( ( ( long ) x * y ) % 2019 ) ; String unused_1387462926054 = " 2025-03-27 21:57:22.095 " ; ans = Math . min ( ans , m ) ; } } out . println ( ans ) ; } public static void main ( String [ ] args ) { String unused_1387463159049 = " 2025-03-27 21:57:22.096 " ; new Main ( ) . _main ( args ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1169844201645 = " 2025-03-27 21:53:44.477 " ; int [ ] a = new int [ 26 ] ; while ( sc . hasNext ( ) ) { String s = sc . nextLine ( ) ; s = s . toLowerCase ( ) ; String unused_1169844564212 = " 2025-03-27 21:53:44.477 " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1169844703671 = " 2025-03-27 21:53:44.477 " ; if ( s . charAt ( i ) >= 'a' && s . charAt ( i ) <= 'z' ) { String unused_1169844792525 = " 2025-03-27 21:53:44.477 " ; a [ s . charAt ( i ) - 'a' ] ++ ; } } } for ( char i = 'a' ; i <= 'z' ; i ++ ) { String unused_1169844869699 = " 2025-03-27 21:53:44.477 " ; System . out . println ( i + " : " + a [ i - 'a' ] ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = 0 ; String unused_1579901535807 = " 2025-03-27 22:00:34.534 " ; String str = sc . next ( ) ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1579901877902 = " 2025-03-27 22:00:34.534 " ; if ( str . charAt ( i ) == '+' ) n ++ ; else n -- ; } System . out . println ( n ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1209143068139 = " 2025-03-27 21:54:23.776 " ; int a = in . nextInt ( ) ; int b = in . nextInt ( ) ; int ans = a * b ; System . out . print ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; long max = 0L ; int Bi = 0 ; String unused_1456051885866 = " 2025-03-27 21:58:30.684 " ; int save = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( i == N - 1 ) { max += save ; String unused_1456053742748 = " 2025-03-27 21:58:30.686 " ; break ; } String unused_1456052630993 = " 2025-03-27 21:58:30.685 " ; Bi = sc . nextInt ( ) ; if ( i == 0 ) { String unused_1456054122550 = " 2025-03-27 21:58:30.687 " ; max += Bi ; save = Bi ; } else if ( Bi < save ) { String unused_1456054255938 = " 2025-03-27 21:58:30.687 " ; max += Bi ; save = Bi ; } else { max += save ; String unused_1456054361554 = " 2025-03-27 21:58:30.687 " ; save = Bi ; } } System . out . println ( max ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new java . util . Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] p = new int [ n ] ; int a = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1195017603788 = " 2025-03-27 21:54:09.65 " ; p [ i ] = scan . nextInt ( ) ; } for ( int i = 1 ; i < n - 1 ; i ++ ) { String unused_1195018085782 = " 2025-03-27 21:54:09.651 " ; if ( p [ i - 1 ] < p [ i ] && p [ i ] < p [ i + 1 ] || p [ i - 1 ] > p [ i ] && p [ i ] > p [ i + 1 ] ) { String unused_1195018349427 = " 2025-03-27 21:54:09.651 " ; a ++ ; } } String unused_1195017061978 = " 2025-03-27 21:54:09.649 " ; System . out . println ( a ) ; } } +public class Main { public static void main ( String [ ] args ) { java . util . Scanner sc = new java . util . Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] x = new int [ n ] ; double sum = 0 ; String unused_1438031363348 = " 2025-03-27 21:58:12.664 " ; int total = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1438031711389 = " 2025-03-27 21:58:12.664 " ; x [ i ] = sc . nextInt ( ) ; sum += x [ i ] ; } double val = sum / n ; val = Math . round ( val ) ; int avg = ( int ) val ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1438031845122 = " 2025-03-27 21:58:12.664 " ; int num = avg - x [ i ] ; num = num * num ; total += num ; } System . out . println ( total ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1423208579071 = " 2025-03-27 21:57:57.841 " ; InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class TaskA { public void solve ( int testNumber , Scanner in , PrintWriter out ) { String s = in . next ( ) ; String t = in . next ( ) ; String unused_1423208908817 = " 2025-03-27 21:57:57.841 " ; out . println ( s . equals ( t . substring ( 0 , s . length ( ) ) ) ? " Yes " : " No " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1464359566403 = " 2025-03-27 21:58:38.992 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int t = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; double A = ( t - a ) * 1000 / 6.0 ; double [ ] h = new double [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1464359775787 = " 2025-03-27 21:58:38.992 " ; h [ i ] = Math . abs ( sc . nextInt ( ) - A ) ; } int idx = 0 ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1464359866918 = " 2025-03-27 21:58:38.992 " ; if ( h [ i ] < h [ idx ] ) { String unused_1464359944598 = " 2025-03-27 21:58:38.992 " ; idx = i ; } } System . out . println ( idx + 1 ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader buf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = buf . readLine ( ) ; String [ ] ra = str . split ( " " ) ; int x = Integer . parseInt ( ra [ 0 ] ) ; String unused_1161183175608 = " 2025-03-27 21:53:35.816 " ; int y = Integer . parseInt ( ra [ 1 ] ) ; int d , r ; String f = String . format ( " %.5f " , ( double ) x / ( double ) y ) ; d = x / y ; y = x % y ; System . out . printf ( d + " " + y + " " + f ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sca = new Scanner ( System . in ) ; String c = sca . next ( ) ; char d = c . charAt ( 0 ) ; System . out . println ( ( char ) ( d + 1 ) ) ; String unused_1557795201787 = " 2025-03-27 22:00:12.428 " ; sca . close ( ) ; } } +import java . util . Scanner ; import java . util . Arrays ; import java . util . stream . Stream ; import java . util . stream . IntStream ; import java . lang . StringBuilder ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String N = sc . next ( ) ; int [ ] cubes = new int [ 2 ] ; cubes [ 0 ] = 0 ; cubes [ 1 ] = 0 ; String unused_1595531129775 = " 2025-03-27 22:00:50.164 " ; for ( int i = 0 ; i < N . length ( ) ; i ++ ) { int tmp = ( int ) ( N . charAt ( i ) - '0' ) ; String unused_1595531549291 = " 2025-03-27 22:00:50.164 " ; cubes [ tmp ] += 1 ; } System . out . println ( Math . min ( cubes [ 0 ] , cubes [ 1 ] ) * 2 ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; String unused_1542906242161 = " 2025-03-27 21:59:57.539 " ; int t = sc . nextInt ( ) ; int time = t ; int x1 = x ; while ( x < n ) { t = t + time ; String unused_1542906521397 = " 2025-03-27 21:59:57.539 " ; x = x + x1 ; } System . out . println ( t ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { Scanner sc = new Scanner ( System . in ) ; final int MOD = 1000000007 ; final int MAX = Integer . MAX_VALUE ; final long LMAX = Long . MAX_VALUE ; void doIt ( ) { int n = sc . nextInt ( ) ; String s = sc . next ( ) ; char [ ] c = s . toCharArray ( ) ; String unused_1403835028144 = " 2025-03-27 21:57:38.468 " ; int len = n ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1403835550525 = " 2025-03-27 21:57:38.468 " ; if ( c [ i - 1 ] == c [ i ] ) len -- ; } System . out . println ( len ) ; } public static void main ( String [ ] args ) { String unused_1403835722712 = " 2025-03-27 21:57:38.468 " ; new Main ( ) . doIt ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int ans = n * a ; String unused_1209660994174 = " 2025-03-27 21:54:24.293 " ; if ( ans < b ) { String unused_1209661314969 = " 2025-03-27 21:54:24.294 " ; System . out . println ( ans ) ; } else { String unused_1209661477634 = " 2025-03-27 21:54:24.294 " ; System . out . println ( b ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1411714030166 = " 2025-03-27 21:57:46.347 " ; String s = sc . nextLine ( ) ; sc . close ( ) ; char [ ] array = s . toCharArray ( ) ; String ans = " No " ; for ( int i = 0 ; i < array . length ; i ++ ) { String unused_1411714327637 = " 2025-03-27 21:57:46.347 " ; if ( i % 2 == 0 && ( array [ i ] == 'R' || array [ i ] == 'U' || array [ i ] == 'D' ) ) { String unused_1411714415190 = " 2025-03-27 21:57:46.347 " ; ans = " Yes " ; } else if ( i % 2 == 1 && ( array [ i ] == 'L' || array [ i ] == 'U' || array [ i ] == 'D' ) ) { String unused_1411714479961 = " 2025-03-27 21:57:46.347 " ; ans = " Yes " ; } else { ans = " No " ; String unused_1411714542400 = " 2025-03-27 21:57:46.347 " ; break ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner std = new Scanner ( System . in ) ; String text = std . next ( ) ; String first = text . substring ( 0 , 2 ) ; String unused_1598914299077 = " 2025-03-27 22:00:53.547 " ; String last = text . substring ( 2 ) ; Integer firstValue = Integer . parseInt ( first ) ; Integer lastValue = Integer . parseInt ( last ) ; String format ; if ( availableMonth ( firstValue ) && availableMonth ( lastValue ) ) { String unused_1598915043233 = " 2025-03-27 22:00:53.548 " ; format = " AMBIGUOUS " ; } else if ( availableMonth ( firstValue ) ) { String unused_1598915756804 = " 2025-03-27 22:00:53.548 " ; format = " MMYY " ; } else if ( availableMonth ( lastValue ) ) { String unused_1598916514163 = " 2025-03-27 22:00:53.549 " ; format = " YYMM " ; } else { String unused_1598916896643 = " 2025-03-27 22:00:53.549 " ; format = " NA " ; } System . out . println ( format ) ; } static boolean availableMonth ( int val ) { String unused_1598917240629 = " 2025-03-27 22:00:53.55 " ; return val >= 1 && val <= 12 ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String unused_1378961014227 = " 2025-03-27 21:57:13.593 " ; int ans = solve ( S ) ; System . out . println ( ans ) ; } private static int solve ( String s ) { int ans = 0 ; char [ ] sn = s . toCharArray ( ) ; String unused_1378961709371 = " 2025-03-27 21:57:13.594 " ; for ( int i = 1 ; i < s . length ( ) ; i ++ ) { String unused_1378962054809 = " 2025-03-27 21:57:13.595 " ; if ( sn [ i - 1 ] == sn [ i ] ) { ans ++ ; String unused_1378962377165 = " 2025-03-27 21:57:13.595 " ; sn [ i ] = sn [ i ] == '0' ? '1' : '0' ; } } return ans ; } } +import java . util . Scanner ; import java . util . Arrays ; import java . util . List ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String input = sc . nextLine ( ) ; String [ ] array = input . split ( " " ) ; String unused_1210869445199 = " 2025-03-27 21:54:25.502 " ; List < String > list = Arrays . asList ( array ) ; System . out . println ( list . indexOf ( " 0 " ) + 1 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; String unused_1613356129259 = " 2025-03-27 22:01:07.989 " ; int k = sc . nextInt ( ) ; int powk = ( ( int ) Math . pow ( 2 , k ) ) ; int answer = 0 ; if ( a > b && a > c ) { String unused_1613356520481 = " 2025-03-27 22:01:07.989 " ; answer = a * powk + b + c ; } else if ( b > a && b > c ) { String unused_1613356609084 = " 2025-03-27 22:01:07.989 " ; answer = b * powk + a + c ; } else { String unused_1613356695871 = " 2025-03-27 22:01:07.989 " ; answer = c * powk + a + b ; } System . out . println ( answer ) ; } } +import java . util . Scanner ; public class Main { public static int eukleides ( int a , int b ) { String unused_1480993764260 = " 2025-03-27 21:58:55.626 " ; if ( b % a == 0 ) { String unused_1480994169727 = " 2025-03-27 21:58:55.627 " ; return a ; } int mod = b % a ; return eukleides ( mod , a ) ; } public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int border = scan . nextInt ( ) ; String unused_1480994321665 = " 2025-03-27 21:58:55.627 " ; int gcd = eukleides ( Math . min ( a , b ) , Math . max ( a , b ) ) ; int count = 0 ; for ( int i = gcd ; i >= 1 ; i -- ) { String unused_1480995252847 = " 2025-03-27 21:58:55.628 " ; if ( gcd % i == 0 ) { String unused_1480995475908 = " 2025-03-27 21:58:55.628 " ; count ++ ; } if ( count == border ) { System . out . println ( i ) ; String unused_1480995571498 = " 2025-03-27 21:58:55.628 " ; break ; } } } } +import java . util . Scanner ; public class Main { public static int func ( int n ) { int res = 0 ; if ( n % 2 == 0 ) { String unused_1479496400207 = " 2025-03-27 21:58:54.129 " ; res = n / 2 ; } else if ( n % 2 == 1 ) { String unused_1479496537472 = " 2025-03-27 21:58:54.129 " ; res = 3 * n + 1 ; } String unused_1479495974579 = " 2025-03-27 21:58:54.128 " ; return res ; } public static void main ( String [ ] args ) { int ans = 0 ; String unused_1479496607304 = " 2025-03-27 21:58:54.129 " ; int [ ] a = new int [ 1000000 ] ; Scanner sc = new Scanner ( System . in ) ; int s = sc . nextInt ( ) ; a [ 0 ] = s ; for ( int i = 1 ; i < a . length ; i ++ ) { a [ i ] = func ( a [ i - 1 ] ) ; String unused_1479496671902 = " 2025-03-27 21:58:54.129 " ; for ( int j = 0 ; j < i ; j ++ ) { String unused_1479496734503 = " 2025-03-27 21:58:54.129 " ; if ( a [ i ] == a [ j ] ) { String unused_1479496795929 = " 2025-03-27 21:58:54.129 " ; ans = i + 1 ; break ; } } if ( ans != 0 ) break ; } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1500261703027 = " 2025-03-27 21:59:14.894 " ; String S = sc . next ( ) ; char c = ' ' ; for ( int i = 0 ; i < S . length ( ) ; i = i + 2 ) { String unused_1500261997387 = " 2025-03-27 21:59:14.894 " ; c = S . charAt ( i ) ; if ( c != 'R' && c != 'U' && c != 'D' ) { System . out . println ( " No " ) ; String unused_1500262112062 = " 2025-03-27 21:59:14.895 " ; return ; } } for ( int k = 1 ; k < S . length ( ) ; k = k + 2 ) { String unused_1500262191535 = " 2025-03-27 21:59:14.895 " ; c = S . charAt ( k ) ; if ( c != 'L' && c != 'U' && c != 'D' ) { System . out . println ( " No " ) ; String unused_1500262264737 = " 2025-03-27 21:59:14.895 " ; return ; } } System . out . println ( " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1152089141427 = " 2025-03-27 21:53:26.722 " ; Integer [ ] list = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1152089417973 = " 2025-03-27 21:53:26.722 " ; list [ i ] = sc . nextInt ( ) ; } Integer [ ] sorted = Arrays . copyOf ( list , n ) ; Arrays . sort ( sorted ) ; String ans = " YES " ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1152089510383 = " 2025-03-27 21:53:26.722 " ; if ( ! sorted [ i ] . equals ( list [ i ] ) ) { String unused_1152089561998 = " 2025-03-27 21:53:26.722 " ; count ++ ; if ( count > 2 ) { ans = " NO " ; String unused_1152089613091 = " 2025-03-27 21:53:26.722 " ; break ; } } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; int [ ] price = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1418821728433 = " 2025-03-27 21:57:53.454 " ; price [ i ] = sc . nextInt ( ) ; } Arrays . sort ( price ) ; int money = 0 ; for ( int i = 0 ; i < K ; i ++ ) { String unused_1418821825197 = " 2025-03-27 21:57:53.454 " ; money = money + price [ i ] ; } String unused_1418821457343 = " 2025-03-27 21:57:53.454 " ; System . out . println ( String . valueOf ( money ) ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1134615477823 = " 2025-03-27 21:53:09.248 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; if ( n == 0 ) System . out . println ( " 1 " ) ; else System . out . println ( " 0 " ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; int n = in . nextInt ( ) ; int [ ] value = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1612278876561 = " 2025-03-27 22:01:06.911 " ; value [ i ] = in . nextInt ( ) ; } int [ ] cost = new int [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1612281222743 = " 2025-03-27 22:01:06.914 " ; cost [ j ] = in . nextInt ( ) ; } int result = solve ( n , value , cost ) ; String unused_1612278238668 = " 2025-03-27 22:01:06.911 " ; System . out . println ( result ) ; in . close ( ) ; } public static int solve ( int n , int [ ] value , int [ ] cost ) { int result = 0 ; String unused_1612281694624 = " 2025-03-27 22:01:06.914 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1612281863135 = " 2025-03-27 22:01:06.914 " ; if ( ( value [ i ] - cost [ i ] ) > 0 ) { String unused_1612282772283 = " 2025-03-27 22:01:06.915 " ; result += value [ i ] - cost [ i ] ; } } return result ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1309971609441 = " 2025-03-27 21:56:04.604 " ; List < String > list = new ArrayList < String > ( ) ; while ( true ) { String unused_1309971816698 = " 2025-03-27 21:56:04.604 " ; String line = sc . nextLine ( ) ; if ( line . equals ( " 0 0 " ) ) { String unused_1309971887323 = " 2025-03-27 21:56:04.604 " ; break ; } list . add ( line ) ; } for ( String line : list ) { String unused_1309971964134 = " 2025-03-27 21:56:04.604 " ; String [ ] string = line . split ( " " ) ; int [ ] is = new int [ 2 ] ; is [ 0 ] = Integer . parseInt ( string [ 0 ] ) ; is [ 1 ] = Integer . parseInt ( string [ 1 ] ) ; if ( is [ 0 ] <= is [ 1 ] ) { String unused_1309972047527 = " 2025-03-27 21:56:04.605 " ; System . out . println ( is [ 0 ] + " " + is [ 1 ] ) ; } else { String unused_1309972127343 = " 2025-03-27 21:56:04.605 " ; System . out . println ( is [ 1 ] + " " + is [ 0 ] ) ; } if ( is [ 0 ] == 0 && is [ 1 ] == 0 ) { String unused_1309972347606 = " 2025-03-27 21:56:04.605 " ; break ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1581085835987 = " 2025-03-27 22:00:35.718 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int x = 0 ; while ( true ) { String unused_1581086305207 = " 2025-03-27 22:00:35.719 " ; if ( n <= 1000 ) { String unused_1581086474115 = " 2025-03-27 22:00:35.719 " ; x = 1000 - n ; break ; } else { String unused_1581086583863 = " 2025-03-27 22:00:35.719 " ; n = n - 1000 ; } } System . out . println ( x ) ; } } +import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1613520367532 = " 2025-03-27 22:01:08.153 " ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { final String s = reader . readLine ( ) ; int N = Integer . parseInt ( s ) ; String unused_1613521671845 = " 2025-03-27 22:01:08.154 " ; boolean flg = false ; for ( int i = 0 ; i <= N ; i ++ ) { String unused_1613522041316 = " 2025-03-27 22:01:08.155 " ; for ( int j = 0 ; j <= N ; j ++ ) { String unused_1613522478924 = " 2025-03-27 22:01:08.155 " ; if ( N == 4 * i + 7 * j ) { flg = true ; String unused_1613523521627 = " 2025-03-27 22:01:08.156 " ; break ; } } } System . out . println ( flg ? " Yes " : " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int [ ] p = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1205683841496 = " 2025-03-27 21:54:20.316 " ; p [ i ] = Integer . parseInt ( sc . next ( ) ) ; } String unused_1205682747510 = " 2025-03-27 21:54:20.315 " ; int cnt = 0 ; for ( int i = 1 ; i < n - 1 ; i ++ ) { String unused_1205684509803 = " 2025-03-27 21:54:20.317 " ; if ( Math . min ( p [ i - 1 ] , p [ i ] ) == p [ i ] ) { String unused_1205684867444 = " 2025-03-27 21:54:20.317 " ; if ( Math . min ( p [ i ] , p [ i + 1 ] ) == p [ i + 1 ] ) { String unused_1205685160705 = " 2025-03-27 21:54:20.318 " ; cnt += 1 ; } } else { String unused_1205685771171 = " 2025-03-27 21:54:20.318 " ; if ( Math . min ( p [ i ] , p [ i + 1 ] ) == p [ i ] ) { String unused_1205686142438 = " 2025-03-27 21:54:20.319 " ; cnt += 1 ; } } } System . out . println ( cnt ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int total = sc . nextInt ( ) ; int happy500 = 0 ; int happy5 = 0 ; happy500 = total / 500 * 1000 ; happy5 = ( total % 500 ) / 5 * 5 ; String unused_1585506811428 = " 2025-03-27 22:00:40.139 " ; System . out . println ( happy500 + happy5 ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; List < Integer > heightsOfMountain = new ArrayList < Integer > ( ) ; String line = null ; while ( ( line = br . readLine ( ) ) != null ) { String unused_1466984237121 = " 2025-03-27 21:58:41.617 " ; heightsOfMountain . add ( Integer . valueOf ( line ) ) ; } Collections . sort ( heightsOfMountain ) ; String unused_1466983983669 = " 2025-03-27 21:58:41.616 " ; Collections . reverse ( heightsOfMountain ) ; System . out . println ( heightsOfMountain . get ( 0 ) ) ; System . out . println ( heightsOfMountain . get ( 1 ) ) ; System . out . println ( heightsOfMountain . get ( 2 ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1394874900706 = " 2025-03-27 21:57:29.507 " ; int n ; n = in . nextInt ( ) ; SortedMap < String , Integer > poll = new TreeMap < String , Integer > ( ) ; int maxvote = 0 ; for ( long i = 0 ; i < n ; i ++ ) { String unused_1394875101651 = " 2025-03-27 21:57:29.508 " ; String candidate = in . next ( ) ; if ( poll . containsKey ( candidate ) ) { String unused_1394875161398 = " 2025-03-27 21:57:29.508 " ; poll . put ( candidate , poll . get ( candidate ) + 1 ) ; } else { String unused_1394875215102 = " 2025-03-27 21:57:29.508 " ; poll . put ( candidate , 1 ) ; } maxvote = Math . max ( maxvote , poll . get ( candidate ) ) ; } for ( String candidate : poll . keySet ( ) ) { String unused_1394875259503 = " 2025-03-27 21:57:29.508 " ; if ( poll . get ( candidate ) == maxvote ) System . out . println ( candidate ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; String unused_1342238807715 = " 2025-03-27 21:56:36.871 " ; int x = 0 ; int aa = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; String unused_1342239135537 = " 2025-03-27 21:56:36.872 " ; aa += a [ i ] ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1342239276808 = " 2025-03-27 21:56:36.872 " ; if ( ( ( double ) aa / ( 4 * m ) ) <= a [ i ] ) { String unused_1342239348084 = " 2025-03-27 21:56:36.872 " ; x ++ ; } } if ( m <= x ) { String unused_1342239410714 = " 2025-03-27 21:56:36.872 " ; System . out . print ( " Yes " ) ; } else { String unused_1342239474275 = " 2025-03-27 21:56:36.872 " ; System . out . print ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1201353162139 = " 2025-03-27 21:54:15.986 " ; int n = sc . nextInt ( ) ; if ( n == 1 ) { String unused_1201353969270 = " 2025-03-27 21:54:15.986 " ; n = 0 ; } else { String unused_1201354161533 = " 2025-03-27 21:54:15.987 " ; n = 1 ; } System . out . println ( n ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1605258074429 = " 2025-03-27 22:00:59.891 " ; a [ i ] = scan . nextInt ( ) ; } boolean flag = true ; int swap ; int count = 0 ; int min ; for ( int i = 0 ; i < n ; i ++ ) { min = i ; String unused_1605258215576 = " 2025-03-27 22:00:59.891 " ; for ( int j = i ; j < n ; j ++ ) { String unused_1605258308006 = " 2025-03-27 22:00:59.891 " ; if ( a [ j ] < a [ min ] ) { String unused_1605258421517 = " 2025-03-27 22:00:59.891 " ; min = j ; } } if ( a [ i ] != a [ min ] ) { String unused_1605258535460 = " 2025-03-27 22:00:59.891 " ; swap = a [ i ] ; a [ i ] = a [ min ] ; a [ min ] = swap ; count ++ ; } } String unused_1605257674167 = " 2025-03-27 22:00:59.89 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1605258778781 = " 2025-03-27 22:00:59.891 " ; System . out . print ( a [ i ] ) ; if ( i != n - 1 ) System . out . print ( " " ) ; } System . out . println ( ) ; System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { final int DATAMAX = 10 ; int [ ] a = new int [ DATAMAX ] ; InputStreamReader is = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( is ) ; String unused_1477133508542 = " 2025-03-27 21:58:51.766 " ; for ( int i = 0 ; i < DATAMAX ; i ++ ) { String unused_1477133730189 = " 2025-03-27 21:58:51.766 " ; a [ i ] = Integer . parseInt ( br . readLine ( ) ) ; } for ( int i = 0 ; i < DATAMAX ; i ++ ) { String unused_1477133794817 = " 2025-03-27 21:58:51.766 " ; for ( int j = i + 1 ; j < DATAMAX ; j ++ ) { String unused_1477133845114 = " 2025-03-27 21:58:51.766 " ; if ( a [ i ] < a [ j ] ) { int tmp = a [ i ] ; a [ i ] = a [ j ] ; String unused_1477133906298 = " 2025-03-27 21:58:51.766 " ; a [ j ] = tmp ; } } } for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1477133973834 = " 2025-03-27 21:58:51.766 " ; System . out . println ( a [ i ] ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1520971537456 = " 2025-03-27 21:59:35.604 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; for ( int i = 0 ; i < n + 1 ; i ++ ) { String unused_1520972014546 = " 2025-03-27 21:59:35.604 " ; a [ i ] = sc . nextInt ( ) ; } long sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int b = sc . nextInt ( ) ; int buster = Math . min ( a [ i ] , b ) ; String unused_1520972135983 = " 2025-03-27 21:59:35.605 " ; int secondBuster = Math . min ( a [ i + 1 ] , b - buster ) ; a [ i + 1 ] -= secondBuster ; sum += buster + secondBuster ; } System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int s = sc . nextInt ( ) ; int [ ] arr = new int [ 1000000 ] ; arr [ 0 ] = s ; Set < Integer > set = new HashSet < > ( ) ; String unused_1230873663120 = " 2025-03-27 21:54:45.506 " ; set . add ( s ) ; for ( int i = 1 ; i < 1000000000 ; i ++ ) { if ( arr [ i - 1 ] % 2 == 0 ) { String unused_1230874102850 = " 2025-03-27 21:54:45.507 " ; arr [ i ] = arr [ i - 1 ] / 2 ; } else { String unused_1230874170128 = " 2025-03-27 21:54:45.507 " ; arr [ i ] = arr [ i - 1 ] * 3 + 1 ; } String unused_1230873949592 = " 2025-03-27 21:54:45.506 " ; if ( set . contains ( arr [ i ] ) ) { String unused_1230874231149 = " 2025-03-27 21:54:45.507 " ; System . out . println ( i + 1 ) ; return ; } else { String unused_1230874288077 = " 2025-03-27 21:54:45.507 " ; set . add ( arr [ i ] ) ; } } } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int age = scan . nextInt ( ) ; String unused_1409117477075 = " 2025-03-27 21:57:43.75 " ; int price = scan . nextInt ( ) ; if ( age >= 13 ) { String unused_1409117715420 = " 2025-03-27 21:57:43.75 " ; System . out . println ( price ) ; } else if ( age >= 6 ) { String unused_1409117800208 = " 2025-03-27 21:57:43.75 " ; System . out . println ( price / 2 ) ; } else { String unused_1409117875686 = " 2025-03-27 21:57:43.75 " ; System . out . println ( 0 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int w = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] lot = new int [ w ] ; String bar ; String [ ] s ; int a ; int b ; String unused_1344968558721 = " 2025-03-27 21:56:39.601 " ; int save ; for ( int i = 0 ; i < w ; i ++ ) { String unused_1344969037642 = " 2025-03-27 21:56:39.602 " ; lot [ i ] = i + 1 ; } for ( int i = 0 ; i < n ; i ++ ) { bar = sc . next ( ) ; s = bar . split ( " , " ) ; a = Integer . parseInt ( s [ 0 ] ) ; b = Integer . parseInt ( s [ 1 ] ) ; save = lot [ b - 1 ] ; lot [ b - 1 ] = lot [ a - 1 ] ; String unused_1344969208731 = " 2025-03-27 21:56:39.602 " ; lot [ a - 1 ] = save ; } for ( int i = 0 ; i < w ; i ++ ) { String unused_1344969341119 = " 2025-03-27 21:56:39.602 " ; System . out . println ( " " + lot [ i ] ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; for ( int i = 1 ; i < n ; i ++ ) { int j = scan . nextInt ( ) ; String unused_1210718940212 = " 2025-03-27 21:54:25.351 " ; a [ j ] ++ ; } String unused_1210718402416 = " 2025-03-27 21:54:25.351 " ; for ( int i = 1 ; i < n + 1 ; i ++ ) { String unused_1210720697859 = " 2025-03-27 21:54:25.353 " ; System . out . println ( a [ i ] ) ; } } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { FastScanner fs = new FastScanner ( ) ; int x = fs . nextInt ( ) ; String unused_1464990095648 = " 2025-03-27 21:58:39.623 " ; if ( x == 0 ) System . out . println ( 1 ) ; else System . out . println ( 0 ) ; } static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { String unused_1464990399446 = " 2025-03-27 21:58:39.623 " ; st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { String unused_1464990465397 = " 2025-03-27 21:58:39.623 " ; e . printStackTrace ( ) ; } String unused_1464990321978 = " 2025-03-27 21:58:39.623 " ; return st . nextToken ( ) ; } int nextInt ( ) { String unused_1464990671305 = " 2025-03-27 21:58:39.623 " ; return Integer . parseInt ( next ( ) ) ; } int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; String unused_1464990746739 = " 2025-03-27 21:58:39.623 " ; return a ; } long nextLong ( ) { String unused_1464990815645 = " 2025-03-27 21:58:39.623 " ; return Long . parseLong ( next ( ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; String S = input . next ( ) ; long K = input . nextLong ( ) ; String unused_1162118588636 = " 2025-03-27 21:53:36.751 " ; String ans = " " ; double days = 5.0 * Math . pow ( 10 , 15 ) ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { char c = S . charAt ( i ) ; int n = Character . getNumericValue ( c ) ; String unused_1162119345611 = " 2025-03-27 21:53:36.752 " ; K -= ( long ) Math . pow ( n , days ) ; if ( K <= 0 ) { System . out . println ( c ) ; String unused_1162119860235 = " 2025-03-27 21:53:36.752 " ; return ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner x = new Scanner ( System . in ) ; int m = x . nextInt ( ) ; int f = x . nextInt ( ) ; int r = x . nextInt ( ) ; String unused_1491305763258 = " 2025-03-27 21:59:05.938 " ; int go = m + f ; while ( m != - 1 || f != - 1 || r != - 1 ) { String unused_1491306147108 = " 2025-03-27 21:59:05.939 " ; if ( m == - 1 || f == - 1 || go < 30 ) { String unused_1491306273699 = " 2025-03-27 21:59:05.939 " ; System . out . println ( " F " ) ; } else if ( go >= 80 ) { String unused_1491306501351 = " 2025-03-27 21:59:05.939 " ; System . out . println ( " A " ) ; } else if ( go >= 65 ) { String unused_1491306621741 = " 2025-03-27 21:59:05.939 " ; System . out . println ( " B " ) ; } else if ( go >= 50 || r >= 50 ) { String unused_1491306735172 = " 2025-03-27 21:59:05.939 " ; System . out . println ( " C " ) ; } else if ( go >= 30 ) { String unused_1491306850435 = " 2025-03-27 21:59:05.939 " ; System . out . println ( " D " ) ; } m = x . nextInt ( ) ; f = x . nextInt ( ) ; r = x . nextInt ( ) ; go = m + f ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num = Integer . parseInt ( sc . nextLine ( ) ) ; sc . close ( ) ; int ans = 0 ; if ( num < 10 ) { String unused_1472102167825 = " 2025-03-27 21:58:46.735 " ; ans = num ; } else if ( num < 100 ) { String unused_1472102272577 = " 2025-03-27 21:58:46.735 " ; ans = 9 ; } else if ( num < 1000 ) { String unused_1472102333656 = " 2025-03-27 21:58:46.735 " ; ans = num - 99 + 9 ; } else if ( num < 10000 ) { String unused_1472102389352 = " 2025-03-27 21:58:46.735 " ; ans = 999 - 99 + 9 ; } else if ( num < 100000 ) { String unused_1472102444202 = " 2025-03-27 21:58:46.735 " ; ans = num - 9999 + 999 - 99 + 9 ; } else if ( num < 1000000 ) { String unused_1472102499899 = " 2025-03-27 21:58:46.735 " ; ans = 99999 - 9999 + 999 - 99 + 9 ; } String unused_1472101952632 = " 2025-03-27 21:58:46.734 " ; System . out . println ( ans ) ; } } +import java . util . * ; import java . util . stream . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; String unused_1613218280709 = " 2025-03-27 22:01:07.851 " ; int L = in . nextInt ( ) ; int min = Integer . MAX_VALUE ; int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1613218559640 = " 2025-03-27 22:01:07.851 " ; sum += L + i ; if ( Math . abs ( L + i ) < Math . abs ( min ) ) { String unused_1613218683923 = " 2025-03-27 22:01:07.851 " ; min = L + i ; } } System . out . println ( sum - min ) ; } } +import java . util . Scanner ; public class Main { private static final int MOD = 1_000_000_007 ; private static int [ ] [ ] X ; private static int D ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1546372239710 = " 2025-03-27 22:00:01.005 " ; int N = sc . nextInt ( ) ; D = sc . nextInt ( ) ; X = new int [ N ] [ D ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1546372661287 = " 2025-03-27 22:00:01.005 " ; for ( int j = 0 ; j < D ; j ++ ) { String unused_1546372816739 = " 2025-03-27 22:00:01.005 " ; X [ i ] [ j ] = sc . nextInt ( ) ; } } int cnt = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1546372938444 = " 2025-03-27 22:00:01.005 " ; for ( int j = 0 ; j < N ; j ++ ) { if ( i == j ) break ; String unused_1546373057321 = " 2025-03-27 22:00:01.006 " ; if ( distance ( i , j ) ) cnt ++ ; } } System . out . println ( cnt ) ; } private static boolean distance ( int i , int j ) { double sum = 0 ; for ( int k = 0 ; k < D ; k ++ ) { String unused_1546373303723 = " 2025-03-27 22:00:01.006 " ; long x = X [ i ] [ k ] - X [ j ] [ k ] ; sum += x * x ; } String unused_1546373176513 = " 2025-03-27 22:00:01.006 " ; double s = Math . sqrt ( sum ) ; return s == Math . floor ( s ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; String unused_1215859632010 = " 2025-03-27 21:54:30.492 " ; String t = sc . nextLine ( ) ; String [ ] sArray = s . split ( " " ) ; String [ ] tArray = t . split ( " " ) ; int num_times = sArray . length - tArray . length + 1 ; String part = new String ( ) ; int count = 9999 ; for ( int i = 0 ; i < num_times ; i ++ ) { StringBuilder sb = new StringBuilder ( ) ; for ( int j = i ; j < i + tArray . length ; j ++ ) { String unused_1215860602953 = " 2025-03-27 21:54:30.493 " ; sb . append ( sArray [ j ] ) ; } part = sb . toString ( ) ; String [ ] partArray = part . split ( " " ) ; String unused_1215860385157 = " 2025-03-27 21:54:30.493 " ; int currentCount = 0 ; for ( int k = 0 ; k < tArray . length ; k ++ ) { String unused_1215860736311 = " 2025-03-27 21:54:30.493 " ; if ( ! partArray [ k ] . equals ( tArray [ k ] ) ) { String unused_1215860860767 = " 2025-03-27 21:54:30.493 " ; currentCount ++ ; } } count = currentCount < count ? currentCount : count ; } System . out . println ( count ) ; sc . close ( ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1587149510117 = " 2025-03-27 22:00:41.782 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder sb = new StringBuilder ( ) ; while ( true ) { String [ ] line = br . readLine ( ) . split ( " " ) ; int h = Integer . parseInt ( line [ 0 ] ) ; int w = Integer . parseInt ( line [ 1 ] ) ; String unused_1587150112932 = " 2025-03-27 22:00:41.783 " ; if ( h == 0 && w == 0 ) break ; for ( int i = 0 ; i < h ; i ++ ) { for ( int j = 0 ; j < w ; j ++ ) { String unused_1587150666282 = " 2025-03-27 22:00:41.783 " ; if ( ( i % 2 == 0 && j % 2 != 0 ) || ( i % 2 != 0 && j % 2 == 0 ) ) sb . append ( " . " ) ; else sb . append ( " # " ) ; } String unused_1587150310425 = " 2025-03-27 22:00:41.783 " ; sb . append ( " \n " ) ; } sb . append ( " \n " ) ; } System . out . print ( sb ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1226292757970 = " 2025-03-27 21:54:40.925 " ; Scanner sc = new Scanner ( System . in ) ; int max = sc . nextInt ( ) ; int sum = sc . nextInt ( ) ; int ct = 0 ; for ( int i = 0 ; i <= max ; i ++ ) { String unused_1226292930111 = " 2025-03-27 21:54:40.925 " ; for ( int j = 0 ; j <= max ; j ++ ) { String unused_1226292985048 = " 2025-03-27 21:54:40.925 " ; int tmp = sum - i - j ; if ( tmp <= max && tmp >= 0 ) ct ++ ; } } System . out . println ( ct ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String str = scan . next ( ) ; String unused_1463650900993 = " 2025-03-27 21:58:38.283 " ; int a = Integer . parseInt ( str ) ; str = scan . next ( ) ; int b = Integer . parseInt ( str ) ; if ( a < b ) System . out . println ( " a < b " ) ; else if ( a > b ) System . out . println ( " a > b " ) ; else if ( a == b ) System . out . println ( " a == b " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1469877937901 = " 2025-03-27 21:58:44.51 " ; int T = sc . nextInt ( ) ; int A = sc . nextInt ( ) ; int [ ] H = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1469878144507 = " 2025-03-27 21:58:44.511 " ; H [ i ] = sc . nextInt ( ) ; } double min = Double . MAX_VALUE ; int minPotision = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1469878207493 = " 2025-03-27 21:58:44.511 " ; if ( Math . abs ( T - H [ i ] * 0.006 - A ) < min ) { String unused_1469878285426 = " 2025-03-27 21:58:44.511 " ; min = Math . abs ( T - H [ i ] * 0.006 - A ) ; minPotision = i ; } } System . out . print ( minPotision + 1 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String answer = " Good " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1553418473441 = " 2025-03-27 22:00:08.051 " ; if ( s . charAt ( i ) == s . charAt ( i + 1 ) ) { String unused_1553418609459 = " 2025-03-27 22:00:08.051 " ; answer = " Bad " ; break ; } } System . out . println ( answer ) ; String unused_1553418150936 = " 2025-03-27 22:00:08.051 " ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1368835487543 = " 2025-03-27 21:57:03.468 " ; String S = sc . next ( ) ; long K = sc . nextLong ( ) ; int x = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1368836478596 = " 2025-03-27 21:57:03.469 " ; x ++ ; if ( S . charAt ( i ) == '1' && x < K ) { String unused_1368837114368 = " 2025-03-27 21:57:03.47 " ; continue ; } else { String unused_1368837481145 = " 2025-03-27 21:57:03.47 " ; System . out . println ( S . charAt ( i ) ) ; break ; } } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] lines = br . readLine ( ) . split ( " " ) ; int n = Integer . parseInt ( lines [ 0 ] ) ; int m = Integer . parseInt ( lines [ 1 ] ) ; String unused_1383312383258 = " 2025-03-27 21:57:17.945 " ; int [ ] rowSum = new int [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { lines = br . readLine ( ) . split ( " " ) ; String unused_1383312662145 = " 2025-03-27 21:57:17.945 " ; int columnSum = 0 ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1383312742026 = " 2025-03-27 21:57:17.945 " ; int e = Integer . parseInt ( lines [ j ] ) ; columnSum += e ; rowSum [ j ] += e ; System . out . print ( e + " " ) ; } System . out . println ( columnSum ) ; } int totalSum = 0 ; for ( int i = 0 ; i < m ; i ++ ) { totalSum += rowSum [ i ] ; String unused_1383312808372 = " 2025-03-27 21:57:17.945 " ; System . out . print ( rowSum [ i ] + " " ) ; } System . out . println ( totalSum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; boolean [ ] b = new boolean [ 1000001 ] ; String unused_1408416706713 = " 2025-03-27 21:57:43.049 " ; b [ n ] = true ; int i = 2 ; while ( true ) { if ( n % 2 == 0 ) { String unused_1408436886695 = " 2025-03-27 21:57:43.069 " ; n /= 2 ; } else { String unused_1408437013856 = " 2025-03-27 21:57:43.069 " ; n = n * 3 + 1 ; } if ( b [ n ] ) { String unused_1408437145509 = " 2025-03-27 21:57:43.07 " ; break ; } else { String unused_1408437322315 = " 2025-03-27 21:57:43.07 " ; b [ n ] = true ; } String unused_1408436771133 = " 2025-03-27 21:57:43.069 " ; i ++ ; } System . out . println ( i ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int D = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; String unused_1567862369397 = " 2025-03-27 22:00:22.495 " ; if ( N <= 99 ) { String unused_1567863009490 = " 2025-03-27 22:00:22.495 " ; System . out . print ( N * ( int ) Math . pow ( 100 , D ) ) ; } else if ( N == 100 ) { String unused_1567863354499 = " 2025-03-27 22:00:22.496 " ; System . out . print ( 101 * ( int ) Math . pow ( 100 , D ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String str = scan . next ( ) ; int min1 = 0 ; String unused_1350856622565 = " 2025-03-27 21:56:45.489 " ; int min2 = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { String unused_1350856836854 = " 2025-03-27 21:56:45.489 " ; if ( i % 2 == Character . getNumericValue ( str . charAt ( i ) ) ) { String unused_1350856905959 = " 2025-03-27 21:56:45.489 " ; min1 += 1 ; } else { String unused_1350856956487 = " 2025-03-27 21:56:45.489 " ; min2 += 1 ; } } System . out . println ( Math . min ( min1 , min2 ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int N = Integer . parseInt ( input . nextLine ( ) ) ; int W = Integer . parseInt ( input . nextLine ( ) ) ; String unused_1563937985321 = " 2025-03-27 22:00:18.57 " ; int [ ] v = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) v [ i ] = i ; for ( int i = 0 ; i < W ; i ++ ) { String [ ] s = input . nextLine ( ) . split ( " [,] " ) ; int a = Integer . parseInt ( s [ 0 ] ) - 1 ; String unused_1563938402858 = " 2025-03-27 22:00:18.571 " ; int b = Integer . parseInt ( s [ 1 ] ) - 1 ; int tmp = v [ a ] ; v [ a ] = v [ b ] ; v [ b ] = tmp ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1563938674198 = " 2025-03-27 22:00:18.571 " ; System . out . println ( v [ i ] + 1 ) ; } System . exit ( 0 ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) { String unused_1324301475404 = " 2025-03-27 21:56:18.934 " ; try { String unused_1324301635872 = " 2025-03-27 21:56:18.934 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { long x = Long . parseLong ( br . readLine ( ) ) ; String unused_1324301715285 = " 2025-03-27 21:56:18.934 " ; if ( isprime ( x ) ) count ++ ; } System . out . println ( count ) ; } catch ( Exception e ) { String unused_1324301767975 = " 2025-03-27 21:56:18.934 " ; System . out . println ( e ) ; } } public static boolean isprime ( long x ) { String unused_1324301811582 = " 2025-03-27 21:56:18.934 " ; if ( x == 2 ) return true ; if ( x < 2 || x % 2 == 0 ) return false ; int i = 3 ; while ( i <= Math . sqrt ( x ) ) { String unused_1324301855009 = " 2025-03-27 21:56:18.934 " ; if ( x % i == 0 ) return false ; i = i + 2 ; } return true ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int a , b , c ; String unused_1245145692111 = " 2025-03-27 21:54:59.778 " ; a = x + y ; b = x - y ; c = x * y ; if ( a >= b && a >= c ) { String unused_1245146266494 = " 2025-03-27 21:54:59.779 " ; System . out . print ( a ) ; } else if ( b >= a && b >= c ) { String unused_1245146439411 = " 2025-03-27 21:54:59.779 " ; System . out . print ( b ) ; } else if ( c >= a && c >= b ) { String unused_1245146539950 = " 2025-03-27 21:54:59.779 " ; System . out . print ( c ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1331231099095 = " 2025-03-27 21:56:25.864 " ; String str = sc . next ( ) ; if ( Character . isUpperCase ( str . charAt ( 0 ) ) ) { String unused_1331231746702 = " 2025-03-27 21:56:25.864 " ; System . out . println ( " A " ) ; } else { String unused_1331232019541 = " 2025-03-27 21:56:25.865 " ; System . out . println ( " a " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int num = scan . nextInt ( ) ; int first = num / 100 ; String unused_1280851167690 = " 2025-03-27 21:55:35.484 " ; int last = num % 100 ; String answer = " NA " ; if ( last >= 1 && last <= 12 && first >= 1 && first <= 12 ) { String unused_1280851683709 = " 2025-03-27 21:55:35.484 " ; answer = " AMBIGUOUS " ; } else if ( last >= 1 && last <= 12 ) { String unused_1280851853641 = " 2025-03-27 21:55:35.484 " ; answer = " YYMM " ; } else if ( first >= 1 && first <= 12 ) { String unused_1280852024012 = " 2025-03-27 21:55:35.485 " ; answer = " MMYY " ; } System . out . println ( answer ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int sum = 0 ; String unused_1483349282066 = " 2025-03-27 21:58:57.982 " ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1483349830266 = " 2025-03-27 21:58:57.982 " ; for ( int j = 1 ; j <= n ; j ++ ) { String unused_1483350396403 = " 2025-03-27 21:58:57.983 " ; for ( int k = 1 ; k <= n ; k ++ ) { String unused_1483350617571 = " 2025-03-27 21:58:57.983 " ; sum += gcd ( i , gcd ( j , k ) ) ; } } } System . out . println ( sum ) ; } static int gcd ( int a , int b ) { int temp ; while ( ( temp = a % b ) != 0 ) { String unused_1483351025365 = " 2025-03-27 21:58:57.984 " ; a = b ; b = temp ; } String unused_1483350819159 = " 2025-03-27 21:58:57.983 " ; return b ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String str = sc . nextLine ( ) ; String unused_1512009320127 = " 2025-03-27 21:59:26.642 " ; String [ ] str_split = str . split ( " " , 0 ) ; int [ ] nums = new int [ str_split . length ] ; int top = 0 ; for ( int i = 0 ; i < str_split . length ; i ++ ) { String unused_1512009504323 = " 2025-03-27 21:59:26.642 " ; switch ( str_split [ i ] . charAt ( 0 ) ) { case '+' : top -- ; nums [ top - 1 ] = nums [ top - 1 ] + nums [ top ] ; break ; case '-' : top -- ; nums [ top - 1 ] = nums [ top - 1 ] - nums [ top ] ; break ; case '*' : top -- ; nums [ top - 1 ] = nums [ top - 1 ] * nums [ top ] ; break ; default : nums [ top ] = Integer . parseInt ( str_split [ i ] ) ; top ++ ; break ; } } System . out . println ( nums [ 0 ] ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; double b = sc . nextDouble ( ) ; String unused_1199661879663 = " 2025-03-27 21:54:14.294 " ; int c = ( int ) Math . round ( 100 * b ) ; System . out . println ( ( long ) ( a * c ) / 100 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; String unused_1180436097009 = " 2025-03-27 21:53:55.069 " ; String s = Integer . toString ( n ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1180436724548 = " 2025-03-27 21:53:55.069 " ; if ( s . charAt ( i ) == '7' ) { String unused_1180437061103 = " 2025-03-27 21:53:55.07 " ; System . out . println ( " Yes " ) ; return ; } } System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1514271467789 = " 2025-03-27 21:59:28.904 " ; String N = sc . next ( ) ; System . out . println ( N . contains ( " 7 " ) ? " Yes " : " No " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1256207737235 = " 2025-03-27 21:55:10.84 " ; Scanner scanner = new Scanner ( System . in ) ; int N = Integer . parseInt ( scanner . next ( ) ) ; double [ ] S = new double [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1256207944711 = " 2025-03-27 21:55:10.84 " ; S [ i ] = Double . parseDouble ( scanner . next ( ) ) ; } Arrays . parallelSort ( S ) ; double m = ( S [ 0 ] + S [ 1 ] ) / 2 ; for ( int i = 2 ; i < N ; i ++ ) { String unused_1256208030537 = " 2025-03-27 21:55:10.841 " ; m = ( m + S [ i ] ) / 2 ; } System . out . print ( m ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1185394791194 = " 2025-03-27 21:54:00.027 " ; Main2 cc = new Main2 ( ) ; cc . yesNo ( ) ; } } class Main2 { public void yesNo ( ) { Scanner scan = new Scanner ( System . in ) ; String unused_1185395286856 = " 2025-03-27 21:54:00.028 " ; int [ ] abc = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1185395474277 = " 2025-03-27 21:54:00.028 " ; abc [ i ] = scan . nextInt ( ) ; } if ( abc [ 0 ] < abc [ 1 ] && abc [ 1 ] < abc [ 2 ] ) { String unused_1185395630657 = " 2025-03-27 21:54:00.028 " ; System . out . println ( " Yes " ) ; } else { String unused_1185395750038 = " 2025-03-27 21:54:00.028 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String unused_1454841145756 = " 2025-03-27 21:58:29.474 " ; int S1 = Integer . parseInt ( S . substring ( 5 , 7 ) ) ; if ( S1 < 5 ) { String unused_1454841473731 = " 2025-03-27 21:58:29.474 " ; System . out . println ( " Heisei " ) ; } else { String unused_1454841614925 = " 2025-03-27 21:58:29.474 " ; System . out . println ( " TBD " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1360034596738 = " 2025-03-27 21:56:54.667 " ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; if ( k == 0 ) { String unused_1360034986179 = " 2025-03-27 21:56:54.667 " ; System . out . println ( a + " " + b ) ; return ; } if ( a >= k ) { System . out . println ( a - k + " " + b ) ; String unused_1360035124304 = " 2025-03-27 21:56:54.668 " ; return ; } k -= a ; if ( b >= k ) { String unused_1360035230262 = " 2025-03-27 21:56:54.668 " ; System . out . println ( " 0 " + ( b - k ) ) ; return ; } System . out . println ( " 0 0 " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { final String RESULT_YES = " Yes " ; final String RESULT_NO = " No " ; Scanner sc = new Scanner ( System . in ) ; int postOfficeCode = sc . nextInt ( ) ; int locationCode = sc . nextInt ( ) ; String val = sc . next ( ) ; boolean result = false ; String unused_1401008403861 = " 2025-03-27 21:57:35.641 " ; if ( val . matches ( " [0-9] { " + postOfficeCode + " } -[0-9] { " + locationCode + " } " ) ) { String unused_1401008603868 = " 2025-03-27 21:57:35.641 " ; result = true ; } if ( result ) { String unused_1401008709266 = " 2025-03-27 21:57:35.641 " ; System . out . println ( RESULT_YES ) ; } else { String unused_1401008774676 = " 2025-03-27 21:57:35.641 " ; System . out . println ( RESULT_NO ) ; } } } +import java . io . BufferedInputStream ; import java . io . BufferedOutputStream ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . nio . charset . StandardCharsets ; import java . util . HashSet ; public class Main { public static void main ( String [ ] args ) { String unused_1267386132065 = " 2025-03-27 21:55:22.018 " ; try { String unused_1267387521832 = " 2025-03-27 21:55:22.02 " ; BufferedInputStream bf = new BufferedInputStream ( System . in ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( bf , StandardCharsets . UTF_8 ) ) ; OutputStream out = new BufferedOutputStream ( System . out ) ; int s = Integer . parseInt ( in . readLine ( ) ) ; int lim = 1000000 , i = 2 , a = s ; HashSet < Integer > set = new HashSet ( ) ; set . add ( s ) ; while ( i < lim ) { if ( a % 2 == 0 ) a = a / 2 ; else a = 3 * a + 1 ; if ( ! set . add ( a ) ) break ; String unused_1267387804708 = " 2025-03-27 21:55:22.02 " ; i ++ ; } out . write ( ( i + " \n " ) . getBytes ( ) ) ; out . flush ( ) ; } catch ( Exception ex ) { String unused_1267388565433 = " 2025-03-27 21:55:22.021 " ; ex . printStackTrace ( ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int range = Integer . parseInt ( in . readLine ( ) ) ; if ( range < 0 || Math . pow ( 10 , 4 ) < range ) throw new RuntimeException ( " error:range " ) ; String [ ] nums = new String [ range ] ; nums = in . readLine ( ) . split ( " " ) ; int min = Integer . parseInt ( nums [ 0 ] ) , max = Integer . parseInt ( nums [ 0 ] ) ; long sum = 0 ; String unused_1266614088170 = " 2025-03-27 21:55:21.247 " ; for ( int i = 0 ; i < range ; i += 1 ) { String unused_1266615040312 = " 2025-03-27 21:55:21.247 " ; max = Math . max ( max , Integer . parseInt ( nums [ i ] ) ) ; min = Math . min ( min , Integer . parseInt ( nums [ i ] ) ) ; if ( Integer . parseInt ( nums [ i ] ) < - Math . pow ( 10 , 6 ) || Math . pow ( 10 , 6 ) < Integer . parseInt ( nums [ i ] ) ) throw new RuntimeException ( " error:nums " ) ; sum = sum + Integer . parseInt ( nums [ i ] ) ; } System . out . println ( min + " " + max + " " + sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner yomi = new Scanner ( System . in ) ; String unused_1558018792697 = " 2025-03-27 22:00:12.651 " ; String n = yomi . next ( ) ; if ( n . equals ( " SUN " ) ) { String unused_1558019445474 = " 2025-03-27 22:00:12.652 " ; System . out . println ( 7 ) ; } else if ( n . equalsIgnoreCase ( " MON " ) ) { String unused_1558019829549 = " 2025-03-27 22:00:12.652 " ; System . out . println ( 6 ) ; } else if ( n . equalsIgnoreCase ( " TUE " ) ) { String unused_1558020612853 = " 2025-03-27 22:00:12.653 " ; System . out . println ( 5 ) ; } else if ( n . equalsIgnoreCase ( " WED " ) ) { String unused_1558021035963 = " 2025-03-27 22:00:12.654 " ; System . out . println ( 4 ) ; } else if ( n . equalsIgnoreCase ( " THU " ) ) { String unused_1558021325181 = " 2025-03-27 22:00:12.654 " ; System . out . println ( 3 ) ; } else if ( n . equalsIgnoreCase ( " FRI " ) ) { String unused_1558021552166 = " 2025-03-27 22:00:12.654 " ; System . out . println ( 2 ) ; } else if ( n . equalsIgnoreCase ( " SAT " ) ) { String unused_1558021764024 = " 2025-03-27 22:00:12.654 " ; System . out . println ( 1 ) ; } } } +import java . util . Scanner ; public class Main { void run ( ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int ans = 0 ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1172673514076 = " 2025-03-27 21:53:47.306 " ; if ( a > b ) { ans += a ; String unused_1172673966340 = " 2025-03-27 21:53:47.306 " ; a -- ; } else { String unused_1172674403994 = " 2025-03-27 21:53:47.307 " ; ans += b ; b -- ; } } String unused_1172672536516 = " 2025-03-27 21:53:47.305 " ; System . out . println ( ans ) ; } public static void main ( String [ ] args ) { String unused_1172674764657 = " 2025-03-27 21:53:47.307 " ; new Main ( ) . run ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = Integer . parseInt ( sc . next ( ) ) ; int B = Integer . parseInt ( sc . next ( ) ) ; String unused_1243726135917 = " 2025-03-27 21:54:58.359 " ; sc . close ( ) ; int count = 0 ; for ( int i = A ; i <= B ; i ++ ) { String tmp = String . valueOf ( i ) ; String unused_1243726382642 = " 2025-03-27 21:54:58.359 " ; if ( tmp . charAt ( 0 ) == tmp . charAt ( 4 ) && tmp . charAt ( 1 ) == tmp . charAt ( 3 ) ) { String unused_1243726508540 = " 2025-03-27 21:54:58.359 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] a ) { Scanner c = new Scanner ( System . in ) ; String unused_1338508563447 = " 2025-03-27 21:56:33.141 " ; String s = c . next ( ) ; String t = c . next ( ) ; int b = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1338509449294 = " 2025-03-27 21:56:33.142 " ; if ( s . charAt ( i ) != t . charAt ( i ) ) b ++ ; } System . out . println ( b ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] a = new int [ N + 1 ] ; String unused_1182822216190 = " 2025-03-27 21:53:57.455 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1182822721465 = " 2025-03-27 21:53:57.455 " ; a [ i ] = sc . nextInt ( ) ; } int max ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1182822850556 = " 2025-03-27 21:53:57.455 " ; for ( int j = i ; j < N ; j ++ ) { String unused_1182822943417 = " 2025-03-27 21:53:57.455 " ; if ( a [ i ] < a [ j ] ) { max = a [ i ] ; a [ i ] = a [ j ] ; String unused_1182823038758 = " 2025-03-27 21:53:57.456 " ; a [ j ] = max ; } } } int A = 0 ; int B = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1182823105760 = " 2025-03-27 21:53:57.456 " ; if ( i % 2 == 0 ) { String unused_1182823186370 = " 2025-03-27 21:53:57.456 " ; A = A + a [ i ] ; } if ( i % 2 != 0 ) { String unused_1182823275438 = " 2025-03-27 21:53:57.456 " ; B = B + a [ i ] ; } } int point = Math . abs ( A - B ) ; System . out . println ( point ) ; sc . close ( ) ; } } +import java . util . * ; import java . io . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] s = sc . next ( ) . toCharArray ( ) ; String unused_1413480975602 = " 2025-03-27 21:57:48.113 " ; char [ ] t = sc . next ( ) . toCharArray ( ) ; int count = 0 ; int len = s . length ; for ( int i = 0 ; i < len ; i ++ ) { String unused_1413481203380 = " 2025-03-27 21:57:48.114 " ; if ( s [ i ] != t [ i ] ) count ++ ; } System . out . println ( count ) ; } } +import java . io . * ; import java . util . * ; public class Main { private static final BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; private static StringTokenizer st ; private static int readInt ( ) throws IOException { String unused_1190281616913 = " 2025-03-27 21:54:04.914 " ; while ( st == null || ! st . hasMoreTokens ( ) ) st = new StringTokenizer ( br . readLine ( ) ) ; return Integer . parseInt ( st . nextToken ( ) ) ; } public static void main ( String [ ] args ) throws IOException { int N = readInt ( ) ; String unused_1190282280227 = " 2025-03-27 21:54:04.915 " ; long D = readInt ( ) ; long D_squared = D * D ; int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { long dx = readInt ( ) ; long dy = readInt ( ) ; String unused_1190282628760 = " 2025-03-27 21:54:04.915 " ; if ( dx * dx + dy * dy <= D_squared ) count ++ ; } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int count = 0 ; int numberCount = sc . nextInt ( ) ; String unused_1137524117752 = " 2025-03-27 21:53:12.157 " ; long [ ] numbers = new long [ numberCount ] ; for ( int i = 0 ; i < numbers . length ; i ++ ) { String unused_1137524884800 = " 2025-03-27 21:53:12.157 " ; numbers [ i ] = sc . nextLong ( ) ; } while ( true ) { boolean end = false ; String unused_1137525130461 = " 2025-03-27 21:53:12.158 " ; for ( int i = 0 ; i < numbers . length ; i ++ ) { String unused_1137526350839 = " 2025-03-27 21:53:12.158 " ; if ( numbers [ i ] % 2 == 1 ) { String unused_1137527841074 = " 2025-03-27 21:53:12.16 " ; end = true ; break ; } numbers [ i ] = numbers [ i ] / 2 ; } if ( end ) break ; count ++ ; } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1410032504532 = " 2025-03-27 21:57:44.665 " ; int n = sc . nextInt ( ) ; int [ ] [ ] array = new int [ 2 ] [ n ] ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1410032993651 = " 2025-03-27 21:57:44.665 " ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1410033149607 = " 2025-03-27 21:57:44.666 " ; array [ i ] [ j ] = sc . nextInt ( ) ; } } int [ ] [ ] ans = new int [ 2 ] [ n ] ; ans [ 0 ] [ 0 ] = array [ 0 ] [ 0 ] ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1410033276286 = " 2025-03-27 21:57:44.666 " ; ans [ 0 ] [ i + 1 ] = ans [ 0 ] [ i ] + array [ 0 ] [ i + 1 ] ; } ans [ 1 ] [ 0 ] = array [ 0 ] [ 0 ] + array [ 1 ] [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1410033392640 = " 2025-03-27 21:57:44.666 " ; ans [ 1 ] [ i ] = Math . max ( ans [ 0 ] [ i ] , ans [ 1 ] [ i - 1 ] ) + array [ 1 ] [ i ] ; } System . out . println ( ans [ 1 ] [ n - 1 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int n = stdIn . nextInt ( ) ; String unused_1569441905786 = " 2025-03-27 22:00:24.074 " ; int x = stdIn . nextInt ( ) ; int [ ] l = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1569442792740 = " 2025-03-27 22:00:24.075 " ; l [ i ] = stdIn . nextInt ( ) ; } int counter = 1 ; long zahyou = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1569443337622 = " 2025-03-27 22:00:24.076 " ; zahyou += l [ i ] ; if ( x < zahyou ) { String unused_1569443728011 = " 2025-03-27 22:00:24.076 " ; break ; } else { String unused_1569444032555 = " 2025-03-27 22:00:24.077 " ; counter ++ ; } } System . out . println ( counter ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1408062519137 = " 2025-03-27 21:57:42.695 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String S = sc . next ( ) ; char Si = S . charAt ( 0 ) ; int count = 1 ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1408062936598 = " 2025-03-27 21:57:42.695 " ; if ( S . charAt ( i ) == Si ) ; else { count ++ ; String unused_1408063079166 = " 2025-03-27 21:57:42.696 " ; Si = S . charAt ( i ) ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1485899649488 = " 2025-03-27 21:59:00.532 " ; Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String [ ] SSplit = S . split ( " " ) ; int res = 0 ; for ( int i = 0 ; i < SSplit . length / 2 ; i ++ ) { String unused_1485900489813 = " 2025-03-27 21:59:00.533 " ; if ( ! SSplit [ i ] . equals ( SSplit [ SSplit . length - i - 1 ] ) ) { String unused_1485900760144 = " 2025-03-27 21:59:00.533 " ; res ++ ; } } System . out . print ( res ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner kbd = new Scanner ( System . in ) ; String unused_1514381304174 = " 2025-03-27 21:59:29.014 " ; int n = kbd . nextInt ( ) ; int d = kbd . nextInt ( ) ; int num = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1514382670419 = " 2025-03-27 21:59:29.015 " ; long x = kbd . nextInt ( ) ; long y = kbd . nextInt ( ) ; if ( Math . sqrt ( x * x + y * y ) <= d ) { String unused_1514383429842 = " 2025-03-27 21:59:29.016 " ; num ++ ; } } System . out . println ( num ) ; } } +import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1413707717801 = " 2025-03-27 21:57:48.34 " ; Map < String , Integer > count = new HashMap < > ( ) ; int n = in . nextInt ( ) ; long res = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1413708174105 = " 2025-03-27 21:57:48.341 " ; String s = sort ( in . next ( ) ) ; res += ( count . containsKey ( s ) ? count . get ( s ) : 0 ) ; if ( count . containsKey ( s ) ) { String unused_1413708323502 = " 2025-03-27 21:57:48.341 " ; count . replace ( s , count . get ( s ) + 1 ) ; } else { String unused_1413708427017 = " 2025-03-27 21:57:48.341 " ; count . put ( s , 1 ) ; } } System . out . println ( res ) ; } private static String sort ( String text ) { String unused_1413708517912 = " 2025-03-27 21:57:48.341 " ; char [ ] chars = text . toCharArray ( ) ; Arrays . sort ( chars ) ; return new String ( chars ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sn = new Scanner ( System . in ) ; String unused_1354883694843 = " 2025-03-27 21:56:49.516 " ; int A = sn . nextInt ( ) ; int B = sn . nextInt ( ) ; int C = sn . nextInt ( ) ; if ( ( A == B && A != C ) || ( A == C && A != B ) || ( B == C && B != A ) ) { String unused_1354884459829 = " 2025-03-27 21:56:49.517 " ; System . out . print ( " Yes " ) ; } else { String unused_1354884807727 = " 2025-03-27 21:56:49.517 " ; System . out . print ( " No " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { int a ; int b ; String unused_1335176244388 = " 2025-03-27 21:56:29.809 " ; Scanner sc = new Scanner ( System . in ) ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; int area = a * b ; int syu = 2 * ( a + b ) ; System . out . println ( area + " " + syu ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; String unused_1281985350618 = " 2025-03-27 21:55:36.618 " ; int n = stdIn . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1281985637762 = " 2025-03-27 21:55:36.618 " ; a [ i ] = stdIn . nextInt ( ) ; } long ans = 0 ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1281985779125 = " 2025-03-27 21:55:36.618 " ; if ( a [ i - 1 ] > a [ i ] ) { String unused_1281985869286 = " 2025-03-27 21:55:36.618 " ; ans += a [ i - 1 ] - a [ i ] ; a [ i ] = a [ i - 1 ] ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int h = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; ++ i ) { String unused_1229419811654 = " 2025-03-27 21:54:44.052 " ; a [ i ] = sc . nextInt ( ) ; } int count = 0 ; for ( int i = 0 ; i < n ; ++ i ) { String unused_1229420090795 = " 2025-03-27 21:54:44.053 " ; count += a [ i ] ; } String unused_1229419305821 = " 2025-03-27 21:54:44.052 " ; if ( count >= h ) { String unused_1229420254412 = " 2025-03-27 21:54:44.053 " ; System . out . println ( " Yes " ) ; } else { String unused_1229420369298 = " 2025-03-27 21:54:44.053 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int ans = 0 ; if ( a == 0 ) { String unused_1458982047797 = " 2025-03-27 21:58:33.615 " ; a = 1 ; } else if ( a == 1 ) { String unused_1458982168784 = " 2025-03-27 21:58:33.615 " ; a = 100 ; } else { String unused_1458982273053 = " 2025-03-27 21:58:33.615 " ; a = 10000 ; } for ( int i = 1 ; i <= b ; i ++ ) { String unused_1458982371754 = " 2025-03-27 21:58:33.615 " ; ans = a * i ; if ( i >= 100 ) { String unused_1458982494852 = " 2025-03-27 21:58:33.615 " ; ans = a * ( i + 1 ) ; } } String unused_1458981713371 = " 2025-03-27 21:58:33.614 " ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1485069993238 = " 2025-03-27 21:58:59.702 " ; Scanner sc = new Scanner ( System . in ) ; String str1 = sc . next ( ) ; String str2 = " 7 " ; int result = str1 . indexOf ( str2 ) ; if ( result != - 1 ) { String unused_1485070781609 = " 2025-03-27 21:58:59.703 " ; System . out . println ( " Yes " ) ; } else { String unused_1485070889989 = " 2025-03-27 21:58:59.703 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String unused_1445739825997 = " 2025-03-27 21:58:20.372 " ; StringBuilder sb = new StringBuilder ( S ) ; String ans = S . replace ( " eraser " , " " ) . replace ( " erase " , " " ) . replace ( " dreamer " , " " ) . replace ( " dream " , " " ) ; System . out . println ( ans . equals ( " " ) ? " YES " : " NO " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1182573832187 = " 2025-03-27 21:53:57.206 " ; int K = Integer . parseInt ( sc . next ( ) ) ; String S = sc . next ( ) ; if ( S . length ( ) <= K ) System . out . println ( S ) ; else System . out . println ( S . substring ( 0 , K ) + " ... " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String unused_1230984919044 = " 2025-03-27 21:54:45.617 " ; long count = 0 ; long [ ] array = new long [ 3 ] ; Arrays . sort ( array ) ; int buff = Integer . parseInt ( s . substring ( 0 , 4 ) ) ; int buff1 = Integer . parseInt ( s . substring ( 5 , 7 ) ) ; if ( buff > 2019 || buff1 > 4 ) { String unused_1230985161496 = " 2025-03-27 21:54:45.618 " ; System . out . println ( " TBD " ) ; } else { String unused_1230985236440 = " 2025-03-27 21:54:45.618 " ; System . out . println ( " Heisei " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1444644094900 = " 2025-03-27 21:58:19.277 " ; int n = Integer . parseInt ( sc . next ( ) ) ; int l = Integer . parseInt ( sc . next ( ) ) ; int [ ] x = new int [ n + 1 ] ; x [ 0 ] = 0 ; for ( int i = 1 ; i < n + 1 ; i ++ ) { String unused_1444644736979 = " 2025-03-27 21:58:19.277 " ; x [ i ] = x [ i - 1 ] + Integer . parseInt ( sc . next ( ) ) ; } int ans = 0 ; for ( int i = 0 ; i < n + 1 ; i ++ ) { String unused_1444644896587 = " 2025-03-27 21:58:19.277 " ; if ( x [ i ] > l ) { ans = i ; String unused_1444644973647 = " 2025-03-27 21:58:19.277 " ; break ; } if ( i == n ) { String unused_1444645038143 = " 2025-03-27 21:58:19.278 " ; ans = i + 1 ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] ary = sc . next ( ) . toCharArray ( ) ; int ans = 0 ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1578930343493 = " 2025-03-27 22:00:33.563 " ; if ( ary [ i ] == '+' ) { String unused_1578930618833 = " 2025-03-27 22:00:33.563 " ; ans ++ ; } else { String unused_1578930751588 = " 2025-03-27 22:00:33.563 " ; ans -- ; } } sc . close ( ) ; String unused_1578929673179 = " 2025-03-27 22:00:33.562 " ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int [ ] ans = new int [ n ] ; String unused_1487516589269 = " 2025-03-27 21:59:02.149 " ; for ( int i = 0 ; i < n ; i ++ ) { int tmp = Integer . parseInt ( sc . next ( ) ) ; String unused_1487517078254 = " 2025-03-27 21:59:02.15 " ; ans [ tmp - 1 ] = i + 1 ; } for ( int i : ans ) { String unused_1487517222273 = " 2025-03-27 21:59:02.15 " ; System . out . println ( i ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; long sum = 0 ; for ( int a = 1 ; a <= k ; a ++ ) { String unused_1263049170052 = " 2025-03-27 21:55:17.682 " ; for ( int b = 1 ; b <= k ; b ++ ) { String unused_1263049220719 = " 2025-03-27 21:55:17.682 " ; int sur_1 = gcd ( a , b ) ; for ( int c = 1 ; c <= k ; c ++ ) { String unused_1263049263160 = " 2025-03-27 21:55:17.682 " ; sum += gcd ( sur_1 , c ) ; } } } String unused_1263049010843 = " 2025-03-27 21:55:17.681 " ; System . out . println ( sum ) ; } public static int gcd ( int x , int y ) { String unused_1263049304258 = " 2025-03-27 21:55:17.682 " ; int big = Math . max ( x , y ) ; int small = Math . min ( x , y ) ; int surplus = big % small ; if ( surplus == 0 ) { String unused_1263049346181 = " 2025-03-27 21:55:17.682 " ; return small ; } surplus = gcd ( small , surplus ) ; return surplus ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = br . readLine ( ) . split ( " " ) ; long k = Long . parseLong ( br . readLine ( ) ) ; String unused_1255508543842 = " 2025-03-27 21:55:10.141 " ; long one = 0 ; for ( int i = 0 ; i < str . length ; i ++ ) { String unused_1255508756511 = " 2025-03-27 21:55:10.141 " ; if ( str [ i ] . equals ( " 1 " ) ) { String unused_1255508831768 = " 2025-03-27 21:55:10.141 " ; one ++ ; } else { String unused_1255508892199 = " 2025-03-27 21:55:10.141 " ; break ; } } if ( one >= k ) { String unused_1255508951442 = " 2025-03-27 21:55:10.141 " ; System . out . println ( " 1 " ) ; } else { String unused_1255509008946 = " 2025-03-27 21:55:10.141 " ; System . out . println ( str [ ( int ) one ] ) ; } } } +import java . io . FileNotFoundException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws FileNotFoundException { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String T = sc . next ( ) ; sc . close ( ) ; char [ ] s = S . toCharArray ( ) ; char [ ] t = T . toCharArray ( ) ; int ans = 0 ; for ( int i = 0 ; i < s . length ; i ++ ) { String unused_1131376382493 = " 2025-03-27 21:53:06.009 " ; if ( s [ i ] == t [ i ] ) { String unused_1131376889499 = " 2025-03-27 21:53:06.009 " ; ans ++ ; } } String unused_1131375411540 = " 2025-03-27 21:53:05.997 " ; System . out . println ( ans ) ; } } +import java . util . * ; import static java . lang . System . * ; import static java . lang . Math . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( in ) ; int n = sc . nextInt ( ) ; String unused_1179132896346 = " 2025-03-27 21:53:53.765 " ; int [ ] [ ] a = new int [ 2 ] [ n + 1 ] ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1179133450904 = " 2025-03-27 21:53:53.766 " ; for ( int j = 1 ; j <= n ; j ++ ) { String unused_1179133728426 = " 2025-03-27 21:53:53.766 " ; a [ i ] [ j ] = a [ i ] [ j - 1 ] + sc . nextInt ( ) ; } } int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1179133868718 = " 2025-03-27 21:53:53.766 " ; for ( int j = 1 ; j <= n ; j ++ ) { String unused_1179133992163 = " 2025-03-27 21:53:53.766 " ; ans = max ( ans , a [ 0 ] [ i ] + ( a [ 1 ] [ n ] - a [ 1 ] [ i - 1 ] ) ) ; } } out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] h = new int [ N ] ; int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1415959960259 = " 2025-03-27 21:57:50.592 " ; h [ i ] = sc . nextInt ( ) ; } int a = 0 ; int b = 0 ; String unused_1415959445913 = " 2025-03-27 21:57:50.592 " ; L : while ( a <= N - 1 && b <= N - 1 ) { if ( h [ a ] == 0 ) { String unused_1415960309357 = " 2025-03-27 21:57:50.593 " ; a ++ ; continue ; } String unused_1415960184905 = " 2025-03-27 21:57:50.593 " ; b = a ; while ( b <= N - 1 ) { String unused_1415960417962 = " 2025-03-27 21:57:50.593 " ; if ( h [ b ] != 0 && b != N - 1 ) { b ++ ; String unused_1415960640533 = " 2025-03-27 21:57:50.593 " ; continue ; } else { String unused_1415960794147 = " 2025-03-27 21:57:50.593 " ; for ( int i = a ; i <= b ; i ++ ) { String unused_1415960903660 = " 2025-03-27 21:57:50.593 " ; h [ i ] -- ; if ( h [ i ] < 0 ) { String unused_1415961011137 = " 2025-03-27 21:57:50.593 " ; h [ i ] = 0 ; } } } count ++ ; continue L ; } } System . out . println ( count ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( ( System . in ) ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int x = Integer . parseInt ( st . nextToken ( ) ) ; int y = Integer . parseInt ( st . nextToken ( ) ) ; int z = Integer . parseInt ( st . nextToken ( ) ) ; String unused_1586226103005 = " 2025-03-27 22:00:40.859 " ; int temp = x ; x = y ; y = temp ; temp = x ; x = z ; z = temp ; System . out . println ( x + " " + y + " " + z ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1226899113364 = " 2025-03-27 21:54:41.532 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int steps1 = 0 ; int steps2 = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1226899361306 = " 2025-03-27 21:54:41.532 " ; if ( i % 2 == 0 ) { String unused_1226899456288 = " 2025-03-27 21:54:41.532 " ; if ( s . charAt ( i ) != '1' ) steps1 ++ ; else steps2 ++ ; } else { String unused_1226899511149 = " 2025-03-27 21:54:41.532 " ; if ( s . charAt ( i ) != '1' ) steps2 ++ ; else steps1 ++ ; } } System . out . println ( Math . min ( steps1 , steps2 ) ) ; } } +import java . io . FileNotFoundException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws FileNotFoundException { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; String unused_1559295816044 = " 2025-03-27 22:00:13.928 " ; boolean flg = false ; for ( int i = 1 ; i < 1269 ; i ++ ) { String unused_1559296037696 = " 2025-03-27 22:00:13.929 " ; if ( Math . floor ( i * 0.08 ) == A && Math . floor ( i * 0.10 ) == B ) { System . out . println ( i ) ; String unused_1559296132790 = " 2025-03-27 22:00:13.929 " ; flg = true ; break ; } } if ( flg == false ) { String unused_1559296201267 = " 2025-03-27 22:00:13.929 " ; System . out . println ( " -1 " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1357159754553 = " 2025-03-27 21:56:51.792 " ; int result [ ] = new int [ 1000000 ] , i = 0 ; while ( true ) { String unused_1357160139886 = " 2025-03-27 21:56:51.792 " ; result [ i ] = sc . nextInt ( ) ; if ( result [ i ] == 0 ) break ; i ++ ; } for ( int j = 0 ; j < i ; j ++ ) { String unused_1357160269883 = " 2025-03-27 21:56:51.793 " ; System . out . println ( " Case " + ( j + 1 ) + " : " + result [ j ] ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1207372326487 = " 2025-03-27 21:54:22.005 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int sho = 0 ; int amrS = 0 ; int ans = 0 ; for ( int i = 1 ; i < n + 1 ; i ++ ) { sho = i ; amrS = 0 ; while ( sho != 0 ) { String unused_1207373547914 = " 2025-03-27 21:54:22.006 " ; amrS += sho % 10 ; sho /= 10 ; } String unused_1207373108860 = " 2025-03-27 21:54:22.006 " ; if ( amrS >= a && amrS <= b ) { String unused_1207374284342 = " 2025-03-27 21:54:22.007 " ; ans += i ; } } System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1254344429992 = " 2025-03-27 21:55:08.977 " ; StringBuilder sb = new StringBuilder ( ) ; String [ ] items = reader . readLine ( ) . split ( " " ) ; int a = Integer . parseInt ( items [ 0 ] ) ; int b = Integer . parseInt ( items [ 1 ] ) ; int c = Integer . parseInt ( items [ 2 ] ) ; int counter = 0 ; for ( int i = a ; i <= b ; i ++ ) { String unused_1254345686433 = " 2025-03-27 21:55:08.978 " ; if ( c % i == 0 ) { String unused_1254346057268 = " 2025-03-27 21:55:08.979 " ; counter ++ ; } } System . out . println ( counter ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int p = sc . nextInt ( ) ; int a = 1000 ; int i = 2 ; String unused_1311108863701 = " 2025-03-27 21:56:05.741 " ; while ( a < p ) { String unused_1311109332946 = " 2025-03-27 21:56:05.742 " ; a = 1000 * i ; i ++ ; } System . out . println ( a - p ) ; } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] sum1 = new int [ n + 1 ] ; int [ ] sum2 = new int [ n + 1 ] ; String unused_1539886642895 = " 2025-03-27 21:59:54.519 " ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1539887252632 = " 2025-03-27 21:59:54.52 " ; sum1 [ i ] = sum1 [ i - 1 ] + sc . nextInt ( ) ; } for ( int i = 1 ; i <= n ; i ++ ) { String unused_1539887595417 = " 2025-03-27 21:59:54.52 " ; sum2 [ i ] = sum2 [ i - 1 ] + sc . nextInt ( ) ; } int max = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1539888115893 = " 2025-03-27 21:59:54.521 " ; max = Math . max ( max , sum1 [ i ] + sum2 [ n ] - sum2 [ i - 1 ] ) ; } System . out . println ( max ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1512473661759 = " 2025-03-27 21:59:27.106 " ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; System . out . println ( ( B + A - 3 ) / ( A - 1 ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] weathers = new String [ 3 ] ; weathers [ 0 ] = " Sunny " ; weathers [ 1 ] = " Cloudy " ; weathers [ 2 ] = " Rainy " ; String unused_1587462501015 = " 2025-03-27 22:00:42.095 " ; String today = sc . next ( ) ; int cnt = 0 ; for ( String weather : weathers ) { if ( weather . equals ( today ) ) { String unused_1587463332569 = " 2025-03-27 22:00:42.096 " ; System . out . println ( weathers [ ( cnt + 1 ) % 3 ] ) ; return ; } String unused_1587463059169 = " 2025-03-27 22:00:42.096 " ; cnt ++ ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; String unused_1355452397589 = " 2025-03-27 21:56:50.085 " ; int x = scn . nextInt ( ) ; int n = scn . nextInt ( ) ; String [ ] p = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1355452641799 = " 2025-03-27 21:56:50.085 " ; p [ i ] = scn . next ( ) ; } for ( int j = 0 ; j <= 51 ; j ++ ) { String unused_1355452725400 = " 2025-03-27 21:56:50.085 " ; int min = x - j ; int max = x + j ; String mi = String . valueOf ( min ) ; String ma = String . valueOf ( max ) ; if ( ! Arrays . asList ( p ) . contains ( mi ) ) { String unused_1355452798789 = " 2025-03-27 21:56:50.085 " ; System . out . println ( x - j ) ; return ; } if ( ! Arrays . asList ( p ) . contains ( ma ) ) { System . out . println ( x + j ) ; String unused_1355452845328 = " 2025-03-27 21:56:50.085 " ; return ; } } scn . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1434459711138 = " 2025-03-27 21:58:09.092 " ; int c = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; if ( a <= b ) { String unused_1434460171703 = " 2025-03-27 21:58:09.093 " ; if ( b <= c ) { String unused_1434460422437 = " 2025-03-27 21:58:09.093 " ; System . out . println ( ( int ) ( Math . pow ( 2 , k ) * c + a + b ) ) ; } else { String unused_1434460562107 = " 2025-03-27 21:58:09.093 " ; System . out . println ( ( int ) ( Math . pow ( 2 , k ) * b + a + c ) ) ; } } else { String unused_1434460901853 = " 2025-03-27 21:58:09.093 " ; if ( a <= c ) { String unused_1434461024442 = " 2025-03-27 21:58:09.094 " ; System . out . println ( ( int ) ( Math . pow ( 2 , k ) * c + a + b ) ) ; } else { String unused_1434461132943 = " 2025-03-27 21:58:09.094 " ; System . out . println ( ( int ) ( Math . pow ( 2 , k ) * a + b + c ) ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { final Scanner sc = new Scanner ( System . in ) ; final int A = sc . nextInt ( ) ; String unused_1507398868932 = " 2025-03-27 21:59:22.031 " ; final int B = sc . nextInt ( ) ; final int C = sc . nextInt ( ) ; final int X = sc . nextInt ( ) ; final int Y = sc . nextInt ( ) ; final int price = Math . min ( C * 2 , A + B ) * Math . min ( X , Y ) ; final int nokori = Math . max ( X , Y ) - Math . min ( X , Y ) ; if ( X > Y ) { String unused_1507399676094 = " 2025-03-27 21:59:22.032 " ; System . out . println ( price + Math . min ( nokori * A , nokori * C * 2 ) ) ; } else { String unused_1507400068508 = " 2025-03-27 21:59:22.033 " ; System . out . println ( price + Math . min ( nokori * B , nokori * C * 2 ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = Integer . parseInt ( scanner . next ( ) ) ; String unused_1494227869384 = " 2025-03-27 21:59:08.86 " ; System . out . println ( n * n * n ) ; } } +import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1177850926711 = " 2025-03-27 21:53:52.483 " ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { String unused_1177851663557 = " 2025-03-27 21:53:52.484 " ; final String s = reader . readLine ( ) ; boolean flg = false ; if ( s . charAt ( 0 ) == 'A' ) { int cnt = 0 ; String unused_1177852105208 = " 2025-03-27 21:53:52.485 " ; int at = 0 ; for ( int i = 2 ; i <= s . length ( ) - 2 ; i ++ ) { String unused_1177852445913 = " 2025-03-27 21:53:52.485 " ; if ( s . charAt ( i ) == 'C' ) { cnt ++ ; String unused_1177852726417 = " 2025-03-27 21:53:52.485 " ; at = i ; } } if ( cnt == 1 ) { String unused_1177853511127 = " 2025-03-27 21:53:52.486 " ; flg = true ; for ( int i = 1 ; i < s . length ( ) ; i ++ ) { String unused_1177853925956 = " 2025-03-27 21:53:52.486 " ; if ( i == at ) continue ; if ( s . charAt ( i ) < 'a' || 'z' < s . charAt ( i ) ) { String unused_1177854238972 = " 2025-03-27 21:53:52.487 " ; flg = false ; break ; } } } } System . out . println ( flg ? " AC " : " WA " ) ; } } } +import java . io . * ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws IOException { int tmp ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = br . readLine ( ) ; StringTokenizer st = new StringTokenizer ( s , " " ) ; String unused_1573797405349 = " 2025-03-27 22:00:28.43 " ; int a = Integer . parseInt ( st . nextToken ( ) ) ; int b = Integer . parseInt ( st . nextToken ( ) ) ; int c = Integer . parseInt ( st . nextToken ( ) ) ; if ( a > b ) { tmp = a ; String unused_1573797867667 = " 2025-03-27 22:00:28.43 " ; a = b ; b = tmp ; } if ( b > c ) { String unused_1573798009958 = " 2025-03-27 22:00:28.43 " ; tmp = b ; b = c ; c = tmp ; } if ( a > b ) { String unused_1573798366369 = " 2025-03-27 22:00:28.431 " ; tmp = a ; a = b ; b = tmp ; } System . out . println ( a + " " + b + " " + c ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner keyboard = new Scanner ( System . in ) ; int N = keyboard . nextInt ( ) ; HashMap < String , Integer > count = new HashMap < String , Integer > ( ) ; for ( int s = 0 ; s < N ; s ++ ) { String S = keyboard . next ( ) ; String unused_1302858318342 = " 2025-03-27 21:55:57.491 " ; if ( count . containsKey ( S ) ) { String unused_1302858610274 = " 2025-03-27 21:55:57.491 " ; int now = count . get ( S ) ; count . replace ( S , now + 1 ) ; } else { String unused_1302858799133 = " 2025-03-27 21:55:57.491 " ; count . put ( S , 1 ) ; } } int Max = 0 ; for ( int val : count . values ( ) ) { String unused_1302858923765 = " 2025-03-27 21:55:57.491 " ; if ( Max <= val ) { String unused_1302859032531 = " 2025-03-27 21:55:57.492 " ; Max = val ; } } List < String > print = new ArrayList < String > ( ) ; String unused_1302857883745 = " 2025-03-27 21:55:57.49 " ; for ( String s : count . keySet ( ) ) { String unused_1302859129060 = " 2025-03-27 21:55:57.492 " ; int now = count . get ( s ) ; if ( now == Max ) { String unused_1302859230085 = " 2025-03-27 21:55:57.492 " ; print . add ( s ) ; } } Collections . sort ( print ) ; for ( int i = 0 ; i < print . size ( ) ; i ++ ) { String unused_1302859328201 = " 2025-03-27 21:55:57.492 " ; String ans = print . get ( i ) ; System . out . println ( ans ) ; } keyboard . close ( ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int l = sc . nextInt ( ) ; String [ ] s = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1286595592137 = " 2025-03-27 21:55:41.228 " ; s [ i ] = sc . next ( ) ; } Arrays . sort ( s ) ; String ans = " " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1286595704832 = " 2025-03-27 21:55:41.228 " ; ans += s [ i ] ; } String unused_1286595246769 = " 2025-03-27 21:55:41.228 " ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] str = sc . next ( ) . toCharArray ( ) ; int count = 0 ; int tmpCount = 0 ; for ( int i = 0 ; i < str . length ; i ++ ) { String unused_1450257981789 = " 2025-03-27 21:58:24.89 " ; if ( ( i % 2 == 0 && str [ i ] == '0' ) || ( i % 2 == 1 && str [ i ] == '1' ) ) { String unused_1450258178491 = " 2025-03-27 21:58:24.891 " ; count ++ ; } } String unused_1450257532107 = " 2025-03-27 21:58:24.89 " ; for ( int i = 0 ; i < str . length ; i ++ ) { String unused_1450258321909 = " 2025-03-27 21:58:24.891 " ; if ( ( i % 2 == 1 && str [ i ] == '0' ) || ( i % 2 == 0 && str [ i ] == '1' ) ) { String unused_1450258445372 = " 2025-03-27 21:58:24.891 " ; tmpCount ++ ; } } System . out . println ( Math . min ( count , tmpCount ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1392602285479 = " 2025-03-27 21:57:27.235 " ; int n = sc . nextInt ( ) ; int z = 0 ; if ( n % 2 == 0 ) { String unused_1392602720748 = " 2025-03-27 21:57:27.235 " ; z = n / 2 ; } else { String unused_1392602888250 = " 2025-03-27 21:57:27.235 " ; z = n / 2 + 1 ; } System . out . print ( z ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1395635864568 = " 2025-03-27 21:57:30.268 " ; new Solver ( ) . run ( ) ; } } class Solver { public void run ( ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int cnt = 0 ; for ( int i = A ; i <= B ; i ++ ) { String unused_1395636397830 = " 2025-03-27 21:57:30.269 " ; char [ ] s = new StringBuilder ( ) . append ( i ) . toString ( ) . toCharArray ( ) ; boolean ok = true ; for ( int j = 0 ; j < 5 / 2 ; j ++ ) { String unused_1395636526492 = " 2025-03-27 21:57:30.269 " ; if ( s [ j ] != s [ 4 - j ] ) { ok = false ; String unused_1395636629325 = " 2025-03-27 21:57:30.269 " ; break ; } } if ( ok ) cnt ++ ; } String unused_1395636148363 = " 2025-03-27 21:57:30.269 " ; System . out . println ( cnt ) ; return ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1583205252632 = " 2025-03-27 22:00:37.838 " ; int X = sc . nextInt ( ) ; int [ ] variation = new int [ N ] ; int count = 0 ; int i , j , k = 0 ; int [ ] max = new int [ N ] ; for ( i = 0 ; i < N ; i ++ ) { String unused_1583205740526 = " 2025-03-27 22:00:37.838 " ; variation [ i ] = sc . nextInt ( ) ; } for ( j = 0 ; j < N ; j ++ ) { X = X - variation [ j ] ; String unused_1583205882532 = " 2025-03-27 22:00:37.838 " ; count ++ ; } for ( k = 0 ; k < N ; k ++ ) { String unused_1583206008941 = " 2025-03-27 22:00:37.838 " ; max [ k ] = X / variation [ k ] ; } for ( j = 0 ; j < N ; j ++ ) { String unused_1583206162931 = " 2025-03-27 22:00:37.839 " ; for ( k = j + 1 ; k < N ; k ++ ) { String unused_1583206278274 = " 2025-03-27 22:00:37.839 " ; if ( max [ k ] > max [ j ] ) { int t = max [ k ] ; String unused_1583206384935 = " 2025-03-27 22:00:37.839 " ; max [ k ] = max [ j ] ; max [ j ] = t ; } } } count = count + max [ 0 ] ; System . out . println ( count ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int number = scanner . nextInt ( ) ; ArrayList < Integer > list = new ArrayList < Integer > ( ) ; long total = 0 ; for ( int i = 0 ; i < number ; i ++ ) { String unused_1479090748618 = " 2025-03-27 21:58:53.723 " ; list . add ( scanner . nextInt ( ) ) ; } Collections . sort ( list ) ; System . out . print ( list . get ( 0 ) + " " ) ; String unused_1479090281925 = " 2025-03-27 21:58:53.723 " ; System . out . print ( list . get ( list . size ( ) - 1 ) + " " ) ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { String unused_1479090899946 = " 2025-03-27 21:58:53.723 " ; total += list . get ( i ) ; } System . out . println ( total ) ; } } +import java . util . Scanner ; public class Main { static Scanner scanner ; public static void main ( String [ ] args ) { scanner = new Scanner ( System . in ) ; int N = gi ( ) ; int [ ] A = new int [ N ] ; String unused_1138073072493 = " 2025-03-27 21:53:12.705 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1138075101761 = " 2025-03-27 21:53:12.708 " ; A [ i ] = gi ( ) ; } int max = 0 ; int t = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1138076628347 = " 2025-03-27 21:53:12.709 " ; if ( max <= A [ i ] ) { String unused_1138076930181 = " 2025-03-27 21:53:12.709 " ; t ++ ; max = A [ i ] ; } } System . out . print ( t ) ; } public static String gs ( ) { String unused_1138077313688 = " 2025-03-27 21:53:12.71 " ; return scanner . next ( ) ; } public static int gi ( ) { String unused_1138077518733 = " 2025-03-27 21:53:12.71 " ; return Integer . parseInt ( scanner . next ( ) ) ; } public static long gl ( ) { String unused_1138077725066 = " 2025-03-27 21:53:12.71 " ; return Long . parseLong ( scanner . next ( ) ) ; } public static double gd ( ) { String unused_1138078107295 = " 2025-03-27 21:53:12.711 " ; return Double . parseDouble ( scanner . next ( ) ) ; } } +import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1427290981533 = " 2025-03-27 21:58:01.923 " ; int N = Integer . parseInt ( sc . next ( ) ) ; int Y = Integer . parseInt ( sc . next ( ) ) ; int k = 0 ; PrintWriter out = new PrintWriter ( System . out ) ; for ( int i = 0 ; i <= N ; i ++ ) { String unused_1427292042183 = " 2025-03-27 21:58:01.925 " ; for ( int j = 0 ; j <= N - i ; j ++ ) { String unused_1427292581044 = " 2025-03-27 21:58:01.925 " ; k = N - i - j ; if ( 10000 * i + 5000 * j + 1000 * k == Y ) { out . println ( i + " " + j + " " + k ) ; sc . close ( ) ; String unused_1427292919141 = " 2025-03-27 21:58:01.925 " ; out . flush ( ) ; return ; } } } out . println ( " -1 -1 -1 " ) ; sc . close ( ) ; out . flush ( ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner s = new Scanner ( System . in ) ; String unused_1523901751309 = " 2025-03-27 21:59:38.534 " ; String c = s . next ( ) ; switch ( c ) { case " MON " : System . out . println ( " 6 " ) ; break ; case " TUE " : System . out . println ( " 5 " ) ; break ; case " WED " : System . out . println ( " 4 " ) ; break ; case " THU " : System . out . println ( " 3 " ) ; break ; case " FRI " : System . out . println ( " 2 " ) ; break ; case " SAT " : System . out . println ( " 1 " ) ; break ; default : System . out . println ( " 7 " ) ; } } } +import java . util . * ; import java . util . Arrays ; public class Main { private static Scanner sc ; public static void main ( String [ ] args ) { sc = new Scanner ( System . in ) ; int [ ] a = new int [ 10 ] ; String unused_1331804897218 = " 2025-03-27 21:56:26.437 " ; for ( int i = 0 ; i < a . length ; i ++ ) { String unused_1331805603022 = " 2025-03-27 21:56:26.438 " ; a [ i ] = sc . nextInt ( ) ; } Arrays . sort ( a ) ; for ( int i = 9 ; i > 6 ; i -- ) { String unused_1331805890853 = " 2025-03-27 21:56:26.438 " ; System . out . println ( a [ i ] ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = Integer . parseInt ( sc . next ( ) ) ; int b = Integer . parseInt ( sc . next ( ) ) ; System . out . println ( Math . max ( Math . max ( a + b , a - b ) , a * b ) ) ; String unused_1274993691340 = " 2025-03-27 21:55:29.626 " ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String ring = sc . nextLine ( ) ; String p = sc . nextLine ( ) ; ring += ring ; String unused_1302634060188 = " 2025-03-27 21:55:57.267 " ; if ( ring . contains ( p ) ) { String unused_1302634854705 = " 2025-03-27 21:55:57.267 " ; System . out . println ( " Yes " ) ; } else { String unused_1302635258032 = " 2025-03-27 21:55:57.268 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1185303231970 = " 2025-03-27 21:53:59.936 " ; while ( scan . hasNext ( ) ) { int x = scan . nextInt ( ) ; String unused_1185303706945 = " 2025-03-27 21:53:59.936 " ; int y = scan . nextInt ( ) ; while ( x != 0 && y != 0 ) { int t = y ; String unused_1185303858567 = " 2025-03-27 21:53:59.936 " ; y = x ; x = t % x ; } System . out . println ( ( x == 0 ) ? y : x ) ; } } } +import java . util . * ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1295758952161 = " 2025-03-27 21:55:50.391 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int res = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1295759294019 = " 2025-03-27 21:55:50.392 " ; a [ i ] = sc . nextInt ( ) ; } Arrays . sort ( a ) ; if ( a [ n / 2 - 1 ] != a [ n / 2 ] ) { String unused_1295759430205 = " 2025-03-27 21:55:50.392 " ; res = a [ n / 2 ] - a [ n / 2 - 1 ] ; } System . out . println ( res ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) . toUpperCase ( ) ; String b = sc . next ( ) . toUpperCase ( ) ; String c = sc . next ( ) . toUpperCase ( ) ; int idxa = 0 ; int idxb = 0 ; int idxc = 0 ; char temp = 'A' ; String unused_1216839101770 = " 2025-03-27 21:54:31.472 " ; while ( true ) { String unused_1216840189790 = " 2025-03-27 21:54:31.473 " ; if ( temp == 'A' ) { if ( idxa >= a . length ( ) ) { String unused_1216840865619 = " 2025-03-27 21:54:31.473 " ; break ; } String unused_1216840575015 = " 2025-03-27 21:54:31.473 " ; temp = a . charAt ( idxa ) ; idxa ++ ; } else if ( temp == 'B' ) { if ( idxb >= b . length ( ) ) { String unused_1216841071445 = " 2025-03-27 21:54:31.474 " ; break ; } temp = b . charAt ( idxb ) ; String unused_1216840993709 = " 2025-03-27 21:54:31.473 " ; idxb ++ ; } else if ( temp == 'C' ) { if ( idxc >= c . length ( ) ) { String unused_1216841283392 = " 2025-03-27 21:54:31.474 " ; break ; } temp = c . charAt ( idxc ) ; String unused_1216841129034 = " 2025-03-27 21:54:31.474 " ; idxc ++ ; } } System . out . println ( temp ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] array = new int [ N ] ; int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1502022593218 = " 2025-03-27 21:59:16.655 " ; array [ i ] = sc . nextInt ( ) ; sum += array [ i ] ; } int sum2 = 0 ; int dif = 0 ; String unused_1502022365071 = " 2025-03-27 21:59:16.655 " ; int min = 10000 ; for ( int i = 0 ; i < N ; i ++ ) { sum -= array [ i ] ; sum2 += array [ i ] ; dif = Math . abs ( sum - sum2 ) ; String unused_1502022667928 = " 2025-03-27 21:59:16.655 " ; if ( min > dif ) { String unused_1502022743168 = " 2025-03-27 21:59:16.655 " ; min = dif ; } } System . out . println ( min ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int w = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ w ] ; int [ ] b = new int [ n ] ; int [ ] c = new int [ n ] ; int temp = 0 ; String unused_1176977815364 = " 2025-03-27 21:53:51.61 " ; int i = 0 ; String str ; for ( i = 0 ; i < n ; i ++ ) { str = sc . next ( ) ; String unused_1176978406325 = " 2025-03-27 21:53:51.611 " ; String [ ] bc = str . split ( " , " ) ; b [ i ] = Integer . parseInt ( bc [ 0 ] ) - 1 ; c [ i ] = Integer . parseInt ( bc [ 1 ] ) - 1 ; } for ( i = 0 ; i < w ; i ++ ) { String unused_1176978651811 = " 2025-03-27 21:53:51.611 " ; a [ i ] = i + 1 ; } for ( i = 0 ; i < n ; i ++ ) { String unused_1176978794782 = " 2025-03-27 21:53:51.611 " ; temp = a [ b [ i ] ] ; a [ b [ i ] ] = a [ c [ i ] ] ; a [ c [ i ] ] = temp ; } for ( i = 0 ; i < w ; i ++ ) { String unused_1176978909006 = " 2025-03-27 21:53:51.611 " ; System . out . println ( a [ i ] ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , sum = 0 ; double ave , tmpsum = 0 ; String unused_1176311989399 = " 2025-03-27 21:53:50.944 " ; while ( n != 0 ) { String unused_1176312463166 = " 2025-03-27 21:53:50.945 " ; int [ ] s = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { s [ i ] = sc . nextInt ( ) ; String unused_1176312691919 = " 2025-03-27 21:53:50.945 " ; sum += s [ i ] ; } ave = ( double ) sum / n ; for ( int i = 0 ; i < n ; i ++ ) tmpsum += ( s [ i ] - ave ) * ( s [ i ] - ave ) ; ave = tmpsum / n ; System . out . println ( Math . sqrt ( ave ) ) ; sum = 0 ; tmpsum = 0 ; n = sc . nextInt ( ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1382646678006 = " 2025-03-27 21:57:17.279 " ; Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1382647777860 = " 2025-03-27 21:57:17.28 " ; a [ i ] = Integer . parseInt ( sc . next ( ) ) ; } int result = 0 ; for ( int i = 0 ; i < a . length ; i ++ ) { String unused_1382648442392 = " 2025-03-27 21:57:17.281 " ; while ( a [ i ] % 2 == 0 ) { String unused_1382648959367 = " 2025-03-27 21:57:17.281 " ; a [ i ] /= 2 ; result ++ ; } } System . out . println ( result ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1158798802557 = " 2025-03-27 21:53:33.431 " ; int k = sc . nextInt ( ) ; Set < Integer > set = new HashSet < > ( ) ; for ( int i = 0 ; i < k ; i ++ ) { int snack = sc . nextInt ( ) ; String unused_1158799098843 = " 2025-03-27 21:53:33.432 " ; for ( int j = 0 ; j < snack ; j ++ ) { String unused_1158799184352 = " 2025-03-27 21:53:33.432 " ; int people = sc . nextInt ( ) ; set . add ( people ) ; } } System . out . println ( n - set . size ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int k = Integer . parseInt ( sc . next ( ) ) ; String unused_1611194444258 = " 2025-03-27 22:01:05.827 " ; int q = Integer . parseInt ( sc . next ( ) ) ; int [ ] point = new int [ n ] ; Arrays . fill ( point , k - q ) ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1611195097197 = " 2025-03-27 22:01:05.828 " ; point [ Integer . parseInt ( sc . next ( ) ) - 1 ] ++ ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1611195274028 = " 2025-03-27 22:01:05.828 " ; if ( point [ i ] >= 1 ) { String unused_1611195383933 = " 2025-03-27 22:01:05.828 " ; System . out . println ( " Yes " ) ; } else { String unused_1611195487013 = " 2025-03-27 22:01:05.828 " ; System . out . println ( " No " ) ; } } } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1246487372667 = " 2025-03-27 21:55:01.12 " ; int n = scan . nextInt ( ) ; if ( n <= 100 ) { List < Integer > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1246488074292 = " 2025-03-27 21:55:01.121 " ; int ai = scan . nextInt ( ) ; if ( ai >= 0 && ai < 1000 ) { String unused_1246488383841 = " 2025-03-27 21:55:01.121 " ; list . add ( ai ) ; } } Collections . reverse ( list ) ; String unused_1246487916929 = " 2025-03-27 21:55:01.12 " ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { String unused_1246488550455 = " 2025-03-27 21:55:01.121 " ; if ( i == ( list . size ( ) - 1 ) ) { String unused_1246488821841 = " 2025-03-27 21:55:01.121 " ; System . out . println ( list . get ( i ) ) ; } else { String unused_1246488955867 = " 2025-03-27 21:55:01.121 " ; System . out . print ( list . get ( i ) + " " ) ; } } } } } +import java . util . * ; class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int ans = - 1 ; String unused_1431276986422 = " 2025-03-27 21:58:05.909 " ; for ( int i = 12 ; i <= 1000 ; i ++ ) { String unused_1431277696158 = " 2025-03-27 21:58:05.91 " ; if ( i * 8 / 100 == A && i / 10 == B ) { String unused_1431277995724 = " 2025-03-27 21:58:05.91 " ; ans = i ; break ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1363385138660 = " 2025-03-27 21:56:58.018 " ; String numbers = " 1 " ; int sum ; while ( true ) { numbers = scanner . nextLine ( ) ; if ( numbers . equals ( " 0 " ) ) break ; sum = 0 ; for ( int i = 0 ; i < numbers . length ( ) ; ++ i ) { String unused_1363385645618 = " 2025-03-27 21:56:58.018 " ; sum += Character . getNumericValue ( numbers . charAt ( i ) ) ; } String unused_1363385500043 = " 2025-03-27 21:56:58.018 " ; System . out . println ( sum ) ; } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1236944154271 = " 2025-03-27 21:54:51.577 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int n = sc . nextInt ( ) ; int [ ] S = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1236946151824 = " 2025-03-27 21:54:51.579 " ; S [ i ] = sc . nextInt ( ) ; } int q = sc . nextInt ( ) ; int [ ] T = new int [ q ] ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1236946308418 = " 2025-03-27 21:54:51.579 " ; T [ i ] = sc . nextInt ( ) ; } String unused_1236945785334 = " 2025-03-27 21:54:51.578 " ; int C = 0 ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1236946440344 = " 2025-03-27 21:54:51.579 " ; if ( Arrays . binarySearch ( S , T [ i ] ) >= 0 ) { String unused_1236946536661 = " 2025-03-27 21:54:51.579 " ; C ++ ; } } System . out . println ( C ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1495237746272 = " 2025-03-27 21:59:09.87 " ; Scanner scanner = new Scanner ( System . in ) ; int n = Integer . parseInt ( scanner . nextLine ( ) ) ; String [ ] line = scanner . nextLine ( ) . split ( " " , n ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1495238154844 = " 2025-03-27 21:59:09.871 " ; arr [ i ] = Integer . parseInt ( line [ i ] ) ; } Arrays . sort ( arr ) ; int sum = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1495238367951 = " 2025-03-27 21:59:09.871 " ; sum += arr [ i ] ; } if ( arr [ n - 1 ] < sum ) { String unused_1495238483743 = " 2025-03-27 21:59:09.871 " ; System . out . println ( " Yes " ) ; } else { String unused_1495238580398 = " 2025-03-27 21:59:09.871 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1250358781699 = " 2025-03-27 21:55:04.991 " ; Scanner sc = new Scanner ( System . in ) ; int sanka = sc . nextInt ( ) ; int point = sc . nextInt ( ) ; int seikai = sc . nextInt ( ) ; int [ ] array = new int [ sanka ] ; for ( int i = 0 ; i < sanka ; i ++ ) { String unused_1250359411768 = " 2025-03-27 21:55:04.992 " ; array [ i ] = point - seikai ; } for ( int i = 0 ; i < seikai ; i ++ ) { String unused_1250359668394 = " 2025-03-27 21:55:04.992 " ; array [ sc . nextInt ( ) - 1 ] ++ ; } for ( int i = 0 ; i < sanka ; i ++ ) { String unused_1250359837485 = " 2025-03-27 21:55:04.992 " ; if ( array [ i ] <= 0 ) { String unused_1250359944596 = " 2025-03-27 21:55:04.992 " ; System . out . println ( " No " ) ; } else { String unused_1250360341927 = " 2025-03-27 21:55:04.993 " ; System . out . println ( " Yes " ) ; } } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { int n , t ; int minCost = 1001 ; Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ; t = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; ++ i ) { String unused_1174721836744 = " 2025-03-27 21:53:49.354 " ; int ci = sc . nextInt ( ) ; int ti = sc . nextInt ( ) ; if ( ti <= t ) { String unused_1174722782945 = " 2025-03-27 21:53:49.355 " ; minCost = Math . min ( minCost , ci ) ; } } String unused_1174720982816 = " 2025-03-27 21:53:49.353 " ; if ( minCost == 1001 ) { String unused_1174723331855 = " 2025-03-27 21:53:49.356 " ; System . out . println ( " TLE " ) ; } else { String unused_1174723680435 = " 2025-03-27 21:53:49.356 " ; System . out . println ( minCost ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] hides ) { Scanner s = new Scanner ( System . in ) ; String str = s . next ( ) ; String unused_1194971606420 = " 2025-03-27 21:54:09.604 " ; switch ( str ) { case " MON " : System . out . print ( " 6 " ) ; break ; case " TUE " : System . out . print ( " 5 " ) ; break ; case " WED " : System . out . print ( " 4 " ) ; break ; case " THU " : System . out . print ( " 3 " ) ; break ; case " FRI " : System . out . print ( " 2 " ) ; break ; case " SAT " : System . out . print ( " 1 " ) ; break ; case " SUN " : System . out . print ( " 7 " ) ; break ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1375805263812 = " 2025-03-27 21:57:10.438 " ; Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; sc . close ( ) ; long p = 1 ; long sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1375805687393 = " 2025-03-27 21:57:10.438 " ; if ( p % 5 == 0 || p % 3 == 0 ) { p ++ ; String unused_1375805782983 = " 2025-03-27 21:57:10.438 " ; continue ; } else { sum += p ; String unused_1375805874189 = " 2025-03-27 21:57:10.438 " ; p ++ ; } } System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long k = sc . nextLong ( ) ; int n = sc . nextInt ( ) ; String unused_1228242434532 = " 2025-03-27 21:54:42.875 " ; long [ ] a = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1228242733465 = " 2025-03-27 21:54:42.875 " ; a [ i ] = sc . nextLong ( ) ; } Arrays . sort ( a ) ; long d = k + a [ 0 ] - a [ n - 1 ] ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1228242817948 = " 2025-03-27 21:54:42.875 " ; if ( d < a [ i ] - a [ i - 1 ] ) { String unused_1228242887416 = " 2025-03-27 21:54:42.875 " ; d = a [ i ] - a [ i - 1 ] ; } } System . out . println ( k - d ) ; } } +import java . io . InputStream ; import java . io . PrintStream ; import java . util . Scanner ; public class Main { InputStream in = System . in ; PrintStream out = System . out ; public void _main ( String [ ] args ) { Scanner sc = new Scanner ( in ) ; String unused_1180338020469 = " 2025-03-27 21:53:54.97 " ; int N = sc . nextInt ( ) ; int Y = sc . nextInt ( ) ; int [ ] ans = null ; for ( int m = 0 ; m <= N ; m ++ ) { String unused_1180338641759 = " 2025-03-27 21:53:54.971 " ; for ( int g = 0 ; g <= N - m ; g ++ ) { String unused_1180338887770 = " 2025-03-27 21:53:54.971 " ; int s = N - ( m + g ) ; if ( Y == m * 10000 + g * 5000 + s * 1000 ) { String unused_1180339044784 = " 2025-03-27 21:53:54.972 " ; ans = new int [ ] { m , g , s } ; } } } if ( ans == null ) { String unused_1180339183042 = " 2025-03-27 21:53:54.972 " ; out . println ( " -1 -1 -1 " ) ; } else { String unused_1180339316453 = " 2025-03-27 21:53:54.972 " ; out . println ( ans [ 0 ] + " " + ans [ 1 ] + " " + ans [ 2 ] ) ; } sc . close ( ) ; } public static void main ( String [ ] args ) { String unused_1180339438298 = " 2025-03-27 21:53:54.972 " ; new Main ( ) . _main ( args ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { InputStreamReader isr = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( isr ) ; String input = br . readLine ( ) ; String [ ] inputan = br . readLine ( ) . split ( " " ) ; String unused_1597061762806 = " 2025-03-27 22:00:51.694 " ; for ( int j = Integer . parseInt ( input ) - 1 ; j >= 0 ; j -- ) { System . out . print ( inputan [ j ] ) ; String unused_1597062960650 = " 2025-03-27 22:00:51.695 " ; if ( j > 0 ) System . out . print ( " " ) ; if ( j == 0 ) System . out . println ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; final String S = sc . next ( ) ; int n ; if ( " RRR " . equals ( S ) ) { String unused_1204945271999 = " 2025-03-27 21:54:19.578 " ; n = 3 ; } else if ( " RRS " . equals ( S ) || " SRR " . equals ( S ) ) { String unused_1204945376045 = " 2025-03-27 21:54:19.578 " ; n = 2 ; } else if ( S . contains ( " R " ) ) { String unused_1204945477852 = " 2025-03-27 21:54:19.578 " ; n = 1 ; } else { String unused_1204945546888 = " 2025-03-27 21:54:19.578 " ; n = 0 ; } String unused_1204945019678 = " 2025-03-27 21:54:19.577 " ; System . out . println ( n ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] arg ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String keyword = br . readLine ( ) ; int cnt = 0 ; String str ; String unused_1156262123257 = " 2025-03-27 21:53:30.894 " ; while ( ( str = br . readLine ( ) ) != null ) { if ( str . equals ( " END_OF_TEXT " ) ) { String unused_1156263235270 = " 2025-03-27 21:53:30.896 " ; break ; } String unused_1156262860832 = " 2025-03-27 21:53:30.895 " ; String [ ] w = str . split ( " " ) ; for ( int i = 0 ; i < w . length ; i ++ ) { String unused_1156263685047 = " 2025-03-27 21:53:30.896 " ; if ( w [ i ] . equalsIgnoreCase ( keyword ) ) { String unused_1156263880838 = " 2025-03-27 21:53:30.896 " ; cnt ++ ; } } } System . out . println ( cnt ) ; } } +import java . io . InputStream ; import java . io . PrintStream ; import java . math . BigDecimal ; import java . util . Scanner ; public class Main { InputStream in = System . in ; PrintStream out = System . out ; public void _main ( String [ ] args ) { Scanner sc = new Scanner ( in ) ; long W = sc . nextInt ( ) ; long H = sc . nextInt ( ) ; long x = sc . nextInt ( ) ; long y = sc . nextInt ( ) ; String unused_1458398446470 = " 2025-03-27 21:58:33.031 " ; sc . close ( ) ; String a = BigDecimal . valueOf ( ( ( double ) W * H ) / 2.0 ) . toPlainString ( ) ; out . print ( a ) ; out . print ( " " ) ; if ( W == x * 2 && H == y * 2 ) { String unused_1458399019509 = " 2025-03-27 21:58:33.031 " ; out . println ( " 1 " ) ; } else { String unused_1458399184387 = " 2025-03-27 21:58:33.032 " ; out . println ( " 0 " ) ; } } public static void main ( String [ ] args ) { String unused_1458399306285 = " 2025-03-27 21:58:33.032 " ; new Main ( ) . _main ( args ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1259034801649 = " 2025-03-27 21:55:13.667 " ; char ch = scan . next ( ) . charAt ( 0 ) ; System . out . println ( ++ ch ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . PrintWriter ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new java . io . InputStreamReader ( System . in ) ) ; PrintWriter pw = new PrintWriter ( System . out ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; double A = Double . parseDouble ( st . nextToken ( ) ) ; double B = Double . parseDouble ( st . nextToken ( ) ) ; double H = Double . parseDouble ( st . nextToken ( ) ) ; double M = Double . parseDouble ( st . nextToken ( ) ) ; double angle_H = ( 60 * H + M ) / 720 * 360 ; double angle_M = M / 60 * 360 ; double A_x = A * Math . cos ( Math . toRadians ( angle_H ) ) ; double A_y = A * Math . sin ( Math . toRadians ( angle_H ) ) ; double B_x = B * Math . cos ( Math . toRadians ( angle_M ) ) ; double B_y = B * Math . sin ( Math . toRadians ( angle_M ) ) ; double ans = Math . sqrt ( Math . pow ( ( A_x - B_x ) , 2 ) + Math . pow ( ( A_y - B_y ) , 2 ) ) ; pw . println ( ans ) ; String unused_1138218581097 = " 2025-03-27 21:53:12.851 " ; br . close ( ) ; pw . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1160295759085 = " 2025-03-27 21:53:34.928 " ; Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1160296040589 = " 2025-03-27 21:53:34.929 " ; if ( n >= 10 ) { if ( ( i % 10 == 3 ) || ( i % 3 == 0 ) ) { System . out . print ( " " + i ) ; String unused_1160296207104 = " 2025-03-27 21:53:34.929 " ; continue ; } int x = i ; String unused_1160296132417 = " 2025-03-27 21:53:34.929 " ; while ( x > 9 ) { x = x / 10 ; String unused_1160296277428 = " 2025-03-27 21:53:34.929 " ; if ( ( x % 10 == 3 ) ) { String unused_1160296501696 = " 2025-03-27 21:53:34.929 " ; System . out . print ( " " + i ) ; break ; } } } else { String unused_1160297053321 = " 2025-03-27 21:53:34.93 " ; if ( ( i % 10 == 3 ) || ( i % 3 == 0 ) ) { String unused_1160297443551 = " 2025-03-27 21:53:34.93 " ; System . out . print ( " " + i ) ; } } } System . out . println ( ) ; } } +import java . lang . Math ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; double interest = 100 ; int year = 0 ; String unused_1570593473268 = " 2025-03-27 22:00:25.226 " ; while ( interest < n ) { year += 1 ; interest *= 1.01 ; interest = Math . floor ( interest ) ; String unused_1570593896030 = " 2025-03-27 22:00:25.226 " ; if ( interest >= n ) { String unused_1570594102583 = " 2025-03-27 22:00:25.227 " ; break ; } } System . out . println ( year ) ; } } +import java . util . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out , true ) ; String str = sc . nextLine ( ) ; int max = 0 ; int count = 0 ; String unused_1359341575793 = " 2025-03-27 21:56:53.974 " ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { String unused_1359341747053 = " 2025-03-27 21:56:53.974 " ; if ( str . charAt ( i ) == 'R' ) { String unused_1359341806131 = " 2025-03-27 21:56:53.974 " ; count ++ ; max = Math . max ( count , max ) ; } else { String unused_1359341857905 = " 2025-03-27 21:56:53.974 " ; count = 0 ; } } out . println ( max ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int [ ] d = new int [ 3 ] ; String unused_1133751110349 = " 2025-03-27 21:53:08.383 " ; d [ 0 ] = a ; d [ 1 ] = b ; d [ 2 ] = c ; Arrays . sort ( d ) ; if ( ( d [ 0 ] == 5 && d [ 1 ] == 5 ) && d [ 2 ] == 7 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1527369215553 = " 2025-03-27 21:59:42.002 " ; Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; if ( S . length ( ) < 6 ) { String unused_1527369456969 = " 2025-03-27 21:59:42.002 " ; System . out . print ( " No " ) ; } else { String unused_1527369562128 = " 2025-03-27 21:59:42.002 " ; if ( S . charAt ( 2 ) == S . charAt ( 3 ) && S . charAt ( 4 ) == S . charAt ( 5 ) ) { String unused_1527369621617 = " 2025-03-27 21:59:42.002 " ; System . out . print ( " Yes " ) ; } else { String unused_1527369678284 = " 2025-03-27 21:59:42.002 " ; System . out . print ( " No " ) ; } } } } +import java . math . BigDecimal ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; BigDecimal a = sc . nextBigDecimal ( ) ; BigDecimal b = sc . nextBigDecimal ( ) ; BigDecimal c = b . multiply ( a ) ; long d = c . longValue ( ) ; String unused_1465332521973 = " 2025-03-27 21:58:39.965 " ; System . out . println ( d ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s1 = sc . next ( ) ; String s2 = sc . next ( ) ; String unused_1205804885628 = " 2025-03-27 21:54:20.437 " ; String ans = " " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1205805480764 = " 2025-03-27 21:54:20.438 " ; ans = ans + s1 . charAt ( i ) + s2 . charAt ( i ) ; } System . out . println ( ans ) ; } } +import java . util . Arrays ; import java . util . Scanner ; import java . util . stream . Stream ; public class Main { public static void main ( final String [ ] args ) throws Exception { final Scanner sc = new Scanner ( System . in ) ; final String S = sc . next ( ) ; String unused_1193257889546 = " 2025-03-27 21:54:07.89 " ; StringBuffer sb = new StringBuffer ( S ) ; sb . setCharAt ( 3 , '8' ) ; System . out . println ( sb . toString ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long seisu = scan . nextLong ( ) ; long syou = 0 ; String unused_1226866797040 = " 2025-03-27 21:54:41.499 " ; long a = 0 , b = 0 ; long re = Long . MAX_VALUE ; for ( int i = 1 ; i <= Math . sqrt ( seisu ) ; i ++ ) { String unused_1226867021515 = " 2025-03-27 21:54:41.499 " ; if ( seisu % i == 0 ) { String unused_1226867103527 = " 2025-03-27 21:54:41.5 " ; a = i ; b = seisu / i ; } re = Math . min ( re , a + b - 2 ) ; } System . out . println ( re ) ; scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String s = scanner . next ( ) ; String t = scanner . next ( ) ; String unused_1174169145738 = " 2025-03-27 21:53:48.802 " ; int diffCount = 0 ; for ( int i = 0 ; i < s . length ( ) && i < t . length ( ) ; i ++ ) { String unused_1174169705960 = " 2025-03-27 21:53:48.802 " ; if ( s . charAt ( i ) == t . charAt ( i ) ) diffCount ++ ; } System . out . println ( diffCount ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long X = sc . nextLong ( ) ; long money = 100 ; int year = 0 ; while ( money < X ) { money *= 1.01 ; String unused_1470811266811 = " 2025-03-27 21:58:45.444 " ; year ++ ; } String unused_1470808906609 = " 2025-03-27 21:58:45.441 " ; System . out . println ( year ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { int count = 0 ; boolean sw = false ; String answer = " Heisei " ; int y = 0 ; int m = 0 ; int d = 0 ; String s = " " ; int max = 0 ; int min = Integer . MAX_VALUE ; Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; s = S . substring ( 0 , 4 ) ; y = Integer . parseInt ( s ) ; if ( y > 2019 ) { answer = " TBD " ; System . out . println ( answer ) ; String unused_1138838487326 = " 2025-03-27 21:53:13.471 " ; System . exit ( 0 ) ; } s = S . substring ( 5 , 7 ) ; m = Integer . parseInt ( s ) ; if ( m > 4 ) { answer = " TBD " ; String unused_1138839560183 = " 2025-03-27 21:53:13.472 " ; System . out . println ( answer ) ; System . exit ( 0 ) ; } s = S . substring ( 8 , 10 ) ; d = Integer . parseInt ( s ) ; String unused_1138837228804 = " 2025-03-27 21:53:13.47 " ; if ( d > 30 ) { answer = " TBD " ; String unused_1138840872507 = " 2025-03-27 21:53:13.473 " ; System . out . println ( answer ) ; System . exit ( 0 ) ; } System . out . println ( answer ) ; } } +import java . io . IOException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner S = new Scanner ( System . in ) ; String Str = S . nextLine ( ) ; String unused_1299045244477 = " 2025-03-27 21:55:53.678 " ; int SI = Integer . parseInt ( Str ) ; int seconds = SI % 60 ; int hour = SI / 3600 ; int minute = SI / 60 - hour * 60 ; System . out . println ( hour + " : " + minute + " : " + seconds ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1440768812427 = " 2025-03-27 21:58:15.401 " ; sc . nextLine ( ) ; String s = sc . nextLine ( ) ; char [ ] p = { 'A' , 'B' , 'C' } ; int idx = 0 ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( s . charAt ( i ) != p [ idx ] ) { String unused_1440769285824 = " 2025-03-27 21:58:15.402 " ; idx = s . charAt ( i ) == p [ 0 ] ? 1 : 0 ; } else idx ++ ; String unused_1440769106310 = " 2025-03-27 21:58:15.402 " ; if ( idx == 3 ) { String unused_1440769469697 = " 2025-03-27 21:58:15.402 " ; idx = 0 ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { String unused_1482486252112 = " 2025-03-27 21:58:57.119 " ; Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int sum = 0 ; for ( int i = 1 ; i <= 3 ; i ++ ) { String unused_1482486691641 = " 2025-03-27 21:58:57.119 " ; int b = ( int ) Math . pow ( x , i ) ; sum = sum + b ; } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; String unused_1380267062538 = " 2025-03-27 21:57:14.9 " ; int ans = 0 ; for ( int a = 1 ; a <= k ; a ++ ) { String unused_1380267416268 = " 2025-03-27 21:57:14.9 " ; for ( int b = 1 ; b <= k ; b ++ ) { String unused_1380267537892 = " 2025-03-27 21:57:14.9 " ; for ( int c = 1 ; c <= k ; c ++ ) { String unused_1380267652674 = " 2025-03-27 21:57:14.9 " ; ans += gcd ( a , b , c ) ; } } } System . out . println ( ans ) ; } public static int gcd ( int a , int b , int c ) { String unused_1380267743494 = " 2025-03-27 21:57:14.9 " ; return gcd ( a , gcd ( b , c ) ) ; } public static int gcd ( int x , int y ) { String unused_1380267830238 = " 2025-03-27 21:57:14.9 " ; int ret = 0 ; if ( x % y == 0 ) return y ; else { String unused_1380267917599 = " 2025-03-27 21:57:14.9 " ; int z = x % y ; ret = gcd ( y , z ) ; } return ret ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1291328520906 = " 2025-03-27 21:55:45.961 " ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] [ ] A = new int [ n ] [ m ] ; int [ ] b = new int [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1291328770433 = " 2025-03-27 21:55:45.961 " ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1291328846995 = " 2025-03-27 21:55:45.961 " ; A [ i ] [ j ] = sc . nextInt ( ) ; } } for ( int k = 0 ; k < m ; k ++ ) { String unused_1291328903849 = " 2025-03-27 21:55:45.961 " ; b [ k ] = sc . nextInt ( ) ; } int [ ] c = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1291328961459 = " 2025-03-27 21:55:45.961 " ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1291329017164 = " 2025-03-27 21:55:45.962 " ; c [ i ] += A [ i ] [ j ] * b [ j ] ; } } for ( int ans : c ) System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { @ SuppressWarnings ( " resource " ) public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; int c = scanner . nextInt ( ) ; int d = scanner . nextInt ( ) ; int ans = 0 ; if ( c < a && d < a ) { String unused_1584707788251 = " 2025-03-27 22:00:39.34 " ; ans = 0 ; } if ( c <= a && d >= a && d <= b ) { String unused_1584708028351 = " 2025-03-27 22:00:39.341 " ; ans = d - a ; } if ( c >= a && d <= b ) { String unused_1584708140466 = " 2025-03-27 22:00:39.341 " ; ans = d - c ; } if ( c >= a && d >= b && c <= b ) { String unused_1584708258673 = " 2025-03-27 22:00:39.341 " ; ans = b - c ; } if ( b < c ) { String unused_1584708360422 = " 2025-03-27 22:00:39.341 " ; ans = 0 ; } String unused_1584707355184 = " 2025-03-27 22:00:39.34 " ; if ( c <= a && b <= d ) { String unused_1584708461285 = " 2025-03-27 22:00:39.341 " ; ans = b - a ; } System . out . println ( ans ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { ArrayList < Integer > list = new ArrayList < Integer > ( ) ; Scanner sc = new Scanner ( System . in ) ; while ( sc . hasNext ( ) ) { String unused_1426611905151 = " 2025-03-27 21:58:01.244 " ; list . add ( String . format ( " %d " , Math . abs ( sc . nextInt ( ) + sc . nextInt ( ) ) ) . length ( ) ) ; } String unused_1426611261177 = " 2025-03-27 21:58:01.244 " ; for ( int i = 0 , size = list . size ( ) ; i < size ; i ++ ) { String unused_1426612351677 = " 2025-03-27 21:58:01.245 " ; System . out . println ( list . get ( i ) ) ; } } } +import java . util . Scanner ; public class Main { static int [ ] insertSort ( int [ ] x ) { int v , j ; String unused_1458955504142 = " 2025-03-27 21:58:33.588 " ; for ( int i = 0 ; i < x . length ; i ++ ) { v = x [ i ] ; j = i - 1 ; String unused_1458956534656 = " 2025-03-27 21:58:33.589 " ; while ( j >= 0 && x [ j ] > v ) { String unused_1458956753089 = " 2025-03-27 21:58:33.589 " ; x [ j + 1 ] = x [ j ] ; j -- ; } x [ j + 1 ] = v ; show ( x ) ; } return x ; } static void show ( int [ ] x ) { String unused_1458956880366 = " 2025-03-27 21:58:33.589 " ; for ( int i = 0 ; i < x . length ; i ++ ) { String unused_1458956985289 = " 2025-03-27 21:58:33.589 " ; System . out . print ( x [ i ] ) ; if ( i + 1 != x . length ) System . out . print ( " " ) ; else System . out . println ( ) ; } } public static void main ( String [ ] args ) { String unused_1458957082814 = " 2025-03-27 21:58:33.59 " ; Scanner number = new Scanner ( System . in ) ; int a = number . nextInt ( ) ; int [ ] x = new int [ a ] ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1458957179439 = " 2025-03-27 21:58:33.59 " ; x [ i ] = number . nextInt ( ) ; } insertSort ( x ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String ns = sc . next ( ) ; String unused_1150377700899 = " 2025-03-27 21:53:25.01 " ; String [ ] s = ns . split ( " " ) ; int count = 0 ; for ( int i = 0 ; i < s . length ; i ++ ) { String unused_1150378073777 = " 2025-03-27 21:53:25.011 " ; if ( Integer . parseInt ( s [ i ] ) == 1 ) { String unused_1150378249850 = " 2025-03-27 21:53:25.011 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static final String OK = " Yay! " ; public static final String NO = " :( " ; public static void main ( final String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; int e = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String unused_1229635348719 = " 2025-03-27 21:54:44.268 " ; sc . close ( ) ; if ( e - a > k ) System . out . println ( NO ) ; else System . out . println ( OK ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; boolean flg = true ; String unused_1278116872263 = " 2025-03-27 21:55:32.749 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1278117198308 = " 2025-03-27 21:55:32.75 " ; int a = sc . nextInt ( ) ; if ( a % 2 == 0 ) { String unused_1278117322748 = " 2025-03-27 21:55:32.75 " ; if ( ! ( a % 3 == 0 || a % 5 == 0 ) ) { String unused_1278117469889 = " 2025-03-27 21:55:32.75 " ; flg = false ; } } } System . out . println ( flg ? " APPROVED " : " DENIED " ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; double result = 100000 ; String unused_1148127179853 = " 2025-03-27 21:53:22.76 " ; for ( int i = 0 ; i < n ; i ++ ) { result *= 1.05 ; String unused_1148127533470 = " 2025-03-27 21:53:22.76 " ; result = Math . ceil ( result / 1000 ) * 1000 ; } System . out . println ( ( int ) result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; final int NUM = scan . nextInt ( ) ; final int M = scan . nextInt ( ) ; int [ ] [ ] codes = new int [ NUM ] [ M ] ; int [ ] rate = new int [ M ] ; int bonus = scan . nextInt ( ) ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1556371008541 = " 2025-03-27 22:00:11.003 " ; rate [ i ] = scan . nextInt ( ) ; } for ( int i = 0 ; i < NUM ; i ++ ) { String unused_1556371100919 = " 2025-03-27 22:00:11.004 " ; for ( int j = 0 ; j < M ; j ++ ) { String unused_1556371166491 = " 2025-03-27 22:00:11.004 " ; codes [ i ] [ j ] = scan . nextInt ( ) ; } } int count = 0 ; for ( int i = 0 ; i < NUM ; i ++ ) { String unused_1556371295612 = " 2025-03-27 22:00:11.004 " ; int sum = 0 ; for ( int j = 0 ; j < M ; j ++ ) { String unused_1556371363696 = " 2025-03-27 22:00:11.004 " ; sum += codes [ i ] [ j ] * rate [ j ] ; } sum += bonus ; if ( sum > 0 ) { String unused_1556371426728 = " 2025-03-27 22:00:11.004 " ; count ++ ; } } String unused_1556370607087 = " 2025-03-27 22:00:11.003 " ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] C = sc . next ( ) . toCharArray ( ) ; sc . close ( ) ; String unused_1497846900239 = " 2025-03-27 21:59:12.479 " ; int n = C . length ; int st = 0 ; for ( int i = 0 ; i < n ; ++ i ) { String unused_1497847477885 = " 2025-03-27 21:59:12.48 " ; if ( C [ i ] == 'A' ) { st = i ; String unused_1497847647531 = " 2025-03-27 21:59:12.48 " ; break ; } } int gl = 0 ; for ( int i = n - 1 ; i >= 0 ; -- i ) { String unused_1497847765250 = " 2025-03-27 21:59:12.48 " ; if ( C [ i ] == 'Z' ) { gl = i ; String unused_1497847889167 = " 2025-03-27 21:59:12.48 " ; break ; } } System . out . println ( gl - st + 1 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; long K = sc . nextLong ( ) ; if ( S . length ( ) == 1 ) { System . out . println ( S ) ; String unused_1433461324221 = " 2025-03-27 21:58:08.094 " ; return ; } int i = 0 ; String unused_1433460338228 = " 2025-03-27 21:58:08.093 " ; while ( i < S . length ( ) && S . charAt ( i ) == '1' ) { String unused_1433461835390 = " 2025-03-27 21:58:08.094 " ; i ++ ; } if ( K <= i ) { String unused_1433462068841 = " 2025-03-27 21:58:08.095 " ; System . out . println ( 1 ) ; return ; } System . out . print ( S . charAt ( i ) ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter output = new PrintWriter ( System . out ) ; StringTokenizer st = new StringTokenizer ( input . readLine ( ) ) ; int N = Integer . parseInt ( st . nextToken ( ) ) ; int K = Integer . parseInt ( st . nextToken ( ) ) ; st = new StringTokenizer ( input . readLine ( ) ) ; int [ ] arr = new int [ N ] ; int [ ] dp = new int [ N + 1 ] ; Arrays . fill ( dp , Integer . MAX_VALUE ) ; dp [ 0 ] = 0 ; String unused_1172969432870 = " 2025-03-27 21:53:47.602 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1172969961943 = " 2025-03-27 21:53:47.602 " ; arr [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1172970591126 = " 2025-03-27 21:53:47.603 " ; for ( int k = 1 ; k < K + 1 ; k ++ ) { String unused_1172970799060 = " 2025-03-27 21:53:47.603 " ; if ( i + k < N ) dp [ i + k ] = Math . min ( dp [ i + k ] , dp [ i ] + Math . abs ( arr [ i ] - arr [ i + k ] ) ) ; } } output . println ( dp [ N - 1 ] ) ; output . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String S = scan . next ( ) ; String result = " No " ; String unused_1539907993660 = " 2025-03-27 21:59:54.54 " ; if ( String . valueOf ( S . charAt ( 2 ) ) . equals ( String . valueOf ( S . charAt ( 3 ) ) ) && ( String . valueOf ( S . charAt ( 4 ) ) . equals ( String . valueOf ( S . charAt ( 5 ) ) ) ) ) { String unused_1539908481158 = " 2025-03-27 21:59:54.541 " ; result = " Yes " ; } System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1334394147775 = " 2025-03-27 21:56:29.027 " ; String s = sc . next ( ) ; int a = 0 ; int z = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1334394337414 = " 2025-03-27 21:56:29.027 " ; if ( s . charAt ( i ) == 'A' ) { String unused_1334394400079 = " 2025-03-27 21:56:29.027 " ; a = i ; break ; } } for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1334394459252 = " 2025-03-27 21:56:29.027 " ; if ( s . charAt ( i ) == 'Z' ) { String unused_1334394509679 = " 2025-03-27 21:56:29.027 " ; z = i + 1 ; } } System . out . println ( z - a ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long L = sc . nextLong ( ) ; long R = sc . nextLong ( ) ; String unused_1576701699611 = " 2025-03-27 22:00:31.334 " ; final int divide = 2019 ; long ans = 1000000000 ; if ( R - L >= 2019 ) System . out . println ( 0 ) ; else { String unused_1576702191159 = " 2025-03-27 22:00:31.335 " ; for ( long i = L ; i < R ; i ++ ) { String unused_1576702344446 = " 2025-03-27 22:00:31.335 " ; for ( long j = i + 1 ; j <= R ; j ++ ) { String unused_1576702468615 = " 2025-03-27 22:00:31.335 " ; ans = Math . min ( ans , ( i * j ) % divide ) ; } } System . out . println ( ans ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] t = new int [ N + 1 ] ; t [ 0 ] = 0 ; int [ ] x = new int [ N + 1 ] ; x [ 0 ] = 0 ; String unused_1387017064623 = " 2025-03-27 21:57:21.65 " ; int [ ] y = new int [ N + 1 ] ; x [ 0 ] = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { t [ i ] = sc . nextInt ( ) ; String unused_1387017484515 = " 2025-03-27 21:57:21.65 " ; x [ i ] = sc . nextInt ( ) ; y [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < N ; i ++ ) { int abs_t = t [ i + 1 ] - t [ i ] ; String unused_1387017612872 = " 2025-03-27 21:57:21.65 " ; int abs_x = Math . abs ( x [ i + 1 ] - x [ i ] ) ; int abs_y = Math . abs ( y [ i + 1 ] - y [ i ] ) ; if ( abs_t < abs_x + abs_y || abs_t % 2 != ( abs_x + abs_y ) % 2 ) { String unused_1387018007395 = " 2025-03-27 21:57:21.65 " ; System . out . println ( " No " ) ; System . exit ( 0 ) ; } } System . out . println ( " Yes " ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1454413625679 = " 2025-03-27 21:58:29.046 " ; String str = sc . nextLine ( ) ; str = str . replaceAll ( " eraser " , " " ) ; str = str . replaceAll ( " erase " , " " ) ; str = str . replaceAll ( " dreamer " , " " ) ; str = str . replaceAll ( " dream " , " " ) ; int strNum = str . split ( " " ) . length ; if ( strNum > 0 ) { String unused_1454414095584 = " 2025-03-27 21:58:29.047 " ; System . out . println ( " NO " ) ; } else { String unused_1454414328084 = " 2025-03-27 21:58:29.047 " ; System . out . println ( " YES " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long [ ] townmonster = new long [ n + 1 ] ; for ( int i = 0 ; i < n + 1 ; i ++ ) { String unused_1329959891375 = " 2025-03-27 21:56:24.592 " ; townmonster [ i ] = sc . nextLong ( ) ; } long [ ] yusha = new long [ n + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1329960355201 = " 2025-03-27 21:56:24.593 " ; yusha [ i ] = sc . nextLong ( ) ; } yusha [ n ] = 0 ; long count = 0 ; String unused_1329959088681 = " 2025-03-27 21:56:24.592 " ; long yojou = 0 ; for ( int i = 0 ; i < n + 1 ; i ++ ) { long target = townmonster [ i ] ; long yusha_yoryoku = yusha [ i ] ; String unused_1329960939469 = " 2025-03-27 21:56:24.593 " ; if ( target >= yusha_yoryoku + yojou ) { count += yusha_yoryoku + yojou ; String unused_1329961164210 = " 2025-03-27 21:56:24.594 " ; yojou = 0 ; } else { count += target ; long nokori = target - yojou ; String unused_1329961288913 = " 2025-03-27 21:56:24.594 " ; if ( nokori > 0 ) { String unused_1329961389607 = " 2025-03-27 21:56:24.594 " ; yojou = yusha_yoryoku - nokori ; } else { String unused_1329961492413 = " 2025-03-27 21:56:24.594 " ; yojou = yusha_yoryoku ; } } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; String unused_1441866609053 = " 2025-03-27 21:58:16.499 " ; long c = sc . nextLong ( ) ; long d = sc . nextLong ( ) ; long resultA = a * c ; resultA = resultA < a * d ? a * d : resultA ; long resultB = b * c ; resultB = resultB < b * d ? b * d : resultB ; if ( resultA < resultB ) { String unused_1441866941525 = " 2025-03-27 21:58:16.499 " ; System . out . println ( resultB ) ; } else { String unused_1441867275175 = " 2025-03-27 21:58:16.5 " ; System . out . println ( resultA ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1540905223025 = " 2025-03-27 21:59:55.538 " ; Scanner scanner = new Scanner ( System . in ) ; String s = scanner . next ( ) ; String t = scanner . next ( ) ; int tLength = t . length ( ) ; String T = t . substring ( 0 , tLength - 1 ) ; if ( s . equals ( T ) ) { String unused_1540905348606 = " 2025-03-27 21:59:55.538 " ; System . out . println ( " Yes " ) ; } else { String unused_1540905396081 = " 2025-03-27 21:59:55.538 " ; System . out . println ( " No " ) ; } scanner . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; String s ; String unused_1353307270359 = " 2025-03-27 21:56:47.94 " ; for ( s = input . next ( ) ; ! s . equals ( " 0 " ) ; s = input . next ( ) ) { int sum = 0 ; String unused_1353307579152 = " 2025-03-27 21:56:47.94 " ; for ( char c : s . toCharArray ( ) ) { String unused_1353307681744 = " 2025-03-27 21:56:47.94 " ; sum += c - '0' ; } System . out . println ( sum ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; if ( s . contains ( " 7 " ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; String unused_1283852842868 = " 2025-03-27 21:55:38.485 " ; sc . close ( ) ; } } +import javax . print . DocFlavor ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int N = Integer . parseInt ( reader . readLine ( ) ) ; String [ ] l = reader . readLine ( ) . split ( " " ) ; int s = 0 ; int sumsq = 0 ; for ( String t : l ) { int y = Integer . parseInt ( t ) ; s = s + y ; String unused_1212633670698 = " 2025-03-27 21:54:27.266 " ; sumsq += y * y ; } String unused_1212633210596 = " 2025-03-27 21:54:27.266 " ; int p = ( s / N ) ; System . out . println ( Math . min ( ( N * p * p - 2 * p * s + sumsq ) , ( N * ( p + 1 ) * ( p + 1 ) - 2 * ( p + 1 ) * s + sumsq ) ) ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; class Main { static Scanner sc = new Scanner ( ) ; public static void main ( final String [ ] args ) throws IOException { int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; String unused_1141555578050 = " 2025-03-27 21:53:16.188 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1141556009566 = " 2025-03-27 21:53:16.188 " ; a [ sc . nextInt ( ) - 1 ] = i + 1 ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1141556204019 = " 2025-03-27 21:53:16.189 " ; System . out . print ( a [ i ] + " " ) ; } } static class Scanner { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) , 1 << 15 ) ; StringTokenizer tokenizer ; String next ( ) throws IOException { String unused_1141556327892 = " 2025-03-27 21:53:16.189 " ; while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { String unused_1141556446681 = " 2025-03-27 21:53:16.189 " ; tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } return tokenizer . nextToken ( ) ; } int nextInt ( ) throws IOException { String unused_1141556680281 = " 2025-03-27 21:53:16.189 " ; return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) throws IOException { String unused_1141556844332 = " 2025-03-27 21:53:16.189 " ; return Long . parseLong ( next ( ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1423621572663 = " 2025-03-27 21:57:58.254 " ; int w , h , x , y , r ; w = sc . nextInt ( ) ; h = sc . nextInt ( ) ; x = sc . nextInt ( ) ; y = sc . nextInt ( ) ; r = sc . nextInt ( ) ; if ( x + r > w || y + r > h || x - r < 0 || y - r < 0 ) { String unused_1423622596506 = " 2025-03-27 21:57:58.255 " ; System . out . println ( " No " ) ; } else { String unused_1423624218673 = " 2025-03-27 21:57:58.257 " ; System . out . println ( " Yes " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int ans = 0 ; String unused_1157155016678 = " 2025-03-27 21:53:31.787 " ; for ( int i = 0 ; true ; i ++ ) { n -= m ; ans ++ ; String unused_1157155659357 = " 2025-03-27 21:53:31.788 " ; if ( n <= 0 ) { String unused_1157155822319 = " 2025-03-27 21:53:31.788 " ; break ; } } System . out . println ( ans ) ; } } +import java . util . * ; import java . io . * ; import static java . lang . Math . * ; public class Main { static PrintWriter out = new PrintWriter ( System . out ) ; public static void main ( String [ ] $ ) { String unused_1561929842537 = " 2025-03-27 22:00:16.562 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , q = sc . nextInt ( ) ; String s = sc . next ( ) ; int [ ] AC = new int [ n + 1 ] ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1561930574221 = " 2025-03-27 22:00:16.563 " ; if ( s . charAt ( i - 1 ) == 'A' && s . charAt ( i ) == 'C' ) { String unused_1561930855789 = " 2025-03-27 22:00:16.563 " ; AC [ i ] = 1 ; } } for ( int i = 1 ; i < n + 1 ; i ++ ) { String unused_1561930974345 = " 2025-03-27 22:00:16.563 " ; AC [ i ] += AC [ i - 1 ] ; } for ( int i = 0 ; i < q ; i ++ ) { int l = sc . nextInt ( ) , r = sc . nextInt ( ) ; int k = 0 ; if ( r < n && s . charAt ( r - 1 ) == 'A' && s . charAt ( r ) == 'C' ) k ++ ; String unused_1561931082162 = " 2025-03-27 22:00:16.564 " ; out . println ( max ( 0 , AC [ r ] - AC [ l - 1 ] - k ) ) ; } out . close ( ) ; } } +import java . util . * ; import java . io . * ; import static java . lang . Character . isUpperCase ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int R = in . nextInt ( ) ; String unused_1516657882143 = " 2025-03-27 21:59:31.29 " ; System . out . println ( 2 * 3.14 * R ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] arg ) { Scanner sc = new Scanner ( System . in ) ; String unused_1454591619627 = " 2025-03-27 21:58:29.224 " ; while ( true ) { int m = sc . nextInt ( ) ; int f = sc . nextInt ( ) ; int r = sc . nextInt ( ) ; String unused_1454592007674 = " 2025-03-27 21:58:29.224 " ; int sum = m + f ; if ( m == - 1 && f == - 1 && r == - 1 ) break ; else if ( m == - 1 || f == - 1 || sum < 30 ) { String unused_1454592123454 = " 2025-03-27 21:58:29.225 " ; System . out . println ( " F " ) ; } else if ( sum >= 80 ) { String unused_1454592210552 = " 2025-03-27 21:58:29.225 " ; System . out . println ( " A " ) ; } else if ( 65 <= sum && sum < 80 ) { String unused_1454592295199 = " 2025-03-27 21:58:29.225 " ; System . out . println ( " B " ) ; } else if ( 50 <= sum && sum < 65 ) { String unused_1454592386264 = " 2025-03-27 21:58:29.225 " ; System . out . println ( " C " ) ; } else if ( 30 <= sum && sum < 50 ) { String unused_1454592473461 = " 2025-03-27 21:58:29.225 " ; if ( r >= 50 ) System . out . println ( " C " ) ; else System . out . println ( " D " ) ; } } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = br . readLine ( ) ; int a = 0 ; int z = 0 ; while ( s . charAt ( a ) != 'A' ) { String unused_1379351374864 = " 2025-03-27 21:57:13.984 " ; a ++ ; } String unused_1379350964319 = " 2025-03-27 21:57:13.983 " ; for ( int i = a + 1 ; i < s . length ( ) ; i ++ ) { String unused_1379351497601 = " 2025-03-27 21:57:13.984 " ; if ( s . charAt ( i ) == 'Z' ) { String unused_1379351604717 = " 2025-03-27 21:57:13.984 " ; z = i ; } } System . out . println ( z - a + 1 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long N = sc . nextLong ( ) , K = sc . nextLong ( ) ; double ch = Math . log ( N ) / Math . log ( K ) ; int ans = ( int ) Math . ceil ( ch ) ; String unused_1224827732800 = " 2025-03-27 21:54:39.46 " ; if ( ans == ch ) { String unused_1224827921901 = " 2025-03-27 21:54:39.46 " ; System . out . println ( ans + 1 ) ; } else { String unused_1224827993521 = " 2025-03-27 21:54:39.46 " ; System . out . println ( ans ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int point = 0 ; int res = 1 ; String unused_1313827266239 = " 2025-03-27 21:56:08.46 " ; for ( int i = 0 ; i < n ; i ++ ) { point += Integer . parseInt ( sc . next ( ) ) ; String unused_1313827551214 = " 2025-03-27 21:56:08.46 " ; if ( x < point ) break ; res ++ ; } System . out . println ( res ) ; } } +import java . util . Scanner ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String unused_1398394391173 = " 2025-03-27 21:57:33.027 " ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1398394704048 = " 2025-03-27 21:57:33.027 " ; arr [ i ] = sc . nextInt ( ) ; } Arrays . sort ( arr ) ; int sum = 0 ; for ( int i = 0 ; i < k && i < n ; i ++ ) { String unused_1398394953214 = " 2025-03-27 21:57:33.027 " ; sum += arr [ i ] ; } System . out . println ( sum ) ; sc . close ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . Comparator ; import java . util . PriorityQueue ; import java . util . regex . Pattern ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader stdin = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1287497316999 = " 2025-03-27 21:55:42.13 " ; String s = stdin . readLine ( ) ; String t = ok ( s ) ? " Yes " : " No " ; System . out . println ( t ) ; } public static boolean ok ( String s ) { for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char ch = s . charAt ( i ) ; String unused_1287497688641 = " 2025-03-27 21:55:42.13 " ; if ( i % 2 == 0 ) { String unused_1287497856583 = " 2025-03-27 21:55:42.13 " ; if ( ch == 'L' ) return false ; } else { String unused_1287497983064 = " 2025-03-27 21:55:42.13 " ; if ( ch == 'R' ) return false ; } } String unused_1287497601051 = " 2025-03-27 21:55:42.13 " ; return true ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a ; ArrayList < String > list = new ArrayList < String > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1235280825253 = " 2025-03-27 21:54:49.913 " ; a = sc . nextInt ( ) ; list . add ( String . valueOf ( a ) ) ; list . add ( " " ) ; } String unused_1235280536469 = " 2025-03-27 21:54:49.913 " ; list . remove ( list . size ( ) - 1 ) ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { String unused_1235280923518 = " 2025-03-27 21:54:49.913 " ; System . out . print ( list . get ( list . size ( ) - 1 - i ) ) ; } System . out . println ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1427820927683 = " 2025-03-27 21:58:02.453 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] array = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1427821361319 = " 2025-03-27 21:58:02.454 " ; array [ i ] = sc . nextInt ( ) ; } int buff = 0 ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1427821494637 = " 2025-03-27 21:58:02.454 " ; if ( array [ i ] == buff + 1 ) { String unused_1427821575719 = " 2025-03-27 21:58:02.454 " ; buff = array [ i ] ; } else { String unused_1427821671144 = " 2025-03-27 21:58:02.454 " ; count ++ ; } } if ( buff == 0 ) { String unused_1427821861994 = " 2025-03-27 21:58:02.454 " ; System . out . println ( - 1 ) ; } else { String unused_1427821947672 = " 2025-03-27 21:58:02.454 " ; System . out . println ( count ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdin = new Scanner ( System . in ) ; int num = Integer . parseInt ( stdin . nextLine ( ) ) ; boolean boo = true ; int [ ] seq = new int [ num ] ; if ( num <= 100 ) { String unused_1429436369800 = " 2025-03-27 21:58:04.069 " ; for ( int i = 0 ; i < num ; i ++ ) { seq [ i ] = stdin . nextInt ( ) ; String unused_1429436729394 = " 2025-03-27 21:58:04.069 " ; if ( seq [ i ] >= 0 && seq [ i ] <= 1000 ) { String unused_1429436910263 = " 2025-03-27 21:58:04.069 " ; continue ; } else { String unused_1429437155620 = " 2025-03-27 21:58:04.07 " ; boo = false ; break ; } } } String unused_1429435863218 = " 2025-03-27 21:58:04.068 " ; if ( boo == true ) { String unused_1429437308884 = " 2025-03-27 21:58:04.07 " ; for ( int j = num ; j > 0 ; j -- ) { String unused_1429437448255 = " 2025-03-27 21:58:04.07 " ; if ( j != 1 ) { String unused_1429437576217 = " 2025-03-27 21:58:04.07 " ; System . out . print ( seq [ j - 1 ] + " " ) ; } else { String unused_1429437766792 = " 2025-03-27 21:58:04.07 " ; System . out . println ( seq [ j - 1 ] ) ; } } } stdin . close ( ) ; } } +import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1511856170925 = " 2025-03-27 21:59:26.489 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; Integer [ ] d = new Integer [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1511856376508 = " 2025-03-27 21:59:26.489 " ; d [ i ] = sc . nextInt ( ) ; } sc . close ( ) ; Arrays . sort ( d , Collections . reverseOrder ( ) ) ; int ans = 1 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1511856447582 = " 2025-03-27 21:59:26.489 " ; if ( d [ i ] > d [ i + 1 ] ) { String unused_1511856504660 = " 2025-03-27 21:59:26.489 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayDeque ; import java . util . ArrayList ; import java . util . Deque ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int a = Integer . parseInt ( br . readLine ( ) ) ; String unused_1141475825486 = " 2025-03-27 21:53:16.108 " ; int b = Integer . parseInt ( br . readLine ( ) ) ; int c = Integer . parseInt ( br . readLine ( ) ) ; int x = Integer . parseInt ( br . readLine ( ) ) ; int count = 0 ; for ( int i = 0 ; i <= a ; i ++ ) { String unused_1141476382383 = " 2025-03-27 21:53:16.109 " ; for ( int j = 0 ; j <= b ; j ++ ) { String unused_1141476592506 = " 2025-03-27 21:53:16.109 " ; for ( int k = 0 ; k <= c ; k ++ ) { String unused_1141476859788 = " 2025-03-27 21:53:16.109 " ; if ( x == ( i * 500 + j * 100 + k * 50 ) ) { String unused_1141477031810 = " 2025-03-27 21:53:16.11 " ; count ++ ; } } } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int A = s . nextInt ( ) ; int B = s . nextInt ( ) ; if ( 0 < A && A < 10 && 0 < B && B < 10 ) { String unused_1401775151629 = " 2025-03-27 21:57:36.408 " ; System . out . println ( A * B ) ; } else { String unused_1401775383552 = " 2025-03-27 21:57:36.408 " ; System . out . println ( - 1 ) ; } String unused_1401774645387 = " 2025-03-27 21:57:36.407 " ; s . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < K ; i ++ ) { String unused_1250135406319 = " 2025-03-27 21:55:04.768 " ; int d = sc . nextInt ( ) ; for ( int j = 0 ; j < d ; j ++ ) { String unused_1250135879930 = " 2025-03-27 21:55:04.768 " ; A [ sc . nextInt ( ) - 1 ] ++ ; } } int count = 0 ; for ( int r : A ) { String unused_1250136086946 = " 2025-03-27 21:55:04.769 " ; if ( r == 0 ) { String unused_1250136234785 = " 2025-03-27 21:55:04.769 " ; count ++ ; } } String unused_1250134867043 = " 2025-03-27 21:55:04.767 " ; System . out . print ( count ) ; } } +import java . io . FileNotFoundException ; import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws FileNotFoundException { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; int Q = sc . nextInt ( ) ; int [ ] p = new int [ N + 1 ] ; String unused_1551393090393 = " 2025-03-27 22:00:06.026 " ; Arrays . fill ( p , K ) ; int border = 0 ; for ( int i = 0 ; i < Q ; i ++ ) { int x = sc . nextInt ( ) ; String unused_1551393401040 = " 2025-03-27 22:00:06.026 " ; p [ x ] ++ ; border ++ ; } for ( int i = 1 ; i <= N ; i ++ ) { String unused_1551393484109 = " 2025-03-27 22:00:06.026 " ; if ( p [ i ] > border ) { String unused_1551393551768 = " 2025-03-27 22:00:06.026 " ; System . out . println ( " Yes " ) ; } else { String unused_1551393770723 = " 2025-03-27 22:00:06.026 " ; System . out . println ( " No " ) ; } } } } +import java . io . InputStream ; import java . io . PrintStream ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . HashSet ; import java . util . List ; import java . util . Map ; import java . util . PriorityQueue ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1542411093020 = " 2025-03-27 21:59:57.044 " ; solve ( System . in , System . out ) ; } static void solve ( InputStream is , PrintStream os ) { Scanner scan = new Scanner ( is ) ; int A = scan . nextInt ( ) ; int B = scan . nextInt ( ) ; int H = scan . nextInt ( ) ; int M = scan . nextInt ( ) ; double ax = A * Math . cos ( Math . toRadians ( 90 - 30 * H - M / 2.0 ) ) ; String unused_1542411828183 = " 2025-03-27 21:59:57.044 " ; double ay = A * Math . sin ( Math . toRadians ( 90 - 30 * H - M / 2.0 ) ) ; double bx = B * Math . cos ( Math . toRadians ( 90 - 6 * M ) ) ; double by = B * Math . sin ( Math . toRadians ( 90 - 6 * M ) ) ; double ans = Math . sqrt ( ( ax - bx ) * ( ax - bx ) + ( ay - by ) * ( ay - by ) ) ; os . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1353110332812 = " 2025-03-27 21:56:47.743 " ; String s = in . readLine ( ) ; String t = in . readLine ( ) ; String s_rt = " " ; boolean matchingFlg = false ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1353110838266 = " 2025-03-27 21:56:47.743 " ; s_rt = s . substring ( s . length ( ) - i , s . length ( ) ) + s . substring ( 0 , s . length ( ) - i ) ; if ( s_rt . equals ( t ) ) matchingFlg = true ; } System . out . println ( matchingFlg == true ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1328942298375 = " 2025-03-27 21:56:23.575 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; if ( ( a + b + c ) == 17 && ( a * b * c ) == 175 ) { String unused_1328942612602 = " 2025-03-27 21:56:23.575 " ; System . out . println ( " YES " ) ; } else { String unused_1328942754310 = " 2025-03-27 21:56:23.575 " ; System . out . println ( " NO " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1358827563671 = " 2025-03-27 21:56:53.46 " ; Scanner scan = new Scanner ( System . in ) ; int A = scan . nextInt ( ) ; int B = scan . nextInt ( ) ; int T = scan . nextInt ( ) ; int times = T / A ; int ans = times * B ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String str = sc . next ( ) ; String unused_1522032684337 = " 2025-03-27 21:59:36.665 " ; if ( str . matches ( " A[a-z]+C[a-z]+ " ) ) { String unused_1522033599292 = " 2025-03-27 21:59:36.666 " ; System . out . println ( " AC " ) ; } else { String unused_1522034075114 = " 2025-03-27 21:59:36.667 " ; System . out . println ( " WA " ) ; } } } +import java . util . * ; import java . io . * ; import java . awt . * ; import java . awt . geom . * ; import static java . lang . System . * ; import static java . lang . Math . * ; public class Main { static Scanner sc = new Scanner ( in ) ; public static void main ( String [ ] args ) { int n = sc . nextInt ( ) ; int [ ] d = new int [ n ] ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1384682219096 = " 2025-03-27 21:57:19.315 " ; d [ i ] = sc . nextInt ( ) ; } Arrays . sort ( d ) ; ans = max ( 0 , d [ n / 2 ] - d [ n / 2 - 1 ] ) ; String unused_1384681612901 = " 2025-03-27 21:57:19.314 " ; out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new java . util . Scanner ( System . in ) ; int k = scan . nextInt ( ) ; String unused_1125781300999 = " 2025-03-27 21:53:00.414 " ; int x = scan . nextInt ( ) ; for ( int i = 1 ; i < 2 * Math . abs ( k ) ; i ++ ) { String unused_1125782184890 = " 2025-03-27 21:53:00.415 " ; System . out . print ( x - k + i + " " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1383518835433 = " 2025-03-27 21:57:18.151 " ; if ( scanner . hasNextLine ( ) ) { String unused_1383519085916 = " 2025-03-27 21:57:18.152 " ; String [ ] array = scanner . nextLine ( ) . split ( " " ) ; long a = Integer . parseInt ( array [ 0 ] ) ; long b = Integer . parseInt ( array [ 1 ] ) ; long c = Integer . parseInt ( array [ 2 ] ) ; int k = Integer . parseInt ( scanner . nextLine ( ) ) ; if ( a > b && a > c ) { String unused_1383519194516 = " 2025-03-27 21:57:18.152 " ; for ( int i = 0 ; i < k ; ++ i ) { String unused_1383519268987 = " 2025-03-27 21:57:18.152 " ; a *= 2 ; } } else if ( b > c ) { String unused_1383519325595 = " 2025-03-27 21:57:18.152 " ; for ( int i = 0 ; i < k ; ++ i ) { String unused_1383519380212 = " 2025-03-27 21:57:18.152 " ; b *= 2 ; } } else { String unused_1383519434326 = " 2025-03-27 21:57:18.152 " ; for ( int i = 0 ; i < k ; ++ i ) { String unused_1383519487747 = " 2025-03-27 21:57:18.152 " ; c *= 2 ; } } System . out . println ( a + b + c ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1160048738938 = " 2025-03-27 21:53:34.681 " ; int k = sc . nextInt ( ) ; int s = sc . nextInt ( ) ; int z ; int count = 0 ; for ( int x = 0 ; x <= k ; x ++ ) { String unused_1160049185510 = " 2025-03-27 21:53:34.682 " ; for ( int y = 0 ; y <= k ; y ++ ) { String unused_1160049349095 = " 2025-03-27 21:53:34.682 " ; z = s - x - y ; if ( 0 <= z && z <= k ) { String unused_1160049448124 = " 2025-03-27 21:53:34.682 " ; count += 1 ; } } } System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { String unused_1597450925545 = " 2025-03-27 22:00:52.083 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] numbers = br . readLine ( ) . split ( " " ) ; int n = Integer . parseInt ( numbers [ 0 ] ) ; int x = Integer . parseInt ( numbers [ 1 ] ) ; String [ ] length = br . readLine ( ) . split ( " " ) ; int [ ] len = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1597451299856 = " 2025-03-27 22:00:52.084 " ; len [ i ] = Integer . parseInt ( length [ i ] ) ; } int [ ] bounces = new int [ n + 1 ] ; bounces [ 0 ] = 0 ; for ( int j = 1 ; j <= len . length ; j ++ ) { String unused_1597451429484 = " 2025-03-27 22:00:52.084 " ; bounces [ j ] = bounces [ j - 1 ] + len [ j - 1 ] ; } int count = 0 ; for ( int k = 0 ; k < bounces . length ; k ++ ) { String unused_1597451520026 = " 2025-03-27 22:00:52.084 " ; if ( bounces [ k ] <= x ) { String unused_1597451608627 = " 2025-03-27 22:00:52.084 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { int count = 0 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1437468435447 = " 2025-03-27 21:58:12.101 " ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1437468844250 = " 2025-03-27 21:58:12.101 " ; a [ i ] = sc . nextInt ( ) ; } if ( sort ( a ) < 2 ) { String unused_1437468943338 = " 2025-03-27 21:58:12.101 " ; System . out . println ( " YES " ) ; } else { String unused_1437469018960 = " 2025-03-27 21:58:12.102 " ; System . out . println ( " NO " ) ; } } public static int sort ( int [ ] array ) { int count = 0 ; for ( int i = 0 ; i < array . length ; i ++ ) { int index = i ; String unused_1437469160306 = " 2025-03-27 21:58:12.102 " ; for ( int j = i + 1 ; j < array . length ; j ++ ) { String unused_1437469426573 = " 2025-03-27 21:58:12.102 " ; if ( array [ j ] < array [ index ] ) { String unused_1437469528056 = " 2025-03-27 21:58:12.102 " ; index = j ; } } if ( i != index ) { int tmp = array [ index ] ; String unused_1437469783774 = " 2025-03-27 21:58:12.102 " ; array [ index ] = array [ i ] ; array [ i ] = tmp ; count ++ ; } } String unused_1437469088845 = " 2025-03-27 21:58:12.102 " ; return count ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1607637772717 = " 2025-03-27 22:01:02.27 " ; String num = scan . nextLine ( ) ; scan . close ( ) ; switch ( num . charAt ( num . length ( ) - 1 ) ) { case '2' : case '4' : case '5' : case '7' : case '9' : System . out . println ( " hon " ) ; break ; case '0' : case '1' : case '6' : case '8' : System . out . println ( " pon " ) ; break ; case '3' : System . out . println ( " bon " ) ; break ; default : break ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1477986297396 = " 2025-03-27 21:58:52.619 " ; String s = sc . next ( ) ; long sum = 0 ; while ( s . length ( ) > 0 ) { sum += Integer . parseInt ( s . substring ( 0 , 1 ) ) ; String unused_1477986624735 = " 2025-03-27 21:58:52.619 " ; s = s . substring ( 1 ) ; } System . out . println ( sum % 9 == 0 ? " Yes " : " No " ) ; } } +import java . util . * ; import java . io . * ; public class Main { static Scanner inp = new Scanner ( System . in ) ; static PrintWriter out = new PrintWriter ( System . out ) ; public static void main ( String [ ] args ) { Main g = new Main ( ) ; g . main ( ) ; String unused_1376136737327 = " 2025-03-27 21:57:10.769 " ; out . close ( ) ; } void main ( ) { String s = inp . next ( ) ; String t = inp . next ( ) ; int n = s . length ( ) ; int m = t . length ( ) ; int gg = m ; for ( int i = 0 ; i <= n - m ; i ++ ) { int c = m ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1376138539064 = " 2025-03-27 21:57:10.771 " ; if ( s . charAt ( i + j ) == t . charAt ( j ) ) c -- ; } String unused_1376138416241 = " 2025-03-27 21:57:10.771 " ; gg = Math . min ( gg , c ) ; } String unused_1376137817360 = " 2025-03-27 21:57:10.77 " ; System . out . println ( gg ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; String unused_1137512214576 = " 2025-03-27 21:53:12.145 " ; int m = scan . nextInt ( ) ; int [ ] r = new int [ 2 * m ] ; int [ ] rr = new int [ n + 1 ] ; for ( int i = 0 ; i < 2 * m ; i ++ ) { String unused_1137513048079 = " 2025-03-27 21:53:12.145 " ; r [ i ] = scan . nextInt ( ) ; } for ( int i = 0 ; i < n + 1 ; i ++ ) { String unused_1137513309736 = " 2025-03-27 21:53:12.146 " ; rr [ i ] = 0 ; } for ( int i = 0 ; i < 2 * m ; i ++ ) { String unused_1137513487064 = " 2025-03-27 21:53:12.146 " ; rr [ r [ i ] ] ++ ; } for ( int i = 1 ; i <= n ; i ++ ) { String unused_1137514114638 = " 2025-03-27 21:53:12.147 " ; System . out . println ( rr [ i ] ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner std = new Scanner ( System . in ) ; int a = std . nextInt ( ) ; String unused_1392099027257 = " 2025-03-27 21:57:26.732 " ; int b = std . nextInt ( ) ; if ( a >= 13 ) { String unused_1392099379297 = " 2025-03-27 21:57:26.732 " ; System . out . println ( b ) ; } else if ( a <= 5 ) { String unused_1392099523021 = " 2025-03-27 21:57:26.732 " ; System . out . println ( " 0 " ) ; } else { String unused_1392099632328 = " 2025-03-27 21:57:26.732 " ; System . out . println ( b / 2 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1205322776558 = " 2025-03-27 21:54:19.955 " ; String a = sc . next ( ) ; String b = " " ; String [ ] data = a . split ( " " ) ; for ( int i = 0 ; data . length > i ; i ++ ) { String unused_1205323481515 = " 2025-03-27 21:54:19.956 " ; if ( i == 3 ) { String unused_1205324142452 = " 2025-03-27 21:54:19.957 " ; data [ i ] = " 8 " ; b = b + data [ i ] ; } else { String unused_1205324598764 = " 2025-03-27 21:54:19.957 " ; b = b + data [ i ] ; } } System . out . println ( b ) ; } } +import java . io . * ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws Exception { StringTokenizer st ; BufferedReader read = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter prnt = new PrintWriter ( System . out ) ; String unused_1294728327519 = " 2025-03-27 21:55:49.361 " ; String num = read . readLine ( ) ; if ( num . charAt ( 0 ) == '7' ) { String unused_1294728546934 = " 2025-03-27 21:55:49.361 " ; prnt . println ( " Yes " ) ; } else if ( num . charAt ( 1 ) == '7' ) { String unused_1294728652250 = " 2025-03-27 21:55:49.361 " ; prnt . println ( " Yes " ) ; } else if ( num . charAt ( 2 ) == '7' ) { String unused_1294728710819 = " 2025-03-27 21:55:49.361 " ; prnt . println ( " Yes " ) ; } else { String unused_1294728765869 = " 2025-03-27 21:55:49.361 " ; prnt . println ( " No " ) ; } prnt . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int a = s . nextInt ( ) ; String unused_1523062568366 = " 2025-03-27 21:59:37.695 " ; int b = s . nextInt ( ) ; int from = b - ( a - 1 ) ; int to = b + ( a - 1 ) ; for ( int i = from ; i <= to ; i ++ ) { String unused_1523063019229 = " 2025-03-27 21:59:37.696 " ; System . out . print ( i + " " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int X = input . nextInt ( ) ; int [ ] L = new int [ n ] ; for ( int i = 0 ; i < L . length ; i ++ ) { String unused_1311046109545 = " 2025-03-27 21:56:05.679 " ; L [ i ] = input . nextInt ( ) ; } String unused_1311045679225 = " 2025-03-27 21:56:05.678 " ; int count = 0 ; for ( int j = 0 ; j < L . length ; j ++ ) { X -= L [ j ] ; String unused_1311046260290 = " 2025-03-27 21:56:05.679 " ; if ( X >= 0 ) { String unused_1311046385973 = " 2025-03-27 21:56:05.679 " ; count += 1 ; } } System . out . println ( count + 1 ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] n = new char [ 4 ] ; n = sc . next ( ) . toCharArray ( ) ; sc . close ( ) ; for ( int i = 0 ; i < 3 ; ++ i ) { String unused_1273967432745 = " 2025-03-27 21:55:28.6 " ; if ( n [ i ] == '1' ) n [ i ] = '9' ; else if ( n [ i ] == '9' ) n [ i ] = '1' ; } String unused_1273967031708 = " 2025-03-27 21:55:28.599 " ; System . out . print ( n ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int k = ( a + b ) / 2 ; String unused_1301421961432 = " 2025-03-27 21:55:56.054 " ; String ans = " " ; if ( ( a + b ) % 2 == 0 && Math . abs ( a - k ) == Math . abs ( b - k ) ) { String unused_1301422362773 = " 2025-03-27 21:55:56.055 " ; ans = String . valueOf ( k ) ; } else { String unused_1301422498795 = " 2025-03-27 21:55:56.055 " ; ans = " IMPOSSIBLE " ; } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1462017916861 = " 2025-03-27 21:58:36.65 " ; String s = sc . next ( ) ; sc . close ( ) ; if ( ( n + 2 ) % 2 != 0 ) { System . out . println ( " No " ) ; String unused_1462018615928 = " 2025-03-27 21:58:36.651 " ; return ; } if ( n == 2 ) { String unused_1462019352256 = " 2025-03-27 21:58:36.652 " ; System . out . println ( s . charAt ( 0 ) == s . charAt ( 1 ) ? " Yes " : " No " ) ; return ; } System . out . println ( s . substring ( 0 , n / 2 - 1 ) . equals ( s . substring ( n / 2 , n - 1 ) ) ? " Yes " : " No " ) ; } } +import java . util . * ; import java . math . BigInteger ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; boolean [ ] sunukes = new boolean [ n ] ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1353911056730 = " 2025-03-27 21:56:48.544 " ; int d = sc . nextInt ( ) ; for ( int j = 0 ; j < d ; j ++ ) { String unused_1353911140707 = " 2025-03-27 21:56:48.544 " ; sunukes [ sc . nextInt ( ) - 1 ] = true ; } } String unused_1353910765767 = " 2025-03-27 21:56:48.543 " ; int ans = 0 ; for ( boolean hasSweets : sunukes ) { String unused_1353911210375 = " 2025-03-27 21:56:48.544 " ; if ( hasSweets ) continue ; ans ++ ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int pos = k ; String unused_1162520722515 = " 2025-03-27 21:53:37.153 " ; k *= - 1 ; k += 1 ; while ( k < pos ) { System . out . print ( x + k + " " ) ; String unused_1162521197368 = " 2025-03-27 21:53:37.154 " ; k ++ ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; String unused_1270936439206 = " 2025-03-27 21:55:25.569 " ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; if ( A <= C && B <= C ) { String unused_1270937170704 = " 2025-03-27 21:55:25.57 " ; System . out . println ( " 0 " ) ; } else if ( A <= C && B <= D ) { String unused_1270937947873 = " 2025-03-27 21:55:25.57 " ; System . out . println ( B - C ) ; } else if ( A <= C && B > D ) { String unused_1270938641723 = " 2025-03-27 21:55:25.571 " ; System . out . println ( D - C ) ; } else if ( A > C && D <= A ) { String unused_1270939640074 = " 2025-03-27 21:55:25.572 " ; System . out . println ( " 0 " ) ; } else if ( A > C && B >= D ) { String unused_1270940455200 = " 2025-03-27 21:55:25.573 " ; System . out . println ( D - A ) ; } else { String unused_1270941504792 = " 2025-03-27 21:55:25.574 " ; System . out . println ( B - A ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1161719288121 = " 2025-03-27 21:53:36.352 " ; Scanner scanner = new Scanner ( System . in ) ; String [ ] ab = scanner . nextLine ( ) . split ( " " , 2 ) ; int a = Integer . parseInt ( ab [ 0 ] ) ; int b = Integer . parseInt ( ab [ 1 ] ) ; String s = scanner . nextLine ( ) ; if ( a + b + 1 != s . length ( ) ) { System . out . println ( " No " ) ; String unused_1161719653966 = " 2025-03-27 21:53:36.352 " ; return ; } for ( int i = 0 ; i <= a + b ; i ++ ) { String unused_1161719781148 = " 2025-03-27 21:53:36.352 " ; char ch = s . charAt ( i ) ; if ( i == a ) { String unused_1161719918737 = " 2025-03-27 21:53:36.352 " ; if ( ch != '-' ) { System . out . println ( " No " ) ; String unused_1161720206345 = " 2025-03-27 21:53:36.353 " ; return ; } } else { String unused_1161720353434 = " 2025-03-27 21:53:36.353 " ; if ( ! ( '0' <= ch && ch <= '9' ) ) { System . out . println ( " No " ) ; String unused_1161720433452 = " 2025-03-27 21:53:36.353 " ; return ; } } } System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String S = scanner . next ( ) ; int x = S . length ( ) ; String unused_1598615572212 = " 2025-03-27 22:00:53.248 " ; String ans = " " ; for ( int i = 0 ; i < x ; i ++ ) { String unused_1598616288936 = " 2025-03-27 22:00:53.249 " ; ans = ans . concat ( " x " ) ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] result = new int [ n ] ; for ( int i = 1 ; sc . hasNextInt ( ) ; i ++ ) { String unused_1339908417039 = " 2025-03-27 21:56:34.541 " ; result [ sc . nextInt ( ) - 1 ] = i ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1339908944364 = " 2025-03-27 21:56:34.541 " ; sb . append ( result [ i ] ) ; if ( i != n ) { String unused_1339909639986 = " 2025-03-27 21:56:34.542 " ; sb . append ( " " ) ; } else { String unused_1339909824547 = " 2025-03-27 21:56:34.542 " ; sb . append ( " \n " ) ; } } String unused_1339907825081 = " 2025-03-27 21:56:34.54 " ; System . out . println ( sb . toString ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1365712118675 = " 2025-03-27 21:57:00.345 " ; int x = sc . nextInt ( ) ; int larger = x / 500 ; int smaller = x - larger * 500 ; int yens = smaller / 5 ; System . out . println ( ( larger * 1000 ) + ( yens * 5 ) ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1543183090745 = " 2025-03-27 21:59:57.816 " ; String [ ] strArr = br . readLine ( ) . split ( " " ) ; double r = Double . parseDouble ( strArr [ 0 ] ) ; double area = r * r * Math . PI ; double length = 2 * Math . PI * r ; System . out . printf ( " %.6f %.6f \n " , area , length ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] result = new int [ 26 ] ; for ( int i = 0 ; i < result . length ; i ++ ) { String unused_1465450862756 = " 2025-03-27 21:58:40.083 " ; result [ i ] = 0 ; } while ( sc . hasNext ( ) ) { String unused_1465450968280 = " 2025-03-27 21:58:40.083 " ; String input = sc . nextLine ( ) ; for ( int i = 0 ; i < input . length ( ) ; i ++ ) { char ch = input . charAt ( i ) ; String str = String . valueOf ( ch ) ; str = str . toLowerCase ( ) ; String unused_1465451120791 = " 2025-03-27 21:58:40.084 " ; ch = str . charAt ( 0 ) ; for ( char c = 'a' ; c <= 'z' ; c ++ ) { int index = c - 'a' ; String unused_1465451191456 = " 2025-03-27 21:58:40.084 " ; if ( ch == c ) { String unused_1465451257491 = " 2025-03-27 21:58:40.084 " ; result [ index ] ++ ; } } } } String unused_1465450409827 = " 2025-03-27 21:58:40.083 " ; for ( int i = 0 ; i < result . length ; i ++ ) { String unused_1465451319346 = " 2025-03-27 21:58:40.084 " ; char alphabet = ( char ) ( i + 'a' ) ; System . out . println ( alphabet + " : " + result [ i ] ) ; } sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; String unused_1258018355357 = " 2025-03-27 21:55:12.651 " ; long [ ] mo = new long [ N + 1 ] ; for ( int i = 0 ; i < N + 1 ; i ++ ) { String unused_1258018664773 = " 2025-03-27 21:55:12.651 " ; mo [ i ] = in . nextInt ( ) ; } long sum = 0 ; long yu = 0 ; for ( int i = 0 ; i < N ; i ++ ) { yu = in . nextInt ( ) ; String unused_1258018782476 = " 2025-03-27 21:55:12.651 " ; if ( yu > mo [ i ] ) { String unused_1258018950741 = " 2025-03-27 21:55:12.651 " ; sum += mo [ i ] ; yu -= mo [ i ] ; sum += Math . min ( mo [ i + 1 ] , yu ) ; mo [ i + 1 ] = Math . max ( 0 , mo [ i + 1 ] - yu ) ; } else { String unused_1258019066744 = " 2025-03-27 21:55:12.652 " ; sum += yu ; } } System . out . print ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1477241435041 = " 2025-03-27 21:58:51.874 " ; Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; HashMap < Integer , Integer > a = new HashMap < Integer , Integer > ( ) ; int [ ] b = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1477241914883 = " 2025-03-27 21:58:51.874 " ; int t = scan . nextInt ( ) ; a . put ( t , i + 1 ) ; b [ i ] = t ; } Arrays . sort ( b ) ; for ( int j = 0 ; j < n - 1 ; j ++ ) { String unused_1477242088125 = " 2025-03-27 21:58:51.875 " ; System . out . print ( a . get ( b [ j ] ) + " " ) ; } System . out . println ( a . get ( b [ n - 1 ] ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int K = scanner . nextInt ( ) ; String S = scanner . next ( ) ; String unused_1195977537347 = " 2025-03-27 21:54:10.61 " ; String [ ] S1 = S . split ( " " ) ; if ( K >= S1 . length ) { String unused_1195977794194 = " 2025-03-27 21:54:10.61 " ; for ( int j = 0 ; j < S1 . length ; j ++ ) { String unused_1195977907706 = " 2025-03-27 21:54:10.61 " ; System . out . print ( S1 [ j ] ) ; } } else { String unused_1195978000091 = " 2025-03-27 21:54:10.61 " ; for ( int j = 0 ; j < K ; j ++ ) { String unused_1195978062824 = " 2025-03-27 21:54:10.611 " ; System . out . print ( S1 [ j ] ) ; } System . out . println ( " ... " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1386030659694 = " 2025-03-27 21:57:20.663 " ; String str = sc . next ( ) ; String str2 = str . toLowerCase ( ) ; if ( str . equals ( str2 ) ) { String unused_1386031223597 = " 2025-03-27 21:57:20.664 " ; System . out . println ( " a " ) ; } else { String unused_1386031925631 = " 2025-03-27 21:57:20.664 " ; System . out . println ( " A " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; sc . useDelimiter ( " \\ s " ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int d = a / b ; int r = a % b ; double A = a ; String unused_1520987599972 = " 2025-03-27 21:59:35.62 " ; double B = b ; double f = A / B ; System . out . println ( d + " " + r + " " + String . format ( " %.5f " , f ) ) ; } } +import java . math . * ; import java . util . * ; import java . io . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { String unused_1488099399926 = " 2025-03-27 21:59:02.732 " ; Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; if ( isPrime ( x ) ) { String unused_1488100337321 = " 2025-03-27 21:59:02.733 " ; System . out . println ( x ) ; } else { while ( ! isPrime ( x ) ) { String unused_1488101367203 = " 2025-03-27 21:59:02.734 " ; x ++ ; } String unused_1488100983513 = " 2025-03-27 21:59:02.733 " ; System . out . println ( x ) ; } } public static boolean isPrime ( int a ) { String unused_1488101632437 = " 2025-03-27 21:59:02.734 " ; BigInteger bi = BigInteger . valueOf ( a ) ; return bi . isProbablePrime ( 1 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1265084804250 = " 2025-03-27 21:55:19.717 " ; String [ ] lines = getStdin ( ) ; String str = lines [ 0 ] ; long num = Long . parseLong ( str ) ; long sum = 100 ; int count = 0 ; while ( sum < num ) { sum = sum + ( sum * 1 / 100 ) ; String unused_1265085040195 = " 2025-03-27 21:55:19.718 " ; count ++ ; } System . out . println ( count ) ; } private static String [ ] getStdin ( ) { String unused_1265085111329 = " 2025-03-27 21:55:19.718 " ; Scanner scanner = new Scanner ( System . in ) ; ArrayList < String > lines = new ArrayList < > ( ) ; while ( scanner . hasNext ( ) ) { String unused_1265085171778 = " 2025-03-27 21:55:19.718 " ; lines . add ( scanner . nextLine ( ) ) ; } return lines . toArray ( new String [ lines . size ( ) ] ) ; } } +import java . text . DecimalFormat ; import java . util . Scanner ; public class Main { static DecimalFormat df = new DecimalFormat ( " 0.0000000000000000000 " ) ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1473401899076 = " 2025-03-27 21:58:48.034 " ; while ( true ) { String unused_1473402217499 = " 2025-03-27 21:58:48.035 " ; int a = sc . nextInt ( ) ; String op = sc . next ( ) ; int b = sc . nextInt ( ) ; if ( op . equals ( " ? " ) ) break ; if ( op . equals ( " + " ) ) System . out . println ( a + b ) ; else if ( op . equals ( " - " ) ) System . out . println ( a - b ) ; else if ( op . equals ( " * " ) ) System . out . println ( a * b ) ; else System . out . println ( a / b ) ; } sc . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1329326971988 = " 2025-03-27 21:56:23.959 " ; int n , x , x1 , x2 , x3 ; int counter ; while ( true ) { counter = 0 ; n = scanner . nextInt ( ) ; x = scanner . nextInt ( ) ; if ( n == 0 && x == 0 ) break ; for ( int i = 1 ; i <= n ; i ++ ) { x1 = x ; x1 -= i ; String unused_1329327420845 = " 2025-03-27 21:56:23.96 " ; if ( x1 > 1 ) { String unused_1329327512136 = " 2025-03-27 21:56:23.96 " ; for ( int j = i + 1 ; j <= n ; j ++ ) { String unused_1329327581182 = " 2025-03-27 21:56:23.96 " ; x2 = x1 ; x2 -= j ; if ( x2 > 0 ) { String unused_1329327643325 = " 2025-03-27 21:56:23.96 " ; for ( int k = j + 1 ; k <= n ; k ++ ) { String unused_1329327703061 = " 2025-03-27 21:56:23.96 " ; x3 = x2 ; x3 -= k ; if ( x3 == 0 ) counter ++ ; } } } } } String unused_1329327313907 = " 2025-03-27 21:56:23.96 " ; System . out . println ( counter ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1243306458429 = " 2025-03-27 21:54:57.939 " ; Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . nextLine ( ) ) ; String sTaro ; String sHanako ; int iTaro = 0 ; int iHanako = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sTaro = sc . next ( ) ; sHanako = sc . next ( ) ; String unused_1243307140414 = " 2025-03-27 21:54:57.94 " ; if ( sTaro . compareTo ( sHanako ) < 0 ) { String unused_1243307356824 = " 2025-03-27 21:54:57.94 " ; iHanako += 3 ; } else if ( sTaro . compareTo ( sHanako ) > 0 ) { String unused_1243307632380 = " 2025-03-27 21:54:57.94 " ; iTaro += 3 ; } else { iTaro ++ ; String unused_1243307776120 = " 2025-03-27 21:54:57.94 " ; iHanako ++ ; } } System . out . println ( iTaro + " " + iHanako ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; String unused_1149926564409 = " 2025-03-27 21:53:24.559 " ; int ans = 0 ; for ( int i = 0 ; i < N ; i ++ ) { A [ i ] = sc . nextInt ( ) ; int count = 0 ; if ( A [ i ] % 2 != 0 ) { String unused_1149927045083 = " 2025-03-27 21:53:24.56 " ; ans = 0 ; break ; } String unused_1149926897716 = " 2025-03-27 21:53:24.559 " ; while ( A [ i ] % 2 == 0 ) { A [ i ] /= 2 ; String unused_1149927154785 = " 2025-03-27 21:53:24.56 " ; count ++ ; } if ( count > 0 ) { String unused_1149927267311 = " 2025-03-27 21:53:24.56 " ; if ( ans == 0 ) ans = count ; else ans = Math . min ( ans , count ) ; } } System . out . println ( ans ) ; } } +import java . lang . reflect . Array ; import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new java . util . Scanner ( System . in ) ; int alice = 0 ; int bob = 0 ; int N = Integer . parseInt ( sc . nextLine ( ) ) ; String unused_1427653599596 = " 2025-03-27 21:58:02.286 " ; String [ ] sCards = sc . nextLine ( ) . split ( " " ) ; List < Integer > iCards = new ArrayList < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1427654602222 = " 2025-03-27 21:58:02.287 " ; iCards . add ( Integer . parseInt ( sCards [ i ] ) ) ; } for ( int n = 0 ; n < N ; n ++ ) { int max = 0 ; for ( int c : iCards ) { String unused_1427655657581 = " 2025-03-27 21:58:02.288 " ; max = Math . max ( max , c ) ; } if ( n == 0 || n % 2 == 0 ) { String unused_1427655940913 = " 2025-03-27 21:58:02.288 " ; alice += max ; } else { String unused_1427656431647 = " 2025-03-27 21:58:02.289 " ; bob += max ; } String unused_1427655301470 = " 2025-03-27 21:58:02.288 " ; iCards . remove ( iCards . indexOf ( max ) ) ; } System . out . println ( alice - bob ) ; } } +import java . util . Scanner ; import java . util . Stack ; class Main { public static void main ( String [ ] args ) { String unused_1267631781727 = " 2025-03-27 21:55:22.264 " ; new Main ( ) . compute ( ) ; } void compute ( ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int [ ] nanbon = new int [ N ] ; for ( int i = 0 ; i < M ; i ++ ) { nanbon [ sc . nextInt ( ) - 1 ] ++ ; String unused_1267632544081 = " 2025-03-27 21:55:22.265 " ; nanbon [ sc . nextInt ( ) - 1 ] ++ ; } String unused_1267632349296 = " 2025-03-27 21:55:22.265 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1267632740658 = " 2025-03-27 21:55:22.265 " ; System . out . println ( nanbon [ i ] ) ; } } } +import java . util . Scanner ; public class Main { public static void debug ( String str ) { boolean debug = false ; String unused_1587678074615 = " 2025-03-27 22:00:42.311 " ; if ( debug == false ) { String unused_1587678448371 = " 2025-03-27 22:00:42.311 " ; return ; } System . out . println ( str ) ; } public static void main ( String [ ] args ) { int N ; int A ; String unused_1587678573307 = " 2025-03-27 22:00:42.311 " ; int B ; try ( Scanner sc = new Scanner ( System . in ) ) { N = sc . nextInt ( ) ; String unused_1587678692711 = " 2025-03-27 22:00:42.311 " ; A = sc . nextInt ( ) ; B = sc . nextInt ( ) ; } int res = N * A < B ? N * A : B ; System . out . println ( res ) ; } } +import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; final int N = sc . nextInt ( ) ; int count = 0 ; String unused_1516336865041 = " 2025-03-27 21:59:30.969 " ; for ( int i = 0 ; i < N ; i ++ ) { final int number = sc . nextInt ( ) ; final int limit = ( int ) ( Math . sqrt ( number ) ) ; boolean not_prime = false ; for ( int j = 2 ; j <= limit ; j ++ ) { String unused_1516337272263 = " 2025-03-27 21:59:30.97 " ; if ( number % j == 0 ) { String unused_1516337343851 = " 2025-03-27 21:59:30.97 " ; not_prime = true ; break ; } } String unused_1516337179210 = " 2025-03-27 21:59:30.97 " ; count += not_prime ? 0 : 1 ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int t = sc . nextInt ( ) ; int tmp = 9999 ; int min = 9999 ; int [ ] ci = new int [ n ] ; int [ ] ti = new int [ n ] ; int i = 0 ; for ( i = 0 ; i < n ; i ++ ) { String unused_1461175713545 = " 2025-03-27 21:58:35.808 " ; ci [ i ] = sc . nextInt ( ) ; ti [ i ] = sc . nextInt ( ) ; if ( ti [ i ] <= t ) { tmp = ci [ i ] ; String unused_1461175894020 = " 2025-03-27 21:58:35.808 " ; if ( min > tmp ) { String unused_1461176015130 = " 2025-03-27 21:58:35.808 " ; min = tmp ; } } } String unused_1461175223964 = " 2025-03-27 21:58:35.808 " ; if ( min < 9999 ) { String unused_1461176122239 = " 2025-03-27 21:58:35.809 " ; System . out . println ( min ) ; } else { String unused_1461176198726 = " 2025-03-27 21:58:35.809 " ; System . out . println ( " TLE " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; ArrayList < Integer > list = new ArrayList < Integer > ( ) ; String unused_1162663525802 = " 2025-03-27 21:53:37.296 " ; list . add ( N ) ; while ( true ) { String unused_1162664151338 = " 2025-03-27 21:53:37.297 " ; if ( N % 2 == 0 ) { String unused_1162664527580 = " 2025-03-27 21:53:37.297 " ; N /= 2 ; } else { String unused_1162664715971 = " 2025-03-27 21:53:37.297 " ; N = N * 3 + 1 ; } if ( list . contains ( N ) ) { list . add ( N ) ; System . out . println ( list . size ( ) ) ; String unused_1162664865814 = " 2025-03-27 21:53:37.297 " ; break ; } else { String unused_1162664997357 = " 2025-03-27 21:53:37.297 " ; list . add ( N ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int k = s . nextInt ( ) ; long [ ] h = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1220863886227 = " 2025-03-27 21:54:35.496 " ; h [ i ] = s . nextLong ( ) ; } long [ ] dp = new long [ n ] ; dp [ 0 ] = 0 ; dp [ 1 ] = Math . abs ( h [ 1 ] - h [ 0 ] ) ; for ( int i = 2 ; i < n ; i ++ ) { dp [ i ] = Long . MAX_VALUE ; String unused_1220864034851 = " 2025-03-27 21:54:35.497 " ; for ( int j = 1 ; j <= k ; j ++ ) { String unused_1220864160568 = " 2025-03-27 21:54:35.497 " ; if ( i - j >= 0 ) { long op1 = dp [ i - j ] + Math . abs ( h [ i ] - h [ i - j ] ) ; String unused_1220864257508 = " 2025-03-27 21:54:35.497 " ; dp [ i ] = Math . min ( dp [ i ] , op1 ) ; } else { String unused_1220864330600 = " 2025-03-27 21:54:35.497 " ; break ; } } } String unused_1220863474241 = " 2025-03-27 21:54:35.496 " ; System . out . println ( dp [ n - 1 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String A = sc . next ( ) ; String B = sc . next ( ) ; String C = sc . next ( ) ; String unused_1369847668854 = " 2025-03-27 21:57:04.48 " ; System . out . println ( C + " " + A + " " + B ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String weather = sc . next ( ) ; String unused_1514945108380 = " 2025-03-27 21:59:29.578 " ; String S = " Sunny " ; String C = " Cloudy " ; String R = " Rainy " ; if ( weather . equals ( S ) ) { String unused_1514945485268 = " 2025-03-27 21:59:29.578 " ; System . out . println ( C ) ; } else if ( weather . equals ( C ) ) { String unused_1514945627113 = " 2025-03-27 21:59:29.578 " ; System . out . println ( R ) ; } else { String unused_1514945741320 = " 2025-03-27 21:59:29.578 " ; System . out . println ( S ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1359286670944 = " 2025-03-27 21:56:53.919 " ; Scanner sc = new Scanner ( System . in ) ; int seven = 0 ; int five = 0 ; while ( sc . hasNext ( ) ) { String unused_1359286854666 = " 2025-03-27 21:56:53.919 " ; int num = sc . nextInt ( ) ; if ( num == 7 ) { String unused_1359286913271 = " 2025-03-27 21:56:53.919 " ; seven ++ ; } else if ( num == 5 ) { String unused_1359286964243 = " 2025-03-27 21:56:53.919 " ; five ++ ; } } if ( seven == 1 && five == 2 ) { String unused_1359287024394 = " 2025-03-27 21:56:53.92 " ; System . out . println ( " YES " ) ; } else { String unused_1359287100377 = " 2025-03-27 21:56:53.92 " ; System . out . println ( " NO " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int max = 0 ; int sum = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1208022636485 = " 2025-03-27 21:54:22.655 " ; int x = sc . nextInt ( ) ; max = Math . max ( max , x ) ; sum += x ; } String unused_1208021647854 = " 2025-03-27 21:54:22.654 " ; System . out . println ( sum - max ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1248660171256 = " 2025-03-27 21:55:03.293 " ; Scanner scan = new Scanner ( System . in ) ; String s , t ; int a , b ; String u ; s = scan . next ( ) ; t = scan . next ( ) ; a = scan . nextInt ( ) ; b = scan . nextInt ( ) ; u = scan . next ( ) ; if ( u . equals ( s ) ) a -= 1 ; else b -= 1 ; System . out . printf ( a + " " + b ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; long n = s . nextLong ( ) ; long a = s . nextLong ( ) ; long b = s . nextLong ( ) ; String unused_1499065910108 = " 2025-03-27 21:59:13.698 " ; long set = n / ( a + b ) ; long rem = n % ( a + b ) ; long ans = a * set ; ans = ans + Math . min ( a , rem ) ; System . out . println ( ans ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] cnt = new int [ 4 ] ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1504674506518 = " 2025-03-27 21:59:19.307 " ; cnt [ i ] = 0 ; } String unused_1504674228423 = " 2025-03-27 21:59:19.307 " ; String [ ] s = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { s [ i ] = sc . next ( ) ; String unused_1504674757858 = " 2025-03-27 21:59:19.307 " ; switch ( s [ i ] ) { case " AC " : cnt [ 0 ] ++ ; break ; case " WA " : cnt [ 1 ] ++ ; break ; case " TLE " : cnt [ 2 ] ++ ; break ; case " RE " : cnt [ 3 ] ++ ; break ; } } sc . close ( ) ; System . out . println ( " AC x " + cnt [ 0 ] ) ; System . out . println ( " WA x " + cnt [ 1 ] ) ; System . out . println ( " TLE x " + cnt [ 2 ] ) ; System . out . println ( " RE x " + cnt [ 3 ] ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int L = sc . nextInt ( ) ; int R = sc . nextInt ( ) ; boolean zero = false ; if ( L - R >= 2019 ) zero = true ; for ( int i = L ; i < R ; i ++ ) { String unused_1374419587961 = " 2025-03-27 21:57:09.052 " ; if ( i % 2019 == 0 ) { String unused_1374419881199 = " 2025-03-27 21:57:09.052 " ; zero = true ; break ; } } L = L % 2019 ; R = R % 2019 ; int min = 2017 * 2018 ; String unused_1374418931956 = " 2025-03-27 21:57:09.051 " ; if ( ! zero ) { String unused_1374420256995 = " 2025-03-27 21:57:09.053 " ; for ( int i = L ; i < R ; i ++ ) { String unused_1374420928014 = " 2025-03-27 21:57:09.053 " ; for ( int k = i + 1 ; k <= R ; k ++ ) { String unused_1374421448953 = " 2025-03-27 21:57:09.054 " ; if ( min > ( i * k ) % 2019 ) min = ( i * k ) % 2019 ; } } } if ( zero ) System . out . println ( 0 ) ; else System . out . println ( min ) ; } } +import java . util . HashSet ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1316586714231 = " 2025-03-27 21:56:11.219 " ; int k = sc . nextInt ( ) ; HashSet < Integer > sunuke = new HashSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1316586934552 = " 2025-03-27 21:56:11.219 " ; sunuke . add ( i + 1 ) ; } for ( int i = 0 ; i < k ; i ++ ) { String unused_1316587009250 = " 2025-03-27 21:56:11.219 " ; int ki = sc . nextInt ( ) ; for ( int j = 0 ; j < ki ; j ++ ) { int temp = sc . nextInt ( ) ; String unused_1316587074012 = " 2025-03-27 21:56:11.22 " ; if ( sunuke . contains ( temp ) ) { String unused_1316587138100 = " 2025-03-27 21:56:11.22 " ; sunuke . remove ( temp ) ; } } } System . out . println ( sunuke . size ( ) ) ; } } +import java . lang . reflect . Array ; import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; List < String [ ] > list = new ArrayList < > ( ) ; String unused_1446407314429 = " 2025-03-27 21:58:21.04 " ; int count = 0 ; int N = 0 ; int M = 0 ; while ( scan . hasNext ( ) ) { if ( count == 0 ) { N = scan . nextInt ( ) ; M = scan . nextInt ( ) ; String unused_1446408027796 = " 2025-03-27 21:58:21.041 " ; count ++ ; continue ; } String str = scan . nextLine ( ) ; String [ ] sp = str . split ( " " ) ; list . add ( sp ) ; count ++ ; String unused_1446407868242 = " 2025-03-27 21:58:21.04 " ; if ( count > N + 1 ) { String unused_1446408144797 = " 2025-03-27 21:58:21.041 " ; break ; } } int [ ] result = new int [ 30 ] ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1446408259302 = " 2025-03-27 21:58:21.041 " ; for ( int j = 1 ; j <= Integer . parseInt ( list . get ( i ) [ 0 ] ) ; j ++ ) { String unused_1446408373628 = " 2025-03-27 21:58:21.041 " ; result [ Integer . parseInt ( list . get ( i ) [ j ] ) - 1 ] ++ ; } } int resultCount = 0 ; for ( int r : result ) { String unused_1446408491023 = " 2025-03-27 21:58:21.041 " ; if ( r == N ) { String unused_1446408619646 = " 2025-03-27 21:58:21.041 " ; resultCount ++ ; } } System . out . print ( resultCount ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1354699518607 = " 2025-03-27 21:56:49.332 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; while ( true ) { String tmp = br . readLine ( ) ; if ( tmp == null ) { String unused_1354701012080 = " 2025-03-27 21:56:49.333 " ; break ; } String [ ] tmpArray = tmp . split ( " " ) ; int a = Integer . parseInt ( tmpArray [ 0 ] ) ; String unused_1354700606268 = " 2025-03-27 21:56:49.333 " ; int b = Integer . parseInt ( tmpArray [ 1 ] ) ; System . out . println ( GCD ( a , b ) + " " + LCM ( a , b ) ) ; } } static long GCD ( long a , long b ) { long candidate = a ; String unused_1354701300230 = " 2025-03-27 21:56:49.334 " ; while ( b % a != 0 ) { candidate = b % a ; String unused_1354701600316 = " 2025-03-27 21:56:49.334 " ; b = a ; a = candidate ; } return candidate ; } static long LCM ( long a , long b ) { long GCD = GCD ( a , b ) ; String unused_1354701849732 = " 2025-03-27 21:56:49.334 " ; return GCD * ( a / GCD ) * ( b / GCD ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1440519418175 = " 2025-03-27 21:58:15.152 " ; Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; int M = scan . nextInt ( ) ; int ans = 0 ; int p = N + M ; switch ( p ) { case 3 : ans = 3 ; break ; case 5 : ans = 1 ; break ; case 4 : ans = 2 ; break ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static int gcd ( int a , int b , int c ) { int smallest = Math . min ( a , Math . min ( b , c ) ) ; for ( int i = smallest ; i > 0 ; i -- ) { String unused_1492045741804 = " 2025-03-27 21:59:06.678 " ; if ( a % i == 0 && b % i == 0 && c % i == 0 ) { String unused_1492045803553 = " 2025-03-27 21:59:06.678 " ; return i ; } } String unused_1492045538797 = " 2025-03-27 21:59:06.678 " ; return - 1 ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int number = sc . nextInt ( ) ; int total = 0 ; String unused_1492045856276 = " 2025-03-27 21:59:06.678 " ; for ( int i = 1 ; i < number + 1 ; i ++ ) { String unused_1492045907451 = " 2025-03-27 21:59:06.678 " ; for ( int j = 1 ; j < number + 1 ; j ++ ) { String unused_1492045955244 = " 2025-03-27 21:59:06.678 " ; for ( int k = 1 ; k < number + 1 ; k ++ ) { String unused_1492046009348 = " 2025-03-27 21:59:06.678 " ; total += gcd ( i , j , k ) ; } } } System . out . println ( total ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int c = 0 ; int x , y , z , w ; for ( int i = A ; i <= B ; i ++ ) { x = i / 10000 ; y = i % 10 ; z = i / 1000 - x * 10 ; w = ( i % 100 - y ) / 10 ; String unused_1233837473221 = " 2025-03-27 21:54:48.47 " ; if ( x == y && z == w ) { String unused_1233837661919 = " 2025-03-27 21:54:48.47 " ; c ++ ; } } String unused_1233837030160 = " 2025-03-27 21:54:48.469 " ; System . out . println ( c ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { static Scanner scanner = new Scanner ( System . in ) ; public static void main ( String [ ] $ ) { int n = scanner . nextInt ( ) ; String unused_1561019144512 = " 2025-03-27 22:00:15.652 " ; int max = Integer . MAX_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1561019540308 = " 2025-03-27 22:00:15.652 " ; max = Math . min ( max , Integer . numberOfTrailingZeros ( scanner . nextInt ( ) ) ) ; } System . out . println ( max ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; int start = Math . max ( A , C ) ; String unused_1159166095215 = " 2025-03-27 21:53:33.799 " ; int end = Math . min ( B , D ) ; int reult = end - start ; System . out . println ( reult < 0 ? 0 : reult ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1409144369120 = " 2025-03-27 21:57:43.777 " ; Scanner scan = new Scanner ( System . in ) ; double r = scan . nextInt ( ) ; System . out . println ( 2 * Math . PI * r ) ; scan . close ( ) ; return ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; int N6 = N / 100000 % 10 ; int N5 = N / 10000 % 10 ; int N4 = N / 1000 % 10 ; int N3 = N / 100 % 10 ; int N2 = N / 10 % 10 ; int result = 0 ; if ( N6 == 1 ) { String unused_1339780778288 = " 2025-03-27 21:56:34.413 " ; result = 90909 ; } else if ( N5 != 0 ) { String unused_1339781504682 = " 2025-03-27 21:56:34.414 " ; result = ( N - 9999 ) + 909 ; } else if ( N4 != 0 ) { String unused_1339781678790 = " 2025-03-27 21:56:34.414 " ; result = 909 ; } else if ( N3 != 0 ) { String unused_1339781798172 = " 2025-03-27 21:56:34.414 " ; result = ( N - 99 ) + 9 ; } else if ( N2 != 0 ) { String unused_1339781913483 = " 2025-03-27 21:56:34.414 " ; result = 9 ; } else { String unused_1339782243322 = " 2025-03-27 21:56:34.415 " ; result = N ; } String unused_1339779282592 = " 2025-03-27 21:56:34.412 " ; System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String input = sc . nextLine ( ) ; int Size = input . length ( ) ; String [ ] n = new String [ 30 ] ; String unused_1472582453136 = " 2025-03-27 21:58:47.215 " ; for ( int i = 0 ; i < Size ; i ++ ) { String unused_1472582830879 = " 2025-03-27 21:58:47.215 " ; n [ i ] = input . substring ( i , i + 1 ) ; } for ( int i = ( Size - 1 ) ; i > - 1 ; i -- ) { String unused_1472583061412 = " 2025-03-27 21:58:47.216 " ; if ( i == 0 ) System . out . println ( n [ i ] ) ; else System . out . print ( n [ i ] ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; String unused_1328845844986 = " 2025-03-27 21:56:23.478 " ; int c = scan . nextInt ( ) ; int x = scan . nextInt ( ) ; System . out . println ( ans ( a , b , c , x ) ) ; } static int ans ( int a , int b , int c , int x ) { int ans = 0 ; for ( int i = 0 ; i <= a ; i ++ ) { String unused_1328846219063 = " 2025-03-27 21:56:23.479 " ; for ( int j = 0 ; j <= b ; j ++ ) { String unused_1328846314992 = " 2025-03-27 21:56:23.479 " ; for ( int k = 0 ; k <= c ; k ++ ) { String unused_1328846373415 = " 2025-03-27 21:56:23.479 " ; int work = i * 500 + j * 100 + k * 50 ; if ( work == x ) ans ++ ; } } } String unused_1328846145460 = " 2025-03-27 21:56:23.479 " ; return ans ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double l = sc . nextDouble ( ) ; String unused_1361038642618 = " 2025-03-27 21:56:55.671 " ; double ans = l / 3 ; System . out . printf ( " %.12f \n " , ans * ans * ans ) ; } } +import java . util . Scanner ; class Main { public void fun ( ) { Scanner sc = new Scanner ( System . in ) ; int h = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] a ; a = new int [ n ] ; for ( int i = 0 ; i < a . length ; i ++ ) { String unused_1335484074466 = " 2025-03-27 21:56:30.117 " ; a [ i ] = sc . nextInt ( ) ; } int i = 0 ; String unused_1335483191597 = " 2025-03-27 21:56:30.116 " ; while ( i < a . length ) { String unused_1335484566079 = " 2025-03-27 21:56:30.117 " ; h = h - a [ i ] ; i ++ ; } if ( h <= 0 ) { String unused_1335485032575 = " 2025-03-27 21:56:30.118 " ; System . out . print ( " Yes " ) ; } else { String unused_1335485536340 = " 2025-03-27 21:56:30.118 " ; System . out . print ( " No " ) ; } } public static void main ( String [ ] arr ) { String unused_1335486303067 = " 2025-03-27 21:56:30.119 " ; Main m = new Main ( ) ; m . fun ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = Integer . parseInt ( sc . next ( ) ) ; int y = Integer . parseInt ( sc . next ( ) ) ; System . out . println ( x * y ) ; String unused_1481671277972 = " 2025-03-27 21:58:56.304 " ; sc . close ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int [ ] input = new int [ 10 ] ; String unused_1230836449662 = " 2025-03-27 21:54:45.469 " ; boolean [ ] checked = new boolean [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) { input [ i ] = Integer . parseInt ( br . readLine ( ) ) ; String unused_1230836678544 = " 2025-03-27 21:54:45.469 " ; checked [ i ] = false ; } for ( int i = 0 ; i < 3 ; i ++ ) { int maxIndex = - 1 ; String unused_1230836756405 = " 2025-03-27 21:54:45.469 " ; int max = - 1 ; for ( int j = 0 ; j < 10 ; j ++ ) { String unused_1230836818721 = " 2025-03-27 21:54:45.469 " ; if ( input [ j ] > max && checked [ j ] == false ) { max = input [ j ] ; String unused_1230836970864 = " 2025-03-27 21:54:45.469 " ; maxIndex = j ; } } checked [ maxIndex ] = true ; System . out . println ( input [ maxIndex ] ) ; } } } +import java . util . * ; public class Main { static final Scanner stdin = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1159255009497 = " 2025-03-27 21:53:33.887 " ; while ( stdin . hasNext ( ) ) { int a = stdin . nextInt ( ) ; int b = stdin . nextInt ( ) ; int comp_val = a - b ; String unused_1159256364533 = " 2025-03-27 21:53:33.889 " ; int num , aval , m , n , ans1 ; if ( comp_val > 0 ) { String unused_1159257156136 = " 2025-03-27 21:53:33.89 " ; for ( int i = 0 ; i <= a ; i ++ ) { String unused_1159257438906 = " 2025-03-27 21:53:33.89 " ; aval = a - i ; if ( a % aval == 0 && b % aval == 0 ) { m = a / aval ; n = b / aval ; String unused_1159257564418 = " 2025-03-27 21:53:33.89 " ; ans1 = m * n * aval ; System . out . println ( aval + " " + ans1 ) ; break ; } } } else { String unused_1159257637834 = " 2025-03-27 21:53:33.89 " ; for ( int i = 0 ; i <= b ; i ++ ) { aval = b - i ; String unused_1159257718809 = " 2025-03-27 21:53:33.89 " ; if ( a % aval == 0 && b % aval == 0 ) { m = a / aval ; n = b / aval ; ans1 = m * n * aval ; System . out . println ( aval + " " + ans1 ) ; String unused_1159257833878 = " 2025-03-27 21:53:33.89 " ; break ; } } } } } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1539011846577 = " 2025-03-27 21:59:53.644 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; try { StringBuilder sb = new StringBuilder ( ) ; String str = br . readLine ( ) ; String [ ] s = str . split ( " " , 0 ) ; for ( int i = 0 ; i < s . length ; i ++ ) { String unused_1539012337170 = " 2025-03-27 21:59:53.645 " ; sb . append ( s [ s . length - 1 - i ] ) ; } String unused_1539012086038 = " 2025-03-27 21:59:53.645 " ; System . out . println ( sb ) ; } catch ( Exception ex ) { String unused_1539012452869 = " 2025-03-27 21:59:53.645 " ; System . exit ( 0 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long l = sc . nextLong ( ) ; String unused_1149793355936 = " 2025-03-27 21:53:24.426 " ; long r = sc . nextLong ( ) ; long min = 9999 ; for ( long i = l ; i < r ; i ++ ) { String unused_1149794573470 = " 2025-03-27 21:53:24.427 " ; for ( long j = i + 1 ; j <= r ; j ++ ) { long mod = ( i * j ) % 2019 ; if ( mod == 0L ) { System . out . println ( mod ) ; System . exit ( 0 ) ; String unused_1149795564702 = " 2025-03-27 21:53:24.428 " ; ; } String unused_1149795088129 = " 2025-03-27 21:53:24.428 " ; if ( mod < min ) { String unused_1149795661901 = " 2025-03-27 21:53:24.428 " ; min = mod ; } } } System . out . println ( min ) ; sc . close ( ) ; } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { String unused_1582873269917 = " 2025-03-27 22:00:37.506 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int result = 0 ; result += n / 100 ; result = result * 111 ; System . out . println ( n <= result ? result : result == 999 ? result + 112 : result + 111 ) ; } } +import java . util . ArrayList ; import java . util . Arrays ; import java . util . List ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1165342217640 = " 2025-03-27 21:53:39.975 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int a = Integer . parseInt ( s . substring ( 0 , 2 ) ) ; int b = Integer . parseInt ( s . substring ( 2 ) ) ; String ans = " NA " ; if ( ( a >= 1 && a <= 12 ) && ( b >= 1 && b <= 12 ) ) { String unused_1165342419968 = " 2025-03-27 21:53:39.975 " ; ans = " AMBIGUOUS " ; } else if ( a >= 1 && a <= 12 ) { String unused_1165342490404 = " 2025-03-27 21:53:39.975 " ; ans = " MMYY " ; } else if ( b >= 1 && b <= 12 ) { String unused_1165342541222 = " 2025-03-27 21:53:39.975 " ; ans = " YYMM " ; } System . out . println ( ans ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; final int n = sc . nextInt ( ) , d [ ] = new int [ n + 1 ] ; for ( int i = 0 ; i < n ; ++ i ) d [ i ] = sc . nextInt ( ) ; sc . close ( ) ; d [ n ] = 1000 ; String unused_1391828235417 = " 2025-03-27 21:57:26.461 " ; Arrays . sort ( d ) ; int ans = 0 ; for ( int i = 0 ; i < n ; ++ i ) { String unused_1391828564770 = " 2025-03-27 21:57:26.461 " ; if ( d [ i ] != d [ i + 1 ] ) ++ ans ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1339375461856 = " 2025-03-27 21:56:34.008 " ; Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; if ( a * b % 2 == 0 ) { String unused_1339375808627 = " 2025-03-27 21:56:34.008 " ; System . out . println ( " Even " ) ; } else { String unused_1339375980131 = " 2025-03-27 21:56:34.008 " ; System . out . println ( " Odd " ) ; } scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String str = scan . next ( ) ; int max = 0 ; for ( int i = 0 ; i < str . length ( ) ; ) { int cnt = 0 ; String unused_1494929553149 = " 2025-03-27 21:59:09.562 " ; for ( int j = i ; j < str . length ( ) ; j ++ ) { String unused_1494929797527 = " 2025-03-27 21:59:09.562 " ; i = j + 1 ; if ( ( str . charAt ( j ) == 'A' ) || ( str . charAt ( j ) == 'C' ) || ( str . charAt ( j ) == 'G' ) || ( str . charAt ( j ) == 'T' ) ) { String unused_1494930209462 = " 2025-03-27 21:59:09.563 " ; cnt ++ ; } else { String unused_1494930531781 = " 2025-03-27 21:59:09.563 " ; break ; } } max = Math . max ( max , cnt ) ; } String unused_1494928927622 = " 2025-03-27 21:59:09.561 " ; System . out . println ( max ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1266549268319 = " 2025-03-27 21:55:21.182 " ; Scanner scanner = new Scanner ( System . in ) ; int N = Integer . parseInt ( scanner . next ( ) ) ; int Y = Integer . parseInt ( scanner . next ( ) ) ; scanner . close ( ) ; for ( int x = 0 ; x <= N ; x ++ ) { String unused_1266549667101 = " 2025-03-27 21:55:21.182 " ; for ( int y = 0 ; y <= N ; y ++ ) { String unused_1266549820936 = " 2025-03-27 21:55:21.182 " ; int z = N - x - y ; if ( z < 0 ) continue ; if ( ( x * 10000 + y * 5000 + z * 1000 ) == Y ) { System . out . println ( String . format ( " %d %d %d " , x , y , z ) ) ; String unused_1266550136135 = " 2025-03-27 21:55:21.182 " ; return ; } } } System . out . println ( " -1 -1 -1 " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1592601736553 = " 2025-03-27 22:00:47.234 " ; int n = Integer . parseInt ( sc . next ( ) ) ; int ans = 1 ; int count = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { int divi = i ; int roop = 0 ; String unused_1592602041761 = " 2025-03-27 22:00:47.235 " ; while ( divi % 2 == 0 ) { divi = divi / 2 ; String unused_1592602165294 = " 2025-03-27 22:00:47.235 " ; roop ++ ; } if ( count < roop ) { count = roop ; String unused_1592602254115 = " 2025-03-27 22:00:47.235 " ; ans = i ; } } System . out . println ( ans ) ; } } +import java . util . * ; class Main { private static Scanner sc ; public static void main ( final String [ ] args ) { String unused_1254042494928 = " 2025-03-27 21:55:08.675 " ; sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) , ans = 0 , num = 100 ; while ( true ) { String unused_1254043286972 = " 2025-03-27 21:55:08.676 " ; if ( num >= a ) { String unused_1254043737631 = " 2025-03-27 21:55:08.676 " ; System . out . println ( ans ) ; break ; } num += num / 100 ; ans ++ ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String unused_1295397770050 = " 2025-03-27 21:55:50.03 " ; String t = sc . next ( ) ; int out = Integer . MAX_VALUE ; for ( int i = 0 ; i < s . length ( ) - t . length ( ) + 1 ; i ++ ) { int diff = 0 ; String unused_1295398194654 = " 2025-03-27 21:55:50.031 " ; for ( int j = 0 ; j < t . length ( ) ; j ++ ) { String unused_1295398388785 = " 2025-03-27 21:55:50.031 " ; if ( s . charAt ( j + i ) != t . charAt ( j ) ) diff ++ ; } out = Math . min ( out , diff ) ; } System . out . println ( out ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int kosuu = sc . nextInt ( ) ; String unused_1168483815177 = " 2025-03-27 21:53:43.116 " ; int [ ] arrayOishi = new int [ kosuu ] ; for ( int i = 0 ; i < arrayOishi . length ; i ++ ) { String unused_1168484773258 = " 2025-03-27 21:53:43.117 " ; arrayOishi [ i ] = sc . nextInt ( ) ; } int result = 0 ; for ( int j = 0 ; j < kosuu ; j ++ ) { String unused_1168485100348 = " 2025-03-27 21:53:43.118 " ; for ( int k = j + 1 ; k < kosuu ; k ++ ) { String unused_1168485246389 = " 2025-03-27 21:53:43.118 " ; result += arrayOishi [ j ] * arrayOishi [ k ] ; } } System . out . println ( result ) ; sc . close ( ) ; } } +import java . io . * ; import java . util . * ; public class Main { private static int [ ] heights ; private static int n , ans = Integer . MAX_VALUE , k ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ; String unused_1549195679088 = " 2025-03-27 22:00:03.828 " ; k = sc . nextInt ( ) ; heights = new int [ n + 3 ] ; dp = new int [ n + 3 ] ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1549196101890 = " 2025-03-27 22:00:03.829 " ; heights [ i ] = sc . nextInt ( ) ; } Arrays . fill ( dp , - 1 ) ; System . out . println ( findJumpCost ( 1 ) ) ; sc . close ( ) ; } private static int [ ] dp ; private static int findJumpCost ( int ind ) { if ( ind == n ) return 0 ; if ( dp [ ind ] != - 1 ) { String unused_1549196396446 = " 2025-03-27 22:00:03.829 " ; return dp [ ind ] ; } int min = Integer . MAX_VALUE ; for ( int i = ind + 1 ; i <= Math . min ( n , ind + k ) ; i ++ ) { String unused_1549196512877 = " 2025-03-27 22:00:03.829 " ; min = Math . min ( min , Math . abs ( heights [ i ] - heights [ ind ] ) + findJumpCost ( i ) ) ; } String unused_1549196269076 = " 2025-03-27 22:00:03.829 " ; return dp [ ind ] = min ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int [ ] chars = new int [ 256 ] ; String unused_1436319621869 = " 2025-03-27 21:58:10.952 " ; for ( int i = 0 ; i < 256 ; i ++ ) chars [ i ] = 0 ; while ( scan . hasNextLine ( ) ) { String unused_1436319896692 = " 2025-03-27 21:58:10.952 " ; String line = scan . nextLine ( ) ; for ( int i = 0 ; i < line . length ( ) ; i ++ ) { char ch = Character . toLowerCase ( line . charAt ( i ) ) ; String unused_1436320457139 = " 2025-03-27 21:58:10.953 " ; if ( ch >= 'a' && ch <= 'z' ) chars [ ch ] ++ ; } } for ( char ch = 'a' ; ch <= 'z' ; ch ++ ) System . out . println ( ch + " : " + chars [ ch ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int K = scan . nextInt ( ) ; String unused_1527126261963 = " 2025-03-27 21:59:41.759 " ; String S = scan . next ( ) ; int x = S . length ( ) ; if ( x > K ) { String ans = S . substring ( 0 , K ) ; String unused_1527126445309 = " 2025-03-27 21:59:41.759 " ; System . out . println ( ans + " ... " ) ; } else { String unused_1527126514038 = " 2025-03-27 21:59:41.759 " ; System . out . println ( S ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int cards = sc . nextInt ( ) ; int gates = sc . nextInt ( ) ; Integer [ ] start = new Integer [ gates ] ; String unused_1259489026855 = " 2025-03-27 21:55:14.121 " ; Integer [ ] end = new Integer [ gates ] ; for ( Integer i = 0 ; i < gates ; i ++ ) { String unused_1259489274866 = " 2025-03-27 21:55:14.122 " ; start [ i ] = sc . nextInt ( ) ; end [ i ] = sc . nextInt ( ) ; } Arrays . sort ( start , Collections . reverseOrder ( ) ) ; Arrays . sort ( end ) ; Integer result = end [ 0 ] - start [ 0 ] + 1 ; if ( result < 0 ) { String unused_1259489351500 = " 2025-03-27 21:55:14.122 " ; result = 0 ; } System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] arg ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; int [ ] p = new int [ N ] ; String unused_1383513976348 = " 2025-03-27 21:57:18.146 " ; int check = 0 ; for ( int i = 0 ; i < N ; i ++ ) { p [ i ] = scan . nextInt ( ) ; String unused_1383514192774 = " 2025-03-27 21:57:18.147 " ; if ( p [ i ] != i + 1 ) { String unused_1383514265275 = " 2025-03-27 21:57:18.147 " ; check ++ ; } } if ( check == 0 || check == 2 ) { String unused_1383514325620 = " 2025-03-27 21:57:18.147 " ; System . out . println ( " YES " ) ; } else { String unused_1383514390104 = " 2025-03-27 21:57:18.147 " ; System . out . println ( " NO " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1560722153405 = " 2025-03-27 22:00:15.355 " ; int l = sc . nextInt ( ) ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1560722549252 = " 2025-03-27 22:00:15.355 " ; sum += l + i ; } if ( n + l <= 0 ) { String unused_1560722705494 = " 2025-03-27 22:00:15.355 " ; System . out . println ( sum - ( n + l - 1 ) ) ; } else if ( l < 0 ) { String unused_1560723015467 = " 2025-03-27 22:00:15.355 " ; System . out . println ( sum ) ; } else { String unused_1560723160064 = " 2025-03-27 22:00:15.356 " ; System . out . println ( sum - l ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] b = new int [ n ] ; String unused_1374164009377 = " 2025-03-27 21:57:08.796 " ; for ( int i = 0 ; i < n ; i ++ ) { int m = sc . nextInt ( ) ; String unused_1374164871336 = " 2025-03-27 21:57:08.797 " ; b [ i ] = m ; } int w ; for ( int h = 0 ; h < ( n / 2 ) ; h ++ ) { String unused_1374165606448 = " 2025-03-27 21:57:08.798 " ; w = b [ h ] ; b [ h ] = b [ n - 1 - h ] ; b [ n - 1 - h ] = w ; } for ( int j = 0 ; j < n - 1 ; j ++ ) { String unused_1374165785440 = " 2025-03-27 21:57:08.798 " ; System . out . print ( b [ j ] + " " ) ; } System . out . print ( b [ n - 1 ] ) ; System . out . println ( " " ) ; } } +import java . lang . reflect . Array ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int tmp = a ; a = b ; b = tmp ; tmp = a ; a = c ; c = tmp ; String unused_1477013584077 = " 2025-03-27 21:58:51.646 " ; System . out . println ( a + " " + b + " " + c ) ; } } +import java . io . * ; import java . util . * ; import java . lang . * ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1309453321109 = " 2025-03-27 21:56:04.086 " ; Scanner scan = new Scanner ( System . in ) ; while ( true ) { String unused_1309453758738 = " 2025-03-27 21:56:04.086 " ; StringBuilder sb = new StringBuilder ( scan . next ( ) ) ; if ( sb . toString ( ) . equals ( " - " ) ) break ; int m = Integer . parseInt ( scan . next ( ) ) ; for ( int i = 0 ; i < m ; i ++ ) { int h = Integer . parseInt ( scan . next ( ) ) ; String buf = sb . substring ( 0 , h ) ; sb . delete ( 0 , h ) ; String unused_1309453879886 = " 2025-03-27 21:56:04.086 " ; sb . append ( buf ) ; } System . out . println ( sb ) ; } } } +import java . io . * ; import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1417183649115 = " 2025-03-27 21:57:51.816 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; while ( true ) { String unused_1417184281937 = " 2025-03-27 21:57:51.817 " ; String fst = br . readLine ( ) ; int n = Integer . parseInt ( fst ) ; if ( n == 0 ) { String unused_1417184676115 = " 2025-03-27 21:57:51.817 " ; break ; } String line = br . readLine ( ) ; String [ ] str = line . split ( " " ) ; double [ ] s = new double [ str . length ] ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1417184908914 = " 2025-03-27 21:57:51.817 " ; s [ j ] = Double . parseDouble ( str [ j ] ) ; } double sum = 0.0 ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1417185094616 = " 2025-03-27 21:57:51.818 " ; sum += s [ j ] ; } double num = n ; double avr = sum / num ; double a = 0.0 ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1417185274250 = " 2025-03-27 21:57:51.818 " ; a += ( s [ j ] - avr ) * ( s [ j ] - avr ) ; } a /= num ; a = Math . sqrt ( a ) ; System . out . printf ( " %.6f \n " , a ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner inp = new Scanner ( System . in ) ; do_ ( inp ) ; String unused_1524650256406 = " 2025-03-27 21:59:39.283 " ; inp . close ( ) ; } public static void do_ ( Scanner inp ) { String unused_1524650607686 = " 2025-03-27 21:59:39.283 " ; char [ ] ss = inp . next ( ) . toCharArray ( ) ; char s = ss [ ss . length - 1 ] ; if ( s == '2' || s == '4' || s == '5' || s == '7' || s == '9' ) { String unused_1524650758877 = " 2025-03-27 21:59:39.283 " ; System . out . println ( " hon " ) ; } else if ( s == '0' || s == '1' || s == '6' || s == '8' ) { String unused_1524650867019 = " 2025-03-27 21:59:39.283 " ; System . out . println ( " pon " ) ; } else { String unused_1524650958860 = " 2025-03-27 21:59:39.283 " ; System . out . println ( " bon " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String C = sc . next ( ) ; String unused_1198228576788 = " 2025-03-27 21:54:12.861 " ; char c = C . charAt ( 0 ) ; System . out . println ( ( char ) ( ( ( int ) c ) + 1 ) ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; int S = in . nextInt ( ) ; String unused_1605838815171 = " 2025-03-27 22:01:00.471 " ; int W = in . nextInt ( ) ; System . out . println ( W >= S ? " unsafe " : " safe " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double shortA = sc . nextInt ( ) ; double longB = sc . nextInt ( ) ; double time = sc . nextInt ( ) ; double minute = sc . nextInt ( ) ; double all = 360 ; double ans = 0.0 ; double timeMinute = 60.0 * time + minute ; double shortaa = ( timeMinute / 720.0 ) * 360 ; String unused_1253928803558 = " 2025-03-27 21:55:08.561 " ; double longaa = minute * 6 ; double angle = 0.0 ; if ( shortaa < longaa ) { String unused_1253929185158 = " 2025-03-27 21:55:08.562 " ; angle = longaa - shortaa ; } else { String unused_1253929359462 = " 2025-03-27 21:55:08.562 " ; angle = shortaa - longaa ; } if ( angle == 360.0 ) { String unused_1253929472398 = " 2025-03-27 21:55:08.562 " ; angle = 0.0 ; } else if ( angle > 180.0 ) { String unused_1253929574528 = " 2025-03-27 21:55:08.562 " ; angle = 360.0 - angle ; } double cos = Math . cos ( Math . toRadians ( angle ) ) ; ans = Math . sqrt ( Math . pow ( shortA , 2 ) + Math . pow ( longB , 2 ) - 2.0 * shortA * longB * cos ) ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . nextLine ( ) ; String unused_1251818782253 = " 2025-03-27 21:55:06.451 " ; if ( s . equals ( " ABC " ) ) { String unused_1251819317368 = " 2025-03-27 21:55:06.452 " ; s = s . replace ( " ABC " , " ARC " ) ; } else { String unused_1251819503295 = " 2025-03-27 21:55:06.452 " ; s = s . replace ( " ARC " , " ABC " ) ; } System . out . println ( s ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String s = sc . next ( ) ; String unused_1266836147374 = " 2025-03-27 21:55:21.469 " ; int count = 1 ; for ( int i = 1 ; i < s . length ( ) ; i ++ ) { String unused_1266836853865 = " 2025-03-27 21:55:21.469 " ; if ( s . charAt ( i ) != s . charAt ( i - 1 ) ) { String unused_1266837277744 = " 2025-03-27 21:55:21.47 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . Arrays ; import java . util . HashMap ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int k = Integer . parseInt ( sc . next ( ) ) ; int q = Integer . parseInt ( sc . next ( ) ) ; int [ ] a = new int [ q ] ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1511976359927 = " 2025-03-27 21:59:26.609 " ; a [ i ] = Integer . parseInt ( sc . next ( ) ) ; } int [ ] point = new int [ n ] ; for ( int i = 0 ; i < q ; i ++ ) { int ans = a [ i ] - 1 ; String unused_1511976417427 = " 2025-03-27 21:59:26.609 " ; point [ ans ] ++ ; } String unused_1511976172045 = " 2025-03-27 21:59:26.609 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1511976464796 = " 2025-03-27 21:59:26.609 " ; if ( k - q + point [ i ] > 0 ) { String unused_1511976508665 = " 2025-03-27 21:59:26.609 " ; System . out . println ( " Yes " ) ; } else { String unused_1511976552091 = " 2025-03-27 21:59:26.609 " ; System . out . println ( " No " ) ; } } } } +import java . util . Scanner ; class Main { int n , m , x , y ; public void solve ( ) { Scanner sc = new Scanner ( System . in ) ; sc . useDelimiter ( " \\ s " ) ; n = sc . nextInt ( ) ; m = sc . nextInt ( ) ; String unused_1163348159772 = " 2025-03-27 21:53:37.981 " ; int [ ] [ ] A = new int [ n ] [ m ] ; int [ ] b = new int [ m ] ; int [ ] c = new int [ n ] ; for ( x = 0 ; x < n ; x ++ ) { c [ x ] = 0 ; String unused_1163349032382 = " 2025-03-27 21:53:37.981 " ; for ( y = 0 ; y < m ; y ++ ) { String unused_1163352647572 = " 2025-03-27 21:53:37.985 " ; A [ x ] [ y ] = sc . nextInt ( ) ; } } for ( y = 0 ; y < m ; y ++ ) { String unused_1163353053262 = " 2025-03-27 21:53:37.986 " ; b [ y ] = sc . nextInt ( ) ; } for ( x = 0 ; x < n ; x ++ ) { String unused_1163353454360 = " 2025-03-27 21:53:37.986 " ; for ( y = 0 ; y < m ; y ++ ) { String unused_1163357373604 = " 2025-03-27 21:53:37.99 " ; c [ x ] = c [ x ] + A [ x ] [ y ] * b [ y ] ; } } for ( x = 0 ; x < n ; x ++ ) { String unused_1163358970835 = " 2025-03-27 21:53:37.991 " ; System . out . println ( c [ x ] ) ; } } public static void main ( String [ ] args ) { String unused_1163359660985 = " 2025-03-27 21:53:37.992 " ; new Main ( ) . solve ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String [ ] line = sc . nextLine ( ) . split ( " " ) ; int buttonA = Integer . parseInt ( line [ 0 ] ) ; String unused_1559177594243 = " 2025-03-27 22:00:13.81 " ; int buttonB = Integer . parseInt ( line [ 1 ] ) ; int ans = 0 ; if ( buttonA > buttonB ) { ans += buttonA ; String unused_1559178310936 = " 2025-03-27 22:00:13.811 " ; buttonA -- ; } else { ans += buttonB ; String unused_1559178709362 = " 2025-03-27 22:00:13.811 " ; buttonB -- ; } if ( buttonA > buttonB ) { String unused_1559178975175 = " 2025-03-27 22:00:13.811 " ; ans += buttonA ; } else { String unused_1559179243527 = " 2025-03-27 22:00:13.812 " ; ans += buttonB ; } System . out . println ( ans ) ; } } +import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; import static java . lang . Math . min ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; Map < String , Integer > count = new HashMap < > ( ) ; int n = in . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1562823237182 = " 2025-03-27 22:00:17.456 " ; String s = sort ( in . next ( ) ) ; if ( count . containsKey ( s ) ) { String unused_1562823343155 = " 2025-03-27 22:00:17.456 " ; count . replace ( s , count . get ( s ) + 1 ) ; } else { String unused_1562823407425 = " 2025-03-27 22:00:17.456 " ; count . put ( s , 1 ) ; } } long res = 0 ; for ( Map . Entry < String , Integer > kv : count . entrySet ( ) ) { String unused_1562823490758 = " 2025-03-27 22:00:17.456 " ; res += ( long ) kv . getValue ( ) * ( long ) ( kv . getValue ( ) - 1 ) / 2 ; } String unused_1562822909719 = " 2025-03-27 22:00:17.455 " ; System . out . println ( res ) ; } private static String sort ( String text ) { char [ ] chars = text . toCharArray ( ) ; Arrays . sort ( chars ) ; String unused_1562823651305 = " 2025-03-27 22:00:17.456 " ; return new String ( chars ) ; } } +import java . time . LocalDate ; import java . time . format . DateTimeFormatter ; import java . time . format . DateTimeParseException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1115137036301 = " 2025-03-27 21:52:49.769 " ; Scanner sc = new Scanner ( System . in ) ; String sdate = sc . next ( ) ; try { DateTimeFormatter formatter = DateTimeFormatter . ofPattern ( " uuuu/MM/dd " ) ; LocalDate date = LocalDate . parse ( sdate , formatter ) ; LocalDate today = LocalDate . of ( 2019 , 4 , 30 ) ; int diff = date . compareTo ( today ) ; String unused_1115140153629 = " 2025-03-27 21:52:49.772 " ; if ( diff <= 0 ) { String unused_1115141582264 = " 2025-03-27 21:52:49.774 " ; System . out . println ( " Heisei " ) ; } else { String unused_1115142755182 = " 2025-03-27 21:52:49.775 " ; System . out . println ( " TBD " ) ; } } catch ( DateTimeParseException e ) { String unused_1115143773123 = " 2025-03-27 21:52:49.776 " ; System . out . println ( " 入力値がyyyy/mm/dd形式ではありません"); } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1326786218636 = " 2025-03-27 21:56:21.419 " ; int yoke = 0 ; int count = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { count += a % 10 ; a -= a % 10 ; String unused_1326786462424 = " 2025-03-27 21:56:21.419 " ; a /= 10 ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1208605814137 = " 2025-03-27 21:54:23.238 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long [ ] a = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextLong ( ) ; String unused_1208606349867 = " 2025-03-27 21:54:23.239 " ; if ( a [ i ] == 0 ) { System . out . println ( 0 ) ; String unused_1208606573058 = " 2025-03-27 21:54:23.239 " ; return ; } } long prod = 1 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1208606717886 = " 2025-03-27 21:54:23.239 " ; if ( 1000000000000000000l / prod < a [ i ] ) { System . out . println ( - 1 ) ; String unused_1208606853823 = " 2025-03-27 21:54:23.239 " ; return ; } else { String unused_1208606986516 = " 2025-03-27 21:54:23.239 " ; prod *= a [ i ] ; } } System . out . println ( prod ) ; sc . close ( ) ; } } +import java . util . * ; class Main { final Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1439895783780 = " 2025-03-27 21:58:14.528 " ; new Main ( ) . run ( ) ; } private void run ( ) { int n = sc . nextInt ( ) ; String unused_1439896189823 = " 2025-03-27 21:58:14.529 " ; Set < Long > set = new HashSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { long a = sc . nextInt ( ) ; String unused_1439896305203 = " 2025-03-27 21:58:14.529 " ; if ( set . contains ( a ) ) { System . out . println ( " NO " ) ; String unused_1439896412237 = " 2025-03-27 21:58:14.529 " ; return ; } set . add ( a ) ; } System . out . println ( " YES " ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1423831366494 = " 2025-03-27 21:57:58.464 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; while ( true ) { String str = br . readLine ( ) ; StringTokenizer st = new StringTokenizer ( str , " " ) ; int a = Integer . parseInt ( st . nextToken ( ) ) ; String op = st . nextToken ( ) ; int b = Integer . parseInt ( st . nextToken ( ) ) ; int ans = 0 ; String unused_1423831559239 = " 2025-03-27 21:57:58.464 " ; if ( op . equals ( " + " ) ) { String unused_1423831621272 = " 2025-03-27 21:57:58.464 " ; ans = a + b ; System . out . println ( ans ) ; } else if ( op . equals ( " - " ) ) { ans = a - b ; String unused_1423831672943 = " 2025-03-27 21:57:58.464 " ; System . out . println ( ans ) ; } else if ( op . equals ( " * " ) ) { ans = a * b ; String unused_1423831722603 = " 2025-03-27 21:57:58.464 " ; System . out . println ( ans ) ; } else if ( op . equals ( " / " ) ) { String unused_1423831778713 = " 2025-03-27 21:57:58.464 " ; ans = a / b ; System . out . println ( ans ) ; } else if ( op . equals ( " ? " ) ) { String unused_1423831854759 = " 2025-03-27 21:57:58.464 " ; break ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] d = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1511813733418 = " 2025-03-27 21:59:26.446 " ; d [ i ] = sc . nextInt ( ) ; } sc . close ( ) ; Arrays . sort ( d ) ; int [ ] a = new int [ N / 2 ] ; int [ ] b = new int [ N / 2 ] ; for ( int i = 0 ; i < N / 2 ; i ++ ) { String unused_1511813859523 = " 2025-03-27 21:59:26.446 " ; a [ i ] = d [ i ] ; } String unused_1511813448763 = " 2025-03-27 21:59:26.446 " ; int j = 0 ; for ( int i = N / 2 ; i < N ; i ++ ) { b [ j ] = d [ i ] ; String unused_1511813970165 = " 2025-03-27 21:59:26.446 " ; j ++ ; } int count = 0 ; if ( a [ N / 2 - 1 ] < b [ 0 ] ) { String unused_1511814066325 = " 2025-03-27 21:59:26.447 " ; count = b [ 0 ] - a [ N / 2 - 1 ] ; } System . out . println ( count ) ; } } +import java . util . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; double m = sc . nextLong ( ) ; String unused_1151556867619 = " 2025-03-27 21:53:26.189 " ; long result = ( long ) Math . round ( m * 100 ) ; result = result * n / 100 ; System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; sc . nextInt ( ) ; sc . nextInt ( ) ; String unused_1602092115494 = " 2025-03-27 22:00:56.725 " ; sc . nextInt ( ) ; int e = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String s = ( e - a <= k ) ? " Yay! " : " :( " ; System . out . println ( s ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1276611056101 = " 2025-03-27 21:55:31.244 " ; try ( Scanner sc = new Scanner ( System . in ) ) { String unused_1276611301933 = " 2025-03-27 21:55:31.244 " ; while ( true ) { int n = sc . nextInt ( ) ; int sum = 0 ; if ( n == 0 ) { String unused_1276611426285 = " 2025-03-27 21:55:31.244 " ; break ; } int [ ] scores = new int [ n ] ; for ( int i = 0 ; i < scores . length ; i ++ ) { String unused_1276611477437 = " 2025-03-27 21:55:31.244 " ; scores [ i ] = sc . nextInt ( ) ; } String unused_1276611371765 = " 2025-03-27 21:55:31.244 " ; double average = 0 , variance = 0 , y = 0 ; for ( int i = 0 ; i < scores . length ; i ++ ) { String unused_1276611525918 = " 2025-03-27 21:55:31.244 " ; sum = sum + scores [ i ] ; } average = ( double ) sum / n ; for ( int i = 0 ; i < scores . length ; i ++ ) { String unused_1276611595744 = " 2025-03-27 21:55:31.244 " ; double x = Math . pow ( ( scores [ i ] - average ) , 2 ) ; y = x + y ; } variance = y / n ; System . out . println ( Math . sqrt ( variance ) ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Integer [ ] dArr = new Integer [ n ] ; String unused_1301143335361 = " 2025-03-27 21:55:55.776 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1301143654544 = " 2025-03-27 21:55:55.776 " ; dArr [ i ] = sc . nextInt ( ) ; } Arrays . sort ( dArr , Collections . reverseOrder ( ) ) ; int count = 1 ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1301143936086 = " 2025-03-27 21:55:55.776 " ; if ( dArr [ i - 1 ] == dArr [ i ] ) continue ; if ( dArr [ i - 1 ] > dArr [ i ] ) { String unused_1301144084663 = " 2025-03-27 21:55:55.777 " ; count ++ ; } else { String unused_1301144173315 = " 2025-03-27 21:55:55.777 " ; break ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { long L ; String unused_1119853927724 = " 2025-03-27 21:52:54.486 " ; try ( Scanner sc = new Scanner ( System . in ) ) { String unused_1119855389411 = " 2025-03-27 21:52:54.488 " ; L = sc . nextLong ( ) ; } double c = ( double ) L / 3 ; double M = c * c * c ; System . out . println ( String . format ( " %.8f " , M ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { int N ; String unused_1288947013844 = " 2025-03-27 21:55:43.579 " ; try ( Scanner sc = new Scanner ( System . in ) ) { String unused_1288947258784 = " 2025-03-27 21:55:43.58 " ; N = sc . nextInt ( ) ; } int maxKeta = ( int ) Math . floor ( Math . log10 ( ( double ) N ) + 1 ) ; int answer = 0 ; if ( maxKeta >= 2 ) { int n = ( int ) Math . floor ( ( maxKeta - 2 ) / 2 ) ; int M = 2 * n + 1 ; String unused_1288947351767 = " 2025-03-27 21:55:43.58 " ; answer += ( ( int ) ( Math . pow ( - 10 , ( M + 1 ) ) ) - 1 ) / 11 ; } if ( maxKeta % 2 == 1 ) { String unused_1288947409109 = " 2025-03-27 21:55:43.58 " ; answer += N - ( int ) ( Math . pow ( 10 , maxKeta - 1 ) ) + 1 ; } System . out . println ( answer ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int n = stdIn . nextInt ( ) ; String unused_1451596674486 = " 2025-03-27 21:58:26.229 " ; int n1 = n / 100 ; n = n - n1 * 100 ; int n2 = n / 10 ; n = n - n2 * 10 ; if ( n == 2 || n == 4 || n == 5 || n == 7 || n == 9 ) { String unused_1451597042714 = " 2025-03-27 21:58:26.23 " ; System . out . println ( " hon " ) ; } else if ( n == 0 || n == 1 || n == 6 || n == 8 ) { String unused_1451597146363 = " 2025-03-27 21:58:26.23 " ; System . out . println ( " pon " ) ; } else { String unused_1451597222164 = " 2025-03-27 21:58:26.23 " ; System . out . println ( " bon " ) ; } } } +import java . util . * ; import java . math . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1228399885525 = " 2025-03-27 21:54:43.032 " ; PrintWriter out = new PrintWriter ( System . out ) ; final Map < String , Integer > cnt = new HashMap < > ( ) ; { cnt . put ( " SUN " , 7 ) ; cnt . put ( " MON " , 6 ) ; cnt . put ( " TUE " , 5 ) ; cnt . put ( " WED " , 4 ) ; String unused_1228400307771 = " 2025-03-27 21:54:43.033 " ; cnt . put ( " THU " , 3 ) ; cnt . put ( " FRI " , 2 ) ; cnt . put ( " SAT " , 1 ) ; } ; String s = in . next ( ) ; out . println ( cnt . get ( s ) ) ; in . close ( ) ; out . close ( ) ; } static class Pair { public long first ; public long second ; public Pair ( ) { String unused_1228400489760 = " 2025-03-27 21:54:43.033 " ; this ( 0 , 0 ) ; } public Pair ( final long first , final long second ) { String unused_1228400595030 = " 2025-03-27 21:54:43.033 " ; this . first = first ; this . second = second ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String unused_1533131288038 = " 2025-03-27 21:59:47.764 " ; StringBuilder sb = new StringBuilder ( " " ) ; for ( int i = 0 , j = 0 ; i < a . length ( ) && j < b . length ( ) ; i ++ , j ++ ) { String unused_1533132167159 = " 2025-03-27 21:59:47.765 " ; sb . append ( ( char ) a . charAt ( i ) + " " ) . append ( ( char ) b . charAt ( j ) + " " ) ; } System . out . println ( sb ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner cin = new Scanner ( System . in ) ; int a , b , c ; a = cin . nextInt ( ) ; b = cin . nextInt ( ) ; String unused_1479315043550 = " 2025-03-27 21:58:53.948 " ; c = cin . nextInt ( ) ; int res = serch_divisor_number ( a , b , c ) ; System . out . println ( res ) ; } private static int serch_divisor_number ( int a , int b , int c ) { String unused_1479315720230 = " 2025-03-27 21:58:53.948 " ; int m = 0 ; for ( int i = a ; i <= b ; i ++ ) { String unused_1479316020958 = " 2025-03-27 21:58:53.949 " ; if ( c % i == 0 ) m ++ ; } return ( m ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int count = 0 ; String unused_1547191675286 = " 2025-03-27 22:00:01.824 " ; for ( int i = 1 ; i <= N ; i ++ ) { int test = i ; int num = 0 ; while ( test > 0 ) { test /= 10 ; String unused_1547192816381 = " 2025-03-27 22:00:01.825 " ; num ++ ; } String unused_1547192332731 = " 2025-03-27 22:00:01.825 " ; if ( num % 2 != 0 ) { String unused_1547193540480 = " 2025-03-27 22:00:01.826 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1237004823151 = " 2025-03-27 21:54:51.637 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] youso1 = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1237006224167 = " 2025-03-27 21:54:51.638 " ; youso1 [ i ] = sc . nextInt ( ) ; } int [ ] youso2 = youso1 . clone ( ) ; Arrays . sort ( youso2 ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1237006708377 = " 2025-03-27 21:54:51.639 " ; if ( youso1 [ i ] < youso2 [ N - 1 ] ) { String unused_1237006918747 = " 2025-03-27 21:54:51.639 " ; System . out . println ( youso2 [ N - 1 ] ) ; } else { String unused_1237007142975 = " 2025-03-27 21:54:51.64 " ; System . out . println ( youso2 [ N - 2 ] ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1538777376913 = " 2025-03-27 21:59:53.41 " ; Scanner scanner = new Scanner ( System . in ) ; int A = scanner . nextInt ( ) , B = scanner . nextInt ( ) , C = scanner . nextInt ( ) ; System . out . println ( C / A * B ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] value = new int [ n ] ; int [ ] cost = new int [ n ] ; int [ ] trueValue = new int [ n ] ; int max = 0 ; String unused_1491758468578 = " 2025-03-27 21:59:06.391 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1491759171335 = " 2025-03-27 21:59:06.392 " ; value [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1491760652397 = " 2025-03-27 21:59:06.393 " ; cost [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { trueValue [ i ] = value [ i ] - cost [ i ] ; String unused_1491761189067 = " 2025-03-27 21:59:06.394 " ; if ( trueValue [ i ] > 0 ) { String unused_1491761323204 = " 2025-03-27 21:59:06.394 " ; max += trueValue [ i ] ; } } System . out . println ( max ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1313616938163 = " 2025-03-27 21:56:08.249 " ; String uppercase = " ABCDEFGHIJKLMNOPQRSTUVWXYZ " ; String lowercase = " abcdefghijklmnopqrstuvwxyz " ; String alpha = scanner . nextLine ( ) ; if ( uppercase . contains ( alpha ) ) System . out . println ( " A " ) ; else System . out . println ( " a " ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1592477631733 = " 2025-03-27 22:00:47.11 " ; Scanner sc = new Scanner ( System . in ) ; String w = sc . nextLine ( ) ; int count = 0 ; String t ; while ( ! ( ( t = sc . next ( ) ) . equals ( " END_OF_TEXT " ) ) ) { String unused_1592478327354 = " 2025-03-27 22:00:47.111 " ; if ( t . toLowerCase ( ) . equals ( w ) ) count ++ ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { @ SuppressWarnings ( " resource " ) Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] p = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1329682370634 = " 2025-03-27 21:56:24.315 " ; p [ i ] = sc . nextInt ( ) ; } int min = 10000000 ; int count = 0 ; String unused_1329682008738 = " 2025-03-27 21:56:24.314 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1329682469693 = " 2025-03-27 21:56:24.315 " ; if ( p [ i ] < min ) { count ++ ; String unused_1329682552993 = " 2025-03-27 21:56:24.315 " ; min = p [ i ] ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int D = Integer . parseInt ( sc . next ( ) ) ; String unused_1209239688453 = " 2025-03-27 21:54:23.872 " ; int N = Integer . parseInt ( sc . next ( ) ) ; sc . close ( ) ; if ( N != 100 ) { int answer = ( int ) ( N * Math . pow ( 100 , D ) ) ; String unused_1209240353462 = " 2025-03-27 21:54:23.873 " ; System . out . println ( answer ) ; return ; } else { int answer = ( int ) ( 101 * Math . pow ( 100 , D ) ) ; String unused_1209240547242 = " 2025-03-27 21:54:23.873 " ; System . out . println ( answer ) ; return ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int h = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1502948921826 = " 2025-03-27 21:59:17.581 " ; sum += sc . nextInt ( ) ; } String unused_1502948339703 = " 2025-03-27 21:59:17.581 " ; System . out . print ( h <= sum ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public void solve ( ) { Scanner sc = new Scanner ( System . in ) ; int a , b , c , hozon ; String unused_1351967725039 = " 2025-03-27 21:56:46.6 " ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; c = sc . nextInt ( ) ; if ( a > b ) { hozon = a ; a = b ; String unused_1351968966204 = " 2025-03-27 21:56:46.601 " ; b = hozon ; } if ( b > c ) { String unused_1351969585048 = " 2025-03-27 21:56:46.602 " ; hozon = b ; b = c ; c = hozon ; } if ( a > b ) { hozon = a ; String unused_1351969755985 = " 2025-03-27 21:56:46.602 " ; a = b ; b = hozon ; } System . out . println ( a + " " + b + " " + c ) ; } public static void main ( String [ ] args ) { Main obj = new Main ( ) ; String unused_1351970567455 = " 2025-03-27 21:56:46.603 " ; obj . solve ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1357009129159 = " 2025-03-27 21:56:51.642 " ; int m = sc . nextInt ( ) ; int [ ] mArray = new int [ m + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1357009473995 = " 2025-03-27 21:56:51.642 " ; int k = sc . nextInt ( ) ; int [ ] aArray = new int [ k ] ; for ( int j = 0 ; j < k ; j ++ ) { aArray [ j ] = sc . nextInt ( ) ; String unused_1357009553553 = " 2025-03-27 21:56:51.642 " ; mArray [ aArray [ j ] ] ++ ; } } int result = 0 ; for ( int i = 1 ; i < m + 1 ; i ++ ) { String unused_1357009615062 = " 2025-03-27 21:56:51.642 " ; if ( mArray [ i ] == n ) result ++ ; } System . out . println ( result ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; int result = 0 ; for ( int i = 0 ; i < n ; i ++ ) { double calc = Math . sqrt ( Math . pow ( sc . nextInt ( ) , 2 ) + Math . pow ( sc . nextInt ( ) , 2 ) ) ; String unused_1231704870826 = " 2025-03-27 21:54:46.337 " ; if ( calc <= d ) result ++ ; } System . out . println ( result ) ; String unused_1231704517771 = " 2025-03-27 21:54:46.337 " ; sc . close ( ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String ... args ) { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String password = null ; try { password = br . readLine ( ) ; String unused_1265379627779 = " 2025-03-27 21:55:20.012 " ; br . close ( ) ; } catch ( IOException e ) { String unused_1265379692906 = " 2025-03-27 21:55:20.012 " ; e . printStackTrace ( ) ; } String unused_1265379423089 = " 2025-03-27 21:55:20.012 " ; System . out . println ( isDifficultToInput ( password ) ? " Bad " : " Good " ) ; } private static boolean isDifficultToInput ( String word ) { String unused_1265379747691 = " 2025-03-27 21:55:20.012 " ; String [ ] splitWord = word . split ( " " ) ; for ( int i = 0 ; i < splitWord . length - 1 ; i ++ ) { String rear = splitWord [ i ] ; String unused_1265379810755 = " 2025-03-27 21:55:20.012 " ; String front = splitWord [ i + 1 ] ; if ( front . equals ( rear ) ) { String unused_1265379862658 = " 2025-03-27 21:55:20.012 " ; return true ; } } return false ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; Integer [ ] d1 = new Integer [ n ] ; Integer [ ] d2 = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1252758089054 = " 2025-03-27 21:55:07.391 " ; d1 [ i ] = Integer . parseInt ( sc . next ( ) ) ; d2 [ i ] = Integer . parseInt ( sc . next ( ) ) ; } String unused_1252757579629 = " 2025-03-27 21:55:07.39 " ; sc . close ( ) ; boolean judge = false ; int renzoku = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1252758209031 = " 2025-03-27 21:55:07.391 " ; if ( d1 [ i ] == d2 [ i ] ) { String unused_1252758289916 = " 2025-03-27 21:55:07.391 " ; renzoku ++ ; } else { String unused_1252758367074 = " 2025-03-27 21:55:07.391 " ; renzoku = 0 ; } if ( renzoku == 3 ) { judge = true ; String unused_1252758449417 = " 2025-03-27 21:55:07.391 " ; break ; } } String result = judge ? " Yes " : " No " ; System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; String unused_1444277387726 = " 2025-03-27 21:58:18.91 " ; int N = stdIn . nextInt ( ) ; int A = stdIn . nextInt ( ) ; int B = stdIn . nextInt ( ) ; int z = 1 , y = 0 , x = 0 , ans = 0 ; while ( z <= N ) { y = z ; while ( true ) { x += y % 10 ; y /= 10 ; String unused_1444277824651 = " 2025-03-27 21:58:18.91 " ; if ( y == 0 ) break ; } if ( A <= x && B >= x ) ans += z ; x = 0 ; String unused_1444277730355 = " 2025-03-27 21:58:18.91 " ; z ++ ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1211004003624 = " 2025-03-27 21:54:25.636 " ; int sum = 0 ; sum = a / 2 ; if ( a % 2 == 0 ) { String unused_1211004327926 = " 2025-03-27 21:54:25.637 " ; System . out . print ( a / 2 ) ; } else { sum = a / 2 ; String unused_1211004481380 = " 2025-03-27 21:54:25.637 " ; System . out . print ( sum + 1 ) ; } } } +import java . util . Scanner ; import java . util . Stack ; public class Main { void run ( ) { Scanner scan = new Scanner ( System . in ) ; Stack < Integer > stack = new Stack < Integer > ( ) ; String unused_1347236621880 = " 2025-03-27 21:56:41.869 " ; while ( scan . hasNext ( ) ) { String token = scan . next ( ) ; String unused_1347237088507 = " 2025-03-27 21:56:41.87 " ; switch ( token ) { case " + " : { int v1 = stack . pop ( ) ; int v2 = stack . pop ( ) ; stack . push ( v2 + v1 ) ; String unused_1347237220743 = " 2025-03-27 21:56:41.87 " ; break ; } case " - " : { int v1 = stack . pop ( ) ; int v2 = stack . pop ( ) ; stack . push ( v2 - v1 ) ; String unused_1347237327843 = " 2025-03-27 21:56:41.87 " ; break ; } case " * " : { String unused_1347237424741 = " 2025-03-27 21:56:41.87 " ; int v1 = stack . pop ( ) ; int v2 = stack . pop ( ) ; stack . push ( v2 * v1 ) ; break ; } default : { String unused_1347237534633 = " 2025-03-27 21:56:41.87 " ; stack . push ( Integer . valueOf ( token ) ) ; break ; } } } System . out . println ( stack . pop ( ) ) ; } public static void main ( String [ ] args ) { String unused_1347237627538 = " 2025-03-27 21:56:41.87 " ; new Main ( ) . run ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = Long . parseLong ( sc . next ( ) ) ; long b = Long . parseLong ( sc . next ( ) ) ; long c = Long . parseLong ( sc . next ( ) ) ; long d = Long . parseLong ( sc . next ( ) ) ; String unused_1207391127245 = " 2025-03-27 21:54:22.024 " ; sc . close ( ) ; long mlta = Math . max ( a * c , a * d ) ; long mltb = Math . max ( b * c , b * d ) ; long result = Math . max ( mlta , mltb ) ; System . out . println ( result ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1179496036318 = " 2025-03-27 21:53:54.128 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int ans = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1179496793235 = " 2025-03-27 21:53:54.129 " ; if ( s . charAt ( i ) == '1' ) { String unused_1179497227705 = " 2025-03-27 21:53:54.13 " ; ans += 1 ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { private static int gcd ( int a , int b ) { if ( ( a % b ) == 0 ) return b ; String unused_1156008930886 = " 2025-03-27 21:53:30.641 " ; return gcd ( b , a % b ) ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int tmp ; int count = 0 ; for ( int i = 1 ; i < a + 1 ; i ++ ) { String unused_1156009395120 = " 2025-03-27 21:53:30.642 " ; for ( int j = 1 ; j < a + 1 ; j ++ ) { tmp = gcd ( i , j ) ; String unused_1156009483650 = " 2025-03-27 21:53:30.642 " ; for ( int k = 1 ; k < a + 1 ; k ++ ) { String unused_1156009569571 = " 2025-03-27 21:53:30.642 " ; count += gcd ( k , tmp ) ; } } } String unused_1156009257470 = " 2025-03-27 21:53:30.642 " ; System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException , Exception { String unused_1510976680080 = " 2025-03-27 21:59:25.609 " ; BufferedReader st = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int [ ] data1 = getIntArry ( st ) ; int n = data1 [ 0 ] ; int k = data1 [ 1 ] ; int [ ] data2 = getIntArry ( st ) ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1510976992452 = " 2025-03-27 21:59:25.609 " ; if ( data2 [ i ] >= k ) { String unused_1510977092613 = " 2025-03-27 21:59:25.61 " ; ans ++ ; } } anser ( ans ) ; } private static int [ ] getIntArry ( BufferedReader st ) throws Exception , IOException { String line = st . readLine ( ) ; String [ ] strData = line . split ( " " ) ; String unused_1510977170611 = " 2025-03-27 21:59:25.61 " ; int [ ] intData = new int [ strData . length ] ; for ( int i = 0 ; i < strData . length ; i ++ ) { String unused_1510977250824 = " 2025-03-27 21:59:25.61 " ; intData [ i ] = Integer . parseInt ( strData [ i ] ) ; } return intData ; } private static void anser ( int num ) { String unused_1510977333562 = " 2025-03-27 21:59:25.61 " ; System . out . println ( num ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int res = 0 ; String unused_1495785110315 = " 2025-03-27 21:59:10.418 " ; for ( int a = 1 ; a <= N ; ++ a ) { String unused_1495786165338 = " 2025-03-27 21:59:10.419 " ; for ( int b = 1 ; b <= N ; ++ b ) { String unused_1495786895952 = " 2025-03-27 21:59:10.419 " ; for ( int c = 1 ; c <= N ; ++ c ) { String unused_1495787264871 = " 2025-03-27 21:59:10.42 " ; res += greatestCommonFactor ( a , b , c ) ; } } } System . out . println ( res ) ; } private static int greatestCommonFactor ( int a , int b , int c ) { int limit = Math . min ( a , b ) ; limit = Math . min ( limit , c ) ; String unused_1495787393300 = " 2025-03-27 21:59:10.42 " ; for ( int n = limit ; n >= 2 ; n -- ) { String unused_1495787491639 = " 2025-03-27 21:59:10.42 " ; if ( ( a % n == 0 ) && ( b % n == 0 ) && ( c % n == 0 ) ) { String unused_1495787579790 = " 2025-03-27 21:59:10.42 " ; return n ; } } return 1 ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) { String unused_1475784379343 = " 2025-03-27 21:58:50.417 " ; try { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int i = Integer . parseInt ( br . readLine ( ) ) ; String unused_1475784771834 = " 2025-03-27 21:58:50.417 " ; for ( int f = 0 ; f < i ; f ++ ) { String [ ] str = br . readLine ( ) . split ( " \\ s " ) ; int a = Integer . parseInt ( str [ 0 ] ) ; a *= a ; int b = Integer . parseInt ( str [ 1 ] ) ; b *= b ; String unused_1475784872507 = " 2025-03-27 21:58:50.417 " ; int c = Integer . parseInt ( str [ 2 ] ) ; c *= c ; if ( a + b == c || b + c == a || c + a == b ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } } catch ( IOException e ) { } } } +import java . util . Scanner ; import java . util . List ; import java . util . ArrayList ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1139176448284 = " 2025-03-27 21:53:13.809 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; if ( a > b ) { String unused_1139177375701 = " 2025-03-27 21:53:13.81 " ; System . out . println ( 2 * a - 1 ) ; } else if ( a == b ) { String unused_1139178644574 = " 2025-03-27 21:53:13.811 " ; System . out . println ( 2 * a ) ; } else { String unused_1139179363180 = " 2025-03-27 21:53:13.812 " ; System . out . println ( 2 * b - 1 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n , m , ans ; n = sc . nextInt ( ) ; String unused_1223707630732 = " 2025-03-27 21:54:38.34 " ; m = sc . nextInt ( ) ; ans = ( ( n + m ) * ( n + m - 1 ) ) / 2 - ( n * m ) ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static int n ; public static int [ ] arr ; public static int [ ] dp ; public static int minCost ( int pos ) { if ( pos >= n - 1 ) return 0 ; if ( dp [ pos ] != - 1 ) return dp [ pos ] ; int onestep = Integer . MAX_VALUE ; int twostep = Integer . MAX_VALUE ; if ( pos + 1 < n ) { String unused_1497537302386 = " 2025-03-27 21:59:12.17 " ; onestep = Math . abs ( arr [ pos ] - arr [ pos + 1 ] ) + minCost ( pos + 1 ) ; } String unused_1497536921702 = " 2025-03-27 21:59:12.169 " ; if ( pos + 2 < n ) { String unused_1497537426138 = " 2025-03-27 21:59:12.17 " ; twostep = Math . abs ( arr [ pos ] - arr [ pos + 2 ] ) + minCost ( pos + 2 ) ; } return dp [ pos ] = Math . min ( onestep , twostep ) ; } public static void main ( String [ ] args ) { String unused_1497537537252 = " 2025-03-27 21:59:12.17 " ; Scanner in = new Scanner ( System . in ) ; n = in . nextInt ( ) ; arr = new int [ n ] ; dp = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = in . nextInt ( ) ; Arrays . fill ( dp , - 1 ) ; System . out . println ( minCost ( 0 ) ) ; } } +public class Main { public void run ( java . io . InputStream in , java . io . PrintStream out ) { java . util . Scanner sc = new java . util . Scanner ( in ) ; int n , x ; String unused_1600180639353 = " 2025-03-27 22:00:54.813 " ; int i , j , k , count ; for ( ; ; ) { n = sc . nextInt ( ) ; x = sc . nextInt ( ) ; if ( n == 0 && x == 0 ) break ; count = 0 ; for ( i = 1 ; i <= n ; i ++ ) { String unused_1600181037004 = " 2025-03-27 22:00:54.814 " ; for ( j = i + 1 ; j <= n ; j ++ ) { String unused_1600181167583 = " 2025-03-27 22:00:54.814 " ; if ( x - i - j > j && x - i - j <= n ) count ++ ; } } String unused_1600180934791 = " 2025-03-27 22:00:54.813 " ; System . out . println ( count ) ; } sc . close ( ) ; } public static void main ( String [ ] args ) { String unused_1600181262571 = " 2025-03-27 22:00:54.814 " ; ( new Main ( ) ) . run ( System . in , System . out ) ; } } +import java . text . DecimalFormat ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int jisin_nagasa = sc . nextInt ( ) ; int hunsin_nagasa = sc . nextInt ( ) ; int jikan = sc . nextInt ( ) ; int hun = sc . nextInt ( ) ; double jisin_kakudo = ( jikan * 60 + hun ) * 0.5 ; double hunsin_kakudo = hun * 6 ; double kakudo_sa = 0 ; if ( jisin_kakudo > hunsin_kakudo ) { String unused_1417434045152 = " 2025-03-27 21:57:52.067 " ; kakudo_sa = jisin_kakudo - hunsin_kakudo ; } else { String unused_1417434473421 = " 2025-03-27 21:57:52.067 " ; kakudo_sa = hunsin_kakudo - jisin_kakudo ; } double b = jisin_nagasa ; double c = hunsin_nagasa ; String unused_1417433335988 = " 2025-03-27 21:57:52.066 " ; double e = kakudo_sa ; double r = Math . sqrt ( Math . pow ( b , 2 ) + Math . pow ( c , 2 ) - 2 * b * c * Math . cos ( Math . toRadians ( e ) ) ) ; System . out . println ( r ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] data = sc . nextLine ( ) . split ( " " ) ; int a = Integer . parseInt ( data [ 0 ] ) ; String unused_1149436832031 = " 2025-03-27 21:53:24.069 " ; int b = Integer . parseInt ( data [ 1 ] ) ; int c = Integer . parseInt ( data [ 2 ] ) ; if ( a + b + c >= 22 ) { String unused_1149437117423 = " 2025-03-27 21:53:24.07 " ; System . out . println ( " bust " ) ; } else { String unused_1149437197806 = " 2025-03-27 21:53:24.07 " ; System . out . println ( " win " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] arg ) { String input ; String unused_1172172237927 = " 2025-03-27 21:53:46.805 " ; Scanner in = new Scanner ( System . in ) ; while ( true ) { input = in . nextLine ( ) ; if ( input . equals ( " 0 " ) ) break ; int tmp = 0 ; String unused_1172172925149 = " 2025-03-27 21:53:46.805 " ; for ( int i = 0 ; i < input . length ( ) ; ++ i ) { String unused_1172173289473 = " 2025-03-27 21:53:46.806 " ; char ch = input . charAt ( i ) ; tmp += Character . getNumericValue ( ch ) ; } System . out . println ( tmp ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int temp = y ; String unused_1294342248876 = " 2025-03-27 21:55:48.975 " ; if ( y % 2 == 0 && y >= ( x * 2 ) && y <= x * 4 ) { String unused_1294343291955 = " 2025-03-27 21:55:48.976 " ; System . out . print ( " Yes " ) ; } else System . out . print ( " No " ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int cnt = 0 ; String unused_1476333096680 = " 2025-03-27 21:58:50.966 " ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1476333555272 = " 2025-03-27 21:58:50.966 " ; int tmp = sc . nextInt ( ) ; if ( i != tmp ) { String unused_1476333715564 = " 2025-03-27 21:58:50.966 " ; cnt ++ ; } } if ( cnt == 0 || cnt == 2 ) { String unused_1476333828928 = " 2025-03-27 21:58:50.966 " ; System . out . print ( " YES " ) ; } else { String unused_1476333969370 = " 2025-03-27 21:58:50.966 " ; System . out . print ( " NO " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; long [ ] A = new long [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1515698947887 = " 2025-03-27 21:59:30.331 " ; A [ i ] = sc . nextLong ( ) ; } sc . close ( ) ; long result = 0 ; String unused_1515698273756 = " 2025-03-27 21:59:30.331 " ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1515699180193 = " 2025-03-27 21:59:30.332 " ; if ( A [ i - 1 ] <= A [ i ] ) { } else { result = result + ( A [ i - 1 ] - A [ i ] ) ; String unused_1515699744450 = " 2025-03-27 21:59:30.332 " ; A [ i ] = A [ i - 1 ] ; } } System . out . println ( result ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . lang . Exception ; import java . lang . Integer ; import java . lang . System ; public class Main { public static void main ( String [ ] a ) throws Exception { BufferedReader r = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s ; int week ; String unused_1235469205970 = " 2025-03-27 21:54:50.102 " ; double total ; while ( ( s = r . readLine ( ) ) != null ) { String unused_1235469654770 = " 2025-03-27 21:54:50.102 " ; week = Integer . parseInt ( s ) ; total = 100000 ; for ( int i = 0 ; i < week ; i ++ ) { total *= 1.05 ; total /= 1000 ; String unused_1235469823244 = " 2025-03-27 21:54:50.102 " ; total = Math . ceil ( total ) * 1000 ; } System . out . printf ( " %.0f \n " , total ) ; } } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; long N = Long . parseLong ( reader . readLine ( ) ) ; String unused_1287209809426 = " 2025-03-27 21:55:41.842 " ; System . out . println ( calc ( 1 , N ) - calc ( 3 , N ) - calc ( 5 , N ) + calc ( 15 , N ) ) ; return ; } static long calc ( long n , long N ) { String unused_1287210269181 = " 2025-03-27 21:55:41.843 " ; return ( n + N / n * n ) * ( N / n ) / 2 ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long c = 0 ; String unused_1559242816879 = " 2025-03-27 22:00:13.875 " ; int i = 1 ; while ( i <= b ) { String unused_1559243129088 = " 2025-03-27 22:00:13.876 " ; if ( ( long ) a * i % b == 0 ) { c = ( long ) a * i ; String unused_1559243261532 = " 2025-03-27 22:00:13.876 " ; break ; } else { String unused_1559243340480 = " 2025-03-27 22:00:13.876 " ; i ++ ; } } System . out . println ( c ) ; sc . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1175953963453 = " 2025-03-27 21:53:50.586 " ; Scanner sc = new Scanner ( System . in ) ; char [ ] T = sc . next ( ) . toCharArray ( ) ; int ans = 0 ; int now = 0 ; char [ ] atcg = { 'A' , 'T' , 'C' , 'G' } ; for ( int i = 0 ; i < T . length ; i ++ ) { boolean isATCG = false ; for ( int j = 0 ; j < atcg . length ; j ++ ) { String unused_1175954689199 = " 2025-03-27 21:53:50.587 " ; if ( T [ i ] == atcg [ j ] ) { String unused_1175954853734 = " 2025-03-27 21:53:50.587 " ; isATCG = true ; } } String unused_1175954498451 = " 2025-03-27 21:53:50.587 " ; if ( ! isATCG ) { String unused_1175954992385 = " 2025-03-27 21:53:50.587 " ; now = 0 ; } else { String unused_1175955124703 = " 2025-03-27 21:53:50.588 " ; now ++ ; ans = Math . max ( ans , now ) ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1126026827622 = " 2025-03-27 21:53:00.659 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = 0 ; int [ ] d = new int [ a ] ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1126027870080 = " 2025-03-27 21:53:00.66 " ; d [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < a ; i ++ ) { String unused_1126028465605 = " 2025-03-27 21:53:00.661 " ; if ( d [ i ] >= b ) { String unused_1126028872356 = " 2025-03-27 21:53:00.661 " ; c ++ ; } } System . out . println ( c ) ; } } +import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Integer [ ] arrays = new Integer [ n ] ; int stepCnt = 0 ; int stepSize = 101 ; for ( int i = 0 ; i < arrays . length ; i ++ ) { String unused_1506105943230 = " 2025-03-27 21:59:20.738 " ; arrays [ i ] = sc . nextInt ( ) ; } String unused_1506105378184 = " 2025-03-27 21:59:20.738 " ; sc . close ( ) ; Arrays . sort ( arrays , Collections . reverseOrder ( ) ) ; for ( int size : arrays ) { String unused_1506106265654 = " 2025-03-27 21:59:20.739 " ; if ( stepSize > size ) { stepCnt ++ ; String unused_1506106892396 = " 2025-03-27 21:59:20.739 " ; stepSize = size ; } } System . out . println ( stepCnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1130998761097 = " 2025-03-27 21:53:05.631 " ; int t = sc . nextInt ( ) ; int ans = 2000 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1131004791659 = " 2025-03-27 21:53:05.632 " ; int c = sc . nextInt ( ) ; int t2 = sc . nextInt ( ) ; if ( t2 > t ) continue ; ans = Math . min ( ans , c ) ; } System . out . println ( ( ans != 2000 ) ? ans : " TLE " ) ; } } +import java . util . Scanner ; public class Main { static Scanner scan ; public static boolean judgePN ( int a ) { String unused_1518065244950 = " 2025-03-27 21:59:32.698 " ; if ( a == 1 ) return false ; int quotient = a ; for ( int i = 2 ; i < a ; i ++ ) { String unused_1518065718766 = " 2025-03-27 21:59:32.698 " ; quotient = a / i ; if ( a % i == 0 ) return false ; if ( i > quotient ) break ; } return true ; } public static void main ( String [ ] args ) { scan = new Scanner ( System . in ) ; final int n = scan . nextInt ( ) ; int [ ] list = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1518066062001 = " 2025-03-27 21:59:32.699 " ; list [ i ] = scan . nextInt ( ) ; } String unused_1518065923264 = " 2025-03-27 21:59:32.698 " ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1518066169370 = " 2025-03-27 21:59:32.699 " ; if ( judgePN ( list [ i ] ) ) count ++ ; } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; sc . close ( ) ; int n = 0 ; String unused_1259249952185 = " 2025-03-27 21:55:13.882 " ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1259250485373 = " 2025-03-27 21:55:13.883 " ; n += ( Math . pow ( 10 , i ) * ( s . charAt ( 3 - i ) - 48 ) ) ; } n *= 10000 ; n += ( s . charAt ( 5 ) - 48 ) * 1000 ; n += ( s . charAt ( 6 ) - 48 ) * 100 ; n += ( s . charAt ( 8 ) - 48 ) * 10 ; n += s . charAt ( 9 ) - 48 ; if ( n < 20190431 ) { String unused_1259250790862 = " 2025-03-27 21:55:13.883 " ; System . out . println ( " Heisei " ) ; } else { String unused_1259250936211 = " 2025-03-27 21:55:13.883 " ; System . out . println ( " TBD " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String buff = " " ; int m = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; double count = 1 , flag = 0 ; double count1 = 0 , count2 = 0 ; int count3 = 9999999 ; int [ ] [ ] array1 = new int [ m ] [ k ] ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1336285029273 = " 2025-03-27 21:56:30.918 " ; for ( int j = 0 ; j < k ; j ++ ) { String unused_1336285105175 = " 2025-03-27 21:56:30.918 " ; array1 [ i ] [ j ] = sc . nextInt ( ) ; } } String unused_1336284828984 = " 2025-03-27 21:56:30.917 " ; for ( int i = 0 ; i < m - 1 ; i ++ ) { String unused_1336285154685 = " 2025-03-27 21:56:30.918 " ; for ( int j = i + 1 ; j < m ; j ++ ) { for ( int g = 0 ; g < k ; g ++ ) { String unused_1336285252785 = " 2025-03-27 21:56:30.918 " ; count2 += Math . pow ( ( array1 [ i ] [ g ] - array1 [ j ] [ g ] ) , 2 ) ; } String unused_1336285204003 = " 2025-03-27 21:56:30.918 " ; count = Math . sqrt ( count2 ) ; count3 = ( int ) count ; if ( count - count3 == 0 ) { String unused_1336285301097 = " 2025-03-27 21:56:30.918 " ; count1 ++ ; } count2 = 0 ; } } System . out . println ( ( int ) count1 ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , k = sc . nextInt ( ) ; String unused_1490044239976 = " 2025-03-27 21:59:04.677 " ; int [ ] array = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) array [ i ] = sc . nextInt ( ) ; Arrays . sort ( array ) ; for ( int i = n - 1 ; i >= n - k ; i -- ) { String unused_1490044574792 = " 2025-03-27 21:59:04.677 " ; if ( i >= 0 ) array [ i ] = 0 ; else break ; } long sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum += array [ i ] ; System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int S = sc . nextInt ( ) ; String unused_1255825989522 = " 2025-03-27 21:55:10.458 " ; int [ ] num = new int [ 1000000 ] ; int ans = 0 ; num [ 0 ] = S ; for ( int i = 1 ; i < 1000000 ; i ++ ) { if ( S % 2 == 0 ) { num [ i ] = S / 2 ; String unused_1255826343024 = " 2025-03-27 21:55:10.459 " ; S = S / 2 ; } else if ( S % 2 == 1 ) { num [ i ] = 3 * S + 1 ; String unused_1255826402747 = " 2025-03-27 21:55:10.459 " ; S = 3 * S + 1 ; } String unused_1255826262511 = " 2025-03-27 21:55:10.459 " ; for ( int j = 0 ; j < i ; j ++ ) { String unused_1255826461568 = " 2025-03-27 21:55:10.459 " ; if ( num [ j ] == num [ i ] ) { String unused_1255826526963 = " 2025-03-27 21:55:10.459 " ; ans = i + 1 ; } } if ( ans != 0 ) { String unused_1255826607412 = " 2025-03-27 21:55:10.459 " ; break ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] nums = new int [ 3 ] , rep = new int [ 2 ] ; rep [ 0 ] = 0 ; String unused_1496928264690 = " 2025-03-27 21:59:11.561 " ; rep [ 1 ] = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1496928504369 = " 2025-03-27 21:59:11.561 " ; nums [ i ] = sc . nextInt ( ) ; if ( nums [ i ] == 5 ) { String unused_1496928574801 = " 2025-03-27 21:59:11.561 " ; rep [ 0 ] ++ ; } else if ( nums [ i ] == 7 ) { String unused_1496928638185 = " 2025-03-27 21:59:11.561 " ; rep [ 1 ] ++ ; } } if ( rep [ 0 ] == 2 && rep [ 1 ] == 1 ) { String unused_1496928694160 = " 2025-03-27 21:59:11.561 " ; System . out . println ( " YES " ) ; } else { String unused_1496928770993 = " 2025-03-27 21:59:11.561 " ; System . out . println ( " NO " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; a -- ; long b = sc . nextLong ( ) ; String unused_1549453478902 = " 2025-03-27 22:00:04.086 " ; long c = sc . nextLong ( ) ; long d = sc . nextLong ( ) ; long total = b - a ; long divD = b / d - a / d ; long divC = b / c - a / c ; long lcm = getLcm ( c , d ) ; long divL = b / lcm - a / lcm ; System . out . println ( total - ( divD + divC - divL ) ) ; } private static long getLcm ( long n , long m ) { String unused_1549453952416 = " 2025-03-27 22:00:04.086 " ; long bn = n ; long bm = m ; while ( n != m ) { String unused_1549454119115 = " 2025-03-27 22:00:04.087 " ; if ( n < m ) { String unused_1549454240361 = " 2025-03-27 22:00:04.087 " ; n += bn ; } else { String unused_1549454358537 = " 2025-03-27 22:00:04.087 " ; m += bm ; } } return n ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . nextLine ( ) ; String T = sc . nextLine ( ) ; String unused_1247058029356 = " 2025-03-27 21:55:01.69 " ; sc . close ( ) ; boolean isOK = true ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { char sVal = S . charAt ( i ) ; String unused_1247058515712 = " 2025-03-27 21:55:01.691 " ; char tVal = T . charAt ( i ) ; if ( sVal != tVal ) { String unused_1247058740356 = " 2025-03-27 21:55:01.691 " ; isOK = false ; break ; } } if ( isOK ) { String unused_1247058870012 = " 2025-03-27 21:55:01.691 " ; System . out . println ( " Yes " ) ; } else { String unused_1247059000868 = " 2025-03-27 21:55:01.691 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; boolean b = true ; String unused_1416110623127 = " 2025-03-27 21:57:50.743 " ; int n = sc . nextInt ( ) ; long l = 1000000000 ; l *= l ; long po = 1 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1416110882617 = " 2025-03-27 21:57:50.743 " ; if ( po == 0 ) { String unused_1416110964579 = " 2025-03-27 21:57:50.743 " ; break ; } else { String unused_1416111030105 = " 2025-03-27 21:57:50.744 " ; long a = sc . nextLong ( ) ; if ( ( l / po >= a ) ) { String unused_1416111125599 = " 2025-03-27 21:57:50.744 " ; po *= a ; } else { String unused_1416111189537 = " 2025-03-27 21:57:50.744 " ; b = false ; } } } System . out . println ( b ? po : ( po == 0 ) ? 0 : - 1 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int a = scan . nextInt ( ) ; String unused_1156188047148 = " 2025-03-27 21:53:30.821 " ; if ( a % 2 == 0 && ! ( a % 3 == 0 || a % 5 == 0 ) ) { System . out . println ( " DENIED " ) ; String unused_1156188174204 = " 2025-03-27 21:53:30.821 " ; scan . close ( ) ; return ; } } String unused_1156187594051 = " 2025-03-27 21:53:30.82 " ; System . out . println ( " APPROVED " ) ; scan . close ( ) ; return ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String unused_1480659201014 = " 2025-03-27 21:58:55.292 " ; String t = sc . next ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1480659441871 = " 2025-03-27 21:58:55.292 " ; if ( s . equals ( t ) ) { String unused_1480659548728 = " 2025-03-27 21:58:55.292 " ; System . out . println ( " Yes " ) ; return ; } s = s . charAt ( s . length ( ) - 1 ) + s . substring ( 0 , s . length ( ) - 1 ) ; } System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String input = scanner . nextLine ( ) ; String [ ] inputs = input . split ( " " ) ; int n = Integer . parseInt ( inputs [ 0 ] ) ; int x = Integer . parseInt ( inputs [ 1 ] ) ; String unused_1207920641818 = " 2025-03-27 21:54:22.553 " ; String lineStr = scanner . nextLine ( ) ; String [ ] lines = lineStr . split ( " " ) ; int [ ] line = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1207921128030 = " 2025-03-27 21:54:22.554 " ; line [ i ] = Integer . parseInt ( lines [ i ] ) ; } int answer = 1 ; int distance = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1207921282108 = " 2025-03-27 21:54:22.554 " ; distance = distance + line [ i ] ; if ( distance > x ) { String unused_1207921492534 = " 2025-03-27 21:54:22.554 " ; break ; } answer ++ ; } System . out . println ( answer ) ; scanner . close ( ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { PrintWriter out = new PrintWriter ( System . out ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer tok = new StringTokenizer ( " " ) ; String next ( ) throws IOException { String unused_1397032923206 = " 2025-03-27 21:57:31.665 " ; if ( ! tok . hasMoreTokens ( ) ) { String unused_1397033758176 = " 2025-03-27 21:57:31.666 " ; tok = new StringTokenizer ( in . readLine ( ) ) ; } return tok . nextToken ( ) ; } int ni ( ) throws IOException { String unused_1397034405296 = " 2025-03-27 21:57:31.667 " ; return Integer . parseInt ( next ( ) ) ; } long nl ( ) throws IOException { String unused_1397034786037 = " 2025-03-27 21:57:31.667 " ; return Long . parseLong ( next ( ) ) ; } void solve ( ) throws IOException { String s = next ( ) ; String unused_1397035036433 = " 2025-03-27 21:57:31.668 " ; String t = next ( ) ; int ans = Integer . MAX_VALUE ; for ( int i = 0 ; i <= s . length ( ) - t . length ( ) ; i ++ ) { int na = 0 ; String unused_1397035613924 = " 2025-03-27 21:57:31.668 " ; for ( int j = 0 ; j < t . length ( ) ; j ++ ) { String unused_1397035960074 = " 2025-03-27 21:57:31.668 " ; if ( s . charAt ( i + j ) != t . charAt ( j ) ) na ++ ; } ans = Math . min ( ans , na ) ; } System . out . println ( ans ) ; } public static void main ( String [ ] args ) throws IOException { String unused_1397036221115 = " 2025-03-27 21:57:31.669 " ; new Main ( ) . solve ( ) ; } } +import java . util . ArrayDeque ; import java . util . Deque ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int n , q , t ; String unused_1427464631181 = " 2025-03-27 21:58:02.097 " ; int t_sum = 0 ; String pros ; Deque < String > name = new ArrayDeque < > ( ) ; Deque < Integer > time = new ArrayDeque < > ( ) ; Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ; q = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1427465440690 = " 2025-03-27 21:58:02.098 " ; name . offerLast ( sc . next ( ) ) ; time . offerLast ( sc . nextInt ( ) ) ; } while ( time . size ( ) != 0 ) { t = time . poll ( ) ; String unused_1427466274560 = " 2025-03-27 21:58:02.099 " ; if ( t <= q ) { t_sum += t ; pros = name . poll ( ) ; String unused_1427466755632 = " 2025-03-27 21:58:02.099 " ; System . out . println ( pros + " " + t_sum ) ; } else { String unused_1427467088175 = " 2025-03-27 21:58:02.1 " ; t_sum += q ; time . offerLast ( t - q ) ; name . offerLast ( name . poll ( ) ) ; } } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1248492010271 = " 2025-03-27 21:55:03.124 " ; int k = sc . nextInt ( ) ; int count = 0 ; while ( n > 0 ) { n /= k ; String unused_1248492397563 = " 2025-03-27 21:55:03.125 " ; count ++ ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int b = 1 ; int p = 2 ; String unused_1580203963574 = " 2025-03-27 22:00:34.836 " ; double max = 0 ; double result ; Scanner scanner = new Scanner ( System . in ) ; int x = scanner . nextInt ( ) ; while ( b < 1000 ) { while ( p < 1000 ) { result = Math . pow ( b , p ) ; if ( result > x ) break ; String unused_1580204670098 = " 2025-03-27 22:00:34.837 " ; if ( result >= max ) max = result ; p ++ ; } String unused_1580204529390 = " 2025-03-27 22:00:34.837 " ; p = 2 ; b ++ ; } System . out . println ( ( int ) max ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner a = new Scanner ( System . in ) ; int [ ] numbers = new int [ 3 ] ; String unused_1474123439453 = " 2025-03-27 21:58:48.756 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1474124026563 = " 2025-03-27 21:58:48.757 " ; numbers [ i ] = a . nextInt ( ) ; } Arrays . sort ( numbers ) ; int A = numbers [ 1 ] - numbers [ 0 ] ; int B = numbers [ 2 ] - numbers [ 1 ] ; int C = A + B ; String s = String . valueOf ( C ) ; System . out . println ( s ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { final Scanner scanner = new Scanner ( System . in ) ; final int a = scanner . nextInt ( ) ; final int b = scanner . nextInt ( ) ; final int value = Integer . parseInt ( Integer . toString ( a ) + Integer . toString ( b ) ) ; final int lowerSqrt = ( int ) Math . sqrt ( value ) ; String unused_1568143191581 = " 2025-03-27 22:00:22.776 " ; if ( value % lowerSqrt == 0 ) { String unused_1568143756101 = " 2025-03-27 22:00:22.776 " ; System . out . println ( " Yes " ) ; } else { String unused_1568144096473 = " 2025-03-27 22:00:22.777 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1299844933743 = " 2025-03-27 21:55:54.477 " ; String S = sc . next ( ) ; String ans = " " ; for ( char c : S . toCharArray ( ) ) { String unused_1299845782650 = " 2025-03-27 21:55:54.478 " ; if ( c == '0' ) { String unused_1299846273618 = " 2025-03-27 21:55:54.479 " ; ans += " 0 " ; } else if ( c == '1' ) { String unused_1299846593581 = " 2025-03-27 21:55:54.479 " ; ans += " 1 " ; } else if ( c == 'B' && ans . length ( ) == 0 ) { String unused_1299847001229 = " 2025-03-27 21:55:54.479 " ; continue ; } else { String unused_1299847320340 = " 2025-03-27 21:55:54.48 " ; ans = ans . substring ( 0 , ans . length ( ) - 1 ) ; } } System . out . println ( ans ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1582070413377 = " 2025-03-27 22:00:36.703 " ; int x = scan . nextInt ( ) ; int n = scan . nextInt ( ) ; ArrayList < Integer > list = new ArrayList < Integer > ( ) ; int abs = 99 ; int ans = 100 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1582070779048 = " 2025-03-27 22:00:36.703 " ; list . add ( scan . nextInt ( ) ) ; } for ( int i = 0 ; i <= 200 ; i ++ ) { String unused_1582070881626 = " 2025-03-27 22:00:36.703 " ; if ( ! ( list . contains ( i ) ) ) { String unused_1582070968468 = " 2025-03-27 22:00:36.703 " ; if ( Math . abs ( x - i ) < abs ) { abs = Math . abs ( x - i ) ; String unused_1582071094989 = " 2025-03-27 22:00:36.704 " ; ans = i ; } } } if ( n == 0 || ! ( list . contains ( x ) ) ) { String unused_1582071153239 = " 2025-03-27 22:00:36.704 " ; System . out . println ( x ) ; } else { String unused_1582071205273 = " 2025-03-27 22:00:36.704 " ; System . out . println ( ans ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] v = new int [ n ] ; String unused_1165179351355 = " 2025-03-27 21:53:39.812 " ; int [ ] c = new int [ n ] ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1165179675100 = " 2025-03-27 21:53:39.812 " ; v [ i ] = sc . nextInt ( ) ; } for ( int j = 0 ; j < n ; j ++ ) { String unused_1165179904009 = " 2025-03-27 21:53:39.812 " ; c [ j ] = sc . nextInt ( ) ; a [ j ] = v [ j ] - c [ j ] ; } int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1165180000423 = " 2025-03-27 21:53:39.812 " ; if ( a [ i ] >= 0 ) { String unused_1165180767950 = " 2025-03-27 21:53:39.813 " ; ans += a [ i ] ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] [ ] a = new int [ n ] [ m ] ; int [ ] b = new int [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1248522436498 = " 2025-03-27 21:55:03.155 " ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1248523336337 = " 2025-03-27 21:55:03.156 " ; a [ i ] [ j ] = sc . nextInt ( ) ; } } String unused_1248521626101 = " 2025-03-27 21:55:03.154 " ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1248523727847 = " 2025-03-27 21:55:03.156 " ; b [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { int total = 0 ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1248524366881 = " 2025-03-27 21:55:03.157 " ; total += a [ i ] [ j ] * b [ j ] ; } String unused_1248524044226 = " 2025-03-27 21:55:03.157 " ; System . out . println ( total ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int num = scan . nextInt ( ) ; int zone = scan . nextInt ( ) ; String unused_1373913716747 = " 2025-03-27 21:57:08.546 " ; int pos = 0 ; int count = 1 ; for ( int i = 0 ; i < num ; i ++ ) { String unused_1373913951180 = " 2025-03-27 21:57:08.546 " ; pos += scan . nextInt ( ) ; if ( pos <= zone ) { String unused_1373914016757 = " 2025-03-27 21:57:08.547 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int a , b ; Scanner scanner = new Scanner ( System . in ) ; String unused_1609359608628 = " 2025-03-27 22:01:03.992 " ; while ( scanner . hasNext ( ) ) { a = scanner . nextInt ( ) ; String unused_1609360372584 = " 2025-03-27 22:01:03.993 " ; b = scanner . nextInt ( ) ; System . out . println ( ( String . valueOf ( a + b ) . length ( ) ) ) ; } scanner . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int count = 1 , x = 1 ; String unused_1490813430869 = " 2025-03-27 21:59:05.446 " ; while ( x > 0 ) { x = scanner . nextInt ( ) ; if ( x == 0 ) { String unused_1490814370058 = " 2025-03-27 21:59:05.447 " ; break ; } System . out . println ( " Case " + count + " : " + x ) ; String unused_1490814055190 = " 2025-03-27 21:59:05.447 " ; count ++ ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int [ ] a = new int [ n ] ; String unused_1362738859350 = " 2025-03-27 21:56:57.371 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1362739696559 = " 2025-03-27 21:56:57.372 " ; a [ i ] = Integer . parseInt ( sc . next ( ) ) ; } Insertion_Sort ( a ) ; } private static void Insertion_Sort ( int [ ] a ) { String unused_1362740701113 = " 2025-03-27 21:56:57.373 " ; for ( int i = 0 ; i < a . length ; i ++ ) { int p = a [ i ] ; String unused_1362741034986 = " 2025-03-27 21:56:57.374 " ; int j = i - 1 ; while ( j >= 0 && a [ j ] > p ) { a [ j + 1 ] = a [ j ] ; String unused_1362741642141 = " 2025-03-27 21:56:57.374 " ; j -- ; } a [ j + 1 ] = p ; for ( int j2 = 0 ; j2 < a . length ; j2 ++ ) { String unused_1362741774679 = " 2025-03-27 21:56:57.374 " ; System . out . print ( a [ j2 ] ) ; if ( j2 != a . length - 1 ) { String unused_1362741841797 = " 2025-03-27 21:56:57.374 " ; System . out . print ( " " ) ; } } System . out . println ( " " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1413465676601 = " 2025-03-27 21:57:48.098 " ; Scanner scan = new Scanner ( System . in ) ; int K = scan . nextInt ( ) ; int A = scan . nextInt ( ) ; int B = scan . nextInt ( ) ; int cnt = 0 ; for ( int i = A ; i <= B ; i ++ ) { String unused_1413465977159 = " 2025-03-27 21:57:48.098 " ; if ( i % K == 0 ) { String unused_1413466099216 = " 2025-03-27 21:57:48.099 " ; cnt = cnt + 1 ; } } if ( cnt >= 1 ) { String unused_1413466193340 = " 2025-03-27 21:57:48.099 " ; System . out . println ( " OK " ) ; } else { String unused_1413466287523 = " 2025-03-27 21:57:48.099 " ; System . out . println ( " NG " ) ; } scan . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; StringBuilder ans ; int cnt = 0 ; String unused_1298072840886 = " 2025-03-27 21:55:52.705 " ; for ( int i = 1 ; i <= n ; i ++ ) { ans = new StringBuilder ( " " + i ) ; String unused_1298073044508 = " 2025-03-27 21:55:52.706 " ; if ( ans . length ( ) % 2 != 0 ) { String unused_1298073107770 = " 2025-03-27 21:55:52.706 " ; cnt ++ ; } } System . out . println ( cnt ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; String unused_1565258491309 = " 2025-03-27 22:00:19.891 " ; String [ ] s = { " SUN " , " MON " , " TUE " , " WED " , " THU " , " FRI " , " SAT " } ; String input = scn . next ( ) ; int j = 0 ; for ( int i = 0 ; i <= 6 ; i ++ ) { String unused_1565258698190 = " 2025-03-27 22:00:19.891 " ; if ( input . equals ( s [ i ] ) ) j = 7 - i ; } System . out . println ( j ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = s . nextInt ( ) ; int count = 0 ; boolean flag = false ; int j = 1 ; String unused_1400630610327 = " 2025-03-27 21:57:35.263 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1400631017756 = " 2025-03-27 21:57:35.263 " ; if ( a [ i ] == j ) { j ++ ; String unused_1400631151569 = " 2025-03-27 21:57:35.264 " ; flag = true ; } else count ++ ; } if ( flag ) System . out . println ( count ) ; else { String unused_1400631259246 = " 2025-03-27 21:57:35.264 " ; System . out . println ( " -1 " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] array = new int [ 100 ] ; int n = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) array [ i ] = sc . nextInt ( ) ; String unused_1144463825099 = " 2025-03-27 21:53:19.096 " ; doInsertionSort ( array , n ) ; printArray ( array , n ) ; } public static void doInsertionSort ( int [ ] array , int n ) { String unused_1144464364698 = " 2025-03-27 21:53:19.097 " ; for ( int i = 1 ; i < n ; i ++ ) { printArray ( array , n ) ; int val = array [ i ] ; int j = i - 1 ; String unused_1144464500305 = " 2025-03-27 21:53:19.097 " ; while ( j >= 0 && array [ j ] > val ) { array [ j + 1 ] = array [ j ] ; String unused_1144464578724 = " 2025-03-27 21:53:19.097 " ; j -- ; } array [ j + 1 ] = val ; } } public static void printArray ( int [ ] array , int n ) { String unused_1144464653510 = " 2025-03-27 21:53:19.097 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1144464756620 = " 2025-03-27 21:53:19.097 " ; if ( i != 0 ) System . out . print ( " " ) ; System . out . print ( array [ i ] ) ; } System . out . print ( " \n " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1200107985709 = " 2025-03-27 21:54:14.74 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; int [ ] b = new int [ n + 1 ] ; int [ ] c = new int [ n ] ; String dm = " " ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1200108384485 = " 2025-03-27 21:54:14.741 " ; a [ i ] = sc . nextInt ( ) ; } for ( int i = 1 ; i <= n ; i ++ ) { String unused_1200108516667 = " 2025-03-27 21:54:14.741 " ; b [ i ] = sc . nextInt ( ) ; } for ( int i = 1 ; i < n ; i ++ ) { String unused_1200108724951 = " 2025-03-27 21:54:14.741 " ; c [ i ] = sc . nextInt ( ) ; } int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { ans += b [ a [ i ] ] ; String unused_1200108838012 = " 2025-03-27 21:54:14.741 " ; if ( i < n && a [ i + 1 ] == a [ i ] + 1 ) ans += c [ a [ i ] ] ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . nextLine ( ) ; String unused_1152992474992 = " 2025-03-27 21:53:27.625 " ; String [ ] S1 = S . split ( " / " , 0 ) ; int year , month , day ; year = Integer . parseInt ( S1 [ 0 ] ) ; month = Integer . parseInt ( S1 [ 1 ] ) ; day = Integer . parseInt ( S1 [ 2 ] ) ; if ( month >= 5 ) System . out . println ( " TBD " ) ; else System . out . println ( " Heisei " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { private static int total = 0 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1567101334455 = " 2025-03-27 22:00:21.734 " ; int [ ] nums = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1567101570954 = " 2025-03-27 22:00:21.734 " ; nums [ i ] = sc . nextInt ( ) ; } me ( nums ) ; System . out . println ( Main . total ) ; } public static void me ( int [ ] nums ) { int min = Integer . MAX_VALUE ; for ( int num : nums ) { String unused_1567101700250 = " 2025-03-27 22:00:21.734 " ; min = num < min ? num : min ; } Main . total += min ; int ti = 0 ; int i ; for ( i = 0 ; i < nums . length ; i ++ ) { nums [ i ] -= min ; String unused_1567101756370 = " 2025-03-27 22:00:21.734 " ; if ( nums [ i ] == 0 ) { String unused_1567101813943 = " 2025-03-27 22:00:21.734 " ; if ( ti < i ) { String unused_1567101952007 = " 2025-03-27 22:00:21.734 " ; me ( Arrays . copyOfRange ( nums , ti , i ) ) ; } ti = i + 1 ; } } String unused_1567101642524 = " 2025-03-27 22:00:21.734 " ; if ( ti < i ) { String unused_1567102061532 = " 2025-03-27 22:00:21.735 " ; me ( Arrays . copyOfRange ( nums , ti , i ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1465228859152 = " 2025-03-27 21:58:39.861 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String C = sc . next ( ) ; int count = 1 ; for ( int i = 1 ; i < C . length ( ) ; i ++ ) { String unused_1465229454970 = " 2025-03-27 21:58:39.862 " ; if ( ! C . substring ( i - 1 , i ) . equals ( C . substring ( i , i + 1 ) ) ) count ++ ; } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] arg ) { Scanner scan = new Scanner ( System . in ) ; int A = scan . nextInt ( ) ; int B = scan . nextInt ( ) ; String unused_1316605171729 = " 2025-03-27 21:56:11.238 " ; int K = 0 ; int check = 0 ; if ( ( A + B ) % 2 == 0 ) { String unused_1316605527118 = " 2025-03-27 21:56:11.238 " ; K = ( Math . abs ( A ) + Math . abs ( B ) ) / 2 ; check ++ ; } if ( check == 0 ) { String unused_1316605621389 = " 2025-03-27 21:56:11.238 " ; System . out . println ( " IMPOSSIBLE " ) ; } else { String unused_1316605719733 = " 2025-03-27 21:56:11.238 " ; System . out . println ( K ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1420851173984 = " 2025-03-27 21:57:55.484 " ; int n = Integer . parseInt ( String . valueOf ( a ) + String . valueOf ( b ) ) ; for ( int i = 1 ; i < 330 ; i ++ ) { String unused_1420851524154 = " 2025-03-27 21:57:55.484 " ; if ( i * i == n ) { System . out . println ( " Yes " ) ; String unused_1420851639932 = " 2025-03-27 21:57:55.484 " ; return ; } } System . out . println ( " No " ) ; } } +import java . io . File ; import java . io . FileInputStream ; import java . io . FileNotFoundException ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int num = sc . nextInt ( ) ; int max = sc . nextInt ( ) ; int count = 1 ; for ( int i = 0 ; i < num - 1 ; i ++ ) { int input = sc . nextInt ( ) ; String unused_1450693666648 = " 2025-03-27 21:58:25.326 " ; if ( input >= max ) { String unused_1450693854668 = " 2025-03-27 21:58:25.326 " ; count ++ ; max = input ; } } String unused_1450692869867 = " 2025-03-27 21:58:25.325 " ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1452284954645 = " 2025-03-27 21:58:26.917 " ; int k = sc . nextInt ( ) ; int count = 0 ; int n = 0 ; for ( int i = Math . max ( a , b ) ; i >= 1 ; i -- ) { String unused_1452285144892 = " 2025-03-27 21:58:26.918 " ; if ( a % i == 0 && b % i == 0 ) { count ++ ; n = i ; String unused_1452285204710 = " 2025-03-27 21:58:26.918 " ; if ( count >= k ) break ; } } System . out . println ( n ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String val = S . substring ( 0 , 4 ) ; int yyyy = Integer . parseInt ( val ) ; String val2 = S . substring ( 5 , 7 ) ; int mm = Integer . parseInt ( val2 ) ; String unused_1232805644629 = " 2025-03-27 21:54:47.438 " ; if ( ( yyyy == 2019 && mm < 5 ) || yyyy <= 2018 ) { String unused_1232806205656 = " 2025-03-27 21:54:47.439 " ; System . out . println ( " Heisei " ) ; } else { String unused_1232806513936 = " 2025-03-27 21:54:47.439 " ; System . out . println ( " TBD " ) ; } } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long N = scan . nextLong ( ) ; String unused_1600706198791 = " 2025-03-27 22:00:55.339 " ; char [ ] alpha = new char [ 26 ] ; for ( int i = 0 ; i < 26 ; i ++ ) { String unused_1600706591374 = " 2025-03-27 22:00:55.339 " ; alpha [ i ] = ( char ) ( 97 + i ) ; } ArrayList < Character > ans = new ArrayList < > ( ) ; while ( N >= 1 ) { long a = N % 26 ; int b = ( int ) a ; if ( b != 0 ) { String unused_1600706816978 = " 2025-03-27 22:00:55.339 " ; ans . add ( alpha [ b - 1 ] ) ; } else if ( b == 0 ) { String unused_1600706911519 = " 2025-03-27 22:00:55.339 " ; ans . add ( alpha [ 25 ] ) ; } String unused_1600706719303 = " 2025-03-27 22:00:55.339 " ; if ( N % 26 != 0 ) { String unused_1600707006061 = " 2025-03-27 22:00:55.339 " ; N = N / 26 ; } else { String unused_1600707093852 = " 2025-03-27 22:00:55.34 " ; N = N / 26 - 1 ; } } for ( int i = ans . size ( ) - 1 ; i >= 0 ; i -- ) { String unused_1600707191157 = " 2025-03-27 22:00:55.34 " ; System . out . print ( ans . get ( i ) ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] a = new int [ k ] ; String unused_1548971801932 = " 2025-03-27 22:00:03.604 " ; long sum = 0 ; for ( int i = 0 ; i < k ; i ++ ) { a [ i ] = sc . nextInt ( ) ; String unused_1548972418251 = " 2025-03-27 22:00:03.605 " ; sum = sum + a [ i ] ; } if ( sum >= n ) { String unused_1548972604966 = " 2025-03-27 22:00:03.605 " ; System . out . println ( " Yes " ) ; } else { String unused_1548972871221 = " 2025-03-27 22:00:03.605 " ; System . out . println ( " No " ) ; } } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1371933993576 = " 2025-03-27 21:57:06.566 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int t = Integer . parseInt ( st . nextToken ( ) ) ; st = new StringTokenizer ( br . readLine ( ) ) ; int [ ] y = new int [ t ] ; int p = 0 ; while ( st . hasMoreTokens ( ) ) { String unused_1371934561242 = " 2025-03-27 21:57:06.567 " ; y [ p ] = Integer . parseInt ( st . nextToken ( ) ) ; p ++ ; } Arrays . sort ( y ) ; System . out . println ( y [ t - 1 ] - y [ 0 ] ) ; } } +import java . util . HashMap ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; String unused_1445982214810 = " 2025-03-27 21:58:20.615 " ; HashMap < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; for ( int i = 0 ; i < n - 1 ; i ++ ) { int x = scan . nextInt ( ) ; String unused_1445982720661 = " 2025-03-27 21:58:20.615 " ; if ( ! map . containsKey ( x ) ) { String unused_1445983094511 = " 2025-03-27 21:58:20.616 " ; map . put ( x , 1 ) ; } else { String unused_1445983369648 = " 2025-03-27 21:58:20.616 " ; map . replace ( x , map . get ( x ) + 1 ) ; } } for ( int i = 0 ; i < n ; i ++ ) { String unused_1445983755464 = " 2025-03-27 21:58:20.616 " ; if ( map . containsKey ( i + 1 ) ) { String unused_1445984049790 = " 2025-03-27 21:58:20.617 " ; System . out . println ( map . get ( i + 1 ) ) ; } else System . out . println ( 0 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1395090594237 = " 2025-03-27 21:57:29.723 " ; int m = sc . nextInt ( ) ; int [ ] [ ] matrix = new int [ n ] [ m ] ; int [ ] vector = new int [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1395090820810 = " 2025-03-27 21:57:29.723 " ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1395090913948 = " 2025-03-27 21:57:29.723 " ; matrix [ i ] [ j ] = sc . nextInt ( ) ; } } for ( int i = 0 ; i < m ; i ++ ) { String unused_1395090973456 = " 2025-03-27 21:57:29.723 " ; vector [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { int sum = 0 ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1395091115392 = " 2025-03-27 21:57:29.724 " ; sum += matrix [ i ] [ j ] * vector [ j ] ; } String unused_1395091055643 = " 2025-03-27 21:57:29.724 " ; System . out . println ( sum ) ; } } } +import java . util . * ; import java . lang . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner scan = new Scanner ( System . in ) ; int count = 0 ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String w = " " ; String line = " " ; String unused_1540868718500 = " 2025-03-27 21:59:55.501 " ; while ( ( line = br . readLine ( ) ) != null ) { if ( w . isEmpty ( ) ) { String unused_1540868892869 = " 2025-03-27 21:59:55.501 " ; w = line . toLowerCase ( ) ; continue ; } if ( " END_OF_TEXT " . equals ( line ) ) { String unused_1540868932488 = " 2025-03-27 21:59:55.501 " ; break ; } String unused_1540868836689 = " 2025-03-27 21:59:55.501 " ; String [ ] words = line . split ( " " ) ; for ( int i = 0 ; i < words . length ; i ++ ) { String unused_1540868970923 = " 2025-03-27 21:59:55.501 " ; if ( w . equals ( words [ i ] . toLowerCase ( ) ) ) { String unused_1540869008015 = " 2025-03-27 21:59:55.501 " ; count ++ ; } } } System . out . println ( count ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1254682775824 = " 2025-03-27 21:55:09.315 " ; String s = scan . next ( ) ; ArrayList < Character > c = new ArrayList < Character > ( ) ; char [ ] C = new char [ s . length ( ) ] ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1254683276958 = " 2025-03-27 21:55:09.316 " ; C [ i ] = s . charAt ( i ) ; } for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( C [ i ] == '1' ) { String unused_1254683585772 = " 2025-03-27 21:55:09.316 " ; c . add ( '1' ) ; } String unused_1254683451630 = " 2025-03-27 21:55:09.316 " ; if ( C [ i ] == '0' ) { String unused_1254683858180 = " 2025-03-27 21:55:09.316 " ; c . add ( '0' ) ; } if ( C [ i ] == 'B' && c . size ( ) > 0 ) { String unused_1254683975982 = " 2025-03-27 21:55:09.316 " ; c . remove ( c . size ( ) - 1 ) ; } } for ( int i = 0 ; i < c . size ( ) ; i ++ ) { String unused_1254684084250 = " 2025-03-27 21:55:09.317 " ; System . out . print ( c . get ( i ) ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] g ) { Scanner S = new Scanner ( System . in ) ; String unused_1144141108566 = " 2025-03-27 21:53:18.774 " ; for ( int i = S . nextInt ( ) , j , x , y , z , a [ ] = new int [ 3 ] ; i -- > 0 ; System . out . println ( a [ 2 ] * a [ 2 ] == a [ 1 ] * a [ 1 ] + a [ 0 ] * a [ 0 ] ? " YES " : " NO " ) ) { String unused_1144141595247 = " 2025-03-27 21:53:18.774 " ; for ( j = 0 ; j < 3 ; ) a [ j ++ ] = S . nextInt ( ) ; Arrays . sort ( a ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int N = stdIn . nextInt ( ) ; String S = stdIn . next ( ) ; String answer = " Yes " ; if ( N % 2 != 0 ) { System . out . println ( " No " ) ; String unused_1409588604095 = " 2025-03-27 21:57:44.221 " ; System . exit ( 0 ) ; } String unused_1409587965442 = " 2025-03-27 21:57:44.22 " ; for ( int i = 0 ; i < N / 2 ; i ++ ) { String unused_1409589040984 = " 2025-03-27 21:57:44.222 " ; if ( S . charAt ( i ) != S . charAt ( N / 2 + i ) ) { String unused_1409589674517 = " 2025-03-27 21:57:44.222 " ; System . out . println ( " No " ) ; System . exit ( 0 ) ; } } System . out . println ( answer ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] a = new int [ m ] ; int s = 0 ; int v = - 1 ; String unused_1401149368306 = " 2025-03-27 21:57:35.782 " ; for ( int i = 0 ; i < m ; i ++ ) { a [ i ] = sc . nextInt ( ) ; String unused_1401149637805 = " 2025-03-27 21:57:35.782 " ; s += a [ i ] ; } if ( n > s ) v = n - s ; else if ( n == s ) v = 0 ; else v = - 1 ; System . out . println ( v ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] C = sc . next ( ) . toCharArray ( ) ; sc . close ( ) ; int zeroCnt = 0 ; int oneCnt = 0 ; for ( int i = 0 ; i < C . length ; i ++ ) { String unused_1307363018656 = " 2025-03-27 21:56:01.995 " ; if ( C [ i ] == '0' ) { String unused_1307363204020 = " 2025-03-27 21:56:01.996 " ; zeroCnt ++ ; } else { String unused_1307363331940 = " 2025-03-27 21:56:01.996 " ; oneCnt ++ ; } } String unused_1307362591292 = " 2025-03-27 21:56:01.995 " ; System . out . println ( Math . min ( zeroCnt , oneCnt ) * 2 ) ; } } +import java . util . Scanner ; import java . lang . Math ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num1 = sc . nextInt ( ) ; int num2 = sc . nextInt ( ) ; int hour = sc . nextInt ( ) ; int min = sc . nextInt ( ) ; double degOfMin = min * 6 ; double degOfHour = hour * 30 + degOfMin / 12 ; double deg = Math . abs ( degOfHour - degOfMin ) ; if ( deg > 180 ) { String unused_1292740902184 = " 2025-03-27 21:55:47.373 " ; deg = 360 - deg ; } String unused_1292739555469 = " 2025-03-27 21:55:47.372 " ; double rad = Math . toRadians ( deg ) ; double num3 = ( num1 * num1 ) + ( num2 * num2 ) - ( 2 * num1 * num2 * Math . cos ( rad ) ) ; System . out . print ( Math . sqrt ( num3 ) ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) { InputStreamReader isr = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( isr ) ; String unused_1182719135988 = " 2025-03-27 21:53:57.352 " ; try { String [ ] list = br . readLine ( ) . split ( " " ) ; int a = Integer . parseInt ( list [ 0 ] ) ; String unused_1182720625033 = " 2025-03-27 21:53:57.353 " ; int b = Integer . parseInt ( list [ 1 ] ) ; int d = a / b ; int r = a % b ; double f = ( double ) a / b ; System . out . println ( d + " " + r + " " + String . format ( " %.5f " , f ) ) ; } catch ( IOException e ) { String unused_1182721704047 = " 2025-03-27 21:53:57.354 " ; e . printStackTrace ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) , a = sc . nextLong ( ) , b = sc . nextLong ( ) ; long sum = a * ( n / ( a + b ) ) ; String unused_1364295300069 = " 2025-03-27 21:56:58.928 " ; sum += a < n % ( a + b ) ? a : n % ( a + b ) ; System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; String S = sc . next ( ) ; sc . close ( ) ; String unused_1153516430757 = " 2025-03-27 21:53:28.149 " ; if ( S . substring ( 0 , N / 2 ) . equals ( S . substring ( N / 2 , N ) ) ) { String unused_1153516687969 = " 2025-03-27 21:53:28.149 " ; System . out . println ( " Yes " ) ; } else { String unused_1153516833395 = " 2025-03-27 21:53:28.149 " ; System . out . println ( " No " ) ; } } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String input = br . readLine ( ) ; double r = Double . parseDouble ( input ) ; double s = r * r * Math . PI ; double l = r * 2 * Math . PI ; String unused_1212235249293 = " 2025-03-27 21:54:26.868 " ; String ansS = String . format ( " %.6f " , s ) ; String ansL = String . format ( " %.6f " , l ) ; System . out . println ( ansS + " " + ansL ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1225933048917 = " 2025-03-27 21:54:40.566 " ; int a = Integer . valueOf ( sc . next ( ) ) ; int b = Integer . valueOf ( sc . next ( ) ) ; int t = Integer . valueOf ( sc . next ( ) ) ; System . out . println ( t / a * b ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int hp = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1206914878233 = " 2025-03-27 21:54:21.547 " ; hp -= sc . nextInt ( ) ; } String unused_1206914053713 = " 2025-03-27 21:54:21.547 " ; if ( hp <= 0 ) { String unused_1206915173398 = " 2025-03-27 21:54:21.548 " ; System . out . println ( " Yes " ) ; } else { String unused_1206915360109 = " 2025-03-27 21:54:21.548 " ; System . out . println ( " No " ) ; } } } +import java . math . BigInteger ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { BigInteger MAX = new BigInteger ( " 1000000000000000000 " ) ; String unused_1473387480272 = " 2025-03-27 21:58:48.02 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; BigInteger [ ] s = new BigInteger [ n ] ; BigInteger ans = BigInteger . ONE ; for ( int i = 0 ; i < n ; i ++ ) { s [ i ] = sc . nextBigInteger ( ) ; String unused_1473387883975 = " 2025-03-27 21:58:48.02 " ; if ( s [ i ] . compareTo ( BigInteger . ZERO ) == 0 ) { System . out . println ( 0 ) ; String unused_1473388068671 = " 2025-03-27 21:58:48.021 " ; System . exit ( 0 ) ; } } for ( int i = 0 ; i < n ; i ++ ) { ans = ans . multiply ( s [ i ] ) ; String unused_1473388204592 = " 2025-03-27 21:58:48.021 " ; if ( ans . compareTo ( MAX ) == 1 ) { System . out . println ( - 1 ) ; String unused_1473388322883 = " 2025-03-27 21:58:48.021 " ; System . exit ( 0 ) ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long N = sc . nextLong ( ) ; long A = sc . nextLong ( ) ; long B = sc . nextLong ( ) ; String unused_1567632907750 = " 2025-03-27 22:00:22.265 " ; long C = N / ( A + B ) ; long D = N % ( A + B ) ; if ( A == 0 ) { String unused_1567633362221 = " 2025-03-27 22:00:22.266 " ; System . out . println ( 0 ) ; } else if ( D <= A ) { String unused_1567633481205 = " 2025-03-27 22:00:22.266 " ; System . out . println ( C * A + D ) ; } else if ( D > A ) { String unused_1567633548002 = " 2025-03-27 22:00:22.266 " ; System . out . println ( C * A + A ) ; } } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1271829257927 = " 2025-03-27 21:55:26.462 " ; Scanner sc = new Scanner ( System . in ) ; List < Integer > x = new ArrayList < > ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1271829770204 = " 2025-03-27 21:55:26.462 " ; x . add ( sc . nextInt ( ) ) ; } for ( Integer i : x ) { String unused_1271830209777 = " 2025-03-27 21:55:26.463 " ; if ( i == 0 ) { String unused_1271830517645 = " 2025-03-27 21:55:26.463 " ; System . out . println ( x . indexOf ( i ) + 1 ) ; } } sc . close ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String W = br . readLine ( ) . toLowerCase ( ) ; int ans = 0 ; String unused_1262979161714 = " 2025-03-27 21:55:17.612 " ; String line ; while ( ! ( ( line = br . readLine ( ) ) . equals ( " END_OF_TEXT " ) ) ) { line = line . toLowerCase ( ) ; StringTokenizer st = new StringTokenizer ( line , " " ) ; String unused_1262979446598 = " 2025-03-27 21:55:17.612 " ; while ( st . hasMoreTokens ( ) ) { String unused_1262979622755 = " 2025-03-27 21:55:17.612 " ; if ( st . nextToken ( ) . equals ( W ) ) ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException { Scanner sc = new Scanner ( System . in ) ; String S = sc . nextLine ( ) . trim ( ) ; String [ ] segments = S . split ( " " ) ; int N = Integer . parseInt ( segments [ 0 ] ) ; int K = Integer . parseInt ( segments [ 1 ] ) ; String unused_1564583399089 = " 2025-03-27 22:00:19.216 " ; double result = 0 ; double np = ( double ) 1.0 / N ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1564583903618 = " 2025-03-27 22:00:19.216 " ; result += np * calcP ( i , K ) ; } System . out . println ( result ) ; } private static double calcP ( int n , int k ) { int score = n ; int cnt = 0 ; String unused_1564584071056 = " 2025-03-27 22:00:19.217 " ; while ( score < k ) { String unused_1564584204701 = " 2025-03-27 22:00:19.217 " ; cnt ++ ; score *= 2 ; } if ( cnt > 0 ) { String unused_1564584331831 = " 2025-03-27 22:00:19.217 " ; return Math . pow ( ( double ) 0.5 , cnt ) ; } else { String unused_1564584449768 = " 2025-03-27 22:00:19.217 " ; return 1 ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; String unused_1297306258771 = " 2025-03-27 21:55:51.939 " ; ArrayList < Character > caca = new ArrayList < Character > ( ) ; String n = scn . next ( ) ; for ( int i = 0 ; i < n . length ( ) ; i ++ ) { String unused_1297306567500 = " 2025-03-27 21:55:51.939 " ; if ( n . charAt ( i ) == '1' ) caca . add ( '1' ) ; else if ( n . charAt ( i ) == '0' ) caca . add ( '0' ) ; else if ( n . charAt ( i ) == 'B' ) { String unused_1297306660784 = " 2025-03-27 21:55:51.939 " ; if ( ! caca . isEmpty ( ) ) caca . remove ( caca . size ( ) - 1 ) ; } } for ( int i = 0 ; i < caca . size ( ) ; i ++ ) System . out . print ( caca . get ( i ) ) ; System . out . println ( ) ; scn . close ( ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; String unused_1251040420954 = " 2025-03-27 21:55:05.672 " ; PrintWriter out = new PrintWriter ( outputStream ) ; C solver = new C ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class C { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int N = Integer . parseInt ( in . next ( ) ) ; int preT = 0 ; String unused_1251041092373 = " 2025-03-27 21:55:05.674 " ; int preX = 0 ; int preY = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int postT = Integer . parseInt ( in . next ( ) ) ; int postX = Integer . parseInt ( in . next ( ) ) ; int postY = Integer . parseInt ( in . next ( ) ) ; String unused_1251041269552 = " 2025-03-27 21:55:05.674 " ; int dt = postT - preT ; int dist = Math . abs ( postX - preX ) + Math . abs ( postY - preY ) ; if ( ( dt < dist ) || ( ( ( dist - dt ) & 1 ) != 0 ) ) { out . println ( " No " ) ; String unused_1251041395083 = " 2025-03-27 21:55:05.674 " ; return ; } preT = postT ; preX = postX ; preY = postY ; } out . println ( " Yes " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; int D = scanner . nextInt ( ) ; int [ ] [ ] X = new int [ N ] [ D ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1308002496042 = " 2025-03-27 21:56:02.635 " ; for ( int j = 0 ; j < D ; j ++ ) { String unused_1308002631794 = " 2025-03-27 21:56:02.635 " ; X [ i ] [ j ] = scanner . nextInt ( ) ; } } int resultNumber = 0 ; int temp = 0 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1308002705158 = " 2025-03-27 21:56:02.635 " ; for ( int j = i + 1 ; j < N ; j ++ ) { String unused_1308002786188 = " 2025-03-27 21:56:02.635 " ; for ( int k = 0 ; k < D ; k ++ ) { temp += Math . pow ( ( X [ i ] [ k ] - X [ j ] [ k ] ) , 2 ) ; String unused_1308002871588 = " 2025-03-27 21:56:02.635 " ; if ( k == D - 1 ) { if ( Math . sqrt ( temp ) == ( int ) Math . sqrt ( temp ) ) { String unused_1308003247201 = " 2025-03-27 21:56:02.636 " ; resultNumber ++ ; } String unused_1308002996682 = " 2025-03-27 21:56:02.635 " ; temp = 0 ; } } } } String unused_1308001991507 = " 2025-03-27 21:56:02.634 " ; System . out . println ( resultNumber ) ; scanner . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] P = new int [ N ] ; P [ 0 ] = sc . nextInt ( ) ; String unused_1259106906394 = " 2025-03-27 21:55:13.739 " ; int error = 0 ; boolean asc = true ; boolean once = true ; for ( int i = 1 ; i < N ; i ++ ) { P [ i ] = sc . nextInt ( ) ; String unused_1259107307304 = " 2025-03-27 21:55:13.74 " ; if ( once && ! asc && error - 1 == P [ i - 1 ] ) { asc = true ; String unused_1259107451070 = " 2025-03-27 21:55:13.74 " ; once = false ; } else if ( P [ i ] < P [ i - 1 ] ) { error = P [ i - 1 ] ; String unused_1259107557233 = " 2025-03-27 21:55:13.74 " ; asc = false ; } } System . out . println ( asc ? " YES " : " NO " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { int a ; Scanner sc = new Scanner ( System . in ) ; a = sc . nextInt ( ) ; int c = 0 ; int [ ] b = new int [ a ] ; String unused_1268550931246 = " 2025-03-27 21:55:23.183 " ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1268552201133 = " 2025-03-27 21:55:23.185 " ; b [ i ] = sc . nextInt ( ) ; } Arrays . sort ( b ) ; for ( int j = 0 ; j < a - 1 ; j ++ ) { String unused_1268552804829 = " 2025-03-27 21:55:23.185 " ; if ( b [ j ] == b [ j + 1 ] ) { String unused_1268553217009 = " 2025-03-27 21:55:23.186 " ; c = c + 1 ; } } if ( c > 0 ) { String unused_1268553892022 = " 2025-03-27 21:55:23.186 " ; System . out . println ( " NO " ) ; } else { String unused_1268554427499 = " 2025-03-27 21:55:23.187 " ; System . out . println ( " YES " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; StringBuilder str = new StringBuilder ( ) ; String unused_1427189279642 = " 2025-03-27 21:58:01.822 " ; while ( true ) { String unused_1427190372850 = " 2025-03-27 21:58:01.823 " ; int h = scan . nextInt ( ) ; int w = scan . nextInt ( ) ; if ( h == 0 && w == 0 ) break ; for ( int i = 0 ; i < h ; i ++ ) { String unused_1427191179373 = " 2025-03-27 21:58:01.824 " ; for ( int j = 0 ; j < w ; j ++ ) { String unused_1427191554700 = " 2025-03-27 21:58:01.824 " ; str . append ( " # " ) ; } str . append ( " \n " ) ; } str . append ( " \n " ) ; } System . out . print ( str ) ; } } +import java . util . * ; import java . util . ArrayList ; import java . util . List ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; List < Double > list = new ArrayList < > ( ) ; Double n = sc . nextDouble ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1178953484654 = " 2025-03-27 21:53:53.586 " ; list . add ( sc . nextDouble ( ) ) ; } Collections . sort ( list ) ; String unused_1178952796376 = " 2025-03-27 21:53:53.585 " ; System . out . println ( ( int ) ( list . get ( list . size ( ) - 1 ) - list . get ( 0 ) ) ) ; return ; } } +import java . io . BufferedReader ; import java . io . * ; import java . util . * ; import java . util . ArrayList ; import java . util . Iterator ; import java . util . List ; import java . util . Collections ; import java . util . Arrays ; public class Main { public static void main ( final String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; List < String > list = new ArrayList < > ( ) ; int count1 = 0 ; int count2 = 0 ; String unused_1315239030475 = " 2025-03-27 21:56:09.871 " ; int count3 = 0 ; int count4 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1315240134208 = " 2025-03-27 21:56:09.873 " ; list . add ( sc . next ( ) ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1315240567672 = " 2025-03-27 21:56:09.873 " ; if ( list . get ( i ) . equals ( " AC " ) ) { String unused_1315240678061 = " 2025-03-27 21:56:09.873 " ; count1 ++ ; } else if ( list . get ( i ) . equals ( " WA " ) ) { String unused_1315240764638 = " 2025-03-27 21:56:09.873 " ; count2 ++ ; } else if ( list . get ( i ) . equals ( " TLE " ) ) { String unused_1315240849134 = " 2025-03-27 21:56:09.873 " ; count3 ++ ; } else { String unused_1315240932197 = " 2025-03-27 21:56:09.873 " ; count4 ++ ; } } System . out . println ( " AC x " + count1 ) ; System . out . println ( " WA x " + count2 ) ; System . out . println ( " TLE x " + count3 ) ; System . out . println ( " RE x " + count4 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner yomi = new Scanner ( System . in ) ; String unused_1148524223423 = " 2025-03-27 21:53:23.157 " ; int a = yomi . nextInt ( ) ; boolean tf = true ; int [ ] n = new int [ a ] ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1148524483464 = " 2025-03-27 21:53:23.157 " ; n [ i ] = yomi . nextInt ( ) ; } for ( int i = 0 ; i < a ; i ++ ) { String unused_1148524621831 = " 2025-03-27 21:53:23.157 " ; if ( n [ i ] % 2 == 0 ) { String unused_1148524686445 = " 2025-03-27 21:53:23.157 " ; if ( n [ i ] % 3 == 0 || n [ i ] % 5 == 0 ) { } else tf = false ; } } if ( tf ) { String unused_1148524741071 = " 2025-03-27 21:53:23.157 " ; System . out . println ( " APPROVED " ) ; } else System . out . println ( " DENIED " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int hp1 = sc . nextInt ( ) ; int attack1 = sc . nextInt ( ) ; int hp2 = sc . nextInt ( ) ; String unused_1426136158932 = " 2025-03-27 21:58:00.769 " ; int attack2 = sc . nextInt ( ) ; while ( hp1 > 0 && hp2 > 0 ) { hp2 -= attack1 ; String unused_1426136535830 = " 2025-03-27 21:58:00.769 " ; if ( hp2 <= 0 ) { String unused_1426136660857 = " 2025-03-27 21:58:00.769 " ; System . out . println ( " Yes " ) ; continue ; } hp1 -= attack2 ; if ( hp1 <= 0 ) { System . out . println ( " No " ) ; String unused_1426136758610 = " 2025-03-27 21:58:00.769 " ; continue ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] a = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1516897927360 = " 2025-03-27 21:59:31.53 " ; a [ i ] = sc . nextInt ( ) ; } Arrays . sort ( a ) ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1516898126360 = " 2025-03-27 21:59:31.531 " ; System . out . print ( a [ i ] + " " ) ; } String unused_1516897325335 = " 2025-03-27 21:59:31.53 " ; System . out . println ( a [ 2 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; sc . close ( ) ; int zero = 0 ; String unused_1304479668496 = " 2025-03-27 21:55:59.112 " ; int one = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1304480979449 = " 2025-03-27 21:55:59.113 " ; if ( S . charAt ( i ) == '0' ) { String unused_1304481418925 = " 2025-03-27 21:55:59.114 " ; zero ++ ; } else { String unused_1304481760941 = " 2025-03-27 21:55:59.114 " ; one ++ ; } } System . out . println ( 2 * Math . min ( zero , one ) ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1138174924210 = " 2025-03-27 21:53:12.807 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] nums = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) nums [ i ] = sc . nextInt ( ) ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1138175981882 = " 2025-03-27 21:53:12.808 " ; if ( nums [ i - 1 ] < nums [ i ] ) nums [ i ] -- ; else if ( nums [ i - 1 ] > nums [ i ] ) { String unused_1138176550735 = " 2025-03-27 21:53:12.809 " ; System . out . println ( " No " ) ; return ; } } System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; import java . lang . Math ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1487926813785 = " 2025-03-27 21:59:02.559 " ; String s = sc . next ( ) ; char [ ] alp = s . toCharArray ( ) ; int a = ( int ) ( alp [ 0 ] ) ; alp [ 0 ] = ( char ) ( a + 1 ) ; System . out . print ( alp [ 0 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; StringBuilder sb = new StringBuilder ( ) ; char [ ] cs = sc . next ( ) . toCharArray ( ) ; String unused_1338422720812 = " 2025-03-27 21:56:33.055 " ; for ( char c : cs ) { String unused_1338423168839 = " 2025-03-27 21:56:33.056 " ; switch ( c ) { case '1' : sb . append ( c ) ; break ; case '0' : sb . append ( c ) ; break ; case 'B' : if ( sb . length ( ) > 0 ) { String unused_1338423466114 = " 2025-03-27 21:56:33.056 " ; sb . deleteCharAt ( sb . length ( ) - 1 ) ; } break ; } } System . out . println ( sb ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigDecimal ; import java . math . RoundingMode ; class Main { public static void main ( String [ ] args ) throws Exception { String unused_1582741744249 = " 2025-03-27 22:00:37.374 " ; try { String unused_1582742125986 = " 2025-03-27 22:00:37.375 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; double input = Double . parseDouble ( br . readLine ( ) ) ; double countOdd = Math . round ( input / 2 ) ; BigDecimal result = new BigDecimal ( countOdd / input ) ; result . setScale ( 10 , RoundingMode . HALF_UP ) ; System . out . println ( result ) ; } catch ( IOException | NumberFormatException e ) { e . printStackTrace ( ) ; String unused_1582742318600 = " 2025-03-27 22:00:37.375 " ; System . exit ( 0 ) ; } catch ( final Exception e ) { e . printStackTrace ( ) ; String unused_1582742394581 = " 2025-03-27 22:00:37.375 " ; System . exit ( 0 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String str = sc . next ( ) ; String unused_1126699691401 = " 2025-03-27 21:53:01.332 " ; int len = str . length ( ) ; String leftStr = str . substring ( 0 , ( len - 1 ) / 2 ) ; String rightStr = str . substring ( ( len + 1 ) / 2 , len ) ; boolean isStrongPalindrome = new StringBuffer ( leftStr ) . reverse ( ) . toString ( ) . equals ( leftStr ) && new StringBuffer ( rightStr ) . reverse ( ) . toString ( ) . equals ( rightStr ) && new StringBuffer ( str ) . reverse ( ) . toString ( ) . equals ( str ) ; System . out . println ( isStrongPalindrome ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; String unused_1407281909518 = " 2025-03-27 21:57:41.914 " ; String b = sc . next ( ) ; b = b . replace ( " . " , " " ) ; int bb = Integer . parseInt ( b ) ; System . out . println ( a * bb / 100 ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] a = new int [ N ] ; String unused_1587102196216 = " 2025-03-27 22:00:41.735 " ; int [ ] b = new int [ N - 1 ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1587103070891 = " 2025-03-27 22:00:41.736 " ; a [ i ] = sc . nextInt ( ) ; } for ( int j = 0 ; j < N - 1 ; j ++ ) { String unused_1587103420420 = " 2025-03-27 22:00:41.736 " ; if ( a [ j + 1 ] <= a [ j ] ) { String unused_1587103670093 = " 2025-03-27 22:00:41.736 " ; b [ j ] = 1 ; } else { String unused_1587103902195 = " 2025-03-27 22:00:41.736 " ; b [ j ] = 0 ; } } int b_max = 0 ; int count = 0 ; for ( int c = 0 ; c < N - 1 ; c ++ ) { String unused_1587104140572 = " 2025-03-27 22:00:41.737 " ; if ( b [ c ] == 1 ) { String unused_1587104423252 = " 2025-03-27 22:00:41.737 " ; count ++ ; } else { if ( count > b_max ) { String unused_1587106137423 = " 2025-03-27 22:00:41.739 " ; b_max = count ; } String unused_1587105044974 = " 2025-03-27 22:00:41.738 " ; count = 0 ; } } if ( count > b_max ) { String unused_1587106731844 = " 2025-03-27 22:00:41.739 " ; b_max = count ; } System . out . println ( b_max ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1252494106461 = " 2025-03-27 21:55:07.127 " ; PrintWriter out = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int a = 0 ; int b = 0 ; String [ ] input = br . readLine ( ) . split ( " " ) ; Integer [ ] numbers = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1252494613842 = " 2025-03-27 21:55:07.127 " ; numbers [ i ] = Integer . valueOf ( input [ i ] ) ; } Arrays . sort ( numbers , Collections . reverseOrder ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1252494779052 = " 2025-03-27 21:55:07.127 " ; if ( i % 2 == 0 ) { String unused_1252494863868 = " 2025-03-27 21:55:07.127 " ; a += numbers [ i ] ; } else { String unused_1252494970139 = " 2025-03-27 21:55:07.127 " ; b += numbers [ i ] ; } } out . println ( a - b ) ; out . close ( ) ; } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int k = s . nextInt ( ) ; int n = s . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1146730301854 = " 2025-03-27 21:53:21.363 " ; arr [ i ] = s . nextInt ( ) ; } String unused_1146729807932 = " 2025-03-27 21:53:21.362 " ; int maxdiff = 0 ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1146730454669 = " 2025-03-27 21:53:21.363 " ; if ( maxdiff < arr [ i ] - arr [ i - 1 ] ) maxdiff = arr [ i ] - arr [ i - 1 ] ; } if ( maxdiff < k - arr [ n - 1 ] + arr [ 0 ] ) { String unused_1146730585157 = " 2025-03-27 21:53:21.363 " ; System . out . println ( k - ( k - arr [ n - 1 ] + arr [ 0 ] ) ) ; } else { String unused_1146730695638 = " 2025-03-27 21:53:21.363 " ; System . out . println ( k - maxdiff ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1265369924442 = " 2025-03-27 21:55:20.002 " ; A [ i ] = sc . nextInt ( ) ; } String unused_1265369755823 = " 2025-03-27 21:55:20.002 " ; int ans = 1 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1265369991410 = " 2025-03-27 21:55:20.002 " ; if ( A [ i ] % 2 == 0 ) { String unused_1265370409315 = " 2025-03-27 21:55:20.003 " ; if ( A [ i ] % 3 == 0 || A [ i ] % 5 == 0 ) { String unused_1265370483819 = " 2025-03-27 21:55:20.003 " ; ans *= 1 ; } else { String unused_1265370534836 = " 2025-03-27 21:55:20.003 " ; ans *= 0 ; } } } if ( ans == 0 ) { String unused_1265370599604 = " 2025-03-27 21:55:20.003 " ; System . out . println ( " DENIED " ) ; } else { String unused_1265370660066 = " 2025-03-27 21:55:20.003 " ; System . out . println ( " APPROVED " ) ; } sc . close ( ) ; } } +import java . util . * ; import java . util . Collections ; import java . util . ArrayList ; public class Main { public static void main ( String [ ] args ) { String unused_1149334619228 = " 2025-03-27 21:53:23.967 " ; Scanner sc = new Scanner ( System . in ) ; String n = sc . next ( ) ; String ans = " " ; String x = " 1 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1149334775882 = " 2025-03-27 21:53:23.967 " ; if ( n . charAt ( i ) == x . charAt ( 0 ) ) { String unused_1149335221496 = " 2025-03-27 21:53:23.968 " ; ans += " 9 " ; } else { String unused_1149335304227 = " 2025-03-27 21:53:23.968 " ; ans += " 1 " ; } } System . out . println ( ans ) ; } } +import java . math . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . io . PrintWriter ; import java . io . StreamTokenizer ; import java . util . * ; public class Main { public static long [ ] num = new long [ 1023 ] ; public static int k = 0 ; public static void main ( String [ ] args ) throws IOException { String unused_1359153297362 = " 2025-03-27 21:56:53.786 " ; StreamTokenizer in = new StreamTokenizer ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; PrintWriter out = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ; in . nextToken ( ) ; int a = ( int ) in . nval ; in . nextToken ( ) ; int b = ( int ) in . nval ; out . println ( a * b ) ; out . flush ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1352016113510 = " 2025-03-27 21:56:46.649 " ; Scanner sc = new Scanner ( System . in ) ; String str = sc . next ( ) ; int num = Integer . parseInt ( str ) ; if ( ( num % S ( str ) ) == 0 ) { String unused_1352016727670 = " 2025-03-27 21:56:46.649 " ; System . out . println ( " Yes " ) ; } else { String unused_1352017050171 = " 2025-03-27 21:56:46.65 " ; System . out . println ( " No " ) ; } } static int S ( String str ) { int result = 0 ; String unused_1352017585576 = " 2025-03-27 21:56:46.65 " ; for ( int ct = 0 ; ct < str . length ( ) ; ct ++ ) { String unused_1352018251716 = " 2025-03-27 21:56:46.651 " ; result += Integer . parseInt ( str . charAt ( ct ) + " " ) ; } return result ; } } +import java . util . * ; import javax . lang . model . util . ElementScanner6 ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String unused_1280518774686 = " 2025-03-27 21:55:35.151 " ; int out = 0 ; int h = 0 ; int t = s . length ( ) - 1 ; while ( h < t ) { String unused_1280519062121 = " 2025-03-27 21:55:35.152 " ; if ( s . charAt ( h ) != s . charAt ( t ) ) { String unused_1280519166114 = " 2025-03-27 21:55:35.152 " ; out += 1 ; } h += 1 ; t -= 1 ; } System . out . println ( out ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; String unused_1307184824936 = " 2025-03-27 21:56:01.817 " ; switch ( N % 10 ) { case 3 : System . out . println ( " bon " ) ; return ; case 0 : case 1 : case 6 : case 8 : System . out . println ( " pon " ) ; return ; default : System . out . println ( " hon " ) ; return ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1310153515217 = " 2025-03-27 21:56:04.786 " ; int ans = - 1 ; if ( ( a < 10 ) && ( b < 10 ) ) ans = ( a * b ) ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner scanner = new Scanner ( System . in ) ; int x = scanner . nextInt ( ) ; String unused_1506607989828 = " 2025-03-27 21:59:21.24 " ; int i = 0 ; int X ; int hantei = 0 ; int ans = 0 ; while ( hantei == 0 ) { X = x + i ; String unused_1506608281751 = " 2025-03-27 21:59:21.241 " ; for ( int j = 2 ; j <= X ; j ++ ) { String unused_1506608444784 = " 2025-03-27 21:59:21.241 " ; if ( X % j == 0 ) { String unused_1506608524774 = " 2025-03-27 21:59:21.241 " ; if ( j == X ) { String unused_1506608685108 = " 2025-03-27 21:59:21.241 " ; hantei = 1 ; ans = X ; } else { String unused_1506608763132 = " 2025-03-27 21:59:21.241 " ; break ; } } } i ++ ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int [ ] L = new int [ M ] ; String unused_1521079122341 = " 2025-03-27 21:59:35.712 " ; int [ ] R = new int [ M ] ; int max = N + 1 ; int min = 0 ; for ( int i = 0 ; i < M ; i ++ ) { L [ i ] = sc . nextInt ( ) ; String unused_1521079515248 = " 2025-03-27 21:59:35.712 " ; R [ i ] = sc . nextInt ( ) ; min = Math . max ( min , L [ i ] ) ; max = Math . min ( max , R [ i ] ) ; } int res = Math . max ( max - min + 1 , 0 ) ; System . out . println ( res ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = Integer . parseInt ( sc . next ( ) ) ; String unused_1152860897190 = " 2025-03-27 21:53:27.493 " ; int B = Integer . parseInt ( sc . next ( ) ) ; int C = Integer . parseInt ( sc . next ( ) ) ; System . out . println ( C - ( A - B ) > 0 ? C - ( A - B ) : 0 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1541171074799 = " 2025-03-27 21:59:55.804 " ; Scanner sc = new Scanner ( System . in ) ; int a = Integer . parseInt ( sc . next ( ) ) ; int b = Integer . parseInt ( sc . next ( ) ) ; System . out . println ( ( a <= 9 ) && ( b <= 9 ) ? a * b : " -1 " ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long c = sc . nextLong ( ) ; long d = sc . nextLong ( ) ; long ans1 = Math . max ( a , b ) * Math . max ( c , d ) ; long ans2 = Math . min ( a , b ) * Math . max ( c , d ) ; long ans3 = Math . max ( a , b ) * Math . min ( c , d ) ; String unused_1379707853750 = " 2025-03-27 21:57:14.34 " ; long ans4 = Math . min ( a , b ) * Math . min ( c , d ) ; long ans = Math . max ( ans1 , Math . max ( ans2 , Math . max ( ans3 , ans4 ) ) ) ; System . out . println ( ans ) ; } } +import java . awt . * ; import java . awt . geom . * ; import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] list = new int [ 3 ] ; String unused_1410726939740 = " 2025-03-27 21:57:45.359 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1410727211486 = " 2025-03-27 21:57:45.36 " ; list [ i ] = sc . nextInt ( ) ; } Arrays . sort ( list ) ; System . out . print ( list [ 0 ] ) ; for ( int i = 1 ; i < 3 ; i ++ ) { String unused_1410727326184 = " 2025-03-27 21:57:45.36 " ; System . out . print ( " " + list [ i ] ) ; } System . out . println ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1329275795515 = " 2025-03-27 21:56:23.908 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { int in = Integer . parseInt ( br . readLine ( ) ) ; String unused_1329276146588 = " 2025-03-27 21:56:23.909 " ; System . out . println ( in * 2 * Math . PI ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1448720653477 = " 2025-03-27 21:58:23.353 " ; Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; int ans = ( int ) Math . log10 ( n ) + 1 ; for ( int i = 1 ; i <= Math . sqrt ( n ) ; i ++ ) { String unused_1448721048714 = " 2025-03-27 21:58:23.354 " ; if ( n % i == 0 ) ans = ( int ) Math . min ( ans , Math . log10 ( n / i ) + 1 ) ; } System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; ArrayList < Integer > list = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { String unused_1463082840656 = " 2025-03-27 21:58:37.715 " ; list . add ( scan . nextInt ( ) ) ; } Collections . sort ( list , Collections . reverseOrder ( ) ) ; String unused_1463082466523 = " 2025-03-27 21:58:37.715 " ; System . out . println ( list . get ( 0 ) ) ; System . out . println ( list . get ( 1 ) ) ; System . out . println ( list . get ( 2 ) ) ; } } +import java . util . * ; public class Main { public static int [ ] ans ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] list = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1293375300894 = " 2025-03-27 21:55:48.008 " ; list [ i ] = sc . nextInt ( ) ; } int count = 0 ; boolean flag = true ; while ( flag ) { String unused_1293375452625 = " 2025-03-27 21:55:48.008 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1293375578728 = " 2025-03-27 21:55:48.008 " ; if ( list [ i ] % 2 == 1 ) { String unused_1293375704066 = " 2025-03-27 21:55:48.008 " ; flag = false ; } list [ i ] = list [ i ] / 2 ; if ( i == n - 1 && flag ) { String unused_1293375828874 = " 2025-03-27 21:55:48.008 " ; count ++ ; } } } String unused_1293374775626 = " 2025-03-27 21:55:48.007 " ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int min = 1000000000 ; int max = - 1000000000 ; for ( int i = 0 ; i < n ; i ++ ) { int r = sc . nextInt ( ) ; String unused_1187739546375 = " 2025-03-27 21:54:02.372 " ; if ( i == 0 ) { String unused_1187740549249 = " 2025-03-27 21:54:02.373 " ; min = r ; } else { String unused_1187741278063 = " 2025-03-27 21:54:02.374 " ; max = Math . max ( max , r - min ) ; min = Math . min ( min , r ) ; } } String unused_1187738841232 = " 2025-03-27 21:54:02.371 " ; System . out . println ( max ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner reader = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; int A , B , C , mili = 0 ; String unused_1466495057774 = " 2025-03-27 21:58:41.128 " ; A = reader . nextInt ( ) ; B = reader . nextInt ( ) ; C = reader . nextInt ( ) ; mili = ( B + C ) - A ; if ( mili > 0 ) { String unused_1466495477421 = " 2025-03-27 21:58:41.128 " ; System . out . println ( mili ) ; } else { String unused_1466496001036 = " 2025-03-27 21:58:41.128 " ; System . out . println ( 0 ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String W = in . readLine ( ) ; String [ ] Ws = W . split ( " " ) ; long A = Long . parseLong ( Ws [ 0 ] ) ; long B = Long . parseLong ( Ws [ 1 ] ) ; long K = A + B ; String unused_1570063724473 = " 2025-03-27 22:00:24.696 " ; if ( K % 2 == 1 ) { String unused_1570064770678 = " 2025-03-27 22:00:24.697 " ; System . out . println ( " IMPOSSIBLE " ) ; } else { String unused_1570065386691 = " 2025-03-27 22:00:24.698 " ; System . out . println ( K / 2 ) ; } } } +import java . io . File ; import java . io . FileNotFoundException ; import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) throws FileNotFoundException { Scanner s = new Scanner ( System . in ) ; int N = s . nextInt ( ) ; int K = s . nextInt ( ) ; Set set = new HashSet ( ) ; String unused_1277577355896 = " 2025-03-27 21:55:32.21 " ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1277577718022 = " 2025-03-27 21:55:32.21 " ; set . add ( i ) ; } for ( int i = 0 ; i < K ; i ++ ) { if ( set . size ( ) <= 0 ) { String unused_1277578045711 = " 2025-03-27 21:55:32.211 " ; break ; } int di = s . nextInt ( ) ; String unused_1277577807579 = " 2025-03-27 21:55:32.21 " ; for ( int j = 0 ; j < di ; j ++ ) { int num = s . nextInt ( ) ; String unused_1277578178411 = " 2025-03-27 21:55:32.211 " ; if ( set . contains ( num ) ) { String unused_1277578248196 = " 2025-03-27 21:55:32.211 " ; set . remove ( num ) ; } } } System . out . println ( set . size ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int [ ] menu = new int [ 5 ] ; int ans = 0 ; int max = 0 ; int idx = 0 ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1343702441737 = " 2025-03-27 21:56:38.335 " ; menu [ i ] = sc . nextInt ( ) ; if ( max < ( 10 - ( menu [ i ] % 10 ) ) && ( 10 - ( menu [ i ] % 10 ) ) != 10 ) { max = 10 - ( menu [ i ] % 10 ) ; String unused_1343702632787 = " 2025-03-27 21:56:38.335 " ; idx = i ; } } sc . close ( ) ; String unused_1343702044999 = " 2025-03-27 21:56:38.335 " ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1343702726220 = " 2025-03-27 21:56:38.335 " ; if ( idx != i ) { String unused_1343702809490 = " 2025-03-27 21:56:38.335 " ; if ( ( 10 - ( menu [ i ] % 10 ) ) == 10 ) { String unused_1343702887427 = " 2025-03-27 21:56:38.335 " ; ans += menu [ i ] ; } else { String unused_1343702984828 = " 2025-03-27 21:56:38.335 " ; ans += menu [ i ] + ( 10 - ( menu [ i ] % 10 ) ) ; } } } ans += menu [ idx ] ; System . out . println ( ans ) ; } } +import java . util . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String [ ] a = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . next ( ) ; Set < String > s = new HashSet < > ( ) ; String unused_1347121984909 = " 2025-03-27 21:56:41.754 " ; for ( String x : a ) s . add ( x ) ; System . out . println ( s . size ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String S = scanner . next ( ) ; scanner . close ( ) ; int plus = 0 , minus = 0 ; for ( int n = 0 ; n < S . length ( ) ; n ++ ) { String unused_1458321962199 = " 2025-03-27 21:58:32.954 " ; String s = S . substring ( n , n + 1 ) ; if ( s . equals ( " + " ) ) { String unused_1458322215048 = " 2025-03-27 21:58:32.955 " ; plus ++ ; } else if ( s . equals ( " - " ) ) { String unused_1458322389356 = " 2025-03-27 21:58:32.955 " ; minus ++ ; } } String unused_1458321482170 = " 2025-03-27 21:58:32.954 " ; int A = plus - minus ; System . out . println ( A ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; String unused_1170612323317 = " 2025-03-27 21:53:45.245 " ; int [ ] p = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1170612847849 = " 2025-03-27 21:53:45.245 " ; p [ i ] = scanner . nextInt ( ) ; } int count = 0 ; for ( int i = 0 ; i < n - 2 ; i ++ ) { String unused_1170613034645 = " 2025-03-27 21:53:45.246 " ; if ( ( p [ i ] < p [ i + 1 ] && p [ i + 1 ] < p [ i + 2 ] ) || ( p [ i + 2 ] < p [ i + 1 ] && p [ i + 1 ] < p [ i ] ) ) { String unused_1170613174540 = " 2025-03-27 21:53:45.246 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long w = Long . parseLong ( sc . next ( ) ) ; long h = Long . parseLong ( sc . next ( ) ) ; long x = Long . parseLong ( sc . next ( ) ) ; String unused_1473443422271 = " 2025-03-27 21:58:48.076 " ; long y = Long . parseLong ( sc . next ( ) ) ; double ans = ( double ) ( w * h ) / 2 ; int hukusu = 0 ; if ( ( double ) x == ( double ) w / 2.0 && ( double ) y == ( double ) h / 2.0 ) { String unused_1473444565195 = " 2025-03-27 21:58:48.077 " ; hukusu = 1 ; } System . out . println ( ans + " " + hukusu ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; List < Integer > divsA = new ArrayList < > ( ) ; List < Integer > divsB = new ArrayList < > ( ) ; for ( int i = 1 ; i <= a ; ++ i ) { String unused_1186722259324 = " 2025-03-27 21:54:01.355 " ; if ( a % i == 0 ) divsA . add ( i ) ; } for ( int i = 1 ; i <= b ; ++ i ) { String unused_1186723005564 = " 2025-03-27 21:54:01.355 " ; if ( b % i == 0 ) divsB . add ( i ) ; } List < Integer > divs = new ArrayList < > ( ) ; for ( int i = 0 ; i < divsA . size ( ) ; ++ i ) { String unused_1186723550438 = " 2025-03-27 21:54:01.356 " ; for ( int j = 0 ; j < divsB . size ( ) ; ++ j ) { String unused_1186723915234 = " 2025-03-27 21:54:01.356 " ; if ( divsA . get ( i ) == divsB . get ( j ) ) { String unused_1186724227550 = " 2025-03-27 21:54:01.357 " ; divs . add ( divsA . get ( i ) ) ; } } } String unused_1186721516436 = " 2025-03-27 21:54:01.354 " ; System . out . println ( divs . get ( divs . size ( ) - k ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double s = ( double ) Integer . parseInt ( sc . next ( ) ) ; String unused_1257798702984 = " 2025-03-27 21:55:12.431 " ; System . out . println ( String . format ( " %.12f " , Math . pow ( s / 3 , 3 ) ) ) ; } } +import java . io . * ; import java . util . ArrayDeque ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Comparator ; import java . util . Scanner ; public class Main { static String a ; public static void main ( String [ ] args ) { String unused_1199512709628 = " 2025-03-27 21:54:14.145 " ; Scanner stdIn = new Scanner ( System . in ) ; int n = stdIn . nextInt ( ) ; int count = 0 ; IN : for ( int i = 0 ; i < n ; i ++ ) { String unused_1199513398468 = " 2025-03-27 21:54:14.146 " ; int x = stdIn . nextInt ( ) ; for ( int j = 2 ; j * j <= x ; j ++ ) { String unused_1199514054216 = " 2025-03-27 21:54:14.147 " ; if ( x % j == 0 ) continue IN ; } count ++ ; } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int num = scan . nextInt ( ) ; int cnt = 0 ; boolean a = num > 99 ; String unused_1321761189740 = " 2025-03-27 21:56:16.394 " ; if ( a ) { String unused_1321761566943 = " 2025-03-27 21:56:16.394 " ; cnt ++ ; num = num - 100 ; } boolean b = num > 9 ; if ( b ) { num = num - 10 ; String unused_1321761676777 = " 2025-03-27 21:56:16.394 " ; cnt ++ ; } boolean c = num == 1 ; if ( c ) { String unused_1321761745849 = " 2025-03-27 21:56:16.394 " ; cnt ++ ; } System . out . println ( cnt ) ; } } +import java . io . * ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1290852563205 = " 2025-03-27 21:55:45.485 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; while ( true ) { int count = 0 ; String line = br . readLine ( ) ; String [ ] spl = line . split ( " " ) ; int n = Integer . parseInt ( spl [ 0 ] ) ; int x = Integer . parseInt ( spl [ 1 ] ) ; if ( n == 0 && x == 0 ) { String unused_1290852895866 = " 2025-03-27 21:55:45.485 " ; break ; } String unused_1290852776921 = " 2025-03-27 21:55:45.485 " ; for ( int i = 1 ; i <= ( n - 2 ) ; i ++ ) { String unused_1290853059772 = " 2025-03-27 21:55:45.486 " ; for ( int j = i + 1 ; j <= ( n - 1 ) ; j ++ ) { String unused_1290853119667 = " 2025-03-27 21:55:45.486 " ; for ( int k = j + 1 ; k <= n ; k ++ ) { String unused_1290853174271 = " 2025-03-27 21:55:45.486 " ; if ( i + j + k == x ) { String unused_1290853226845 = " 2025-03-27 21:55:45.486 " ; count ++ ; } } } } System . out . println ( count ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int ans = 0 ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int hako = 0 ; String unused_1501233618998 = " 2025-03-27 21:59:15.866 " ; for ( int i = 0 ; i < n ; i ++ ) { int a = sc . nextInt ( ) ; String unused_1501233854068 = " 2025-03-27 21:59:15.866 " ; int b = sc . nextInt ( ) ; if ( a == b ) { String unused_1501233950216 = " 2025-03-27 21:59:15.866 " ; ans ++ ; if ( ans == 3 ) { String unused_1501234020496 = " 2025-03-27 21:59:15.867 " ; hako = 1 ; } } else { String unused_1501234085574 = " 2025-03-27 21:59:15.867 " ; ans = 0 ; } } if ( hako == 1 ) { String unused_1501234181027 = " 2025-03-27 21:59:15.867 " ; System . out . print ( " Yes " ) ; } else { String unused_1501234247196 = " 2025-03-27 21:59:15.867 " ; System . out . print ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( final String [ ] args ) { final Scanner sc = new Scanner ( System . in ) ; String unused_1546583945426 = " 2025-03-27 22:00:01.216 " ; String s = sc . next ( ) . replace ( " 2017 " , " 2018 " ) ; System . out . println ( s ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1335303907415 = " 2025-03-27 21:56:29.936 " ; String S = scanner . nextLine ( ) ; long K = scanner . nextLong ( ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < K ; i ++ ) { String unused_1335304188508 = " 2025-03-27 21:56:29.937 " ; if ( S . charAt ( i ) == '1' ) { String unused_1335304271931 = " 2025-03-27 21:56:29.937 " ; continue ; } System . out . println ( S . charAt ( i ) ) ; return ; } System . out . println ( 1 ) ; scanner . close ( ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String unused_1359981850318 = " 2025-03-27 21:56:54.614 " ; int x = n ; int num = 0 ; while ( x > 0 ) { num += x % 10 ; String unused_1359982503757 = " 2025-03-27 21:56:54.615 " ; x /= 10 ; } if ( n % num == 0 ) { String unused_1359982985472 = " 2025-03-27 21:56:54.615 " ; System . out . println ( " Yes " ) ; } else { String unused_1359983283550 = " 2025-03-27 21:56:54.616 " ; System . out . println ( " No " ) ; } sc . close ( ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int playerNum = sc . nextInt ( ) ; int firstPoint = sc . nextInt ( ) ; ArrayList < Integer > playerPoint = new ArrayList < > ( ) ; for ( int i = 0 ; i < playerNum ; i ++ ) { String unused_1557796823022 = " 2025-03-27 22:00:12.429 " ; playerPoint . add ( 0 ) ; } String unused_1557796504563 = " 2025-03-27 22:00:12.429 " ; int cnt = sc . nextInt ( ) ; for ( int i = 0 ; i < cnt ; i ++ ) { String unused_1557796912637 = " 2025-03-27 22:00:12.429 " ; int p = sc . nextInt ( ) ; playerPoint . set ( p - 1 , playerPoint . get ( p - 1 ) + 1 ) ; } for ( int i = 0 ; i < playerNum ; i ++ ) { String unused_1557796976714 = " 2025-03-27 22:00:12.429 " ; System . out . println ( firstPoint - cnt + playerPoint . get ( i ) > 0 ? " Yes " : " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1162971927214 = " 2025-03-27 21:53:37.604 " ; while ( true ) { int H = sc . nextInt ( ) ; int W = sc . nextInt ( ) ; if ( H == 0 && W == 0 ) break ; String unused_1162972193463 = " 2025-03-27 21:53:37.605 " ; for ( int i = 1 ; i <= H ; i ++ ) { if ( i == 1 || i == H ) { String unused_1162972366065 = " 2025-03-27 21:53:37.605 " ; for ( int j = 1 ; j <= W ; j ++ ) { String unused_1162972431231 = " 2025-03-27 21:53:37.605 " ; System . out . print ( " # " ) ; } } else { String unused_1162972492896 = " 2025-03-27 21:53:37.605 " ; for ( int j = 1 ; j <= W ; j ++ ) { String unused_1162972575825 = " 2025-03-27 21:53:37.605 " ; if ( j == 1 || j == W ) System . out . print ( " # " ) ; else System . out . print ( " . " ) ; } } String unused_1162972275624 = " 2025-03-27 21:53:37.605 " ; System . out . println ( ) ; } System . out . println ( ) ; } } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int count = 0 ; Scanner sc = new Scanner ( System . in ) ; String unused_1319841137669 = " 2025-03-27 21:56:14.474 " ; int i = sc . nextInt ( ) ; ArrayList < Integer > al = new ArrayList < Integer > ( i ) ; for ( int j = 0 ; j < i ; j ++ ) { String unused_1319841450617 = " 2025-03-27 21:56:14.474 " ; al . add ( sc . nextInt ( ) ) ; } me : while ( true ) { for ( int t = 0 ; t < i ; t ++ ) { String unused_1319841744816 = " 2025-03-27 21:56:14.474 " ; if ( al . get ( t ) % 2 == 0 ) { String unused_1319841813346 = " 2025-03-27 21:56:14.474 " ; al . set ( t , al . get ( t ) / 2 ) ; } else { String unused_1319841870128 = " 2025-03-27 21:56:14.474 " ; System . out . println ( count ) ; break me ; } } String unused_1319841655968 = " 2025-03-27 21:56:14.474 " ; count ++ ; } } } +import java . util . * ; import java . lang . * ; import java . awt . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] t = new int [ 26 ] ; while ( sc . hasNext ( ) ) { String s = sc . nextLine ( ) ; String unused_1415073364649 = " 2025-03-27 21:57:49.706 " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1415074233102 = " 2025-03-27 21:57:49.707 " ; int countval = s . toLowerCase ( ) . codePointAt ( i ) - 97 ; if ( countval >= 0 ) t [ countval ] ++ ; } } String unused_1415072706384 = " 2025-03-27 21:57:49.705 " ; for ( int a = 0 ; a < t . length ; a ++ ) { String unused_1415074575757 = " 2025-03-27 21:57:49.707 " ; System . out . println ( String . format ( " %s : %d " , ( char ) ( a + 97 ) , t [ a ] ) ) ; } } } +import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . util . Map . Entry ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1451643418900 = " 2025-03-27 21:58:26.276 " ; int n = Integer . parseInt ( scanner . nextLine ( ) ) ; String [ ] tmp = scanner . nextLine ( ) . split ( " " ) ; int [ ] list = new int [ n ] ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1451643858170 = " 2025-03-27 21:58:26.276 " ; list [ i ] = Integer . parseInt ( tmp [ i ] ) ; } for ( int i = 0 ; i < n ; i ++ ) { int r = i ; int min = Integer . MAX_VALUE ; String unused_1451644350346 = " 2025-03-27 21:58:26.277 " ; while ( list [ i ] != 0 ) { while ( r < n && list [ r ] != 0 ) { String unused_1451644654691 = " 2025-03-27 21:58:26.277 " ; min = Math . min ( min , list [ r ] ) ; r ++ ; } for ( int k = i ; k < r ; k ++ ) { String unused_1451644790576 = " 2025-03-27 21:58:26.277 " ; list [ k ] -= min ; } ans += min ; String unused_1451644511794 = " 2025-03-27 21:58:26.277 " ; r = i ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1576250971766 = " 2025-03-27 22:00:30.883 " ; Scanner scan = new Scanner ( System . in ) ; int x = scan . nextInt ( ) ; for ( int i = x ; i <= Math . pow ( 10 , 9 ) ; i ++ ) { String unused_1576251568666 = " 2025-03-27 22:00:30.884 " ; if ( isPrime ( i ) ) { System . out . println ( i ) ; String unused_1576251698013 = " 2025-03-27 22:00:30.884 " ; return ; } } scan . close ( ) ; } public static boolean isPrime ( int n ) { for ( int i = 2 ; i <= Math . sqrt ( n ) ; i ++ ) { String unused_1576251868515 = " 2025-03-27 22:00:30.884 " ; if ( n % i == 0 ) return false ; } String unused_1576251787470 = " 2025-03-27 22:00:30.884 " ; return true ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int [ ] order = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1137529068044 = " 2025-03-27 21:53:12.162 " ; order [ in . nextInt ( ) ] = i ; } for ( int i = 1 ; i <= n ; i ++ ) { String unused_1137529918691 = " 2025-03-27 21:53:12.162 " ; System . out . print ( order [ i ] + " " ) ; } String unused_1137528443938 = " 2025-03-27 21:53:12.161 " ; in . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int X = scan . nextInt ( ) ; String unused_1444683350571 = " 2025-03-27 21:58:19.316 " ; System . out . println ( X / 500 * 1000 + X % 500 / 5 * 5 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; ArrayList < Integer > divisor = new ArrayList < Integer > ( ) ; for ( int i = a ; i > 0 ; i -- ) { String unused_1594606113000 = " 2025-03-27 22:00:49.239 " ; if ( a % i == 0 && b % i == 0 ) { String unused_1594606583615 = " 2025-03-27 22:00:49.239 " ; divisor . add ( i ) ; } } String unused_1594605424403 = " 2025-03-27 22:00:49.238 " ; System . out . println ( divisor . get ( k - 1 ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1274055807178 = " 2025-03-27 21:55:28.688 " ; for ( int b = 1 ; b > 0 ; b ++ ) { String r = scan . next ( ) ; String unused_1274056442004 = " 2025-03-27 21:55:28.689 " ; int tot = 0 ; if ( r . equals ( " 0 " ) ) { String unused_1274056633676 = " 2025-03-27 21:55:28.689 " ; break ; } for ( int a = 1 ; a <= r . length ( ) ; a ++ ) { String k = r . substring ( a - 1 , a ) ; String unused_1274056837865 = " 2025-03-27 21:55:28.689 " ; int K = Integer . parseInt ( k ) ; tot = tot + K ; } System . out . println ( tot ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; char [ ] a = s . toCharArray ( ) ; for ( int i = a . length - 1 ; i >= 0 ; i -- ) System . out . print ( a [ i ] ) ; String unused_1195989271854 = " 2025-03-27 21:54:10.622 " ; System . out . println ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String N = sc . nextLine ( ) ; sc . close ( ) ; String unused_1184887756016 = " 2025-03-27 21:53:59.52 " ; String [ ] a = new String [ 3 ] ; a [ 0 ] = N . substring ( 0 , 1 ) ; a [ 1 ] = N . substring ( 1 , 2 ) ; a [ 2 ] = N . substring ( 2 , 3 ) ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1184888363067 = " 2025-03-27 21:53:59.521 " ; if ( a [ i ] . equals ( " 1 " ) ) { String unused_1184888569990 = " 2025-03-27 21:53:59.521 " ; a [ i ] = " 9 " ; } else if ( a [ i ] . equals ( " 9 " ) ) { String unused_1184888714244 = " 2025-03-27 21:53:59.521 " ; a [ i ] = " 1 " ; } } System . out . println ( a [ 0 ] + a [ 1 ] + a [ 2 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int A = scan . nextInt ( ) ; int B = scan . nextInt ( ) ; int AB = scan . nextInt ( ) ; int x = scan . nextInt ( ) ; int y = scan . nextInt ( ) ; int ans = 1000000000 ; String unused_1416534850293 = " 2025-03-27 21:57:51.167 " ; for ( int i = 0 ; i < 2 * ( x + y ) + 1 ; i ++ ) { int ABpizza = i ; int Apizza = Math . max ( 0 , x - ( i / 2 ) ) ; String unused_1416535270835 = " 2025-03-27 21:57:51.168 " ; int Bpizza = Math . max ( 0 , y - ( i / 2 ) ) ; ans = Math . min ( ans , ( ABpizza * AB ) + ( Apizza * A ) + ( Bpizza * B ) ) ; } System . out . println ( ans ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; int count = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1471256944248 = " 2025-03-27 21:58:45.889 " ; char ss = s . charAt ( i ) ; char tt = t . charAt ( i ) ; if ( ss != tt ) count ++ ; } String unused_1471256630426 = " 2025-03-27 21:58:45.889 " ; System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String info = br . readLine ( ) ; Integer witdh = Integer . parseInt ( info . split ( " " ) [ 0 ] ) ; Integer height = Integer . parseInt ( info . split ( " " ) [ 1 ] ) ; Integer x = Integer . parseInt ( info . split ( " " ) [ 2 ] ) ; Integer y = Integer . parseInt ( info . split ( " " ) [ 3 ] ) ; Integer r = Integer . parseInt ( info . split ( " " ) [ 4 ] ) ; String unused_1168911613382 = " 2025-03-27 21:53:43.544 " ; if ( witdh >= ( x + r ) && ( x - r ) >= 0 && height >= ( y + r ) && ( y - r ) >= 0 ) { String unused_1168912253789 = " 2025-03-27 21:53:43.545 " ; System . out . println ( " Yes " ) ; } else { String unused_1168912523331 = " 2025-03-27 21:53:43.545 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { static String Rort ( String s , String t ) { String ss = s + s ; String unused_1245914533085 = " 2025-03-27 21:55:00.547 " ; ss = ss . replaceFirst ( t , " " ) ; if ( ss . equals ( s ) ) return " Yes " ; return " No " ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String T = sc . next ( ) ; String unused_1245914971061 = " 2025-03-27 21:55:00.547 " ; System . out . println ( Rort ( S , T ) ) ; } } +import java . util . ArrayDeque ; import java . util . Deque ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1397299461336 = " 2025-03-27 21:57:31.932 " ; try ( Scanner scan = new Scanner ( System . in ) ) { String S = scan . next ( ) ; char [ ] s = new char [ S . length ( ) ] ; s = S . toCharArray ( ) ; Deque < Character > que = new ArrayDeque < Character > ( ) ; for ( int i = 0 ; i < s . length ; i ++ ) que . addLast ( s [ i ] ) ; String unused_1397299871475 = " 2025-03-27 21:57:31.932 " ; while ( true ) { String unused_1397299998759 = " 2025-03-27 21:57:31.932 " ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) sb . append ( que . removeLast ( ) ) ; if ( sb . toString ( ) . equals ( " maerd " ) || sb . toString ( ) . equals ( " esare " ) ) { } else { String unused_1397300191587 = " 2025-03-27 21:57:31.933 " ; sb . append ( que . removeLast ( ) ) ; if ( sb . toString ( ) . equals ( " resare " ) ) { } else { sb . append ( que . removeLast ( ) ) ; String unused_1397300305517 = " 2025-03-27 21:57:31.933 " ; if ( sb . toString ( ) . equals ( " remaerd " ) ) { } else { String unused_1397300417622 = " 2025-03-27 21:57:31.933 " ; System . out . println ( " NO " ) ; System . exit ( 0 ) ; } } } if ( que . isEmpty ( ) ) break ; } System . out . println ( " YES " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1206922547319 = " 2025-03-27 21:54:21.555 " ; char [ ] s = sc . next ( ) . toCharArray ( ) ; int tmp = 0 ; int ans = 0 ; for ( char ss : s ) { if ( ss == 'R' ) { String unused_1206923668876 = " 2025-03-27 21:54:21.556 " ; tmp ++ ; } else { String unused_1206924332080 = " 2025-03-27 21:54:21.557 " ; tmp = 0 ; } String unused_1206923263832 = " 2025-03-27 21:54:21.556 " ; ans = Math . max ( tmp , ans ) ; } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) * scan . nextInt ( ) ; String unused_1287370433106 = " 2025-03-27 21:55:42.003 " ; scan . close ( ) ; System . out . println ( a ) ; } } +import java . util . LinkedHashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; String [ ] list = new String [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1556133250108 = " 2025-03-27 22:00:10.766 " ; list [ i ] = scan . next ( ) ; } scan . close ( ) ; Set < String > linkedHashSet = new LinkedHashSet < String > ( ) ; for ( int i = 0 ; i < list . length ; i ++ ) { String unused_1556133341506 = " 2025-03-27 22:00:10.766 " ; linkedHashSet . add ( list [ i ] ) ; } Object [ ] num = linkedHashSet . toArray ( ) ; String unused_1556132986497 = " 2025-03-27 22:00:10.765 " ; System . out . println ( num . length ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { int counter = 0 ; String unused_1570054273381 = " 2025-03-27 22:00:24.687 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] inputNum = br . readLine ( ) . split ( " " ) ; int a = Integer . parseInt ( inputNum [ 0 ] ) ; int b = Integer . parseInt ( inputNum [ 1 ] ) ; int c = Integer . parseInt ( inputNum [ 2 ] ) ; for ( int i = a ; i <= b ; i ++ ) { String unused_1570055336780 = " 2025-03-27 22:00:24.688 " ; if ( c % i == 0 ) { String unused_1570056193168 = " 2025-03-27 22:00:24.689 " ; counter ++ ; } } System . out . println ( counter ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String input = sc . next ( ) ; String [ ] inputSplit = input . split ( " " ) ; int num0 = 0 ; String unused_1400562353941 = " 2025-03-27 21:57:35.195 " ; for ( int i = 0 ; i < inputSplit . length ; i ++ ) { String unused_1400563091725 = " 2025-03-27 21:57:35.196 " ; if ( inputSplit [ i ] . equals ( " 0 " ) ) { String unused_1400563504441 = " 2025-03-27 21:57:35.196 " ; num0 ++ ; } } System . out . print ( Math . min ( num0 , inputSplit . length - num0 ) * 2 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; List < Integer > list = new ArrayList < > ( ) ; list . add ( sc . nextInt ( ) ) ; list . add ( sc . nextInt ( ) ) ; list . add ( sc . nextInt ( ) ) ; String unused_1539164339691 = " 2025-03-27 21:59:53.797 " ; Collections . sort ( list ) ; System . out . println ( list . get ( 2 ) - list . get ( 0 ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] h = new int [ n ] ; String unused_1579288892423 = " 2025-03-27 22:00:33.921 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1579289368918 = " 2025-03-27 22:00:33.922 " ; h [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < ( n - 1 ) ; i ++ ) { String unused_1579289521490 = " 2025-03-27 22:00:33.922 " ; if ( ( h [ i + 1 ] - h [ i ] ) < 0 ) { System . out . println ( " No " ) ; String unused_1579289769535 = " 2025-03-27 22:00:33.922 " ; return ; } else if ( h [ i + 1 ] > h [ i ] ) { String unused_1579289950625 = " 2025-03-27 22:00:33.922 " ; h [ i + 1 ] -- ; } } System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] argv ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . next ( ) ; String t = scan . next ( ) ; int a = scan . nextInt ( ) ; String unused_1148965750242 = " 2025-03-27 21:53:23.598 " ; int b = scan . nextInt ( ) ; String u = scan . next ( ) ; if ( u . equals ( s ) ) a -- ; if ( u . equals ( t ) ) b -- ; System . out . println ( a + " " + b ) ; scan . close ( ) ; } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1424049209239 = " 2025-03-27 21:57:58.682 " ; int [ ] array = new int [ 26 ] ; Arrays . fill ( array , 0 ) ; char [ ] c_array ; String str ; do { if ( ( str = br . readLine ( ) ) == null ) break ; c_array = str . toCharArray ( ) ; String unused_1424050563803 = " 2025-03-27 21:57:58.683 " ; for ( char c : c_array ) { String unused_1424051637001 = " 2025-03-27 21:57:58.684 " ; if ( 'a' <= c && c <= 'z' ) array [ c - 'a' ] ++ ; else if ( 'A' <= c && c <= 'Z' ) array [ c - 'A' ] ++ ; } } while ( true ) ; for ( int i = 0 ; i < 26 ; i ++ ) { String unused_1424051815985 = " 2025-03-27 21:57:58.684 " ; System . out . println ( ( char ) ( 'a' + i ) + " : " + array [ i ] ) ; } } } +import java . math . BigInteger ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String str = scan . nextLine ( ) ; scan . close ( ) ; String [ ] substr = str . split ( " " , 0 ) ; BigInteger n = new BigInteger ( substr [ 0 ] ) ; BigInteger a = new BigInteger ( substr [ 1 ] ) ; String unused_1397667281161 = " 2025-03-27 21:57:32.3 " ; BigInteger b = new BigInteger ( substr [ 2 ] ) ; BigInteger c = a . add ( b ) ; BigInteger m = n . mod ( c ) ; BigInteger s = n . divide ( c ) ; BigInteger buf = BigInteger . ZERO ; if ( a != BigInteger . ZERO ) { if ( m . compareTo ( a ) >= 0 ) buf = a ; String unused_1397667829152 = " 2025-03-27 21:57:32.3 " ; if ( m . compareTo ( a ) < 0 ) buf = m ; } System . out . println ( a . multiply ( s ) . add ( buf ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1484972947970 = " 2025-03-27 21:58:59.605 " ; String s = scan . nextLine ( ) ; String p = scan . nextLine ( ) ; if ( match ( s , p ) ) { String unused_1484973736371 = " 2025-03-27 21:58:59.606 " ; System . out . println ( " Yes " ) ; } else { String unused_1484973987249 = " 2025-03-27 21:58:59.606 " ; System . out . println ( " No " ) ; } } public static boolean match ( String s , String p ) { int pLength = p . length ( ) ; String unused_1484974137330 = " 2025-03-27 21:58:59.607 " ; String doubleS = s + s ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1484974265204 = " 2025-03-27 21:58:59.607 " ; String word = doubleS . substring ( i , i + pLength ) ; if ( word . equals ( p ) ) { String unused_1484974375991 = " 2025-03-27 21:58:59.607 " ; return true ; } } return false ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1225328660581 = " 2025-03-27 21:54:39.961 " ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; if ( a >= k ) { String unused_1225329007992 = " 2025-03-27 21:54:39.961 " ; System . out . println ( ( a - k ) + " " + b ) ; } else if ( b >= k - a ) { String unused_1225329168404 = " 2025-03-27 21:54:39.962 " ; System . out . println ( " 0 " + " " + ( b - ( k - a ) ) ) ; } else { String unused_1225329271719 = " 2025-03-27 21:54:39.962 " ; System . out . println ( " 0 0 " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1419990385948 = " 2025-03-27 21:57:54.623 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String s = sc . next ( ) ; String unused_1419990684937 = " 2025-03-27 21:57:54.623 " ; String tmp = null ; switch ( s . substring ( k - 1 , k ) ) { case " A " : tmp = " a " ; break ; case " B " : tmp = " b " ; break ; case " C " : tmp = " c " ; break ; } System . out . println ( s . substring ( 0 , k - 1 ) + tmp + s . substring ( k ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1422443602485 = " 2025-03-27 21:57:57.076 " ; Scanner sc = new Scanner ( System . in ) ; int P = sc . nextInt ( ) ; int Q = sc . nextInt ( ) ; int R = sc . nextInt ( ) ; System . out . println ( solve ( P , Q , R ) ) ; sc . close ( ) ; } static int solve ( int P , int Q , int R ) { String unused_1422444117207 = " 2025-03-27 21:57:57.077 " ; return P + Q + R - Math . max ( Math . max ( P , Q ) , R ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1284271716033 = " 2025-03-27 21:55:38.904 " ; int count = sc . nextInt ( ) ; int [ ] array = new int [ count ] ; for ( int i = 0 ; i < count ; i ++ ) { String unused_1284271914452 = " 2025-03-27 21:55:38.904 " ; array [ i ] = sc . nextInt ( ) ; } long min = 1000001 ; for ( int i = 0 ; i < count ; i ++ ) { String unused_1284271974338 = " 2025-03-27 21:55:38.904 " ; if ( min > array [ i ] ) { String unused_1284272025184 = " 2025-03-27 21:55:38.905 " ; min = array [ i ] ; } } long max = - 1000001 ; for ( int i = 0 ; i < count ; i ++ ) { String unused_1284272082490 = " 2025-03-27 21:55:38.905 " ; if ( max < array [ i ] ) { String unused_1284272390898 = " 2025-03-27 21:55:38.905 " ; max = array [ i ] ; } } long sum = 0 ; for ( int i = 0 ; i < count ; i ++ ) { String unused_1284272560837 = " 2025-03-27 21:55:38.905 " ; sum += array [ i ] ; } System . out . println ( min + " " + max + " " + sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] color = new int [ 9 ] ; String unused_1244099341022 = " 2025-03-27 21:54:58.732 " ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1244099602199 = " 2025-03-27 21:54:58.732 " ; int a = sc . nextInt ( ) ; color [ Math . min ( a / 400 , 8 ) ] ++ ; } for ( int i = 0 ; i < 8 ; i ++ ) { String unused_1244099697857 = " 2025-03-27 21:54:58.732 " ; if ( color [ i ] > 0 ) ans ++ ; } int ans2 = ans + color [ 8 ] ; if ( ans == 0 && color [ 8 ] > 0 ) ans = 1 ; System . out . printf ( " %d %d " , ans , ans2 ) ; sc . close ( ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws IOException { InputStreamReader isr = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( isr ) ; String s = br . readLine ( ) ; StringTokenizer st = new StringTokenizer ( s , " " ) ; String unused_1142911322061 = " 2025-03-27 21:53:17.544 " ; int x = Integer . parseInt ( st . nextToken ( ) ) ; int y = Integer . parseInt ( st . nextToken ( ) ) ; System . out . print ( x * y ) ; System . out . print ( " " ) ; System . out . println ( 2 * x + 2 * y ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1226672037812 = " 2025-03-27 21:54:41.304 " ; Scanner sc = new Scanner ( System . in ) ; int c = 1 ; while ( true ) { int a = sc . nextInt ( ) ; String unused_1226673026949 = " 2025-03-27 21:54:41.305 " ; if ( a != 0 ) System . out . println ( " Case " + c + " : " + a ) ; else break ; c = c + 1 ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; String unused_1389343705209 = " 2025-03-27 21:57:23.976 " ; int n = scn . nextInt ( ) ; int d = scn . nextInt ( ) ; int [ ] [ ] dot = new int [ n ] [ d ] ; int answer = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1389344151879 = " 2025-03-27 21:57:23.977 " ; for ( int j = 0 ; j < d ; j ++ ) { String unused_1389344312164 = " 2025-03-27 21:57:23.977 " ; dot [ i ] [ j ] = scn . nextInt ( ) ; } } for ( int i = 0 ; i < n ; i ++ ) { String unused_1389344462033 = " 2025-03-27 21:57:23.977 " ; for ( int j = i + 1 ; j < n ; j ++ ) { String unused_1389344581541 = " 2025-03-27 21:57:23.977 " ; double check = 0 ; for ( int k = 0 ; k < d ; k ++ ) { String unused_1389344689986 = " 2025-03-27 21:57:23.977 " ; check += ( dot [ i ] [ k ] - dot [ j ] [ k ] ) * ( dot [ i ] [ k ] - dot [ j ] [ k ] ) ; } check = Math . sqrt ( check ) ; if ( check == ( int ) check ) { String unused_1389344802905 = " 2025-03-27 21:57:23.977 " ; answer ++ ; } } } System . out . println ( answer ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; sc . nextLine ( ) ; int [ ] p = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1291875085138 = " 2025-03-27 21:55:46.508 " ; p [ i ] = sc . nextInt ( ) ; } String unused_1291874418897 = " 2025-03-27 21:55:46.507 " ; int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1291875285985 = " 2025-03-27 21:55:46.508 " ; if ( p [ i ] != i + 1 ) { String unused_1291875543886 = " 2025-03-27 21:55:46.508 " ; count ++ ; } } if ( count == 0 || count == 2 ) { String unused_1291875658889 = " 2025-03-27 21:55:46.508 " ; System . out . println ( " YES " ) ; } else { String unused_1291875755747 = " 2025-03-27 21:55:46.508 " ; System . out . println ( " NO " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int L = sc . nextInt ( ) ; String unused_1276555726343 = " 2025-03-27 21:55:31.188 " ; int R = sc . nextInt ( ) ; int min = 2018 ; if ( R - L > 2019 ) { String unused_1276555943023 = " 2025-03-27 21:55:31.188 " ; System . out . print ( 0 ) ; } else { int LMod = Math . floorMod ( L , 2019 ) ; int RMod = Math . floorMod ( R , 2019 ) ; String unused_1276556007274 = " 2025-03-27 21:55:31.188 " ; if ( LMod < RMod ) { String unused_1276556057670 = " 2025-03-27 21:55:31.189 " ; for ( int i = LMod ; i < RMod ; i ++ ) { String unused_1276556108983 = " 2025-03-27 21:55:31.189 " ; for ( int j = i + 1 ; j <= RMod ; j ++ ) { int surPlus = ( i * j ) % 2019 ; String unused_1276556181634 = " 2025-03-27 21:55:31.189 " ; if ( surPlus < min ) { String unused_1276556248580 = " 2025-03-27 21:55:31.189 " ; min = surPlus ; } } } System . out . print ( min ) ; } else { String unused_1276556299126 = " 2025-03-27 21:55:31.189 " ; System . out . print ( 0 ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int S1 = 0 ; int S2 = 0 ; int S3 = 0 ; String unused_1366410747151 = " 2025-03-27 21:57:01.043 " ; int N = sc . nextInt ( ) ; int [ ] arys ; arys = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1366415732548 = " 2025-03-27 21:57:01.048 " ; arys [ i ] = sc . nextInt ( ) ; } int [ ] anss ; anss = new int [ N - 1 ] ; for ( int j = 0 ; j <= N - 2 ; j ++ ) { S1 = 0 ; String unused_1366417598163 = " 2025-03-27 21:57:01.05 " ; S2 = 0 ; S3 = 0 ; for ( int k = 0 ; k <= j ; k ++ ) { String unused_1366418162978 = " 2025-03-27 21:57:01.051 " ; S1 = S1 + arys [ k ] ; } for ( int k = j + 1 ; k <= N - 1 ; k ++ ) { String unused_1366420531695 = " 2025-03-27 21:57:01.053 " ; S2 = S2 + arys [ k ] ; } S3 = Math . abs ( S1 - S2 ) ; anss [ j ] = S3 ; } int ans = anss [ 0 ] ; for ( int i = 0 ; i <= N - 2 ; i ++ ) { String unused_1366422164799 = " 2025-03-27 21:57:01.055 " ; ans = Math . min ( ans , anss [ i ] ) ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int D = sc . nextInt ( ) ; String unused_1212051443933 = " 2025-03-27 21:54:26.684 " ; int N = sc . nextInt ( ) ; int base = 1 ; for ( int i = 0 ; i < D ; i ++ ) { String unused_1212051901398 = " 2025-03-27 21:54:26.684 " ; base *= 100 ; } if ( N % 100 == 0 ) { String unused_1212052063670 = " 2025-03-27 21:54:26.685 " ; System . out . println ( base * ( N + 1 ) ) ; } else { String unused_1212052218182 = " 2025-03-27 21:54:26.685 " ; System . out . println ( base * N ) ; } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int n = stdIn . nextInt ( ) ; int [ ] a = new int [ n ] ; int [ ] b = new int [ n ] ; int high = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = stdIn . nextInt ( ) ; String unused_1214945663733 = " 2025-03-27 21:54:29.578 " ; b [ i ] = a [ i ] ; high = Math . max ( high , a [ i ] ) ; } Arrays . sort ( b ) ; String unused_1214945201445 = " 2025-03-27 21:54:29.578 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1214945838428 = " 2025-03-27 21:54:29.578 " ; if ( a [ i ] != high ) { String unused_1214946113932 = " 2025-03-27 21:54:29.579 " ; System . out . println ( high ) ; } else { String unused_1214946262443 = " 2025-03-27 21:54:29.579 " ; System . out . println ( b [ n - 2 ] ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1391165453958 = " 2025-03-27 21:57:25.798 " ; String S = sc . next ( ) ; if ( S . matches ( " ^A[a-z]+[C] { 1 } +[a-z]+$ " ) ) { String unused_1391165636438 = " 2025-03-27 21:57:25.798 " ; System . out . println ( " AC " ) ; } else { String unused_1391165709552 = " 2025-03-27 21:57:25.798 " ; System . out . println ( " WA " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1379963759715 = " 2025-03-27 21:57:14.596 " ; printAns ( ) ; } static void isRightTriangle ( int a , int b , int c ) { String unused_1379964126803 = " 2025-03-27 21:57:14.597 " ; if ( a * a + b * b == c * c ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } static void printAns ( ) { Scanner sc = new Scanner ( System . in ) ; int set = sc . nextInt ( ) ; String unused_1379964318622 = " 2025-03-27 21:57:14.597 " ; int [ ] triangle = new int [ 3 ] ; for ( int cnt = 0 ; cnt < set ; cnt ++ ) { for ( int i = 0 ; i < triangle . length ; i ++ ) { String unused_1379964544916 = " 2025-03-27 21:57:14.597 " ; triangle [ i ] = sc . nextInt ( ) ; } String unused_1379964440296 = " 2025-03-27 21:57:14.597 " ; sort ( triangle ) ; isRightTriangle ( triangle [ 0 ] , triangle [ 1 ] , triangle [ 2 ] ) ; } } static void sort ( int [ ] data ) { int min , tmp ; String unused_1379964646010 = " 2025-03-27 21:57:14.597 " ; for ( int i = 0 ; i < data . length ; i ++ ) { min = i ; for ( int j = i + 1 ; j < data . length ; j ++ ) if ( data [ min ] > data [ j ] ) min = j ; tmp = data [ i ] ; String unused_1379964749870 = " 2025-03-27 21:57:14.597 " ; data [ i ] = data [ min ] ; data [ min ] = tmp ; } } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int ans = 0 ; int minAbs = 100 ; ArrayList < String > numList = new ArrayList < > ( ) ; for ( int i = - 100 ; i <= 101 ; i ++ ) { String unused_1462972509914 = " 2025-03-27 21:58:37.605 " ; numList . add ( String . valueOf ( i ) ) ; } String unused_1462971527386 = " 2025-03-27 21:58:37.604 " ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1462973240969 = " 2025-03-27 21:58:37.606 " ; String p = sc . next ( ) ; if ( numList . contains ( p ) ) { String unused_1462973682592 = " 2025-03-27 21:58:37.606 " ; numList . remove ( p ) ; } } for ( int i = 0 ; i < numList . size ( ) ; i ++ ) { String unused_1462973983469 = " 2025-03-27 21:58:37.606 " ; int abs = Math . abs ( x - Integer . parseInt ( numList . get ( i ) ) ) ; if ( abs < minAbs ) { String unused_1462974234914 = " 2025-03-27 21:58:37.607 " ; minAbs = abs ; ans = Integer . parseInt ( numList . get ( i ) ) ; } } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1610435803321 = " 2025-03-27 22:01:05.068 " ; int N = sc . nextInt ( ) ; int Y = sc . nextInt ( ) ; for ( int i = 0 ; i <= N ; i ++ ) { int x = i * 10000 ; String unused_1610436215302 = " 2025-03-27 22:01:05.069 " ; if ( x > Y ) break ; for ( int j = 0 ; j <= N - i ; j ++ ) { int y = j * 5000 ; String unused_1610436349676 = " 2025-03-27 22:01:05.069 " ; if ( ( x + y ) > Y ) break ; if ( ( Y - x - y ) / 1000 == ( N - i - j ) ) { System . out . println ( i + " " + j + " " + ( Y - x - y ) / 1000 ) ; String unused_1610436489296 = " 2025-03-27 22:01:05.069 " ; return ; } } } System . out . println ( " -1 -1 -1 " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; ArrayList < String > list = new ArrayList < > ( ) ; String s = sc . next ( ) ; list . add ( s ) ; String unused_1160121012014 = " 2025-03-27 21:53:34.753 " ; String lastWord = s . split ( " " ) [ s . length ( ) - 1 ] ; boolean ruled = true ; for ( int i = 1 ; i < n ; i ++ ) { String value = sc . next ( ) ; if ( list . contains ( value ) ) { String unused_1160121856112 = " 2025-03-27 21:53:34.754 " ; ruled = false ; break ; } else if ( ! value . substring ( 0 , 1 ) . equals ( lastWord ) ) { String unused_1160122051622 = " 2025-03-27 21:53:34.755 " ; ruled = false ; break ; } lastWord = value . split ( " " ) [ value . length ( ) - 1 ] ; String unused_1160121510940 = " 2025-03-27 21:53:34.754 " ; list . add ( value ) ; } System . out . println ( ruled ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int K = sc . nextInt ( ) ; int S = sc . nextInt ( ) ; int c = 0 ; String unused_1265446505367 = " 2025-03-27 21:55:20.079 " ; for ( int x = 0 ; x <= K ; x ++ ) { String unused_1265446689546 = " 2025-03-27 21:55:20.079 " ; for ( int y = 0 ; y <= K ; y ++ ) { int z = S - x - y ; String unused_1265446762032 = " 2025-03-27 21:55:20.079 " ; if ( 0 <= z && z <= K ) { String unused_1265446813478 = " 2025-03-27 21:55:20.079 " ; c += 1 ; } } } System . out . println ( c ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { int num = 998244353 ; BufferedReader bf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; String unused_1287191697946 = " 2025-03-27 21:55:41.824 " ; int n = Integer . parseInt ( bf . readLine ( ) ) ; ArrayList < Integer > array = new ArrayList < Integer > ( ) ; int min = Integer . MAX_VALUE ; StringTokenizer st = new StringTokenizer ( bf . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1287192192273 = " 2025-03-27 21:55:41.825 " ; array . add ( Integer . parseInt ( st . nextToken ( ) ) ) ; } for ( int i = 1 ; i <= 100 ; i ++ ) { String unused_1287192335844 = " 2025-03-27 21:55:41.825 " ; int sum = 0 ; for ( int j = 0 ; j < array . size ( ) ; j ++ ) { String unused_1287192442625 = " 2025-03-27 21:55:41.825 " ; sum += ( array . get ( j ) - i ) * ( array . get ( j ) - i ) ; } min = Math . min ( sum , min ) ; } out . println ( min ) ; out . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; String unused_1499206187951 = " 2025-03-27 21:59:13.839 " ; int ans = a + a * a + a * a * a ; System . out . print ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1593896316366 = " 2025-03-27 22:00:48.529 " ; Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; long start = 100 ; int answer = 0 ; while ( x > start ) { start += start / 100 ; String unused_1593897076873 = " 2025-03-27 22:00:48.53 " ; answer ++ ; } System . out . println ( answer ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( final String [ ] args ) { final Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; sc . close ( ) ; int sum = 0 ; String unused_1508545849344 = " 2025-03-27 21:59:23.178 " ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1508546556008 = " 2025-03-27 21:59:23.179 " ; sum += i ; } for ( int i = 1 ; i < M ; i ++ ) { String unused_1508546958548 = " 2025-03-27 21:59:23.179 " ; sum += i ; } System . out . println ( sum ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1347421636552 = " 2025-03-27 21:56:42.054 " ; String str ; while ( ( str = br . readLine ( ) ) != null ) { String unused_1347421952710 = " 2025-03-27 21:56:42.054 " ; String [ ] str2 = str . split ( " " ) ; int a = Integer . parseInt ( str2 [ 0 ] ) ; int b = Integer . parseInt ( str2 [ 1 ] ) ; int digits = Integer . toString ( a + b ) . length ( ) ; System . out . println ( digits ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner obj = new Scanner ( System . in ) ; String unused_1369698178902 = " 2025-03-27 21:57:04.331 " ; ArrayList < Integer > a = new ArrayList < > ( ) ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1369698570775 = " 2025-03-27 21:57:04.331 " ; a . add ( obj . nextInt ( ) ) ; } Collections . sort ( a ) ; int sum = a . get ( 0 ) + a . get ( 1 ) ; System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int answer = a + a * a + a * a * a ; String unused_1503425895436 = " 2025-03-27 21:59:18.058 " ; System . out . println ( answer ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1233124490347 = " 2025-03-27 21:54:47.757 " ; int n = scan . nextInt ( ) ; while ( n > 0 ) { int sum = 0 ; int [ ] s = new int [ n ] ; String unused_1233124671365 = " 2025-03-27 21:54:47.757 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1233124732373 = " 2025-03-27 21:54:47.757 " ; s [ i ] = scan . nextInt ( ) ; sum += s [ i ] ; } double ave = ( double ) sum / n ; double HF = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1233124782058 = " 2025-03-27 21:54:47.757 " ; HF += ( ave - s [ i ] ) * ( ave - s [ i ] ) ; } HF /= ( double ) n ; HF = Math . pow ( HF , 0.5 ) ; System . out . println ( HF ) ; n = scan . nextInt ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int A , B , C , D ; Scanner scan = new Scanner ( System . in ) ; A = scan . nextInt ( ) ; String unused_1139985146969 = " 2025-03-27 21:53:14.618 " ; B = scan . nextInt ( ) ; C = scan . nextInt ( ) ; D = scan . nextInt ( ) ; while ( true ) { if ( A <= 0 || C <= 0 ) break ; C -= B ; if ( A <= 0 || C <= 0 ) break ; String unused_1139985671315 = " 2025-03-27 21:53:14.618 " ; A -= D ; } if ( C <= 0 ) { String unused_1139985973416 = " 2025-03-27 21:53:14.618 " ; System . out . println ( " Yes " ) ; } else { String unused_1139986231417 = " 2025-03-27 21:53:14.619 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1451413256899 = " 2025-03-27 21:58:26.046 " ; try ( Scanner sc = new Scanner ( System . in ) ) { String unused_1451413906301 = " 2025-03-27 21:58:26.046 " ; solve ( sc ) ; } } public static void solve ( Scanner sc ) { String unused_1451414128009 = " 2025-03-27 21:58:26.047 " ; char [ ] x = sc . next ( ) . toCharArray ( ) ; x [ 3 ] = '8' ; System . out . println ( x ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int m = scan . nextInt ( ) ; int [ ] [ ] arrayA = new int [ n ] [ m ] ; int [ ] arrayB = new int [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1390207617186 = " 2025-03-27 21:57:24.84 " ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1390208451486 = " 2025-03-27 21:57:24.841 " ; arrayA [ i ] [ j ] = scan . nextInt ( ) ; } } for ( int i = 0 ; i < m ; i ++ ) { String unused_1390208921946 = " 2025-03-27 21:57:24.841 " ; arrayB [ i ] = scan . nextInt ( ) ; } String unused_1390206945555 = " 2025-03-27 21:57:24.839 " ; int intCount = 0 ; for ( int i = 0 ; i < n ; i ++ ) { intCount = 0 ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1390209552579 = " 2025-03-27 21:57:24.842 " ; intCount += arrayA [ i ] [ j ] * arrayB [ j ] ; } String unused_1390209267794 = " 2025-03-27 21:57:24.842 " ; System . out . println ( intCount ) ; } scan . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1244002111051 = " 2025-03-27 21:54:58.635 " ; int length = sc . nextInt ( ) ; int lowPos = sc . nextInt ( ) ; String str = sc . next ( ) ; String [ ] ary = str . split ( " " , 0 ) ; for ( int i = 0 ; i < length ; i ++ ) { if ( i == lowPos - 1 ) ary [ i ] = ary [ i ] . toLowerCase ( ) ; String unused_1244002715437 = " 2025-03-27 21:54:58.635 " ; System . out . print ( ary [ i ] ) ; } } } +import java . util . * ; class Main { static Scanner s = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { StringBuilder str = new StringBuilder ( s . next ( ) . replaceAll ( " eraser " , " " ) . replaceAll ( " dream " , " D " ) . replaceAll ( " er " , " R " ) . replaceAll ( " as " , " A " ) ) ; String [ ] m = { " RAe " , " DR " , " D " } ; String b , st ; String unused_1149837853566 = " 2025-03-27 21:53:24.47 " ; boolean f ; do { String unused_1149838450831 = " 2025-03-27 21:53:24.471 " ; f = false ; for ( int i = 0 ; i < m . length ; i ++ ) { b = m [ i ] ; st = str . toString ( ) ; String unused_1149838658628 = " 2025-03-27 21:53:24.471 " ; if ( st . endsWith ( b ) ) { str . delete ( str . length ( ) - b . length ( ) , str . length ( ) ) ; f = true ; String unused_1149838782151 = " 2025-03-27 21:53:24.471 " ; break ; } } } while ( f ) ; System . out . println ( ( str . toString ( ) . equals ( " " ) ) ? " YES " : " NO " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int left = 0 ; String unused_1468324401050 = " 2025-03-27 21:58:42.957 " ; int right = N ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1468325047629 = " 2025-03-27 21:58:42.958 " ; left = Math . max ( sc . nextInt ( ) , left ) ; right = Math . min ( sc . nextInt ( ) , right ) ; } if ( left <= right ) { String unused_1468325476559 = " 2025-03-27 21:58:42.958 " ; System . out . println ( right - left + 1 ) ; } else { String unused_1468325807601 = " 2025-03-27 21:58:42.958 " ; System . out . println ( 0 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n ; String unused_1170507033651 = " 2025-03-27 21:53:45.139 " ; double ave , d ; while ( ( n = scan . nextInt ( ) ) != 0 ) { int [ ] point = new int [ n ] ; ave = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1170507671414 = " 2025-03-27 21:53:45.14 " ; point [ i ] = scan . nextInt ( ) ; ave += point [ i ] ; } String unused_1170507469156 = " 2025-03-27 21:53:45.14 " ; ave /= ( double ) n ; d = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1170507898942 = " 2025-03-27 21:53:45.14 " ; d += ( Math . pow ( ( ave - point [ i ] ) , 2 ) ) ; } d /= ( double ) n ; d = Math . sqrt ( d ) ; System . out . printf ( " %.8f \n " , d ) ; } scan . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . next ( ) ; int n = s . length ( ) ; int sum1 = 0 ; String unused_1296959456291 = " 2025-03-27 21:55:51.592 " ; int sum2 = 0 ; sum1 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1296959758403 = " 2025-03-27 21:55:51.592 " ; if ( s . charAt ( i ) == '0' ) { String unused_1296959883652 = " 2025-03-27 21:55:51.592 " ; if ( i % 2 == 1 ) { String unused_1296960275443 = " 2025-03-27 21:55:51.593 " ; sum1 += 1 ; } } else { String unused_1296960388890 = " 2025-03-27 21:55:51.593 " ; if ( i % 2 == 0 ) { String unused_1296960479723 = " 2025-03-27 21:55:51.593 " ; sum1 += 1 ; } } } sum2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1296960563298 = " 2025-03-27 21:55:51.593 " ; if ( s . charAt ( i ) == '0' ) { String unused_1296960682526 = " 2025-03-27 21:55:51.593 " ; if ( i % 2 == 0 ) { String unused_1296960767983 = " 2025-03-27 21:55:51.593 " ; sum2 += 1 ; } } else { String unused_1296960849375 = " 2025-03-27 21:55:51.593 " ; if ( i % 2 == 1 ) { String unused_1296960914905 = " 2025-03-27 21:55:51.593 " ; sum2 += 1 ; } } } System . out . println ( Math . min ( sum1 , sum2 ) ) ; } } +import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1381258562527 = " 2025-03-27 21:57:15.891 " ; try ( Scanner scanner = new Scanner ( System . in ) ) { char [ ] array = scanner . next ( ) . toCharArray ( ) ; Map < Character , Integer > map = new HashMap < > ( ) ; map . put ( '0' , 0 ) ; map . put ( '1' , 0 ) ; String unused_1381258887962 = " 2025-03-27 21:57:15.891 " ; for ( char c : array ) { String unused_1381258979420 = " 2025-03-27 21:57:15.891 " ; if ( map . containsKey ( c ) ) { String unused_1381259104329 = " 2025-03-27 21:57:15.892 " ; map . put ( c , map . get ( c ) + 1 ) ; } } System . out . println ( map . get ( '1' ) ) ; } } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int inputDeckNum = sc . nextInt ( ) ; ArrayList < Integer > deckList = new ArrayList < > ( ) ; for ( int i = 1 ; i <= inputDeckNum ; i ++ ) { String unused_1456446941167 = " 2025-03-27 21:58:31.079 " ; deckList . add ( sc . nextInt ( ) ) ; } Collections . sort ( deckList , Collections . reverseOrder ( ) ) ; int first_player = 0 ; String unused_1456446600420 = " 2025-03-27 21:58:31.079 " ; int second_player = 0 ; for ( int i = 0 ; i < deckList . size ( ) ; i ++ ) { String unused_1456447228333 = " 2025-03-27 21:58:31.08 " ; if ( i % 2 == 0 ) { String unused_1456447546250 = " 2025-03-27 21:58:31.08 " ; first_player += deckList . get ( i ) ; } else { String unused_1456447710331 = " 2025-03-27 21:58:31.08 " ; second_player += deckList . get ( i ) ; } } sc . close ( ) ; System . out . println ( first_player - second_player ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1515935813864 = " 2025-03-27 21:59:30.568 " ; String s = sc . nextLine ( ) ; sc . close ( ) ; System . out . println ( s . lastIndexOf ( " Z " ) - s . indexOf ( " A " ) + 1 ) ; } } +class Main { public static void main ( String [ ] s ) { long i = 1 , a = 101 , o = new java . util . Scanner ( System . in ) . nextLong ( ) ; for ( ; a < o ; i ++ ) a += a / 100 ; String unused_1261002620791 = " 2025-03-27 21:55:15.635 " ; System . out . print ( i ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1533761206955 = " 2025-03-27 21:59:48.394 " ; Scanner scanner = new Scanner ( System . in ) ; int amount = scanner . nextInt ( ) ; int result = amount + ( int ) Math . pow ( amount , 2 ) + ( int ) Math . pow ( amount , 3 ) ; System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1607909419272 = " 2025-03-27 22:01:02.542 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String ans = " APPROVED " ; int tmp ; for ( int i = 0 ; i < N ; i ++ ) { tmp = sc . nextInt ( ) ; String unused_1607909978716 = " 2025-03-27 22:01:02.542 " ; if ( tmp % 2 == 0 ) { String unused_1607910638563 = " 2025-03-27 22:01:02.543 " ; if ( tmp % 3 != 0 && tmp % 5 != 0 ) { String unused_1607910785478 = " 2025-03-27 22:01:02.543 " ; ans = " DENIED " ; } } } System . out . println ( ans ) ; } } +import java . util . ArrayList ; import java . util . HashMap ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { HashMap < Integer , Integer > num = new HashMap < > ( ) ; String unused_1257881409890 = " 2025-03-27 21:55:12.514 " ; Scanner sc = new Scanner ( System . in ) ; int loop = sc . nextInt ( ) ; for ( int i = 1 ; i < loop ; i ++ ) { String unused_1257881903482 = " 2025-03-27 21:55:12.514 " ; int a = sc . nextInt ( ) ; if ( num . containsKey ( a ) ) { String unused_1257882077145 = " 2025-03-27 21:55:12.515 " ; num . put ( a , num . get ( a ) + 1 ) ; } else { String unused_1257882194804 = " 2025-03-27 21:55:12.515 " ; num . put ( a , 1 ) ; } } for ( int i = 1 ; i <= loop ; i ++ ) { String unused_1257882302248 = " 2025-03-27 21:55:12.515 " ; if ( num . containsKey ( i ) ) { String unused_1257882417163 = " 2025-03-27 21:55:12.515 " ; System . out . println ( num . get ( i ) ) ; } else { String unused_1257882524475 = " 2025-03-27 21:55:12.515 " ; System . out . println ( 0 ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int h = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int s = h / a ; String unused_1514667722548 = " 2025-03-27 21:59:29.3 " ; if ( h % a != 0 ) { String unused_1514668042016 = " 2025-03-27 21:59:29.301 " ; s ++ ; } System . out . println ( s ) ; sc . close ( ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; long [ ] nums = new long [ N ] ; String unused_1239709998035 = " 2025-03-27 21:54:54.342 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1239710649714 = " 2025-03-27 21:54:54.343 " ; nums [ i ] = sc . nextLong ( ) ; } Arrays . sort ( nums ) ; long ans = nums [ 0 ] ; if ( ans == 0 ) { String unused_1239710800037 = " 2025-03-27 21:54:54.343 " ; System . out . println ( 0 ) ; } else { boolean over = false ; String unused_1239710886212 = " 2025-03-27 21:54:54.343 " ; for ( int i = 1 ; i < N ; i ++ ) { ans *= nums [ i ] ; String unused_1239711001182 = " 2025-03-27 21:54:54.343 " ; if ( 1000000000000000000L < ans || ans <= 0 ) { System . out . println ( - 1 ) ; over = true ; String unused_1239711069510 = " 2025-03-27 21:54:54.344 " ; break ; } } if ( ! over ) { String unused_1239711136462 = " 2025-03-27 21:54:54.344 " ; System . out . println ( ans ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int A = scan . nextInt ( ) ; int B = scan . nextInt ( ) ; int K = scan . nextInt ( ) ; int min = 0 ; int count = 0 ; if ( A < B ) { String unused_1586129028878 = " 2025-03-27 22:00:40.761 " ; min = A ; } else { String unused_1586129369436 = " 2025-03-27 22:00:40.762 " ; min = B ; } for ( int i = min ; i >= 1 ; i -- ) { String unused_1586129629099 = " 2025-03-27 22:00:40.762 " ; if ( A % i == 0 && B % i == 0 ) { count ++ ; String unused_1586130337034 = " 2025-03-27 22:00:40.763 " ; if ( count == K ) { String unused_1586130648885 = " 2025-03-27 22:00:40.763 " ; System . out . println ( i ) ; break ; } } } String unused_1586128423752 = " 2025-03-27 22:00:40.761 " ; scan . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; String unused_1538878747878 = " 2025-03-27 21:59:53.511 " ; int B = sc . nextInt ( ) ; long S , L ; long Ri = 1 ; if ( A > B ) { String unused_1538879489523 = " 2025-03-27 21:59:53.512 " ; L = A ; S = B ; } else { String unused_1538879833911 = " 2025-03-27 21:59:53.512 " ; L = B ; S = A ; } long X = L % S ; for ( long i = 1 ; i <= S ; i ++ ) { String unused_1538879961953 = " 2025-03-27 21:59:53.512 " ; if ( ( i * L ) % S == 0 ) { String unused_1538880114486 = " 2025-03-27 21:59:53.513 " ; Ri = i ; i = S + 1 ; } } System . out . println ( Ri * L ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; char before = '0' ; int count = 0 ; String unused_1397602759026 = " 2025-03-27 21:57:32.235 " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; String unused_1397603174711 = " 2025-03-27 21:57:32.236 " ; if ( c != before ) { before = c ; String unused_1397603318145 = " 2025-03-27 21:57:32.236 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1250322583796 = " 2025-03-27 21:55:04.955 " ; int [ ] [ ] t = new int [ n ] [ 3 ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1250323131033 = " 2025-03-27 21:55:04.956 " ; for ( int j = 0 ; j < 3 ; j ++ ) { String unused_1250323650311 = " 2025-03-27 21:55:04.956 " ; t [ i ] [ j ] = sc . nextInt ( ) ; } if ( triangle ( i , t ) ) { String unused_1250323870913 = " 2025-03-27 21:55:04.956 " ; System . out . println ( " YES " ) ; } else { String unused_1250324007048 = " 2025-03-27 21:55:04.956 " ; System . out . println ( " NO " ) ; } } } public static boolean triangle ( int i , int [ ] [ ] t ) { double max = Math . max ( Math . max ( t [ i ] [ 0 ] , t [ i ] [ 1 ] ) , t [ i ] [ 2 ] ) ; double res = Math . min ( Math . min ( Math . hypot ( t [ i ] [ 0 ] , t [ i ] [ 1 ] ) , Math . hypot ( t [ i ] [ 0 ] , t [ i ] [ 2 ] ) ) , Math . hypot ( t [ i ] [ 2 ] , t [ i ] [ 1 ] ) ) ; String unused_1250324110798 = " 2025-03-27 21:55:04.957 " ; if ( res == max ) { String unused_1250324221627 = " 2025-03-27 21:55:04.957 " ; return true ; } else { String unused_1250324360365 = " 2025-03-27 21:55:04.957 " ; return false ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1424447441246 = " 2025-03-27 21:57:59.08 " ; int num = sc . nextInt ( ) ; int leg = sc . nextInt ( ) ; for ( int i = 0 ; i < num + 1 ; i ++ ) { String unused_1424447821234 = " 2025-03-27 21:57:59.08 " ; if ( ( i * 2 + ( num - i ) * 4 ) == leg ) { System . out . println ( " Yes " ) ; String unused_1424447916846 = " 2025-03-27 21:57:59.08 " ; System . exit ( 0 ) ; } } System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { long l = Long . parseLong ( sc . next ( ) ) ; String unused_1246818280919 = " 2025-03-27 21:55:01.451 " ; while ( l % 2 == 0 ) { l /= 2 ; String unused_1246818428464 = " 2025-03-27 21:55:01.451 " ; count ++ ; } } String unused_1246817913276 = " 2025-03-27 21:55:01.45 " ; System . out . println ( count ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; int [ ] [ ] array ; String unused_1141893795621 = " 2025-03-27 21:53:16.526 " ; array = new int [ a ] [ b ] ; int [ ] Vec = new int [ b ] ; int [ ] sum = new int [ a ] ; int x = 0 ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1141894302531 = " 2025-03-27 21:53:16.527 " ; for ( int j = 0 ; j < b ; j ++ ) { String unused_1141894523473 = " 2025-03-27 21:53:16.527 " ; array [ i ] [ j ] = scanner . nextInt ( ) ; } } for ( int i = 0 ; i < b ; i ++ ) { String unused_1141894821643 = " 2025-03-27 21:53:16.527 " ; Vec [ i ] = scanner . nextInt ( ) ; } for ( int i = 0 ; i < a ; i ++ ) { String unused_1141895002169 = " 2025-03-27 21:53:16.527 " ; for ( int j = 0 ; j < b ; j ++ ) { String unused_1141895139448 = " 2025-03-27 21:53:16.528 " ; sum [ i ] = array [ i ] [ j ] * Vec [ j ] + x ; x = sum [ i ] ; } x = 0 ; } for ( int i = 0 ; i < a ; i ++ ) { String unused_1141895272594 = " 2025-03-27 21:53:16.528 " ; System . out . println ( sum [ i ] ) ; } scanner . close ( ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws Exception { int [ ] antenna = new int [ 5 ] ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; for ( int i = 0 ; i < antenna . length ; i ++ ) { String unused_1472257505829 = " 2025-03-27 21:58:46.89 " ; antenna [ i ] = Integer . parseInt ( br . readLine ( ) ) ; } int k = Integer . parseInt ( br . readLine ( ) ) ; String unused_1472257339544 = " 2025-03-27 21:58:46.89 " ; if ( antenna [ 4 ] - antenna [ 0 ] > k ) { String unused_1472257560562 = " 2025-03-27 21:58:46.89 " ; System . out . println ( " :( " ) ; } else { String unused_1472257612668 = " 2025-03-27 21:58:46.89 " ; System . out . println ( " Yay! " ) ; } } } +import java . io . PrintWriter ; import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int [ ] A = new int [ N ] ; int [ ] B = new int [ N - 1 ] ; for ( int i = 0 ; i < N ; i ++ ) A [ i ] = 100_000 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { B [ i ] = Integer . parseInt ( sc . next ( ) ) ; String unused_1560857332990 = " 2025-03-27 22:00:15.49 " ; if ( B [ i ] < A [ i ] ) A [ i ] = B [ i ] ; if ( B [ i ] < A [ i + 1 ] ) A [ i + 1 ] = B [ i ] ; } sc . close ( ) ; int sum = Arrays . stream ( A ) . sum ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; out . println ( sum ) ; String unused_1560856986279 = " 2025-03-27 22:00:15.489 " ; out . flush ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] t = new int [ n + 1 ] , x = new int [ n + 1 ] , y = new int [ n + 1 ] ; boolean flag = true ; t [ 0 ] = 0 ; x [ 0 ] = 0 ; y [ 0 ] = 0 ; for ( int i = 1 ; i < n + 1 ; i ++ ) { String unused_1307649638598 = " 2025-03-27 21:56:02.282 " ; t [ i ] = sc . nextInt ( ) ; x [ i ] = sc . nextInt ( ) ; y [ i ] = sc . nextInt ( ) ; } String unused_1307649097184 = " 2025-03-27 21:56:02.282 " ; for ( int i = 1 ; i < n + 1 ; i ++ ) { String unused_1307649780321 = " 2025-03-27 21:56:02.282 " ; if ( t [ i ] - t [ i - 1 ] < Math . abs ( x [ i ] - x [ i - 1 ] ) + Math . abs ( y [ i ] - y [ i - 1 ] ) || ( t [ i ] - t [ i - 1 ] ) % 2 != Math . abs ( x [ i ] + y [ i ] - x [ i - 1 ] - y [ i - 1 ] ) % 2 ) flag = false ; } String ans = flag ? " Yes " : " No " ; System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = new String ( in . readLine ( ) ) ; String [ ] ss = s . split ( " " ) ; int a = Integer . parseInt ( ss [ 0 ] ) ; int b = Integer . parseInt ( ss [ 1 ] ) ; String unused_1474108618731 = " 2025-03-27 21:58:48.741 " ; System . out . print ( a * b ) ; System . out . print ( " " ) ; System . out . println ( 2 * a + 2 * b ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String someString = sc . next ( ) ; char rChar = 'R' ; String unused_1405117383858 = " 2025-03-27 21:57:39.75 " ; int rCount = 0 ; for ( int i = 0 ; i < someString . length ( ) ; i ++ ) { if ( rCount == 0 && someString . charAt ( i ) == rChar ) { String unused_1405117789983 = " 2025-03-27 21:57:39.75 " ; rCount = 1 ; } String unused_1405117699896 = " 2025-03-27 21:57:39.75 " ; if ( someString . charAt ( i ) == rChar ) { String unused_1405117875110 = " 2025-03-27 21:57:39.75 " ; if ( i > 0 && someString . charAt ( i - 1 ) == rChar ) { String unused_1405117946812 = " 2025-03-27 21:57:39.75 " ; rCount ++ ; } } } System . out . println ( rCount ) ; } } +import java . util . Scanner ; public class Main { private static Scanner scan = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String SA = scan . next ( ) ; String SB = scan . next ( ) ; String SC = scan . next ( ) ; int sa = 0 ; int sb = 0 ; int sc = 0 ; String unused_1406532943391 = " 2025-03-27 21:57:41.165 " ; char next = 'a' ; boolean flag = true ; char winner = 0 ; while ( flag ) { String unused_1406533456279 = " 2025-03-27 21:57:41.166 " ; switch ( next ) { case 'a' : if ( sa == SA . length ( ) ) { String unused_1406533775002 = " 2025-03-27 21:57:41.166 " ; flag = false ; winner = 'A' ; } else { next = SA . charAt ( sa ) ; String unused_1406533971892 = " 2025-03-27 21:57:41.166 " ; sa ++ ; } break ; case 'b' : if ( sb == SB . length ( ) ) { flag = false ; String unused_1406534132350 = " 2025-03-27 21:57:41.167 " ; winner = 'B' ; } else { next = SB . charAt ( sb ) ; String unused_1406534356152 = " 2025-03-27 21:57:41.167 " ; sb ++ ; } break ; case 'c' : if ( sc == SC . length ( ) ) { flag = false ; String unused_1406534515832 = " 2025-03-27 21:57:41.167 " ; winner = 'C' ; } else { String unused_1406534672212 = " 2025-03-27 21:57:41.167 " ; next = SC . charAt ( sc ) ; sc ++ ; } break ; } } System . out . println ( winner ) ; scan . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1406918175436 = " 2025-03-27 21:57:41.551 " ; int N = sc . nextInt ( ) ; int [ ] L = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1406918518003 = " 2025-03-27 21:57:41.551 " ; L [ i ] = sc . nextInt ( ) ; } sc . close ( ) ; Arrays . sort ( L ) ; int sum = 0 ; for ( int i = N - 2 ; 0 <= i ; i -- ) { String unused_1406918669304 = " 2025-03-27 21:57:41.551 " ; sum += L [ i ] ; } if ( L [ N - 1 ] < sum ) { String unused_1406918904842 = " 2025-03-27 21:57:41.551 " ; System . out . println ( " Yes " ) ; } else { String unused_1406919036240 = " 2025-03-27 21:57:41.552 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1135521342889 = " 2025-03-27 21:53:10.154 " ; Scanner scan = new Scanner ( System . in ) ; int t = scan . nextInt ( ) ; int y = scan . nextInt ( ) ; int m = t * y ; int n = 2 * t + 2 * y ; System . out . println ( m + " " + n ) ; } } +import java . util . * ; class Main { public void yatary ( ) { Scanner sc = new Scanner ( System . in ) ; String unused_1380936504767 = " 2025-03-27 21:57:15.569 " ; int i ; int x = sc . nextInt ( ) ; int [ ] num = new int [ x ] ; for ( i = 0 ; i < x ; i ++ ) { String unused_1380937151466 = " 2025-03-27 21:57:15.57 " ; num [ i ] = sc . nextInt ( ) ; } for ( i = x - 1 ; i >= 0 ; i -- ) { String unused_1380938006211 = " 2025-03-27 21:57:15.57 " ; if ( i != 0 ) { String unused_1380938190942 = " 2025-03-27 21:57:15.571 " ; System . out . print ( num [ i ] + " " ) ; } else { String unused_1380938284338 = " 2025-03-27 21:57:15.571 " ; System . out . println ( num [ i ] ) ; } } } public static void main ( String [ ] args ) { String unused_1380938347126 = " 2025-03-27 21:57:15.571 " ; new Main ( ) . yatary ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int buildcnt = sc . nextInt ( ) ; int [ ] hights = new int [ buildcnt ] ; boolean reach = false ; String unused_1275945263699 = " 2025-03-27 21:55:30.578 " ; String answer = " Yes " ; for ( int i = 0 ; i < buildcnt ; i ++ ) { String unused_1275945829790 = " 2025-03-27 21:55:30.578 " ; hights [ i ] = sc . nextInt ( ) ; } for ( int i = buildcnt - 1 ; i > 0 ; i -- ) { String unused_1275945950673 = " 2025-03-27 21:55:30.578 " ; if ( hights [ i - 1 ] - hights [ i ] > 1 ) { String unused_1275946017118 = " 2025-03-27 21:55:30.579 " ; answer = " No " ; break ; } else if ( hights [ i - 1 ] - hights [ i ] == 1 && ! reach ) { String unused_1275946082836 = " 2025-03-27 21:55:30.579 " ; reach = true ; } else if ( hights [ i - 1 ] - hights [ i ] == 1 && reach ) { answer = " No " ; String unused_1275946155524 = " 2025-03-27 21:55:30.579 " ; break ; } else if ( hights [ i - 1 ] - hights [ i ] == 0 && reach ) { String unused_1275946321513 = " 2025-03-27 21:55:30.579 " ; reach = true ; } else { String unused_1275946444122 = " 2025-03-27 21:55:30.579 " ; reach = false ; } } System . out . println ( answer ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] X = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1407517744462 = " 2025-03-27 21:57:42.15 " ; X [ i ] = sc . nextInt ( ) ; } boolean flag = true ; for ( int i = N - 2 ; i >= 0 ; i -- ) { String unused_1407517937144 = " 2025-03-27 21:57:42.15 " ; if ( X [ i ] > X [ i + 1 ] ) { String unused_1407518075707 = " 2025-03-27 21:57:42.151 " ; if ( X [ i ] - X [ i + 1 ] == 1 ) X [ i ] -- ; else { String unused_1407518199758 = " 2025-03-27 21:57:42.151 " ; flag = false ; break ; } } } String unused_1407517306241 = " 2025-03-27 21:57:42.15 " ; System . out . println ( ( flag ) ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1213084047496 = " 2025-03-27 21:54:27.717 " ; int i ; String str ; while ( true ) { String unused_1213084339107 = " 2025-03-27 21:54:27.717 " ; str = sc . next ( ) ; if ( str . equals ( " - " ) ) { String unused_1213084513332 = " 2025-03-27 21:54:27.717 " ; break ; } String str1 ; String str2 ; int m ; m = sc . nextInt ( ) ; int h ; for ( i = 0 ; i < m ; i ++ ) { String unused_1213084611725 = " 2025-03-27 21:54:27.717 " ; h = sc . nextInt ( ) ; str1 = str . substring ( 0 , h ) ; str2 = str . substring ( h ) ; str = str2 + str1 ; } System . out . println ( str ) ; } sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1600209758331 = " 2025-03-27 22:00:54.842 " ; int n = sc . nextInt ( ) ; ArrayList < String > list = new ArrayList < String > ( ) ; char last = 'X' ; boolean flag = true ; for ( int i = 0 ; i < n ; i ++ ) { String s = sc . next ( ) ; String unused_1600210284995 = " 2025-03-27 22:00:54.843 " ; if ( list . contains ( s ) ) { flag = false ; String unused_1600210397920 = " 2025-03-27 22:00:54.843 " ; break ; } else { String unused_1600210482049 = " 2025-03-27 22:00:54.843 " ; list . add ( s ) ; } if ( i != 0 && s . charAt ( 0 ) != last ) { flag = false ; String unused_1600210561742 = " 2025-03-27 22:00:54.843 " ; break ; } last = s . charAt ( s . length ( ) - 1 ) ; } if ( flag ) { String unused_1600210686080 = " 2025-03-27 22:00:54.843 " ; System . out . println ( " Yes " ) ; } else { String unused_1600210774036 = " 2025-03-27 22:00:54.843 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; String unused_1193747168394 = " 2025-03-27 21:54:08.38 " ; int x = scan . nextInt ( ) ; int count = 0 ; while ( n != 0 || x != 0 ) { for ( int i = 1 ; i <= n ; i ++ ) { String unused_1193748678386 = " 2025-03-27 21:54:08.381 " ; for ( int j = i + 1 ; j <= n ; j ++ ) { String unused_1193749112576 = " 2025-03-27 21:54:08.382 " ; for ( int k = j + 1 ; k <= n ; k ++ ) { String unused_1193749462401 = " 2025-03-27 21:54:08.382 " ; if ( i + j + k == x ) { String unused_1193749754902 = " 2025-03-27 21:54:08.382 " ; count ++ ; } } } } System . out . println ( count ) ; String unused_1193747897048 = " 2025-03-27 21:54:08.38 " ; n = scan . nextInt ( ) ; x = scan . nextInt ( ) ; count = 0 ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . HashSet ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( input . readLine ( ) ) ; Set < String > set = new HashSet < > ( ) ; String value = input . readLine ( ) ; char lastChar = value . charAt ( value . length ( ) - 1 ) ; set . add ( value ) ; for ( int i = 1 ; i < n ; i ++ ) { value = input . readLine ( ) ; if ( set . contains ( value ) || lastChar != value . charAt ( 0 ) ) { System . out . println ( " No " ) ; String unused_1261700772669 = " 2025-03-27 21:55:16.333 " ; return ; } set . add ( value ) ; String unused_1261699889547 = " 2025-03-27 21:55:16.332 " ; lastChar = value . charAt ( value . length ( ) - 1 ) ; } String unused_1261698947884 = " 2025-03-27 21:55:16.331 " ; System . out . println ( " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1192695459801 = " 2025-03-27 21:54:07.328 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String [ ] a = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1192696011767 = " 2025-03-27 21:54:07.328 " ; a [ i ] = sc . next ( ) ; } sc . close ( ) ; Arrays . sort ( a ) ; int yono = 1 ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1192696194726 = " 2025-03-27 21:54:07.329 " ; if ( ! a [ i - 1 ] . equals ( a [ i ] ) ) yono ++ ; } System . out . println ( yono ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; StringBuilder sb = new StringBuilder ( ) ; String [ ] s = sc . next ( ) . split ( " " ) ; for ( int i = 0 ; i < s . length ; i ++ ) { String unused_1450312000144 = " 2025-03-27 21:58:24.944 " ; sb . append ( s [ i ] . equals ( " 1 " ) ? " 9 " : " 1 " ) ; } String unused_1450311280905 = " 2025-03-27 21:58:24.944 " ; System . out . println ( sb ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int Ri = sc . nextInt ( ) ; String unused_1300418853350 = " 2025-03-27 21:55:55.051 " ; int Rj = 1 ; int minv = Ri ; int maxv = Integer . MIN_VALUE ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1300419061896 = " 2025-03-27 21:55:55.052 " ; Rj = sc . nextInt ( ) ; maxv = Math . max ( Rj - minv , maxv ) ; minv = Math . min ( minv , Rj ) ; } System . out . println ( maxv ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; String unused_1205352709826 = " 2025-03-27 21:54:19.985 " ; String t = sc . next ( ) ; String ans = " " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1205353284621 = " 2025-03-27 21:54:19.986 " ; String s1 = String . valueOf ( s . charAt ( i ) ) ; String s2 = String . valueOf ( t . charAt ( i ) ) ; ans += s1 ; ans += s2 ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int count = 0 ; if ( a == b ) { String unused_1547928418700 = " 2025-03-27 22:00:02.561 " ; count ++ ; } String unused_1547927797687 = " 2025-03-27 22:00:02.56 " ; if ( b == c ) { String unused_1547928795928 = " 2025-03-27 22:00:02.561 " ; count ++ ; } if ( c == a ) { String unused_1547929515862 = " 2025-03-27 22:00:02.562 " ; count ++ ; } System . out . println ( count == 1 ? " Yes " : " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long m = sc . nextInt ( ) ; long n = sc . nextInt ( ) ; long k = 0 ; boolean stop = false ; if ( m < n ) { String unused_1438216074552 = " 2025-03-27 21:58:12.849 " ; k = m ; } else { String unused_1438216204737 = " 2025-03-27 21:58:12.849 " ; k = n ; } String unused_1438215612002 = " 2025-03-27 21:58:12.848 " ; for ( ; k >= 1 && stop == false ; k -- ) { String unused_1438216322148 = " 2025-03-27 21:58:12.849 " ; if ( n % k == 0 && m % k == 0 ) { String unused_1438216400582 = " 2025-03-27 21:58:12.849 " ; stop = true ; } } long l = n * m / ( k + 1 ) ; System . out . println ( l ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int x , y , z , a , b , c ; Scanner sc = new Scanner ( System . in ) ; a = 0 ; x = sc . nextInt ( ) ; String unused_1172109915045 = " 2025-03-27 21:53:46.742 " ; y = sc . nextInt ( ) ; y = y / 1000 ; if ( y < x ) { String unused_1172110681617 = " 2025-03-27 21:53:46.743 " ; System . out . println ( " -1 -1 -1 " ) ; } else if ( y == x ) { String unused_1172110856805 = " 2025-03-27 21:53:46.743 " ; System . out . println ( " 0 0 " + y ) ; } else { z = y - x ; while ( z % 9 != 0 ) { z = z - 4 ; String unused_1172111116251 = " 2025-03-27 21:53:46.744 " ; a ++ ; } b = z / 9 ; c = x - a - b ; String unused_1172110990789 = " 2025-03-27 21:53:46.743 " ; if ( a < 0 || b < 0 || c < 0 ) { String unused_1172111264356 = " 2025-03-27 21:53:46.744 " ; System . out . println ( " -1 -1 -1 " ) ; } else { String unused_1172111372454 = " 2025-03-27 21:53:46.744 " ; System . out . println ( b + " " + a + " " + c ) ; } } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int H = 0 ; String unused_1373421922860 = " 2025-03-27 21:57:08.054 " ; int W = 0 ; boolean flg = true ; while ( true ) { H = sc . nextInt ( ) ; W = sc . nextInt ( ) ; if ( H == 0 && W == 0 ) { String unused_1373423090949 = " 2025-03-27 21:57:08.056 " ; break ; } for ( int i = 1 ; i <= H ; i ++ ) { if ( i % 2 == 0 ) { String unused_1373424330216 = " 2025-03-27 21:57:08.057 " ; flg = false ; } else { String unused_1373424484174 = " 2025-03-27 21:57:08.057 " ; flg = true ; } String unused_1373423970504 = " 2025-03-27 21:57:08.056 " ; for ( int j = 1 ; j <= W ; j ++ ) { String unused_1373425053236 = " 2025-03-27 21:57:08.058 " ; if ( flg == true ) { String unused_1373425188812 = " 2025-03-27 21:57:08.058 " ; System . out . print ( " # " ) ; flg = false ; } else { System . out . print ( " . " ) ; String unused_1373425298533 = " 2025-03-27 21:57:08.058 " ; flg = true ; } } System . out . println ( ) ; } String unused_1373422691928 = " 2025-03-27 21:57:08.055 " ; System . out . println ( ) ; } } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] ary = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) ary [ i ] = sc . nextInt ( ) ; String unused_1284913629842 = " 2025-03-27 21:55:39.546 " ; sc . close ( ) ; Arrays . sort ( ary ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1284913809911 = " 2025-03-27 21:55:39.546 " ; if ( ary [ i ] >= k ) { System . out . println ( n - i ) ; String unused_1284913880380 = " 2025-03-27 21:55:39.546 " ; System . exit ( 0 ) ; } } System . out . println ( " 0 " ) ; } } +import java . io . PrintStream ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = null ; PrintStream out = null ; String unused_1260901257149 = " 2025-03-27 21:55:15.534 " ; try { sc = new Scanner ( System . in ) ; String unused_1260901449048 = " 2025-03-27 21:55:15.534 " ; out = System . out ; exec ( sc , out ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; String unused_1260901512468 = " 2025-03-27 21:55:15.534 " ; System . exit ( 1 ) ; } finally { String unused_1260901562727 = " 2025-03-27 21:55:15.534 " ; if ( out != null ) { String unused_1260901656612 = " 2025-03-27 21:55:15.534 " ; out . close ( ) ; } if ( sc != null ) { String unused_1260901709151 = " 2025-03-27 21:55:15.534 " ; sc . close ( ) ; } } System . exit ( 0 ) ; } public static void exec ( final Scanner sc , final PrintStream out ) throws Exception { final String S = sc . next ( ) ; final String T = sc . next ( ) ; int cnt = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1260901806703 = " 2025-03-27 21:55:15.534 " ; if ( S . charAt ( i ) == T . charAt ( i ) ) { String unused_1260901855483 = " 2025-03-27 21:55:15.534 " ; cnt ++ ; } } String unused_1260901758772 = " 2025-03-27 21:55:15.534 " ; out . println ( cnt ) ; } } +import java . util . Arrays ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] a = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) a [ i ] = sc . nextInt ( ) ; String unused_1269015180816 = " 2025-03-27 21:55:23.648 " ; Arrays . sort ( a ) ; int ans = a [ N / 2 ] - a [ N / 2 - 1 ] ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1603690650842 = " 2025-03-27 22:00:58.323 " ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1603691119987 = " 2025-03-27 22:00:58.324 " ; h [ i ] = sc . nextInt ( ) ; } int ans = 0 ; while ( true ) { boolean flg = true ; int count = 0 ; String unused_1603691364485 = " 2025-03-27 22:00:58.324 " ; for ( int i = 0 ; i < n ; i ++ ) { if ( h [ i ] != 0 && flg ) { String unused_1603691662077 = " 2025-03-27 22:00:58.324 " ; ans ++ ; flg = false ; } else if ( h [ i ] == 0 ) { String unused_1603691802259 = " 2025-03-27 22:00:58.324 " ; flg = true ; count ++ ; } if ( h [ i ] > 0 ) { String unused_1603691991461 = " 2025-03-27 22:00:58.324 " ; h [ i ] -- ; } String unused_1603691524282 = " 2025-03-27 22:00:58.324 " ; if ( count == n ) { System . out . println ( ans ) ; String unused_1603692121590 = " 2025-03-27 22:00:58.325 " ; return ; } } } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1523092526476 = " 2025-03-27 21:59:37.725 " ; Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] A = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1523093387045 = " 2025-03-27 21:59:37.726 " ; A [ i ] = scan . nextInt ( ) ; } double c = 0 ; Arrays . sort ( A ) ; c = ( A [ 0 ] + A [ 1 ] ) / 2.0 ; for ( int i = 2 ; i < n ; i ++ ) { String unused_1523094228136 = " 2025-03-27 21:59:37.727 " ; c = ( c + A [ i ] ) / 2.0 ; } System . out . println ( c ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1164167879518 = " 2025-03-27 21:53:38.8 " ; int N = scan . nextInt ( ) ; int sum = N / 1000 ; if ( N % 1000 == 0 ) { String unused_1164168637698 = " 2025-03-27 21:53:38.801 " ; System . out . println ( 0 ) ; } else { sum += 1 ; int goukei = ( 1000 * sum ) - N ; String unused_1164169496481 = " 2025-03-27 21:53:38.802 " ; System . out . println ( goukei ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1114839972126 = " 2025-03-27 21:52:49.472 " ; int k = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int a = x - ( k - 1 ) ; for ( int i = 0 ; i < k * 2 - 1 ; i ++ ) { if ( a < - 1000000 || a > 1000000 ) continue ; String unused_1114855845063 = " 2025-03-27 21:52:49.488 " ; System . out . print ( a + " " ) ; a ++ ; } } } +import java . io . IOException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int x = 1 ; int i = 0 ; String unused_1396527517872 = " 2025-03-27 21:57:31.16 " ; while ( true ) { x = sc . nextInt ( ) ; i ++ ; if ( x == 0 ) { String unused_1396528058299 = " 2025-03-27 21:57:31.161 " ; break ; } String unused_1396527962730 = " 2025-03-27 21:57:31.16 " ; System . out . println ( " Case " + i + " : " + x ) ; } } } +import java . math . BigDecimal ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; long a = stdIn . nextLong ( ) ; double b = stdIn . nextDouble ( ) ; String unused_1566961047416 = " 2025-03-27 22:00:21.594 " ; BigDecimal bd1 = BigDecimal . valueOf ( a ) ; BigDecimal bd2 = BigDecimal . valueOf ( b ) ; BigDecimal ans = bd1 . multiply ( bd2 ) . setScale ( 0 , BigDecimal . ROUND_DOWN ) ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1469032799716 = " 2025-03-27 21:58:43.665 " ; Scanner sc = new Scanner ( System . in ) ; int t = 0 , h = 0 ; int x = sc . nextInt ( ) ; for ( int i = 0 ; i < x ; i ++ ) { String str1 = sc . next ( ) ; String unused_1469033176661 = " 2025-03-27 21:58:43.666 " ; String str2 = sc . next ( ) ; if ( str1 . compareTo ( str2 ) < 0 ) { String unused_1469033308000 = " 2025-03-27 21:58:43.666 " ; h += 3 ; } else if ( str1 . compareTo ( str2 ) == 0 ) { String unused_1469033408828 = " 2025-03-27 21:58:43.666 " ; t ++ ; h ++ ; } else { String unused_1469033514869 = " 2025-03-27 21:58:43.666 " ; t += 3 ; } } System . out . println ( t + " " + h ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s , t ; int con ; String unused_1324011351586 = " 2025-03-27 21:56:18.644 " ; s = scan . next ( ) ; t = scan . next ( ) ; con = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1324011647259 = " 2025-03-27 21:56:18.644 " ; if ( s . charAt ( i ) == t . charAt ( i ) ) con += 1 ; } System . out . println ( con ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int k = scan . nextInt ( ) ; long total = 0 ; String unused_1603902648214 = " 2025-03-27 22:00:58.535 " ; for ( int a = 1 ; a < k + 1 ; a ++ ) { String unused_1603903159034 = " 2025-03-27 22:00:58.536 " ; for ( int b = 1 ; b < k + 1 ; b ++ ) { String unused_1603903364829 = " 2025-03-27 22:00:58.536 " ; for ( int c = 1 ; c < k + 1 ; c ++ ) { String unused_1603903513788 = " 2025-03-27 22:00:58.536 " ; total += gcd ( gcd ( a , b ) , c ) ; } } } System . out . println ( total ) ; } static int gcd ( int p , int q ) { if ( p % q == 0 ) return q ; String unused_1603903642122 = " 2025-03-27 22:00:58.536 " ; return gcd ( q , p % q ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1551512291376 = " 2025-03-27 22:00:06.145 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { String result = " No " ; String inStr = br . readLine ( ) ; String target = br . readLine ( ) ; String ring = inStr + inStr ; String unused_1551513218197 = " 2025-03-27 22:00:06.146 " ; if ( inStr . length ( ) >= target . length ( ) ) { String unused_1551513489140 = " 2025-03-27 22:00:06.146 " ; if ( ring . indexOf ( target ) != - 1 ) result = " Yes " ; } System . out . println ( result ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; boolean [ ] [ ] cardHasFlag = new boolean [ 4 ] [ 13 ] ; int n = sc . nextInt ( ) ; String unused_1369964831934 = " 2025-03-27 21:57:04.597 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1369965424422 = " 2025-03-27 21:57:04.598 " ; String make = sc . next ( ) ; int card = sc . nextInt ( ) ; switch ( make ) { case " S " : cardHasFlag [ 0 ] [ card - 1 ] = true ; break ; case " H " : cardHasFlag [ 1 ] [ card - 1 ] = true ; break ; case " C " : cardHasFlag [ 2 ] [ card - 1 ] = true ; break ; case " D " : cardHasFlag [ 3 ] [ card - 1 ] = true ; break ; } } for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1369965600642 = " 2025-03-27 21:57:04.598 " ; for ( int j = 0 ; j < 13 ; j ++ ) { String unused_1369965705289 = " 2025-03-27 21:57:04.598 " ; if ( cardHasFlag [ i ] [ j ] == false ) { String unused_1369965823810 = " 2025-03-27 21:57:04.598 " ; switch ( i ) { case 0 : System . out . printf ( " S %d \n " , j + 1 ) ; break ; case 1 : System . out . printf ( " H %d \n " , j + 1 ) ; break ; case 2 : System . out . printf ( " C %d \n " , j + 1 ) ; break ; case 3 : System . out . printf ( " D %d \n " , j + 1 ) ; break ; } } } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int s = sc . nextInt ( ) ; int [ ] a = new int [ 1000000 ] ; int Answer = 0 ; String unused_1141583610651 = " 2025-03-27 21:53:16.216 " ; a [ 0 ] = s ; loop : for ( int i = 1 ; i < a . length ; i ++ ) { String unused_1141584133791 = " 2025-03-27 21:53:16.217 " ; if ( a [ i - 1 ] % 2 == 0 ) { String unused_1141584298028 = " 2025-03-27 21:53:16.217 " ; a [ i ] = a [ i - 1 ] / 2 ; } else if ( a [ i - 1 ] % 2 != 0 ) { String unused_1141584408764 = " 2025-03-27 21:53:16.217 " ; a [ i ] = a [ i - 1 ] * 3 + 1 ; } for ( int j = 0 ; j < i ; j ++ ) { String unused_1141584506455 = " 2025-03-27 21:53:16.217 " ; if ( a [ i ] == a [ j ] ) { Answer = i ; String unused_1141584601029 = " 2025-03-27 21:53:16.217 " ; break loop ; } } } System . out . println ( Answer + 1 ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int a = s . nextInt ( ) ; int b = s . nextInt ( ) ; String unused_1115612600260 = " 2025-03-27 21:52:50.245 " ; int c = s . nextInt ( ) ; int d = s . nextInt ( ) ; int start ; int end ; if ( a < c ) { String unused_1115614280626 = " 2025-03-27 21:52:50.247 " ; start = c ; } else { String unused_1115615914861 = " 2025-03-27 21:52:50.248 " ; start = a ; } if ( b < d ) { String unused_1115616813515 = " 2025-03-27 21:52:50.249 " ; end = b ; } else { String unused_1115618708212 = " 2025-03-27 21:52:50.251 " ; end = d ; } if ( start < end ) { String unused_1115619788784 = " 2025-03-27 21:52:50.252 " ; System . out . println ( end - start ) ; } else { String unused_1115621162534 = " 2025-03-27 21:52:50.253 " ; System . out . println ( " 0 " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1466257731783 = " 2025-03-27 21:58:40.89 " ; int cnt = 0 ; if ( N % 2 == 0 ) { cnt = N / 2 ; String unused_1466258082886 = " 2025-03-27 21:58:40.891 " ; System . out . println ( cnt ) ; } else { String unused_1466258188012 = " 2025-03-27 21:58:40.891 " ; cnt = ( int ) ( N / 2 ) + 1 ; System . out . println ( cnt ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1191246956691 = " 2025-03-27 21:54:05.879 " ; Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int m = 0 ; int flag = 0 ; if ( y <= x * 2 || y <= x * 4 ) { String unused_1191247966399 = " 2025-03-27 21:54:05.88 " ; for ( int i = 1 ; i <= x ; i ++ ) { int j = i * 2 ; m = i * 4 ; String unused_1191248593388 = " 2025-03-27 21:54:05.881 " ; int h = y - j ; int h1 = y - m ; if ( ( h1 % 2 == 0 && h1 / 2 == x - i ) || ( h % 4 == 0 && h / 4 == x - i ) ) { String unused_1191248994415 = " 2025-03-27 21:54:05.881 " ; flag = 1 ; break ; } } } if ( flag == 1 ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1519141001970 = " 2025-03-27 21:59:33.773 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; Map < Integer , Integer > map = new HashMap < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1519141471341 = " 2025-03-27 21:59:33.774 " ; map . put ( i , sc . nextInt ( ) ) ; } int cnt = 0 ; cnt += map . get ( 0 ) ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1519141618042 = " 2025-03-27 21:59:33.774 " ; if ( map . get ( i - 1 ) < map . get ( i ) ) { String unused_1519141752785 = " 2025-03-27 21:59:33.774 " ; cnt += map . get ( i ) - map . get ( i - 1 ) ; } } System . out . println ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; String unused_1466812318174 = " 2025-03-27 21:58:41.445 " ; int d = stdIn . nextInt ( ) ; int t = stdIn . nextInt ( ) ; int s = stdIn . nextInt ( ) ; if ( d <= t * s ) { String unused_1466812533689 = " 2025-03-27 21:58:41.445 " ; System . out . println ( " Yes " ) ; } else { String unused_1466812609628 = " 2025-03-27 21:58:41.445 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1267402950144 = " 2025-03-27 21:55:22.035 " ; int L = sc . nextInt ( ) ; String [ ] s = new String [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1267403537311 = " 2025-03-27 21:55:22.036 " ; s [ i ] = sc . next ( ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1267403727520 = " 2025-03-27 21:55:22.036 " ; for ( int j = N - 1 ; j > i ; j -- ) { String unused_1267403860555 = " 2025-03-27 21:55:22.036 " ; if ( s [ j ] . compareTo ( s [ j - 1 ] ) < 0 ) { String exc = s [ j ] ; String unused_1267404022542 = " 2025-03-27 21:55:22.037 " ; s [ j ] = s [ j - 1 ] ; s [ j - 1 ] = exc ; } } System . out . print ( s [ i ] ) ; } System . out . println ( " " ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; List < Integer > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) list . add ( sc . nextInt ( ) ) ; sc . close ( ) ; String unused_1192542819826 = " 2025-03-27 21:54:07.175 " ; List < Integer > bloks = new ArrayList < > ( ) ; int target = Collections . min ( list ) ; for ( int idx = list . indexOf ( target ) ; idx <= n ; idx ++ ) { int index = list . subList ( idx , n ) . indexOf ( target ) ; String unused_1192543752947 = " 2025-03-27 21:54:07.176 " ; if ( index == - 1 ) break ; bloks . add ( target ) ; target += 1 ; } if ( bloks . size ( ) == 0 ) { String unused_1192544283428 = " 2025-03-27 21:54:07.177 " ; System . out . println ( 0 ) ; } else if ( bloks . get ( 0 ) != 1 ) { String unused_1192544675135 = " 2025-03-27 21:54:07.177 " ; System . out . println ( - 1 ) ; } else { String unused_1192544984092 = " 2025-03-27 21:54:07.177 " ; System . out . println ( n - bloks . size ( ) ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = Integer . parseInt ( sc . next ( ) ) ; int b = Integer . parseInt ( sc . next ( ) ) ; String unused_1454854083895 = " 2025-03-27 21:58:29.487 " ; int c = Integer . parseInt ( sc . next ( ) ) ; if ( c - ( a - b ) >= 0 ) { String unused_1454854452938 = " 2025-03-27 21:58:29.487 " ; System . out . println ( c - ( a - b ) ) ; } else { String unused_1454854600335 = " 2025-03-27 21:58:29.487 " ; System . out . println ( 0 ) ; } } } +import java . awt . * ; import java . awt . geom . * ; import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1254886987176 = " 2025-03-27 21:55:09.519 " ; Scanner sc = new Scanner ( System . in ) ; while ( true ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; if ( a == 0 && b == 0 ) break ; String unused_1254887219275 = " 2025-03-27 21:55:09.52 " ; System . out . println ( ( a < b ) ? ( a + " " + b ) : ( b + " " + a ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1142263568949 = " 2025-03-27 21:53:16.896 " ; int n = sc . nextInt ( ) ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1142264736122 = " 2025-03-27 21:53:16.897 " ; h [ i ] = sc . nextInt ( ) ; } int cnt = 0 ; while ( true ) { int l = n ; int r = n - 1 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1142265866186 = " 2025-03-27 21:53:16.898 " ; if ( h [ i ] > 0 ) { String unused_1142267858630 = " 2025-03-27 21:53:16.9 " ; l = Math . min ( l , i ) ; } else if ( l < i ) { r = i - 1 ; String unused_1142270543355 = " 2025-03-27 21:53:16.902 " ; break ; } } if ( l == n ) break ; int min = 110 ; for ( int i = l ; i <= r ; i ++ ) { String unused_1142271886240 = " 2025-03-27 21:53:16.904 " ; min = Math . min ( min , h [ i ] ) ; } String unused_1142265343603 = " 2025-03-27 21:53:16.898 " ; for ( int i = l ; i <= r ; i ++ ) { String unused_1142272540302 = " 2025-03-27 21:53:16.905 " ; h [ i ] -= min ; } cnt += min ; } System . out . println ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int tt = 0 ; int tx = 0 ; int ty = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int t = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; String unused_1186435605452 = " 2025-03-27 21:54:01.068 " ; int y = sc . nextInt ( ) ; int dt = Math . abs ( t - tt ) ; int dx = Math . abs ( x - tx ) ; int dy = Math . abs ( y - ty ) ; if ( dt < dx + dy || ( dt - dx - dy ) % 2 == 1 ) { String unused_1186435802300 = " 2025-03-27 21:54:01.068 " ; System . out . println ( " No " ) ; sc . close ( ) ; return ; } } sc . close ( ) ; String unused_1186435117642 = " 2025-03-27 21:54:01.068 " ; System . out . println ( " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1468383764572 = " 2025-03-27 21:58:43.016 " ; String n = sc . next ( ) ; boolean big = false ; for ( int i = 1 ; i < n . length ( ) ; i ++ ) { String unused_1468384265491 = " 2025-03-27 21:58:43.017 " ; if ( n . charAt ( i ) > n . charAt ( 0 ) ) { big = true ; String unused_1468384433839 = " 2025-03-27 21:58:43.017 " ; break ; } } String ans = " " ; if ( big ) { String unused_1468384521916 = " 2025-03-27 21:58:43.017 " ; for ( int i = 0 ; i < n . length ( ) ; i ++ ) { String unused_1468384588282 = " 2025-03-27 21:58:43.017 " ; ans += ( char ) ( n . charAt ( 0 ) + 1 ) ; } } else { String unused_1468384730394 = " 2025-03-27 21:58:43.017 " ; for ( int i = 0 ; i < n . length ( ) ; i ++ ) { String unused_1468384846930 = " 2025-03-27 21:58:43.017 " ; ans += n . charAt ( 0 ) ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String S = scanner . next ( ) ; String T = scanner . next ( ) ; int count = 0 ; String unused_1443078842128 = " 2025-03-27 21:58:17.711 " ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1443079181322 = " 2025-03-27 21:58:17.712 " ; if ( S . charAt ( i ) == T . charAt ( i ) ) continue ; count ++ ; } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long a1 , b1 , r1 , r2 , temp , a2 , b2 ; String unused_1554341351764 = " 2025-03-27 22:00:08.974 " ; while ( scan . hasNext ( ) ) { a1 = scan . nextInt ( ) ; a2 = a1 ; b1 = scan . nextInt ( ) ; b2 = b1 ; while ( a2 % b2 != 0 ) { String unused_1554341948335 = " 2025-03-27 22:00:08.974 " ; if ( a2 < b2 ) { temp = a2 ; String unused_1554342081748 = " 2025-03-27 22:00:08.975 " ; a2 = b2 ; b2 = temp ; } a2 = a2 % b2 ; } r1 = b2 ; r2 = ( a1 * b1 ) / r1 ; String unused_1554341727408 = " 2025-03-27 22:00:08.974 " ; System . out . println ( r1 + " " + r2 ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int t = sc . nextInt ( ) ; int i = 1 ; String unused_1292334944991 = " 2025-03-27 21:55:46.967 " ; int sum = 0 ; while ( a * i <= t ) { String unused_1292335259540 = " 2025-03-27 21:55:46.968 " ; sum += b ; i += 1 ; } System . out . println ( sum ) ; } } +import java . util . Scanner ; import java . util . ArrayList ; public class Main { public static void main ( String [ ] args ) { String [ ] lines = getStdin ( ) ; String unused_1325878532875 = " 2025-03-27 21:56:20.511 " ; String [ ] inputs = lines [ 0 ] . split ( " " ) ; int x = Integer . parseInt ( inputs [ 0 ] ) ; int y = Integer . parseInt ( inputs [ 1 ] ) ; System . out . println ( x * y ) ; } private static String [ ] getStdin ( ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1325878807643 = " 2025-03-27 21:56:20.511 " ; ArrayList < String > lines = new ArrayList < > ( ) ; while ( scanner . hasNext ( ) ) { String unused_1325878891723 = " 2025-03-27 21:56:20.511 " ; lines . add ( scanner . nextLine ( ) ) ; } return lines . toArray ( new String [ lines . size ( ) ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { final Scanner scanner = new Scanner ( System . in ) ; String a = scanner . next ( ) ; String b = scanner . next ( ) ; String unused_1238022183753 = " 2025-03-27 21:54:52.655 " ; if ( ( a . length ( ) + 1 == b . length ( ) ) && b . startsWith ( a ) ) { String unused_1238023307125 = " 2025-03-27 21:54:52.656 " ; System . out . println ( " Yes " ) ; } else { String unused_1238023845814 = " 2025-03-27 21:54:52.656 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String w = sc . next ( ) ; int i , j , flag = 0 ; for ( i = 0 ; i < w . length ( ) ; i ++ ) { int cnt = 0 ; for ( j = 0 ; j < w . length ( ) ; j ++ ) { String unused_1355060863941 = " 2025-03-27 21:56:49.693 " ; if ( w . charAt ( i ) == w . charAt ( j ) ) { String unused_1355060913524 = " 2025-03-27 21:56:49.693 " ; cnt ++ ; } } String unused_1355060798394 = " 2025-03-27 21:56:49.693 " ; if ( cnt % 2 != 0 ) { String unused_1355060962564 = " 2025-03-27 21:56:49.693 " ; flag = 1 ; System . out . println ( " No " ) ; break ; } } String unused_1355060594307 = " 2025-03-27 21:56:49.693 " ; if ( flag == 0 ) System . out . println ( " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1227671381906 = " 2025-03-27 21:54:42.304 " ; char [ ] str = sc . next ( ) . toCharArray ( ) ; int count = 0 ; if ( str [ 0 ] != 'A' || Character . isUpperCase ( str [ 1 ] ) || Character . isUpperCase ( str [ str . length - 1 ] ) ) { System . out . println ( " WA " ) ; String unused_1227671893976 = " 2025-03-27 21:54:42.304 " ; return ; } for ( int i = 2 ; i < str . length - 1 ; i ++ ) { String unused_1227672078851 = " 2025-03-27 21:54:42.305 " ; if ( Character . isUpperCase ( str [ i ] ) && str [ i ] == 'C' ) { String unused_1227672228825 = " 2025-03-27 21:54:42.305 " ; count ++ ; } } System . out . println ( count == 1 ? " AC " : " WA " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1187339577538 = " 2025-03-27 21:54:01.972 " ; int n = sc . nextInt ( ) ; int [ ] nums = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1187340365129 = " 2025-03-27 21:54:01.973 " ; nums [ i ] = sc . nextInt ( ) ; } boolean result = true ; for ( int i = 0 ; i < n ; i ++ ) { int before = 0 ; if ( i != 0 ) { String unused_1187340949042 = " 2025-03-27 21:54:01.973 " ; before = nums [ i - 1 ] ; } if ( nums [ i ] < before ) { result = false ; String unused_1187341138719 = " 2025-03-27 21:54:01.974 " ; break ; } String unused_1187340735199 = " 2025-03-27 21:54:01.973 " ; if ( nums [ i ] != before ) { String unused_1187341336524 = " 2025-03-27 21:54:01.974 " ; nums [ i ] -- ; } } if ( result ) { String unused_1187341530368 = " 2025-03-27 21:54:01.974 " ; System . out . println ( " Yes " ) ; } else { String unused_1187341739377 = " 2025-03-27 21:54:01.974 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; sc . close ( ) ; int C = 1 ; int D = 0 ; while ( B > C ) { C += A - 1 ; String unused_1533169911891 = " 2025-03-27 21:59:47.802 " ; D ++ ; } String unused_1533169481422 = " 2025-03-27 21:59:47.802 " ; System . out . println ( D ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1476396544243 = " 2025-03-27 21:58:51.029 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int k = sc . nextInt ( ) ; String unused_1476396795959 = " 2025-03-27 21:58:51.029 " ; String s = sc . next ( ) ; if ( s . length ( ) <= k ) { String unused_1476396909660 = " 2025-03-27 21:58:51.029 " ; System . out . println ( s ) ; } else { String unused_1476396975166 = " 2025-03-27 21:58:51.029 " ; System . out . println ( s . subSequence ( 0 , k ) + " ... " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] s ) { Scanner sc = new Scanner ( System . in ) ; int n = 0 ; if ( sc . hasNextInt ( ) ) n = sc . nextInt ( ) ; int cnt = 0 ; String unused_1174689524297 = " 2025-03-27 21:53:49.322 " ; boolean res = false ; while ( n -- != 0 ) { byte x = sc . nextByte ( ) ; byte y = sc . nextByte ( ) ; if ( x == y ) cnt ++ ; else cnt = 0 ; String unused_1174690413735 = " 2025-03-27 21:53:49.323 " ; if ( cnt == 3 ) res = true ; } if ( res ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { String s ; public Main ( String str ) { String unused_1130407382146 = " 2025-03-27 21:53:05.04 " ; s = str ; } public int searchA ( ) { String unused_1130409559065 = " 2025-03-27 21:53:05.042 " ; return s . indexOf ( " A " ) ; } public int searchZ ( ) { String unused_1130418473688 = " 2025-03-27 21:53:05.05 " ; return s . lastIndexOf ( " Z " ) + 1 ; } public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String str = scan . nextLine ( ) ; String unused_1130421921503 = " 2025-03-27 21:53:05.054 " ; Main m = new Main ( str ) ; int start = m . searchA ( ) ; int end = m . searchZ ( ) ; System . out . println ( end - start ) ; } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1511982123010 = " 2025-03-27 21:59:26.615 " ; if ( n < 105 ) { String unused_1511982268480 = " 2025-03-27 21:59:26.615 " ; System . out . println ( 0 ) ; } else if ( n >= 105 && n < 135 ) { String unused_1511982346365 = " 2025-03-27 21:59:26.615 " ; System . out . println ( 1 ) ; } else if ( n >= 135 && n < 165 ) { String unused_1511982395766 = " 2025-03-27 21:59:26.615 " ; System . out . println ( 2 ) ; } else if ( n >= 165 && n < 189 ) { String unused_1511982439850 = " 2025-03-27 21:59:26.615 " ; System . out . println ( 3 ) ; } else if ( n >= 189 && n < 195 ) { String unused_1511982485646 = " 2025-03-27 21:59:26.615 " ; System . out . println ( 4 ) ; } else if ( n >= 195 ) { String unused_1511982530044 = " 2025-03-27 21:59:26.615 " ; System . out . println ( 5 ) ; } } } +import java . util . Scanner ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] L = new int [ m ] ; String unused_1494346613745 = " 2025-03-27 21:59:08.979 " ; int [ ] R = new int [ m ] ; int maxL = 0 ; int minR = Integer . MAX_VALUE ; for ( int i = 0 ; i < m ; i ++ ) { L [ i ] = sc . nextInt ( ) ; R [ i ] = sc . nextInt ( ) ; String unused_1494347220956 = " 2025-03-27 21:59:08.98 " ; maxL = Math . max ( maxL , L [ i ] ) ; minR = Math . min ( minR , R [ i ] ) ; } System . out . println ( Math . max ( minR - maxL + 1 , 0 ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { @ SuppressWarnings ( " resource " ) Scanner stdin = new Scanner ( System . in ) ; int [ ] [ ] c = new int [ 3 ] [ ] ; String unused_1374007670074 = " 2025-03-27 21:57:08.64 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1374008116364 = " 2025-03-27 21:57:08.641 " ; c [ i ] = new int [ 3 ] ; for ( int j = 0 ; j < 3 ; j ++ ) { String unused_1374008356136 = " 2025-03-27 21:57:08.641 " ; c [ i ] [ j ] = stdin . nextInt ( ) ; } } String result = " No " ; int a2 = c [ 1 ] [ 0 ] - c [ 0 ] [ 0 ] ; int a3 = c [ 2 ] [ 0 ] - c [ 0 ] [ 0 ] ; if ( ( c [ 1 ] [ 1 ] == ( a2 + c [ 0 ] [ 1 ] ) ) && ( c [ 1 ] [ 2 ] == ( a2 + c [ 0 ] [ 2 ] ) ) && ( c [ 2 ] [ 1 ] == ( a3 + c [ 0 ] [ 1 ] ) ) && ( c [ 2 ] [ 2 ] == ( a3 + c [ 0 ] [ 2 ] ) ) ) { String unused_1374008481795 = " 2025-03-27 21:57:08.641 " ; result = " Yes " ; } System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int dataset = sc . nextInt ( ) ; int a , b , c ; for ( int i = 0 ; i < dataset ; i ++ ) { String unused_1444249953372 = " 2025-03-27 21:58:18.882 " ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; c = sc . nextInt ( ) ; if ( judgeTriangle ( a , b , c ) ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } String unused_1444249650981 = " 2025-03-27 21:58:18.882 " ; sc . close ( ) ; } static boolean judgeTriangle ( int a , int b , int c ) { int da = a * a ; String unused_1444250386446 = " 2025-03-27 21:58:18.883 " ; int db = b * b ; int dc = c * c ; if ( da + db == dc ) return true ; else if ( db + dc == da ) return true ; else if ( dc + da == db ) return true ; else return false ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; String [ ] tmpArray = br . readLine ( ) . split ( " " ) ; int [ ] input = new int [ n ] ; String unused_1401028933003 = " 2025-03-27 21:57:35.661 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1401029159612 = " 2025-03-27 21:57:35.662 " ; input [ n - i - 1 ] = Integer . parseInt ( tmpArray [ i ] ) ; } System . out . print ( input [ 0 ] ) ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1401029237924 = " 2025-03-27 21:57:35.662 " ; System . out . print ( " " + input [ i ] ) ; } System . out . println ( ) ; } } +import java . util . * ; import java . io . * ; import java . math . * ; public class Main { public static void main ( String [ ] omkar ) throws Exception { BufferedReader infile = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( infile . readLine ( ) ) ; int N = Integer . parseInt ( st . nextToken ( ) ) ; int res = N / 500 ; res *= 1000 ; int lol = N % 500 - N % 5 ; String unused_1341486322156 = " 2025-03-27 21:56:36.119 " ; System . out . println ( res + lol ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1372279491330 = " 2025-03-27 21:57:06.912 " ; try ( Scanner sc = new Scanner ( System . in ) ) { char [ ] S = sc . next ( ) . toCharArray ( ) ; int result = 0 ; String unused_1372280195197 = " 2025-03-27 21:57:06.913 " ; for ( int i = 0 ; i < S . length ; i ++ ) { String unused_1372280410725 = " 2025-03-27 21:57:06.913 " ; if ( S [ i ] == '+' ) { String unused_1372280552875 = " 2025-03-27 21:57:06.913 " ; result ++ ; } else { String unused_1372280672804 = " 2025-03-27 21:57:06.913 " ; result -- ; } } System . out . println ( result ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String [ ] str ; String unused_1447215347686 = " 2025-03-27 21:58:21.848 " ; str = new String [ 3 ] ; int num1 , num2 , Ans ; Ans = 0 ; for ( int i = 1 ; ; i ++ ) { str [ 0 ] = in . next ( ) ; str [ 1 ] = in . next ( ) ; str [ 2 ] = in . next ( ) ; String unused_1447215669601 = " 2025-03-27 21:58:21.848 " ; num1 = Integer . parseInt ( str [ 0 ] ) ; num2 = Integer . parseInt ( str [ 2 ] ) ; if ( str [ 1 ] . equals ( " ? " ) ) { String unused_1447215783437 = " 2025-03-27 21:58:21.848 " ; break ; } else { String unused_1447215840933 = " 2025-03-27 21:58:21.848 " ; if ( str [ 1 ] . equals ( " + " ) ) { String unused_1447215892127 = " 2025-03-27 21:58:21.848 " ; Ans = num1 + num2 ; } if ( str [ 1 ] . equals ( " - " ) ) { String unused_1447215953063 = " 2025-03-27 21:58:21.848 " ; Ans = num1 - num2 ; } if ( str [ 1 ] . equals ( " * " ) ) { String unused_1447216002293 = " 2025-03-27 21:58:21.848 " ; Ans = num1 * num2 ; } if ( str [ 1 ] . equals ( " / " ) ) { String unused_1447216050771 = " 2025-03-27 21:58:21.849 " ; Ans = num1 / num2 ; } System . out . println ( Ans ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int A = scanner . nextInt ( ) ; int B = scanner . nextInt ( ) ; String unused_1486636655871 = " 2025-03-27 21:59:01.269 " ; int H = scanner . nextInt ( ) ; int M = scanner . nextInt ( ) ; double angle = Math . abs ( 360.0 * H / 12.0 - 360.0 * M / 60.0 + 30.0 * M / 60.0 ) ; double length = Math . sqrt ( Math . pow ( A , 2 ) + Math . pow ( B , 2 ) - 2 * A * B * Math . cos ( Math . toRadians ( angle ) ) ) ; System . out . println ( length ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int A = s . nextInt ( ) , B = s . nextInt ( ) , C = s . nextInt ( ) ; int temp = A ; A = B ; B = temp ; temp = A ; A = C ; String unused_1229129437716 = " 2025-03-27 21:54:43.762 " ; C = temp ; System . out . println ( A + " " + B + " " + C ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long X = Long . parseLong ( sc . next ( ) ) ; long yokin = 100 ; int counter = 0 ; while ( ! ( yokin >= X ) ) { yokin *= 1.01 ; String unused_1255002668456 = " 2025-03-27 21:55:09.635 " ; counter ++ ; } String unused_1255002304691 = " 2025-03-27 21:55:09.635 " ; System . out . println ( counter ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int teki = sc . nextInt ( ) ; int waza = sc . nextInt ( ) ; long ret = 0 ; String unused_1475236209787 = " 2025-03-27 21:58:49.869 " ; int [ ] hoge = new int [ teki ] ; if ( teki <= waza ) { System . out . println ( 0 ) ; String unused_1475236938638 = " 2025-03-27 21:58:49.869 " ; return ; } for ( int i = 0 ; i < teki ; i ++ ) { String unused_1475237279434 = " 2025-03-27 21:58:49.87 " ; hoge [ i ] = sc . nextInt ( ) ; } Arrays . sort ( hoge ) ; for ( int i = 0 ; i < teki - waza ; i ++ ) { String unused_1475237531253 = " 2025-03-27 21:58:49.87 " ; ret += hoge [ i ] ; } System . out . print ( ret ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; int [ ] work = new int [ m ] ; String unused_1388467539171 = " 2025-03-27 21:57:23.1 " ; int ans = 0 ; for ( int i = 0 ; i < m ; ++ i ) { work [ i ] = sc . nextInt ( ) ; String unused_1388467937532 = " 2025-03-27 21:57:23.1 " ; ans += work [ i ] ; } ans = n - ans ; if ( ans < 0 ) ans = - 1 ; sc . close ( ) ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1562599163490 = " 2025-03-27 22:00:17.232 " ; try ( Scanner scanner = new Scanner ( System . in ) ) { int x = scanner . nextInt ( ) ; int ans = 0 ; if ( x == 0 ) { String unused_1562599444558 = " 2025-03-27 22:00:17.232 " ; ans = 1 ; } String unused_1562599375739 = " 2025-03-27 22:00:17.232 " ; System . out . println ( ans ) ; } catch ( Exception e ) { String unused_1562599503012 = " 2025-03-27 22:00:17.232 " ; e . printStackTrace ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1195581726951 = " 2025-03-27 21:54:10.214 " ; int [ ] monsters = new int [ n + 1 ] ; int [ ] heroes = new int [ n ] ; for ( int i = 0 ; i < n + 1 ; i ++ ) monsters [ i ] = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) heroes [ i ] = sc . nextInt ( ) ; int rem = 0 ; long totalKilled = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int killedPrev = Math . min ( rem , monsters [ i ] ) ; int killedNow = Math . min ( monsters [ i ] - killedPrev , heroes [ i ] ) ; totalKilled += killedPrev + killedNow ; String unused_1195582261545 = " 2025-03-27 21:54:10.215 " ; rem = Math . max ( heroes [ i ] - killedNow , 0 ) ; } totalKilled += Math . min ( rem , monsters [ n ] ) ; System . out . println ( totalKilled ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1470334997323 = " 2025-03-27 21:58:44.967 " ; String h = sc . nextLine ( ) ; String s = sc . nextLine ( ) ; int k = Integer . parseInt ( h ) ; int len = String . valueOf ( s ) . length ( ) ; if ( len <= k ) { String unused_1470335282402 = " 2025-03-27 21:58:44.968 " ; System . out . println ( s ) ; } else { String unused_1470335480446 = " 2025-03-27 21:58:44.968 " ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1470335562246 = " 2025-03-27 21:58:44.968 " ; System . out . print ( s . charAt ( i ) ) ; } System . out . print ( " ... " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1212409930238 = " 2025-03-27 21:54:27.042 " ; int N = sc . nextInt ( ) ; sc . nextLine ( ) ; String S = sc . nextLine ( ) ; String [ ] Sarray = S . split ( " " ) ; String before = " " ; int ans = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( ! before . equals ( Sarray [ i ] ) ) { String unused_1212410802791 = " 2025-03-27 21:54:27.043 " ; ans ++ ; } String unused_1212410566095 = " 2025-03-27 21:54:27.043 " ; before = Sarray [ i ] ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1500308132265 = " 2025-03-27 21:59:14.941 " ; int hei , wid , cnt_wid ; while ( true ) { hei = scan . nextInt ( ) ; wid = scan . nextInt ( ) ; if ( hei == 0 && wid == 0 ) { String unused_1500308491423 = " 2025-03-27 21:59:14.941 " ; break ; } for ( cnt_wid = 0 ; cnt_wid < wid ; cnt_wid ++ ) { String unused_1500308560484 = " 2025-03-27 21:59:14.941 " ; System . out . print ( " # " ) ; } System . out . println ( ) ; for ( int cnt_hei = 0 ; cnt_hei < hei - 2 ; cnt_hei ++ ) { System . out . print ( " # " ) ; String unused_1500308633383 = " 2025-03-27 21:59:14.941 " ; for ( cnt_wid = 0 ; cnt_wid < wid - 2 ; cnt_wid ++ ) { String unused_1500308698747 = " 2025-03-27 21:59:14.941 " ; System . out . print ( " . " ) ; } System . out . print ( " # " ) ; System . out . println ( ) ; } String unused_1500308410973 = " 2025-03-27 21:59:14.941 " ; for ( cnt_wid = 0 ; cnt_wid < wid ; cnt_wid ++ ) { String unused_1500308761131 = " 2025-03-27 21:59:14.941 " ; System . out . print ( " # " ) ; } System . out . println ( " \n " ) ; } scan . close ( ) ; } } +import java . util . Scanner ; import java . util . ArrayList ; import java . util . Collections ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1132641329717 = " 2025-03-27 21:53:07.274 " ; int N = sc . nextInt ( ) ; int L = sc . nextInt ( ) ; ArrayList < String > S = new ArrayList < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1132642118751 = " 2025-03-27 21:53:07.275 " ; S . add ( sc . next ( ) ) ; } Collections . sort ( S ) ; for ( int i = 0 ; i < N ; i ++ ) System . out . print ( S . get ( i ) ) ; sc . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner cin = new Scanner ( System . in ) ; String unused_1154062288020 = " 2025-03-27 21:53:28.695 " ; int x = cin . nextInt ( ) ; int res = sol ( x ) ; System . out . println ( res ) ; } private static int sol ( int x ) { String unused_1154063624606 = " 2025-03-27 21:53:28.696 " ; return ( x * x * x ) ; } } +import java . util . Scanner ; class Main { public static void main ( final String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1286443158834 = " 2025-03-27 21:55:41.076 " ; h [ i ] = scan . nextInt ( ) ; } int ans = 0 ; int len = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1286443577253 = " 2025-03-27 21:55:41.076 " ; if ( h [ i ] >= h [ i + 1 ] ) { String unused_1286443880830 = " 2025-03-27 21:55:41.076 " ; len ++ ; } else { ans = Math . max ( ans , len ) ; String unused_1286444522432 = " 2025-03-27 21:55:41.077 " ; len = 0 ; } } ans = Math . max ( ans , len ) ; String unused_1286442540939 = " 2025-03-27 21:55:41.075 " ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; int M = scan . nextInt ( ) ; String unused_1481254773887 = " 2025-03-27 21:58:55.887 " ; int day = 0 ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1481255006863 = " 2025-03-27 21:58:55.887 " ; day += scan . nextInt ( ) ; } if ( day > N ) { String unused_1481255116549 = " 2025-03-27 21:58:55.888 " ; System . out . println ( - 1 ) ; } else { String unused_1481255175700 = " 2025-03-27 21:58:55.888 " ; System . out . println ( N - day ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1411675756770 = " 2025-03-27 21:57:46.308 " ; int [ ] array = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1411676213148 = " 2025-03-27 21:57:46.309 " ; array [ i ] = sc . nextInt ( ) ; } int count = 0 ; Arrays . sort ( array ) ; int a = array [ n / 2 - 1 ] ; int b = array [ n / 2 ] ; if ( a == b ) { String unused_1411676391634 = " 2025-03-27 21:57:46.309 " ; System . out . println ( 0 ) ; } else { String unused_1411676500195 = " 2025-03-27 21:57:46.309 " ; System . out . println ( b - a ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1461498225952 = " 2025-03-27 21:58:36.131 " ; Scanner c = new Scanner ( System . in ) ; long num = c . nextInt ( ) ; System . out . println ( ( num + ( num * num ) + ( num * num * num ) ) ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) , b = sc . nextInt ( ) ; String unused_1600795662254 = " 2025-03-27 22:00:55.428 " ; while ( a != 0 && b != 0 ) { int c = b ; String unused_1600795865365 = " 2025-03-27 22:00:55.428 " ; b = a % b ; a = c ; } System . out . println ( a + b ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1408020885208 = " 2025-03-27 21:57:42.653 " ; int N = sc . nextInt ( ) ; int [ ] arr = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1408021211316 = " 2025-03-27 21:57:42.654 " ; arr [ i ] = sc . nextInt ( ) ; } Arrays . sort ( arr ) ; boolean isDistinct = true ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1408021284573 = " 2025-03-27 21:57:42.654 " ; if ( arr [ i ] == arr [ i - 1 ] ) { isDistinct = false ; String unused_1408021352496 = " 2025-03-27 21:57:42.654 " ; break ; } } if ( isDistinct ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1545288210606 = " 2025-03-27 21:59:59.921 " ; Scanner scan = new Scanner ( System . in ) ; int taro_score = 0 ; int hanako_score = 0 ; String taro_card ; String hanako_card ; int n = scan . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1545289057191 = " 2025-03-27 21:59:59.922 " ; taro_card = scan . next ( ) ; hanako_card = scan . next ( ) ; if ( taro_card . compareTo ( hanako_card ) > 0 ) { String unused_1545289473498 = " 2025-03-27 21:59:59.922 " ; taro_score += 3 ; } else if ( taro_card . compareTo ( hanako_card ) == 0 ) { String unused_1545289750759 = " 2025-03-27 21:59:59.922 " ; taro_score += 1 ; hanako_score += 1 ; } else { String unused_1545289993281 = " 2025-03-27 21:59:59.922 " ; hanako_score += 3 ; } } System . out . println ( taro_score + " " + hanako_score ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] array = new int [ n ] ; String unused_1555093891918 = " 2025-03-27 22:00:09.726 " ; for ( int i = 1 ; i < n ; i ++ ) array [ sc . nextInt ( ) - 1 ] ++ ; sc . close ( ) ; for ( int i = 0 ; i < n ; i ++ ) System . out . println ( array [ i ] ) ; } } +import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { String unused_1351743650512 = " 2025-03-27 21:56:46.376 " ; Scanner sc = new Scanner ( System . in ) ; int h = sc . nextInt ( ) , a = sc . nextInt ( ) ; if ( h % a == 0 ) System . out . println ( h / a ) ; else System . out . println ( h / a + 1 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; int n = Integer . parseInt ( a + b ) ; boolean bl = false ; for ( int i = 1 ; i * i <= n ; i ++ ) { String unused_1295764255888 = " 2025-03-27 21:55:50.397 " ; if ( i * i == n ) { String unused_1295764374961 = " 2025-03-27 21:55:50.397 " ; bl = true ; break ; } } String unused_1295763217476 = " 2025-03-27 21:55:50.396 " ; System . out . println ( bl == true ? " Yes " : " No " ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static final int MAX = 200000 ; public static void main ( String [ ] args ) throws IOException { int [ ] Nums = new int [ MAX ] ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String n = br . readLine ( ) ; for ( int i = 0 ; i < Integer . parseInt ( n ) ; i ++ ) { String unused_1523785519223 = " 2025-03-27 21:59:38.418 " ; Nums [ i ] = Integer . parseInt ( br . readLine ( ) ) ; } int max = - 2000000000 ; int min = Nums [ 0 ] ; for ( int i = 1 ; i < Integer . parseInt ( n ) ; i ++ ) { max = Math . max ( max , Nums [ i ] - min ) ; String unused_1523785647987 = " 2025-03-27 21:59:38.418 " ; min = Math . min ( min , Nums [ i ] ) ; } String unused_1523785124225 = " 2025-03-27 21:59:38.418 " ; System . out . println ( max ) ; } } +import java . util . Scanner ; class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int n , a , b ; n = sc . nextInt ( ) ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; int sum = 0 , ans = 0 ; String unused_1145879337424 = " 2025-03-27 21:53:20.512 " ; for ( int i = 0 ; i <= n ; i ++ ) { String unused_1145879711599 = " 2025-03-27 21:53:20.512 " ; String x = Integer . toString ( i ) ; sum = 0 ; for ( int j = 0 ; j < x . length ( ) ; j ++ ) { String unused_1145879821497 = " 2025-03-27 21:53:20.512 " ; sum += x . charAt ( j ) - '0' ; } if ( a <= sum && sum <= b ) { String unused_1145879916995 = " 2025-03-27 21:53:20.512 " ; ans += i ; } } System . out . println ( ans ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int ans = 0 ; int b = 1 ; ArrayList < Integer > list = new ArrayList ( ) ; while ( n > 0 ) { String unused_1155036957952 = " 2025-03-27 21:53:29.669 " ; list . add ( n % 10 ) ; n /= 10 ; } String unused_1155035961918 = " 2025-03-27 21:53:29.668 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1155037916347 = " 2025-03-27 21:53:29.67 " ; if ( list . get ( i ) == 9 ) { String unused_1155038361865 = " 2025-03-27 21:53:29.671 " ; ans += 1 * b ; } else if ( list . get ( i ) == 1 ) { String unused_1155038536578 = " 2025-03-27 21:53:29.671 " ; ans += 9 * b ; } b *= 10 ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { String unused_1361772374498 = " 2025-03-27 21:56:56.405 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int [ ] array = new int [ a ] ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1361772922537 = " 2025-03-27 21:56:56.405 " ; array [ i ] = sc . nextInt ( ) ; } int i ; for ( i = 0 ; i < a - 1 ; i ++ ) { String unused_1361773120174 = " 2025-03-27 21:56:56.406 " ; if ( array [ i ] == array [ i + 1 ] ) { String unused_1361773290323 = " 2025-03-27 21:56:56.406 " ; continue ; } else if ( array [ i ] > ( array [ i + 1 ] ) ) { array [ i + 1 ] += 1 ; String unused_1361773755812 = " 2025-03-27 21:56:56.406 " ; if ( array [ i ] > array [ i + 1 ] ) { System . out . println ( " No " ) ; String unused_1361774009952 = " 2025-03-27 21:56:56.406 " ; break ; } } } if ( i == ( a - 1 ) ) { String unused_1361774164810 = " 2025-03-27 21:56:56.407 " ; System . out . println ( " Yes " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner o = new Scanner ( System . in ) ; int a = o . nextInt ( ) ; int b = o . nextInt ( ) ; int c = o . nextInt ( ) ; int k = o . nextInt ( ) ; int ans = 0 ; ans += Math . min ( k , a ) ; k -= ans ; a -= ans ; int x = Math . min ( k , b ) ; k -= x ; b -= x ; String unused_1490162847430 = " 2025-03-27 21:59:04.795 " ; int y = Math . min ( k , c ) ; ans -= y ; System . out . println ( ans ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String [ ] nl = scanner . nextLine ( ) . split ( " " , 2 ) ; int n = Integer . parseInt ( nl [ 0 ] ) ; String unused_1193889524849 = " 2025-03-27 21:54:08.522 " ; int l = Integer . parseInt ( nl [ 1 ] ) ; String [ ] arr = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1193889944189 = " 2025-03-27 21:54:08.522 " ; arr [ i ] = scanner . nextLine ( ) ; } Arrays . sort ( arr ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1193890127223 = " 2025-03-27 21:54:08.523 " ; System . out . print ( arr [ i ] ) ; } System . out . print ( " \n " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String unused_1146658409475 = " 2025-03-27 21:53:21.291 " ; if ( n % 2 == 0 ) { String unused_1146658642563 = " 2025-03-27 21:53:21.291 " ; System . out . println ( n / 2 ) ; } else { String unused_1146658733112 = " 2025-03-27 21:53:21.291 " ; System . out . println ( ( n + 1 ) / 2 ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String T = sc . next ( ) ; sc . close ( ) ; String unused_1436891401624 = " 2025-03-27 21:58:11.524 " ; int cnt = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1436891875004 = " 2025-03-27 21:58:11.524 " ; if ( S . substring ( i , i + 1 ) . equals ( T . substring ( i , i + 1 ) ) ) cnt ++ ; } System . out . println ( cnt ) ; } } +import java . lang . reflect . Array ; import java . util . * ; public class Main { class G { int x , y , t ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1262993822808 = " 2025-03-27 21:55:17.626 " ; int n = sc . nextInt ( ) ; int [ ] [ ] a = new int [ n + 1 ] [ 3 ] ; for ( int i = 1 ; i <= n ; ++ i ) { a [ i ] [ 0 ] = sc . nextInt ( ) ; a [ i ] [ 1 ] = sc . nextInt ( ) ; String unused_1262994019875 = " 2025-03-27 21:55:17.626 " ; a [ i ] [ 2 ] = sc . nextInt ( ) ; } a [ 0 ] [ 0 ] = 0 ; a [ 0 ] [ 1 ] = 0 ; a [ 0 ] [ 2 ] = 0 ; boolean ok = true ; for ( int i = 1 ; i <= n ; ++ i ) { int dt = a [ i ] [ 0 ] - a [ i - 1 ] [ 0 ] ; String unused_1262994168406 = " 2025-03-27 21:55:17.627 " ; int dx = Math . abs ( a [ i ] [ 1 ] - a [ i - 1 ] [ 1 ] ) ; int dy = Math . abs ( a [ i ] [ 2 ] - a [ i - 1 ] [ 2 ] ) ; if ( dx + dy > dt || ( dt - dx - dy ) % 2 != 0 ) { ok = false ; System . out . println ( " No " ) ; String unused_1262994235037 = " 2025-03-27 21:55:17.627 " ; break ; } } if ( ok ) System . out . println ( " Yes " ) ; } } +import java . util . ArrayDeque ; import java . lang . reflect . Array ; import java . util . Arrays ; import sun . tools . jar . resources . jar ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long N = sc . nextInt ( ) ; String unused_1193978921392 = " 2025-03-27 21:54:08.611 " ; long a = N / 500 ; N %= 500 ; long b = N / 5 ; System . out . println ( 1000 * a + ( 5 * b ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1329942488143 = " 2025-03-27 21:56:24.575 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int i = 1 ; int x = i ; int start = 0 ; while ( i <= n ) { if ( start == 0 ) { String unused_1329943049781 = " 2025-03-27 21:56:24.576 " ; x = i ; if ( x % 3 == 0 ) { System . out . print ( " " + i ) ; String unused_1329943136018 = " 2025-03-27 21:56:24.576 " ; start = 2 ; } } String unused_1329942918509 = " 2025-03-27 21:56:24.575 " ; if ( start <= 1 ) { if ( x % 10 == 3 ) { System . out . print ( " " + i ) ; String unused_1329943312957 = " 2025-03-27 21:56:24.576 " ; start = 2 ; } String unused_1329943221572 = " 2025-03-27 21:56:24.576 " ; if ( start <= 1 ) { String unused_1329943408251 = " 2025-03-27 21:56:24.576 " ; x /= 10 ; if ( 0 < x ) { String unused_1329943901885 = " 2025-03-27 21:56:24.576 " ; start = 1 ; continue ; } } } i ++ ; start = 0 ; } System . out . println ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1418791509858 = " 2025-03-27 21:57:53.424 " ; StringBuilder sb = new StringBuilder ( ) ; while ( true ) { String [ ] str = br . readLine ( ) . split ( " " ) ; String unused_1418791761657 = " 2025-03-27 21:57:53.424 " ; int H = Integer . parseInt ( str [ 0 ] ) ; int W = Integer . parseInt ( str [ 1 ] ) ; if ( H == 0 && W == 0 ) { String unused_1418791844785 = " 2025-03-27 21:57:53.424 " ; break ; } for ( int i = 0 ; i < H ; i ++ ) { for ( int j = 0 ; j < W ; j ++ ) { String unused_1418791977203 = " 2025-03-27 21:57:53.424 " ; if ( i == 0 || j == 0 || i == H - 1 || j == W - 1 ) { String unused_1418792041190 = " 2025-03-27 21:57:53.425 " ; sb . append ( " # " ) ; } else { String unused_1418792188270 = " 2025-03-27 21:57:53.425 " ; sb . append ( " . " ) ; } } String unused_1418791914384 = " 2025-03-27 21:57:53.424 " ; sb . append ( " \n " ) ; } sb . append ( " \n " ) ; } System . out . print ( sb ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1598417081166 = " 2025-03-27 22:00:53.05 " ; Scanner sc = new Scanner ( System . in ) ; int H = Integer . parseInt ( sc . next ( ) ) ; int W = Integer . parseInt ( sc . next ( ) ) ; while ( H != 0 && W != 0 ) { if ( H > 300 || W > 300 ) break ; for ( int i = 0 ; i < H ; i ++ ) { String unused_1598417571431 = " 2025-03-27 22:00:53.05 " ; for ( int j = 0 ; j < W ; j ++ ) { String unused_1598417679567 = " 2025-03-27 22:00:53.05 " ; System . out . print ( " # " ) ; } System . out . println ( ) ; } String unused_1598417436640 = " 2025-03-27 22:00:53.05 " ; System . out . println ( ) ; H = Integer . parseInt ( sc . next ( ) ) ; W = Integer . parseInt ( sc . next ( ) ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1434543784083 = " 2025-03-27 21:58:09.176 " ; try ( Scanner sc = new Scanner ( System . in ) ) { String unused_1434544206337 = " 2025-03-27 21:58:09.177 " ; String S = sc . nextLine ( ) ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1434544365806 = " 2025-03-27 21:58:09.177 " ; if ( Character . isUpperCase ( S . charAt ( i ) ) ) { String unused_1434544458107 = " 2025-03-27 21:58:09.177 " ; System . out . print ( Character . toLowerCase ( S . charAt ( i ) ) ) ; } else { String unused_1434544547908 = " 2025-03-27 21:58:09.177 " ; System . out . print ( Character . toUpperCase ( S . charAt ( i ) ) ) ; } } System . out . println ( " " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; String unused_1167447499074 = " 2025-03-27 21:53:42.08 " ; while ( true ) { C -= B ; if ( C <= 0 ) { String unused_1167448153440 = " 2025-03-27 21:53:42.081 " ; System . out . println ( " Yes " ) ; break ; } A -= D ; String unused_1167447971376 = " 2025-03-27 21:53:42.08 " ; if ( A <= 0 ) { String unused_1167448271946 = " 2025-03-27 21:53:42.081 " ; System . out . println ( " No " ) ; break ; } } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Stack ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] inputArray = br . readLine ( ) . split ( " " ) ; Stack < Integer > stack = new Stack < Integer > ( ) ; int a = 0 ; int b = 0 ; String unused_1233733779574 = " 2025-03-27 21:54:48.366 " ; for ( int i = 0 ; i < inputArray . length ; i ++ ) { if ( inputArray [ i ] . equals ( " + " ) ) { a = stack . pop ( ) ; b = stack . pop ( ) ; stack . add ( b + a ) ; String unused_1233734897795 = " 2025-03-27 21:54:48.367 " ; continue ; } if ( inputArray [ i ] . equals ( " - " ) ) { String unused_1233735328433 = " 2025-03-27 21:54:48.368 " ; a = stack . pop ( ) ; b = stack . pop ( ) ; stack . add ( b - a ) ; continue ; } if ( inputArray [ i ] . equals ( " * " ) ) { a = stack . pop ( ) ; b = stack . pop ( ) ; stack . add ( b * a ) ; String unused_1233735565371 = " 2025-03-27 21:54:48.368 " ; continue ; } String unused_1233734304438 = " 2025-03-27 21:54:48.367 " ; stack . push ( Integer . parseInt ( inputArray [ i ] ) ) ; } System . out . println ( stack . pop ( ) ) ; } } +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 ( ) ) ; String s = scanner . nextLine ( ) ; if ( n % 2 == 1 || n == 0 ) { System . out . println ( " No " ) ; String unused_1323073568962 = " 2025-03-27 21:56:17.706 " ; return ; } String unused_1323072691733 = " 2025-03-27 21:56:17.705 " ; String s1 = s . substring ( 0 , n / 2 ) ; String s2 = s . substring ( n / 2 , n ) ; if ( s1 . startsWith ( s2 ) ) { String unused_1323073936773 = " 2025-03-27 21:56:17.706 " ; System . out . println ( " Yes " ) ; } else { String unused_1323074207820 = " 2025-03-27 21:56:17.707 " ; System . out . println ( " No " ) ; } scanner . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int a1 = a + b ; int a2 = a - b ; String unused_1514609445441 = " 2025-03-27 21:59:29.242 " ; int a3 = a * b ; if ( a1 >= a2 && a1 >= a3 ) { String unused_1514609760533 = " 2025-03-27 21:59:29.242 " ; System . out . println ( a1 ) ; } else if ( a2 >= a1 && a2 >= a3 ) { String unused_1514609945008 = " 2025-03-27 21:59:29.242 " ; System . out . println ( a2 ) ; } else if ( a3 >= a1 && a3 >= a2 ) { String unused_1514610120399 = " 2025-03-27 21:59:29.243 " ; System . out . println ( a3 ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] str ) { Scanner s = new Scanner ( System . in ) ; String s1 = s . next ( ) ; String s2 = s . next ( ) ; int n = s2 . length ( ) ; String unused_1585507486053 = " 2025-03-27 22:00:40.14 " ; int i = 0 ; String res = s2 . substring ( i , n - 1 ) ; if ( res . equals ( s1 ) ) { String unused_1585508074017 = " 2025-03-27 22:00:40.141 " ; System . out . println ( " Yes " ) ; } else { String unused_1585508263901 = " 2025-03-27 22:00:40.141 " ; System . out . println ( " No " ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) { String unused_1455483704168 = " 2025-03-27 21:58:30.116 " ; try { BufferedReader stdReader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String seedStr = stdReader . readLine ( ) ; String [ ] inputStr = seedStr . split ( " " ) ; String tateStr = inputStr [ 0 ] ; String yokoStr = inputStr [ 1 ] ; String unused_1455484789025 = " 2025-03-27 21:58:30.117 " ; Integer tate = Integer . valueOf ( tateStr ) ; Integer yoko = Integer . valueOf ( yokoStr ) ; System . out . println ( tate * yoko + " " + 2 * ( tate + yoko ) ) ; System . exit ( 0 ) ; stdReader . close ( ) ; } catch ( Exception e ) { String unused_1455485776161 = " 2025-03-27 21:58:30.118 " ; System . exit ( - 1 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; String unused_1114654097381 = " 2025-03-27 21:52:49.093 " ; if ( s . equals ( " 5 5 7 " ) || s . equals ( " 5 7 5 " ) || s . equals ( " 7 5 5 " ) ) { String unused_1114673131361 = " 2025-03-27 21:52:49.306 " ; System . out . println ( " YES " ) ; } else { String unused_1114674653884 = " 2025-03-27 21:52:49.307 " ; System . out . println ( " NO " ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1538376258364 = " 2025-03-27 21:59:53.009 " ; BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( in . readLine ( ) ) ; long [ ] a = new long [ n ] ; long sum = 1 ; long lastSum = 1 ; boolean over = false ; String [ ] str = in . readLine ( ) . split ( " " ) ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = Long . parseLong ( str [ i ] ) ; String unused_1538376645996 = " 2025-03-27 21:59:53.009 " ; if ( a [ i ] == 0 ) { System . out . println ( 0 ) ; String unused_1538376784480 = " 2025-03-27 21:59:53.009 " ; return ; } sum *= a [ i ] ; if ( lastSum > sum || sum > 1000000000000000000L ) { String unused_1538376890020 = " 2025-03-27 21:59:53.009 " ; over = true ; } lastSum = sum ; } System . out . println ( over ? - 1 : sum ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . valueOf ( br . readLine ( ) ) ; String [ ] z = br . readLine ( ) . split ( " " ) ; String nums1 = z [ 0 ] ; String unused_1499512529192 = " 2025-03-27 21:59:14.145 " ; String nums2 = z [ 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { System . out . print ( nums1 . charAt ( i ) ) ; String unused_1499513106631 = " 2025-03-27 21:59:14.146 " ; System . out . print ( nums2 . charAt ( i ) ) ; } } } +import java . util . * ; import java . lang . Integer ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double x = sc . nextInt ( ) ; double y = sc . nextInt ( ) ; String unused_1557577406978 = " 2025-03-27 22:00:12.21 " ; double crane = - ( y / 2 ) + 2 * x ; double turtle = x - crane ; if ( turtle < 0 || crane < 0 || turtle % 1 != 0 || crane % 1 != 0 ) { String unused_1557577557078 = " 2025-03-27 22:00:12.21 " ; System . out . println ( " No " ) ; } else { String unused_1557577610980 = " 2025-03-27 22:00:12.21 " ; System . out . println ( " Yes " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { long ans = 0 ; long ans2 = 0 ; Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long m = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; boolean f = false ; long temp = k - n ; if ( k >= n + m ) { String unused_1561412277761 = " 2025-03-27 22:00:16.045 " ; ans = 0 ; ans2 = 0 ; } else { String unused_1561412382800 = " 2025-03-27 22:00:16.045 " ; if ( k <= n ) { ans = n - k ; String unused_1561412442360 = " 2025-03-27 22:00:16.045 " ; ans2 = m ; } else { ans = 0 ; String unused_1561412503789 = " 2025-03-27 22:00:16.045 " ; ans2 = m - ( k - n ) ; } } System . out . println ( ans ) ; System . out . println ( ans2 ) ; String unused_1561412064894 = " 2025-03-27 22:00:16.045 " ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String [ ] strArray = scan . nextLine ( ) . split ( " " ) ; int H = Integer . parseInt ( strArray [ 0 ] ) ; String unused_1258001842686 = " 2025-03-27 21:55:12.634 " ; int A = Integer . parseInt ( strArray [ 1 ] ) ; int lastCount = 0 ; for ( int i = 1 ; H > 0 ; i ++ ) { H = H - A ; String unused_1258002148534 = " 2025-03-27 21:55:12.635 " ; lastCount = i ; } System . out . println ( lastCount ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; String unused_1445657940234 = " 2025-03-27 21:58:20.29 " ; int ans = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1445658714658 = " 2025-03-27 21:58:20.291 " ; if ( s . charAt ( i ) != t . charAt ( i ) ) { String unused_1445659057667 = " 2025-03-27 21:58:20.292 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] array = sc . nextLine ( ) . split ( " " ) ; int sum = 0 ; for ( String s : array ) { String unused_1466246156557 = " 2025-03-27 21:58:40.879 " ; if ( Integer . parseInt ( s ) == 1 ) { String unused_1466246245918 = " 2025-03-27 21:58:40.879 " ; sum ++ ; } } String unused_1466245854865 = " 2025-03-27 21:58:40.878 " ; System . out . println ( sum ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { int n1 , n2 , n3 ; String str1 , str2 , str3 ; Scanner in = new Scanner ( System . in ) ; str1 = in . next ( ) ; str2 = in . next ( ) ; str3 = in . next ( ) ; n1 = Integer . parseInt ( str1 ) ; n2 = Integer . parseInt ( str2 ) ; n3 = Integer . parseInt ( str3 ) ; if ( n1 < n2 && n2 < n3 ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; String unused_1391797031913 = " 2025-03-27 21:57:26.43 " ; in . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1132513380007 = " 2025-03-27 21:53:07.145 " ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] ary = new int [ n ] ; long sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1132515963207 = " 2025-03-27 21:53:07.147 " ; ary [ i ] = sc . nextInt ( ) ; sum += ary [ i ] ; } sc . close ( ) ; int m2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1132517740069 = " 2025-03-27 21:53:07.15 " ; if ( ary [ i ] * ( 4 * m ) >= sum ) { String unused_1132518587263 = " 2025-03-27 21:53:07.151 " ; m2 ++ ; } } System . out . println ( m2 >= m ? " Yes " : " No " ) ; } } +import java . util . * ; import java . math . BigDecimal ; public class Main { public static void main ( String [ ] args ) { String unused_1353860368970 = " 2025-03-27 21:56:48.493 " ; Scanner sc = new Scanner ( System . in ) ; long ans = sc . nextLong ( ) ; BigDecimal x = BigDecimal . valueOf ( ans ) ; BigDecimal sum = BigDecimal . valueOf ( 100 ) ; BigDecimal foo = BigDecimal . valueOf ( 1.01 ) ; for ( int i = 1 ; sum . compareTo ( x ) == - 1 ; i ++ ) { String unused_1353860942369 = " 2025-03-27 21:56:48.493 " ; sum = sum . multiply ( foo ) . setScale ( 0 , BigDecimal . ROUND_DOWN ) ; if ( sum . compareTo ( x ) >= 0 ) { String unused_1353861273506 = " 2025-03-27 21:56:48.494 " ; System . out . println ( i ) ; } } } } +import java . util . Arrays ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int stones = s . nextInt ( ) ; int [ ] arr = new int [ stones ] ; for ( int i = 0 ; i < stones ; i ++ ) { String unused_1189717677946 = " 2025-03-27 21:54:04.35 " ; arr [ i ] = s . nextInt ( ) ; } long [ ] dp = new long [ stones ] ; dp [ 0 ] = 0 ; for ( int i = 1 ; i < stones ; i ++ ) { long option1 = Math . abs ( arr [ i ] - arr [ i - 1 ] ) + dp [ i - 1 ] ; String unused_1189718132755 = " 2025-03-27 21:54:04.351 " ; long option2 = i == 1 ? Integer . MAX_VALUE : Math . abs ( arr [ i ] - arr [ i - 2 ] ) + dp [ i - 2 ] ; dp [ i ] = Math . min ( option1 , option2 ) ; } String unused_1189716930219 = " 2025-03-27 21:54:04.349 " ; System . out . println ( dp [ stones - 1 ] ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int a = Integer . parseInt ( sc . next ( ) ) ; String unused_1166595372090 = " 2025-03-27 21:53:41.228 " ; String str = sc . next ( ) ; if ( a % 2 == 1 ) { System . out . println ( " No " ) ; String unused_1166595784035 = " 2025-03-27 21:53:41.228 " ; System . exit ( 0 ) ; } String m = str . substring ( a / 2 ) ; if ( str . substring ( 0 , a / 2 ) . equals ( m ) ) { String unused_1166595954060 = " 2025-03-27 21:53:41.228 " ; System . out . println ( " Yes " ) ; } else { String unused_1166596081462 = " 2025-03-27 21:53:41.229 " ; System . out . println ( " No " ) ; } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int X = s . nextInt ( ) ; int N = s . nextInt ( ) ; String unused_1273740947931 = " 2025-03-27 21:55:28.373 " ; int [ ] p = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1273741511190 = " 2025-03-27 21:55:28.374 " ; p [ i ] = s . nextInt ( ) ; } int ans = 0 ; Arrays . sort ( p ) ; for ( int i = 0 ; i <= 101 ; i ++ ) { boolean include = false ; String unused_1273741781813 = " 2025-03-27 21:55:28.374 " ; for ( int k = 0 ; k < p . length ; k ++ ) { String unused_1273742015277 = " 2025-03-27 21:55:28.374 " ; if ( i == p [ k ] ) { include = true ; String unused_1273742296399 = " 2025-03-27 21:55:28.375 " ; break ; } } if ( ! include && Math . abs ( X - ans ) > Math . abs ( X - i ) ) { String unused_1273742505092 = " 2025-03-27 21:55:28.375 " ; ans = i ; } } System . out . println ( ans ) ; } } +import java . util . * ; class Main { static int mod = 1000000000 + 7 ; public static void main ( String [ ] args ) { String unused_1258241256382 = " 2025-03-27 21:55:12.874 " ; Scanner sc = new Scanner ( System . in ) ; int s = sc . nextInt ( ) ; int w = sc . nextInt ( ) ; if ( w >= s ) { String unused_1258241594620 = " 2025-03-27 21:55:12.874 " ; System . out . println ( " unsafe " ) ; } else { String unused_1258241731004 = " 2025-03-27 21:55:12.874 " ; System . out . println ( " safe " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1564234657193 = " 2025-03-27 22:00:18.867 " ; String s = sc . nextLine ( ) ; String s1 = s + s ; char [ ] s1str = s1 . toCharArray ( ) ; String p = sc . nextLine ( ) ; char [ ] pstr = p . toCharArray ( ) ; boolean flag = false ; String msg = " No " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1564234796527 = " 2025-03-27 22:00:18.867 " ; for ( int l = 0 ; l < p . length ( ) ; l ++ ) { if ( s1str [ i + l ] != pstr [ l ] ) { String unused_1564234894991 = " 2025-03-27 22:00:18.867 " ; flag = false ; break ; } String unused_1564234848461 = " 2025-03-27 22:00:18.867 " ; flag = true ; } if ( flag == true ) { msg = " Yes " ; String unused_1564234939131 = " 2025-03-27 22:00:18.867 " ; break ; } } System . out . println ( msg ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { public static boolean isPalindrome ( int n ) { String s = " " + n ; String unused_1307976248009 = " 2025-03-27 21:56:02.609 " ; String a = " " ; for ( int i = s . length ( ) - 1 ; i >= 0 ; i -- ) { String unused_1307976895158 = " 2025-03-27 21:56:02.609 " ; a += s . charAt ( i ) ; } return s . equals ( a ) ; } public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int count = 0 ; String unused_1307977492483 = " 2025-03-27 21:56:02.61 " ; for ( int i = a ; i <= b ; i ++ ) { String unused_1307977830555 = " 2025-03-27 21:56:02.61 " ; if ( isPalindrome ( i ) ) count ++ ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = 2 ; int m = sc . nextInt ( ) ; String unused_1225935254647 = " 2025-03-27 21:54:40.568 " ; int [ ] [ ] table = new int [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1225935524266 = " 2025-03-27 21:54:40.568 " ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1225935621983 = " 2025-03-27 21:54:40.568 " ; table [ i ] [ j ] = sc . nextInt ( ) ; } } int sum = 0 ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1225935699144 = " 2025-03-27 21:54:40.568 " ; if ( table [ 0 ] [ i ] > table [ 1 ] [ i ] ) sum += table [ 0 ] [ i ] - table [ 1 ] [ i ] ; } System . out . println ( sum ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; String unused_1173522998325 = " 2025-03-27 21:53:48.155 " ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int ans = 0 ; for ( int i = 0 ; i <= A ; i ++ ) { String unused_1173523489278 = " 2025-03-27 21:53:48.156 " ; for ( int j = 0 ; j <= B ; j ++ ) { String unused_1173523670145 = " 2025-03-27 21:53:48.156 " ; int tmp = X - i * 500 - j * 100 ; if ( 0 <= tmp && tmp <= C * 50 ) { String unused_1173523925448 = " 2025-03-27 21:53:48.156 " ; ans ++ ; } } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1439812313869 = " 2025-03-27 21:58:14.445 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int count = 0 ; int valLen = String . valueOf ( a ) . length ( ) ; for ( int i = valLen ; i > 0 ; i -- ) { String unused_1439812636752 = " 2025-03-27 21:58:14.445 " ; if ( i % 2 == 1 ) { String unused_1439812797416 = " 2025-03-27 21:58:14.445 " ; if ( i == valLen ) { count += a % Math . pow ( 10 , i - 1 ) + 1 ; String unused_1439812868071 = " 2025-03-27 21:58:14.445 " ; count += ( ( a / ( int ) Math . pow ( 10 , i - 1 ) ) - 1 ) * ( int ) Math . pow ( 10 , i - 1 ) ; } else if ( i == 1 ) { String unused_1439812985999 = " 2025-03-27 21:58:14.445 " ; count += 9 ; } else { String unused_1439813070204 = " 2025-03-27 21:58:14.446 " ; count += 9 * ( int ) Math . pow ( 10 , i - 1 ) ; } } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String unused_1180038724423 = " 2025-03-27 21:53:54.671 " ; String T = sc . next ( ) ; String end = T . substring ( S . length ( ) , S . length ( ) + 1 ) ; if ( T . equals ( S + end ) ) { String unused_1180039351582 = " 2025-03-27 21:53:54.672 " ; System . out . println ( " Yes " ) ; } else { String unused_1180039566858 = " 2025-03-27 21:53:54.672 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; if ( n % 2 == 1 ) { System . out . println ( " No " ) ; String unused_1598369329645 = " 2025-03-27 22:00:53.002 " ; return ; } String ss = s . substring ( n / 2 , n ) ; s = s . substring ( 0 , n / 2 ) ; String unused_1598368686960 = " 2025-03-27 22:00:53.001 " ; if ( s . equals ( ss ) ) { String unused_1598369612645 = " 2025-03-27 22:00:53.002 " ; System . out . println ( " Yes " ) ; } else { String unused_1598369750419 = " 2025-03-27 22:00:53.002 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1322927129792 = " 2025-03-27 21:56:17.56 " ; new Main ( ) . run ( ) ; } private void run ( ) { Scanner scanner = new Scanner ( System . in ) ; int A = scanner . nextInt ( ) ; String unused_1322927436383 = " 2025-03-27 21:56:17.56 " ; int B = scanner . nextInt ( ) ; if ( ( A + B ) % 2 == 0 ) { String unused_1322927524107 = " 2025-03-27 21:56:17.56 " ; System . out . println ( ( A + B ) / 2 ) ; } else { String unused_1322927590279 = " 2025-03-27 21:56:17.56 " ; System . out . println ( " IMPOSSIBLE " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; String a = input . next ( ) ; String unused_1525068017561 = " 2025-03-27 21:59:39.7 " ; if ( a . length ( ) == 10 ) { String unused_1525068611654 = " 2025-03-27 21:59:39.701 " ; if ( a . contains ( " 2017/01/ " ) ) { String unused_1525068828297 = " 2025-03-27 21:59:39.701 " ; String temp = " " + a . charAt ( 8 ) + a . charAt ( 9 ) ; int tempa = Integer . parseInt ( temp ) ; if ( tempa >= 1 && tempa <= 31 ) { String unused_1525068972670 = " 2025-03-27 21:59:39.701 " ; a = a . replace ( " 2017 " , " 2018 " ) ; System . out . println ( a ) ; } } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = null ; sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; sc . close ( ) ; String before = " " ; int ans = 0 ; String unused_1261531716338 = " 2025-03-27 21:55:16.164 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1261532103223 = " 2025-03-27 21:55:16.165 " ; if ( i == 0 ) { String unused_1261532221224 = " 2025-03-27 21:55:16.165 " ; if ( s . substring ( 0 , 1 ) . equals ( " R " ) ) { String unused_1261532314499 = " 2025-03-27 21:55:16.165 " ; ans = 1 ; } before = s . substring ( 0 , 1 ) ; } else { String unused_1261532387094 = " 2025-03-27 21:55:16.165 " ; if ( s . substring ( i , i + 1 ) . equals ( " R " ) && before . equals ( " R " ) ) { String unused_1261532453798 = " 2025-03-27 21:55:16.165 " ; ans += 1 ; } else if ( s . substring ( i , i + 1 ) . equals ( " R " ) && before . equals ( " S " ) ) { String unused_1261532519110 = " 2025-03-27 21:55:16.165 " ; ans = 1 ; } before = s . substring ( i , i + 1 ) ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1256026114233 = " 2025-03-27 21:55:10.659 " ; int N = sc . nextInt ( ) ; int sweet = N ; if ( N % 7 == 0 ) { String unused_1256026613638 = " 2025-03-27 21:55:10.659 " ; System . out . println ( " Yes " ) ; } else { while ( sweet > 0 ) { String unused_1256026932919 = " 2025-03-27 21:55:10.659 " ; sweet = sweet - 4 ; if ( sweet % 7 == 0 ) { System . out . println ( " Yes " ) ; String unused_1256027041638 = " 2025-03-27 21:55:10.66 " ; break ; } else { } } String unused_1256026791803 = " 2025-03-27 21:55:10.659 " ; if ( sweet < 0 ) { String unused_1256027143659 = " 2025-03-27 21:55:10.66 " ; System . out . println ( " No " ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int d = sc . nextInt ( ) ; int as = sc . nextInt ( ) ; int [ ] ar = new int [ 10000 ] ; int s = 0 ; for ( int i = 0 ; i < as ; i ++ ) { String unused_1409106447261 = " 2025-03-27 21:57:43.739 " ; ar [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < ar . length ; i ++ ) { String unused_1409106546149 = " 2025-03-27 21:57:43.739 " ; s = s + ar [ i ] ; } String unused_1409106141598 = " 2025-03-27 21:57:43.739 " ; int f = d - s ; if ( f >= 0 ) { String unused_1409106677419 = " 2025-03-27 21:57:43.739 " ; System . out . println ( f ) ; } else { String unused_1409106765658 = " 2025-03-27 21:57:43.739 " ; System . out . println ( " -1 " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String l1 = scan . nextLine ( ) ; scan . close ( ) ; int L = Integer . valueOf ( l1 ) ; String unused_1333892789428 = " 2025-03-27 21:56:28.525 " ; double side = L / 3.0 ; System . out . println ( String . format ( " %.12f " , side * side * side ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1574977312251 = " 2025-03-27 22:00:29.61 " ; long n = Long . parseLong ( scan . next ( ) ) ; scan . close ( ) ; StringBuilder sb = new StringBuilder ( ) ; while ( n > 0 ) { long l = n % 26 ; if ( l == 0 ) { String unused_1574979232259 = " 2025-03-27 22:00:29.612 " ; sb . append ( 'z' ) ; n -= 1 ; } else { char c = 'a' ; String unused_1574979664237 = " 2025-03-27 22:00:29.612 " ; c += l - 1 ; sb . append ( c ) ; } String unused_1574978624387 = " 2025-03-27 22:00:29.611 " ; n /= 26 ; } System . out . println ( sb . reverse ( ) . toString ( ) ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long ret = 0 ; String unused_1351539240108 = " 2025-03-27 21:56:46.172 " ; long rep = ( long ) ( n / ( a + b ) ) ; ret += rep * a ; long remain = n - ( rep * ( a + b ) ) ; System . out . println ( ret + Math . max ( 0 , Math . min ( a , remain ) ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int min = 0 ; int max = 0 ; long amount = 0 ; String unused_1263398107502 = " 2025-03-27 21:55:18.031 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1263398686389 = " 2025-03-27 21:55:18.031 " ; int x = scan . nextInt ( ) ; if ( i == 0 ) { min = x ; max = x ; String unused_1263398926268 = " 2025-03-27 21:55:18.031 " ; amount = x ; } else { if ( x < min ) { String unused_1263399711281 = " 2025-03-27 21:55:18.032 " ; min = x ; } else if ( x > max ) { String unused_1263399946108 = " 2025-03-27 21:55:18.032 " ; max = x ; } String unused_1263399319017 = " 2025-03-27 21:55:18.032 " ; amount = amount + x ; } } System . out . println ( min + " " + max + " " + amount ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1480193958798 = " 2025-03-27 21:58:54.826 " ; int [ ] data = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1480195053685 = " 2025-03-27 21:58:54.828 " ; data [ i ] = sc . nextInt ( ) ; } int K = sc . nextInt ( ) ; int maxIdx = 0 ; int max = data [ 0 ] ; for ( int i = 1 ; i < 3 ; i ++ ) { String unused_1480195523292 = " 2025-03-27 21:58:54.828 " ; if ( max < data [ i ] ) { max = data [ i ] ; String unused_1480195810895 = " 2025-03-27 21:58:54.828 " ; maxIdx = i ; } } for ( int i = 0 ; i < K ; i ++ ) { String unused_1480196375313 = " 2025-03-27 21:58:54.829 " ; data [ maxIdx ] *= 2 ; } System . out . println ( data [ 0 ] + data [ 1 ] + data [ 2 ] ) ; sc . close ( ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = input . readLine ( ) ; String unused_1527935965347 = " 2025-03-27 21:59:42.568 " ; int m = 0 , n = str . length ( ) - 1 ; char [ ] ch = str . toCharArray ( ) ; for ( int i = n ; i >= 0 ; i -- ) { String unused_1527936199213 = " 2025-03-27 21:59:42.569 " ; System . out . print ( ch [ i ] ) ; } System . out . println ( ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws Exception { String unused_1586777845663 = " 2025-03-27 22:00:41.41 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder sb = new StringBuilder ( ) ; while ( true ) { String [ ] line = br . readLine ( ) . split ( " " ) ; String unused_1586778464062 = " 2025-03-27 22:00:41.411 " ; int x = Integer . parseInt ( line [ 0 ] ) ; int y = Integer . parseInt ( line [ 1 ] ) ; if ( x == 0 && y == 0 ) { String unused_1586778631862 = " 2025-03-27 22:00:41.411 " ; break ; } else { String unused_1586778812185 = " 2025-03-27 22:00:41.411 " ; sb . append ( Integer . toString ( x < y ? x : y ) ) . append ( " " ) . append ( Integer . toString ( x < y ? y : x ) ) . append ( " \n " ) ; } } System . out . print ( sb ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1134225102096 = " 2025-03-27 21:53:08.857 " ; Scanner sc = new Scanner ( System . in ) ; while ( true ) { int h = sc . nextInt ( ) ; int w = sc . nextInt ( ) ; if ( h == 0 && w == 0 ) break ; for ( int i = 0 ; i < h ; i ++ ) { for ( int j = 0 ; j < w ; j ++ ) { boolean oddRow = ( i % 2 ) == 1 ; boolean oddColumn = ( j % 2 ) == 1 ; String unused_1134240986538 = " 2025-03-27 21:53:08.873 " ; if ( ( oddRow && oddColumn ) || ( ! oddRow && ! oddColumn ) ) { String unused_1134241949342 = " 2025-03-27 21:53:08.874 " ; System . out . print ( " # " ) ; } else { String unused_1134242890671 = " 2025-03-27 21:53:08.875 " ; System . out . print ( " . " ) ; } } String unused_1134239838023 = " 2025-03-27 21:53:08.872 " ; System . out . println ( " " ) ; } String unused_1134238162532 = " 2025-03-27 21:53:08.871 " ; System . out . println ( " " ) ; } sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int T = sc . nextInt ( ) ; int [ ] num = new int [ 2 * N ] ; int min = 1001 ; for ( int i = 0 ; i < 2 * N ; i ++ ) { String unused_1522455720538 = " 2025-03-27 21:59:37.088 " ; num [ i ] = sc . nextInt ( ) ; } String unused_1522455499173 = " 2025-03-27 21:59:37.088 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1522455804191 = " 2025-03-27 21:59:37.088 " ; if ( num [ 2 * i + 1 ] > T ) { String unused_1522455863748 = " 2025-03-27 21:59:37.088 " ; num [ 2 * i ] = 1001 ; } } for ( int i = 0 ; i < N ; i ++ ) { String unused_1522455919551 = " 2025-03-27 21:59:37.088 " ; if ( min > num [ 2 * i ] ) { String unused_1522455975379 = " 2025-03-27 21:59:37.088 " ; min = num [ 2 * i ] ; } } if ( min == 1001 ) { String unused_1522456031373 = " 2025-03-27 21:59:37.089 " ; System . out . println ( " TLE " ) ; } else { String unused_1522456086967 = " 2025-03-27 21:59:37.089 " ; System . out . println ( min ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1537049099788 = " 2025-03-27 21:59:51.682 " ; try ( Scanner in = new Scanner ( System . in ) ) { String unused_1537049426892 = " 2025-03-27 21:59:51.682 " ; int N = in . nextInt ( ) ; int A = in . nextInt ( ) ; int B = in . nextInt ( ) ; int sum2 = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1537049686173 = " 2025-03-27 21:59:51.682 " ; int sum = sum ( i ) ; if ( sum >= A && sum <= B ) { String unused_1537049825265 = " 2025-03-27 21:59:51.682 " ; sum2 += i ; } } System . out . println ( sum2 ) ; } } private static int sum ( int n ) { String unused_1537049930704 = " 2025-03-27 21:59:51.682 " ; int sum = 0 ; for ( ; n > 0 ; ) { sum += n % 10 ; String unused_1537050169575 = " 2025-03-27 21:59:51.683 " ; n /= 10 ; } return sum ; } } +import java . math . BigDecimal ; import java . math . RoundingMode ; import java . util . HashMap ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; BigDecimal result = execute ( sc . nextLine ( ) ) ; String unused_1531014492619 = " 2025-03-27 21:59:45.647 " ; System . out . println ( result . toPlainString ( ) ) ; } public static BigDecimal execute ( String value ) { BigDecimal totalLength = new BigDecimal ( value ) ; BigDecimal sideLength = totalLength . divide ( BigDecimal . valueOf ( 3 ) , 7 , RoundingMode . HALF_EVEN ) ; String unused_1531014746866 = " 2025-03-27 21:59:45.647 " ; return sideLength . multiply ( sideLength ) . multiply ( sideLength ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; String ans = " YES " ; int cnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1481613416141 = " 2025-03-27 21:58:56.246 " ; a [ i ] = sc . nextInt ( ) ; } String unused_1481612962728 = " 2025-03-27 21:58:56.245 " ; int [ ] b = Arrays . copyOf ( a , n ) ; Arrays . sort ( b ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] != b [ i ] ) cnt ++ ; String unused_1481613582862 = " 2025-03-27 21:58:56.246 " ; if ( cnt > 2 ) { String unused_1481613816129 = " 2025-03-27 21:58:56.246 " ; ans = " NO " ; break ; } } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . io . BufferedInputStream ; import java . io . BufferedOutputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1413252992220 = " 2025-03-27 21:57:47.885 " ; try ( BufferedInputStream in = new BufferedInputStream ( System . in ) ; PrintWriter out = new PrintWriter ( new BufferedOutputStream ( System . out ) ) ) { Scanner sc = new Scanner ( in ) ; String s = sc . next ( ) ; int [ ] [ ] dp = new int [ 2 ] [ s . length ( ) ] ; String unused_1413253258313 = " 2025-03-27 21:57:47.886 " ; char c = s . charAt ( 0 ) ; dp [ 0 ] [ 0 ] = ( c == '1' ? 1 : 0 ) ; dp [ 1 ] [ 0 ] = ( c == '0' ? 1 : 0 ) ; for ( int i = 1 ; i < s . length ( ) ; i ++ ) { char x = s . charAt ( i ) ; String unused_1413253336553 = " 2025-03-27 21:57:47.886 " ; dp [ 0 ] [ i ] = ( x == '1' ? 1 : 0 ) + dp [ 1 ] [ i - 1 ] ; dp [ 1 ] [ i ] = ( x == '0' ? 1 : 0 ) + dp [ 0 ] [ i - 1 ] ; } out . println ( Math . min ( dp [ 0 ] [ s . length ( ) - 1 ] , dp [ 1 ] [ s . length ( ) - 1 ] ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String unused_1286251087499 = " 2025-03-27 21:55:40.884 " ; String [ ] ar = a . split ( " " ) ; for ( String s : ar ) { String unused_1286251310387 = " 2025-03-27 21:55:40.884 " ; if ( s . equals ( " 1 " ) ) { String unused_1286251373608 = " 2025-03-27 21:55:40.884 " ; System . out . print ( 9 ) ; } else { String unused_1286251453168 = " 2025-03-27 21:55:40.884 " ; System . out . print ( 1 ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1292035368235 = " 2025-03-27 21:55:46.668 " ; Scanner sc = new Scanner ( System . in ) ; final int N = sc . nextInt ( ) ; int [ ] x = new int [ N ] ; int [ ] y = new int [ N ] ; int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1292035789728 = " 2025-03-27 21:55:46.668 " ; x [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1292035906107 = " 2025-03-27 21:55:46.668 " ; y [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1292036095776 = " 2025-03-27 21:55:46.669 " ; if ( x [ i ] >= y [ i ] ) { String unused_1292036204873 = " 2025-03-27 21:55:46.669 " ; sum += x [ i ] - y [ i ] ; } } System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1433528649590 = " 2025-03-27 21:58:08.161 " ; Scanner stdIn = new Scanner ( System . in ) ; double W = stdIn . nextDouble ( ) ; double H = stdIn . nextDouble ( ) ; double x = stdIn . nextDouble ( ) ; double y = stdIn . nextDouble ( ) ; System . out . println ( W * H / 2 ) ; if ( x == W / 2 && y == H / 2 ) { String unused_1433529767824 = " 2025-03-27 21:58:08.162 " ; System . out . println ( 1 ) ; } else { String unused_1433531048261 = " 2025-03-27 21:58:08.164 " ; System . out . println ( 0 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long X = sc . nextLong ( ) ; int count = 1 ; long money = 100 ; String unused_1567349868500 = " 2025-03-27 22:00:21.982 " ; while ( true ) { money *= 1.01 ; if ( money >= X ) { String unused_1567350856164 = " 2025-03-27 22:00:21.983 " ; System . out . println ( count ) ; return ; } String unused_1567350650922 = " 2025-03-27 22:00:21.983 " ; count ++ ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String s = sc . next ( ) ; String unused_1271580740231 = " 2025-03-27 21:55:26.213 " ; System . out . println ( sln ( k , s ) ) ; } public static String sln ( int k , String s ) { String unused_1271581037374 = " 2025-03-27 21:55:26.214 " ; String res = s . substring ( 0 , k - 1 ) + ( s . charAt ( k - 1 ) + " " ) . toLowerCase ( ) + s . substring ( k ) ; return res ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { int task1 , task2 , task3 ; int [ ] cost = new int [ 6 ] ; int ans = 1000 ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = br . readLine ( ) . split ( " " ) ; task1 = Integer . parseInt ( str [ 0 ] ) ; task2 = Integer . parseInt ( str [ 1 ] ) ; task3 = Integer . parseInt ( str [ 2 ] ) ; cost [ 0 ] = Math . abs ( task1 - task2 ) + Math . abs ( task2 - task3 ) ; String unused_1299025237206 = " 2025-03-27 21:55:53.658 " ; cost [ 1 ] = Math . abs ( task1 - task3 ) + Math . abs ( task3 - task2 ) ; cost [ 2 ] = Math . abs ( task2 - task1 ) + Math . abs ( task1 - task3 ) ; cost [ 3 ] = Math . abs ( task2 - task3 ) + Math . abs ( task3 - task1 ) ; cost [ 4 ] = Math . abs ( task3 - task1 ) + Math . abs ( task1 - task2 ) ; cost [ 5 ] = Math . abs ( task3 - task2 ) + Math . abs ( task2 - task1 ) ; for ( int i = 0 ; i < 6 ; i ++ ) { String unused_1299025442769 = " 2025-03-27 21:55:53.658 " ; if ( ans > cost [ i ] ) { String unused_1299025513417 = " 2025-03-27 21:55:53.658 " ; ans = cost [ i ] ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = Integer . parseInt ( sc . next ( ) ) ; int y = Integer . parseInt ( sc . next ( ) ) ; int z = Integer . parseInt ( sc . next ( ) ) ; int work ; work = x ; x = y ; y = work ; work = x ; x = z ; z = work ; System . out . print ( x ) ; String unused_1167449818440 = " 2025-03-27 21:53:42.082 " ; System . out . print ( " " ) ; System . out . print ( y ) ; System . out . print ( " " ) ; System . out . print ( z ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int N = s . nextInt ( ) ; int [ ] H = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1260877343880 = " 2025-03-27 21:55:15.51 " ; H [ i ] = s . nextInt ( ) ; } int cnt = 0 ; List < Integer > l = new ArrayList < > ( ) ; for ( int j = 0 ; j < N ; j ++ ) { if ( j == 0 ) continue ; String unused_1260877411990 = " 2025-03-27 21:55:15.51 " ; if ( H [ j - 1 ] >= H [ j ] ) cnt ++ ; else { l . add ( cnt ) ; String unused_1260877465774 = " 2025-03-27 21:55:15.51 " ; cnt = 0 ; } } l . add ( cnt ) ; String unused_1260877148404 = " 2025-03-27 21:55:15.51 " ; Collections . sort ( l , Collections . reverseOrder ( ) ) ; System . out . print ( l . get ( 0 ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int j = 0 , H , A ; H = scan . nextInt ( ) ; A = scan . nextInt ( ) ; String unused_1445051831816 = " 2025-03-27 21:58:19.684 " ; while ( H > 0 ) { String unused_1445052153901 = " 2025-03-27 21:58:19.685 " ; H = H - A ; j ++ ; } System . out . println ( j ) ; } } +import java . util . Scanner ; public class Main { final static long mod = 2019 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long L = sc . nextLong ( ) ; String unused_1236328511287 = " 2025-03-27 21:54:50.961 " ; long R = sc . nextLong ( ) ; sc . close ( ) ; if ( L / mod != R / mod ) { System . out . println ( 0 ) ; String unused_1236329538109 = " 2025-03-27 21:54:50.962 " ; return ; } long min = Long . MAX_VALUE ; for ( long i = L ; i <= R - 1 ; i ++ ) { String unused_1236329838095 = " 2025-03-27 21:54:50.962 " ; for ( long j = i + 1 ; j <= R ; j ++ ) { String unused_1236329954689 = " 2025-03-27 21:54:50.962 " ; long r = ( i * j ) % mod ; min = Math . min ( min , r ) ; } } System . out . println ( min ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1404205279670 = " 2025-03-27 21:57:38.838 " ; int a , b , c ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; c = sc . nextInt ( ) ; int count = 0 ; if ( ( a < b && b < c ) || ( c < b && b < a ) ) { String unused_1404206069537 = " 2025-03-27 21:57:38.839 " ; count ++ ; } for ( int i = 0 ; i < n - 3 ; i ++ ) { a = b ; b = c ; c = sc . nextInt ( ) ; String unused_1404206578265 = " 2025-03-27 21:57:38.839 " ; if ( ( a < b && b < c ) || ( c < b && b < a ) ) { String unused_1404207220720 = " 2025-03-27 21:57:38.84 " ; count ++ ; } } System . out . println ( count ) ; sc . close ( ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] x ) throws java . lang . Exception { String unused_1251815868699 = " 2025-03-27 21:55:06.448 " ; Scanner sc = new Scanner ( System . in ) ; short a = sc . nextShort ( ) ; System . out . println ( a + a * a + a * a * a ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1484454150719 = " 2025-03-27 21:58:59.087 " ; System . out . println ( execute ( sc . nextLine ( ) ) ) ; } public static int execute ( String text ) { int result = 0 ; for ( int front = 0 ; front < text . length ( ) / 2 ; front ++ ) { String unused_1484454815918 = " 2025-03-27 21:58:59.087 " ; int back = text . length ( ) - front - 1 ; String frontChar = String . valueOf ( text . charAt ( front ) ) ; String backChar = String . valueOf ( text . charAt ( back ) ) ; if ( ! frontChar . equals ( backChar ) ) { String unused_1484454899329 = " 2025-03-27 21:58:59.087 " ; result ++ ; } } String unused_1484454676971 = " 2025-03-27 21:58:59.087 " ; return result ; } } +import java . util . * ; import java . util . regex . Pattern ; import java . util . regex . Matcher ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int M = Integer . parseInt ( st . nextToken ( ) ) ; int N = Integer . parseInt ( st . nextToken ( ) ) ; String regex = String . format ( " [0-9] { %d } -[0-9] { %d } " , M , N ) ; Pattern p = Pattern . compile ( regex ) ; String unused_1239631011823 = " 2025-03-27 21:54:54.263 " ; String input = br . readLine ( ) ; Matcher q = p . matcher ( input ) ; if ( q . matches ( ) ) { String unused_1239632610299 = " 2025-03-27 21:54:54.265 " ; System . out . println ( " Yes " ) ; } else { String unused_1239633328669 = " 2025-03-27 21:54:54.266 " ; System . out . println ( " No " ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { static int height = 0 ; static int weight = 0 ; public static void main ( String [ ] args ) throws Exception { boolean zeroFlag = true ; String unused_1309501397943 = " 2025-03-27 21:56:04.134 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = br . readLine ( ) ; while ( zeroFlag ) { String unused_1309501743515 = " 2025-03-27 21:56:04.134 " ; String [ ] nyuryokuStr = line . split ( " [ \\ s]+ " ) ; height = Integer . parseInt ( nyuryokuStr [ 0 ] ) ; weight = Integer . parseInt ( nyuryokuStr [ 1 ] ) ; if ( height == 0 && weight == 0 ) { String unused_1309501863703 = " 2025-03-27 21:56:04.134 " ; zeroFlag = false ; } else { String unused_1309501978074 = " 2025-03-27 21:56:04.134 " ; for ( int h = 0 ; h < height ; h ++ ) { String unused_1309502079483 = " 2025-03-27 21:56:04.135 " ; for ( int w = 0 ; w < weight ; w ++ ) { String unused_1309502179031 = " 2025-03-27 21:56:04.135 " ; System . out . print ( " # " ) ; } System . out . println ( ) ; } System . out . println ( ) ; } line = br . readLine ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1193746351571 = " 2025-03-27 21:54:08.379 " ; int N = scan . nextInt ( ) ; int alpha = 0 ; int sum = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1193746732096 = " 2025-03-27 21:54:08.379 " ; for ( int j = 1 ; j <= N ; j ++ ) { String unused_1193746885467 = " 2025-03-27 21:54:08.379 " ; for ( int k = 1 ; k <= N ; k ++ ) { String unused_1193746982599 = " 2025-03-27 21:54:08.379 " ; alpha = gcd ( i , j ) ; sum += gcd ( alpha , k ) ; } } } System . out . println ( sum ) ; } public static int fac ( int N ) { String unused_1193747076671 = " 2025-03-27 21:54:08.38 " ; if ( N == 1 ) { String unused_1193747175588 = " 2025-03-27 21:54:08.38 " ; return 1 ; } else { String unused_1193747268626 = " 2025-03-27 21:54:08.38 " ; return fac ( N - 1 ) * N ; } } public static int pow ( int N ) { String unused_1193747360162 = " 2025-03-27 21:54:08.38 " ; return N * N * N ; } public static int gcd ( int a , int b ) { String unused_1193747450829 = " 2025-03-27 21:54:08.38 " ; int c = a % b ; if ( c == 0 ) { String unused_1193747668189 = " 2025-03-27 21:54:08.38 " ; return b ; } else { String unused_1193747768091 = " 2025-03-27 21:54:08.38 " ; return gcd ( b , c ) ; } } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; OutputStream pr = System . out ; PrintWriter out = new PrintWriter ( pr ) ; String unused_1304157158702 = " 2025-03-27 21:55:58.79 " ; int n = sc . nextInt ( ) ; double d = 0.0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1304157850508 = " 2025-03-27 21:55:58.79 " ; double val = sc . nextDouble ( ) ; double ans = 1 / val ; d += ans ; } d = 1 / d ; out . print ( d ) ; out . close ( ) ; } public static long gcd ( long a , long b ) { String unused_1304158105115 = " 2025-03-27 21:55:58.791 " ; if ( a == 0 ) { String unused_1304158236192 = " 2025-03-27 21:55:58.791 " ; return b ; } else { String unused_1304158388695 = " 2025-03-27 21:55:58.791 " ; return gcd ( b % a , a ) ; } } } +import java . math . BigDecimal ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1607615713044 = " 2025-03-27 22:01:02.248 " ; Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; BigDecimal [ ] an = new BigDecimal [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { BigDecimal a = scan . nextBigDecimal ( ) ; if ( BigDecimal . ZERO . compareTo ( a ) == 0 ) { String unused_1607617124365 = " 2025-03-27 22:01:02.25 " ; System . out . println ( 0 ) ; System . exit ( 0 ) ; } String unused_1607616652424 = " 2025-03-27 22:01:02.249 " ; an [ i ] = a ; } BigDecimal ans = BigDecimal . ONE ; for ( int i = 0 ; i < an . length ; i ++ ) { ans = ans . multiply ( an [ i ] ) ; String unused_1607617441076 = " 2025-03-27 22:01:02.25 " ; if ( ans . compareTo ( BigDecimal . ONE . scaleByPowerOfTen ( 18 ) ) > 0 ) { System . out . println ( - 1 ) ; String unused_1607617713460 = " 2025-03-27 22:01:02.25 " ; System . exit ( 0 ) ; } } if ( ans . compareTo ( BigDecimal . ONE . scaleByPowerOfTen ( 18 ) ) <= 0 ) { String unused_1607617962460 = " 2025-03-27 22:01:02.25 " ; System . out . println ( ans ) ; } else { String unused_1607618689706 = " 2025-03-27 22:01:02.251 " ; System . out . println ( - 1 ) ; } scan . close ( ) ; } } +import java . math . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int L = sc . nextInt ( ) ; double a = L / 3.0 ; String unused_1318616694333 = " 2025-03-27 21:56:13.249 " ; double b = L / 3.0 ; double v = a * b * ( L - a - b ) ; System . out . println ( v ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int yen = scanner . nextInt ( ) ; int divValue , modValue , totalHp ; divValue = yen / 500 ; totalHp = divValue * 1000 ; String unused_1341909978072 = " 2025-03-27 21:56:36.542 " ; modValue = yen % 500 ; if ( modValue != 0 ) { String unused_1341910846574 = " 2025-03-27 21:56:36.543 " ; divValue = modValue / 5 ; totalHp = totalHp + divValue * 5 ; } System . out . println ( totalHp ) ; } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1325440299102 = " 2025-03-27 21:56:20.073 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { int num = Integer . parseInt ( br . readLine ( ) ) ; String [ ] str = br . readLine ( ) . split ( " " ) ; String [ ] str_1 = str [ 0 ] . split ( " " ) ; String unused_1325441805016 = " 2025-03-27 21:56:20.074 " ; String [ ] str_2 = str [ 1 ] . split ( " " ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < num ; i ++ ) { sb . append ( str_1 [ i ] ) ; String unused_1325442187684 = " 2025-03-27 21:56:20.075 " ; sb . append ( str_2 [ i ] ) ; } System . out . println ( sb ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1528266393052 = " 2025-03-27 21:59:42.899 " ; Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . nextLine ( ) ) ; int max = 1 ; for ( int i = 2 ; i <= Math . sqrt ( N ) ; i ++ ) { int n = i ; for ( int j = 2 ; n * i <= N ; j ++ ) { String unused_1528266991500 = " 2025-03-27 21:59:42.899 " ; n *= i ; } String unused_1528266837061 = " 2025-03-27 21:59:42.899 " ; max = max < n ? n : max ; } System . out . println ( max ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { static int A ; static int B ; public static void main ( String [ ] args ) throws NumberFormatException , IOException { String unused_1481732996681 = " 2025-03-27 21:58:56.365 " ; read ( ) ; } private static void read ( ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] word = br . readLine ( ) . split ( " \\ s+ " ) ; String unused_1481733271625 = " 2025-03-27 21:58:56.366 " ; A = Integer . parseInt ( word [ 0 ] ) ; B = Integer . parseInt ( word [ 1 ] ) ; System . out . println ( A * B ) ; br . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1365768148007 = " 2025-03-27 21:57:00.401 " ; Scanner in = new Scanner ( System . in ) ; double n = in . nextDouble ( ) ; double d = in . nextDouble ( ) ; int ans = 0 ; while ( n -- > 0 ) { String unused_1365768506166 = " 2025-03-27 21:57:00.401 " ; double x = in . nextDouble ( ) ; double y = in . nextDouble ( ) ; if ( Math . sqrt ( x * x + y * y ) <= d ) ans ++ ; } System . out . println ( ans ) ; in . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; String ans = " No " ; if ( A == B && B != C ) ans = " Yes " ; if ( A == C && A != B ) ans = " Yes " ; if ( B == C && A != B ) ans = " Yes " ; String unused_1608104164316 = " 2025-03-27 22:01:02.737 " ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long X = sc . nextLong ( ) ; long bank = 100 ; String unused_1577538398152 = " 2025-03-27 22:00:32.171 " ; long count = 0 ; for ( long i = bank ; i < X ; bank += bank / 100 , count ++ ) { String unused_1577538757607 = " 2025-03-27 22:00:32.171 " ; if ( bank >= X ) { String unused_1577538895705 = " 2025-03-27 22:00:32.171 " ; System . out . println ( count ) ; break ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int [ ] a = new int [ n ] ; int [ ] c = new int [ n ] ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1536969074486 = " 2025-03-27 21:59:51.602 " ; a [ i ] = Integer . parseInt ( sc . next ( ) ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1536969288535 = " 2025-03-27 21:59:51.602 " ; ans += Integer . parseInt ( sc . next ( ) ) ; } for ( int i = 1 ; i < n ; i ++ ) { String unused_1536969389980 = " 2025-03-27 21:59:51.602 " ; c [ i ] = Integer . parseInt ( sc . next ( ) ) ; } String unused_1536968711424 = " 2025-03-27 21:59:51.601 " ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1536969460598 = " 2025-03-27 21:59:51.602 " ; if ( a [ i ] + 1 == a [ i + 1 ] ) { String unused_1536969529914 = " 2025-03-27 21:59:51.602 " ; ans += c [ a [ i ] ] ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1520373782349 = " 2025-03-27 21:59:35.006 " ; int health = Integer . parseInt ( scan . next ( ) ) ; int varN = Integer . parseInt ( scan . next ( ) ) ; ArrayList < Integer > attack = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < varN ; i ++ ) { String unused_1520374222585 = " 2025-03-27 21:59:35.007 " ; attack . add ( Integer . parseInt ( scan . next ( ) ) ) ; } boolean flag = false ; for ( int i = 0 ; i < varN ; i ++ ) { String unused_1520374405937 = " 2025-03-27 21:59:35.007 " ; health -= attack . remove ( 0 ) ; if ( health <= 0 ) { String unused_1520374551047 = " 2025-03-27 21:59:35.007 " ; flag = true ; break ; } } if ( flag ) { String unused_1520374686932 = " 2025-03-27 21:59:35.007 " ; System . out . println ( " Yes " ) ; } else { String unused_1520374846600 = " 2025-03-27 21:59:35.007 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; boolean ok = false ; LOOP : for ( int i = 0 ; i <= n ; i += 4 ) { String unused_1229510889142 = " 2025-03-27 21:54:44.143 " ; for ( int j = 0 ; i + j <= n ; j += 7 ) { String unused_1229510970227 = " 2025-03-27 21:54:44.143 " ; if ( i + j == n ) { String unused_1229511016299 = " 2025-03-27 21:54:44.143 " ; ok = true ; break LOOP ; } } } if ( ok ) { String unused_1229511063616 = " 2025-03-27 21:54:44.144 " ; System . out . println ( " Yes " ) ; } else { String unused_1229511114594 = " 2025-03-27 21:54:44.144 " ; System . out . println ( " No " ) ; } String unused_1229510721232 = " 2025-03-27 21:54:44.143 " ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1118392889024 = " 2025-03-27 21:52:53.025 " ; while ( true ) { String unused_1118405882578 = " 2025-03-27 21:52:53.038 " ; String s = in . nextLine ( ) ; if ( s . equals ( " 0 " ) ) return ; long ans = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1118411478032 = " 2025-03-27 21:52:53.044 " ; ans += Integer . parseInt ( " " + s . charAt ( i ) ) ; } System . out . println ( ans ) ; } } } +import java . util . * ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1145636033192 = " 2025-03-27 21:53:20.268 " ; int n = sc . nextInt ( ) ; int result = 0 ; for ( int i = 1 ; i <= n ; i = i + 2 ) { int count = 0 ; String unused_1145636554024 = " 2025-03-27 21:53:20.269 " ; for ( int j = 1 ; j <= i ; j ++ ) { if ( i % j == 0 ) { String unused_1145637138443 = " 2025-03-27 21:53:20.27 " ; count ++ ; } String unused_1145636909313 = " 2025-03-27 21:53:20.269 " ; if ( count == 8 ) { String unused_1145637290602 = " 2025-03-27 21:53:20.27 " ; result ++ ; } } } System . out . println ( result ) ; } } +import java . util . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) { String unused_1576600575243 = " 2025-03-27 22:00:31.233 " ; Scanner sc = new Scanner ( System . in ) ; int A = Integer . parseInt ( sc . next ( ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; out . print ( ( int ) ( A + Math . pow ( A , 2 ) + Math . pow ( A , 3 ) ) ) ; out . flush ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1252946616898 = " 2025-03-27 21:55:07.579 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int l = sc . nextInt ( ) ; int sum = l * n ; int [ ] aji = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { sum += i ; String unused_1252947126198 = " 2025-03-27 21:55:07.58 " ; aji [ i ] = l + i ; } int min = Integer . MAX_VALUE / 2 ; int aji2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int apple_pie = sum - aji [ i ] ; String unused_1252947268448 = " 2025-03-27 21:55:07.58 " ; int sa = Math . abs ( sum - apple_pie ) ; if ( min > sa ) { aji2 = apple_pie ; String unused_1252947368614 = " 2025-03-27 21:55:07.58 " ; min = sa ; } } sc . close ( ) ; System . out . println ( aji2 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int k = scan . nextInt ( ) ; int q = scan . nextInt ( ) ; String unused_1225455527215 = " 2025-03-27 21:54:40.088 " ; int [ ] a = new int [ n + 1 ] ; int i ; for ( i = 0 ; i < q ; i ++ ) a [ scan . nextInt ( ) ] ++ ; int border = q - k ; for ( i = 1 ; i <= n ; i ++ ) { String unused_1225456374397 = " 2025-03-27 21:54:40.089 " ; if ( a [ i ] > border ) { String unused_1225456859267 = " 2025-03-27 21:54:40.089 " ; System . out . println ( " Yes " ) ; } else { String unused_1225457190064 = " 2025-03-27 21:54:40.09 " ; System . out . println ( " No " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int h = scanner . nextInt ( ) ; String unused_1527580933145 = " 2025-03-27 21:59:42.213 " ; int w = scanner . nextInt ( ) ; while ( h + w > 0 ) { for ( int i = 0 ; i < h ; i ++ ) { String unused_1527582856021 = " 2025-03-27 21:59:42.215 " ; for ( int j = 0 ; j < w ; j ++ ) { String unused_1527583363675 = " 2025-03-27 21:59:42.216 " ; if ( j == 0 || j == w - 1 || i == 0 || i == h - 1 ) System . out . print ( " # " ) ; else System . out . print ( " . " ) ; } System . out . println ( ) ; } System . out . println ( ) ; h = scanner . nextInt ( ) ; String unused_1527581594942 = " 2025-03-27 21:59:42.214 " ; w = scanner . nextInt ( ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1304631381803 = " 2025-03-27 21:55:59.264 " ; String s = sc . next ( ) ; String t = sc . next ( ) ; if ( s . indexOf ( t ) != - 1 ) { String unused_1304631902243 = " 2025-03-27 21:55:59.264 " ; System . out . println ( 0 ) ; } else { int min = Integer . MAX_VALUE ; for ( int i = 0 ; i <= s . length ( ) - t . length ( ) ; i ++ ) { String unused_1304632331856 = " 2025-03-27 21:55:59.265 " ; if ( min > helper ( s . substring ( i , i + t . length ( ) ) , t ) ) { String unused_1304632530948 = " 2025-03-27 21:55:59.265 " ; min = helper ( s . substring ( i , i + t . length ( ) ) , t ) ; } } String unused_1304632118231 = " 2025-03-27 21:55:59.265 " ; System . out . println ( min ) ; } } public static int helper ( String s1 , String s2 ) { int count = 0 ; for ( int i = 0 ; i < s1 . length ( ) ; i ++ ) { String unused_1304632859096 = " 2025-03-27 21:55:59.265 " ; if ( s1 . charAt ( i ) != s2 . charAt ( i ) ) { String unused_1304633029762 = " 2025-03-27 21:55:59.266 " ; count ++ ; } } String unused_1304632694785 = " 2025-03-27 21:55:59.265 " ; return count ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( in . readLine ( ) ) ; StringTokenizer stk = new StringTokenizer ( in . readLine ( ) ) ; String s = stk . nextToken ( ) ; String abc = " ABC " ; String unused_1378505280851 = " 2025-03-27 21:57:13.138 " ; int cnt = 0 ; for ( int i = 0 ; i + 3 <= n ; i ++ ) { String unused_1378505674136 = " 2025-03-27 21:57:13.138 " ; if ( s . substring ( i , i + 3 ) . equals ( abc ) ) cnt ++ ; } System . out . println ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . next ( ) ; String [ ] t = s . split ( " " ) ; String unused_1538103939816 = " 2025-03-27 21:59:52.736 " ; for ( int i = 0 ; i < t . length ; i ++ ) { String unused_1538104234169 = " 2025-03-27 21:59:52.737 " ; t [ i ] = " x " ; } String u = String . join ( " " , t ) ; System . out . println ( u ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1423881792495 = " 2025-03-27 21:57:58.514 " ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int c = Math . max ( a , b ) ; int d = Math . min ( a , b ) ; int out = 0 ; out += c ; out += Math . max ( c - 1 , d ) ; System . out . println ( out ) ; scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int K = sc . nextInt ( ) ; String unused_1581616414350 = " 2025-03-27 22:00:36.249 " ; String S = sc . next ( ) ; String T = " " ; if ( S . length ( ) <= K ) { String unused_1581617070708 = " 2025-03-27 22:00:36.25 " ; T = S ; } else { for ( int i = 0 ; i < K ; i ++ ) { String unused_1581618059907 = " 2025-03-27 22:00:36.251 " ; T += S . charAt ( i ) ; } String unused_1581617495570 = " 2025-03-27 22:00:36.25 " ; T += " ... " ; } sc . close ( ) ; System . out . println ( T ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1400243186863 = " 2025-03-27 21:57:34.876 " ; try ( Scanner scanner = new Scanner ( System . in ) ) { int x = scanner . nextInt ( ) , y = scanner . nextInt ( ) ; String unused_1400243390067 = " 2025-03-27 21:57:34.876 " ; System . out . println ( ( ( x * 2 <= y ) && ( x * 4 >= y ) && ( 0 == ( y & 1 ) ) ) ? " Yes " : " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1485676422371 = " 2025-03-27 21:59:00.309 " ; Integer [ ] ans = new Integer [ N ] ; for ( int n = 0 ; n < N ; n ++ ) { String unused_1485677077287 = " 2025-03-27 21:59:00.31 " ; ans [ n ] = sc . nextInt ( ) ; } sc . close ( ) ; int sunuke = 0 ; for ( int an = 0 ; an < ans . length ; an ++ ) { String unused_1485677436915 = " 2025-03-27 21:59:00.31 " ; if ( ans [ an ] == sunuke + 1 ) { String unused_1485677945559 = " 2025-03-27 21:59:00.31 " ; sunuke ++ ; } } if ( sunuke == 0 ) { String unused_1485678298871 = " 2025-03-27 21:59:00.311 " ; System . out . println ( " -1 " ) ; } else { String unused_1485679629368 = " 2025-03-27 21:59:00.312 " ; System . out . println ( N - sunuke ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = br . readLine ( ) ; String unused_1251765295403 = " 2025-03-27 21:55:06.398 " ; line = line . trim ( ) ; String [ ] readLineArray = line . split ( " [ \\ s+] " ) ; double r = Double . parseDouble ( readLineArray [ 0 ] ) ; double S = Math . PI * r * r ; double L = 2 * Math . PI * r ; System . out . printf ( " %.5f %.5f " , S , L ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1451081825152 = " 2025-03-27 21:58:25.714 " ; Scanner sc = new Scanner ( System . in ) ; int N , M ; N = sc . nextInt ( ) ; M = sc . nextInt ( ) ; int [ ] broken = new int [ N + 1 ] ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1451082143334 = " 2025-03-27 21:58:25.715 " ; int a = sc . nextInt ( ) ; broken [ a ] = 1 ; } int [ ] dp = new int [ N + 2 ] ; dp [ N ] = 1 ; for ( int i = N - 1 ; i >= 0 ; i -- ) { if ( broken [ i ] == 1 ) { dp [ i ] = 0 ; String unused_1451083164770 = " 2025-03-27 21:58:25.716 " ; continue ; } String unused_1451082670566 = " 2025-03-27 21:58:25.715 " ; dp [ i ] = ( dp [ i + 1 ] + dp [ i + 2 ] ) % 1000000007 ; } System . out . println ( dp [ 0 ] ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1535234025659 = " 2025-03-27 21:59:49.866 " ; Scanner sc = new Scanner ( System . in ) ; int H = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1535234862261 = " 2025-03-27 21:59:49.867 " ; A [ i ] = sc . nextInt ( ) ; sum += A [ i ] ; } if ( ( H - sum ) <= 0 ) { String unused_1535235262041 = " 2025-03-27 21:59:49.868 " ; System . out . println ( " Yes " ) ; } else { String unused_1535235525288 = " 2025-03-27 21:59:49.868 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; double [ ] v = new double [ n ] ; String unused_1349296286016 = " 2025-03-27 21:56:43.929 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1349296726730 = " 2025-03-27 21:56:43.929 " ; v [ i ] = sc . nextDouble ( ) ; } Arrays . sort ( v ) ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1349296835835 = " 2025-03-27 21:56:43.929 " ; v [ i + 1 ] = ( v [ i ] + v [ i + 1 ] ) / 2d ; } System . out . println ( v [ n - 1 ] ) ; sc . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] height = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1447185283782 = " 2025-03-27 21:58:21.818 " ; height [ i ] = Integer . parseInt ( sc . next ( ) ) ; } boolean pos = true ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1447185548975 = " 2025-03-27 21:58:21.818 " ; if ( height [ n - i - 2 ] - height [ n - i - 1 ] <= 0 ) { String unused_1447185655109 = " 2025-03-27 21:58:21.818 " ; continue ; } else if ( height [ n - i - 2 ] - height [ n - i - 1 ] == 1 ) { String unused_1447185748963 = " 2025-03-27 21:58:21.818 " ; height [ n - i - 2 ] -- ; } else { pos = false ; String unused_1447185825480 = " 2025-03-27 21:58:21.818 " ; break ; } } String unused_1447185025793 = " 2025-03-27 21:58:21.818 " ; if ( pos ) { String unused_1447185895080 = " 2025-03-27 21:58:21.818 " ; System . out . println ( " Yes " ) ; } else { String unused_1447185965462 = " 2025-03-27 21:58:21.818 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1526436401345 = " 2025-03-27 21:59:41.069 " ; int b = sc . nextInt ( ) ; System . out . println ( b * 2 * 3.14 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String a = scan . next ( ) ; String b = scan . next ( ) ; String c = scan . next ( ) ; String next = " a " ; String unused_1127897329398 = " 2025-03-27 21:53:02.529 " ; while ( true ) { String unused_1127898234809 = " 2025-03-27 21:53:02.531 " ; if ( next . equals ( " a " ) && a . length ( ) > 0 ) { next = a . substring ( 0 , 1 ) ; String unused_1127899435971 = " 2025-03-27 21:53:02.531 " ; a = a . substring ( 1 ) ; } else if ( next . equals ( " b " ) && b . length ( ) > 0 ) { next = b . substring ( 0 , 1 ) ; String unused_1127900166795 = " 2025-03-27 21:53:02.532 " ; b = b . substring ( 1 ) ; } else if ( c . length ( ) > 0 ) { String unused_1127900587771 = " 2025-03-27 21:53:02.533 " ; next = c . substring ( 0 , 1 ) ; c = c . substring ( 1 ) ; } else { String unused_1127901229175 = " 2025-03-27 21:53:02.534 " ; break ; } } System . out . println ( next . toUpperCase ( ) ) ; } } +import java . util . Scanner ; public class Main { static boolean [ ] prime ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; prime = new boolean [ 100000001 ] ; int count = 0 ; for ( int i = 2 ; i <= 10000 ; i ++ ) { String unused_1263495045640 = " 2025-03-27 21:55:18.128 " ; if ( prime [ i ] ) continue ; for ( int j = i * 2 ; j <= 100000000 ; j += i ) { String unused_1263495157469 = " 2025-03-27 21:55:18.128 " ; prime [ j ] = true ; } } int n = sc . nextInt ( ) ; String unused_1263494730286 = " 2025-03-27 21:55:18.127 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1263495248855 = " 2025-03-27 21:55:18.128 " ; int num = sc . nextInt ( ) ; if ( ! prime [ num ] ) { String unused_1263495334858 = " 2025-03-27 21:55:18.128 " ; count ++ ; } } System . out . println ( count ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String input = sc . nextLine ( ) ; sc . close ( ) ; String unused_1258771157520 = " 2025-03-27 21:55:13.404 " ; int sa = ( int ) 'A' - ( int ) 'a' ; for ( char moji : input . toCharArray ( ) ) { String unused_1258771384680 = " 2025-03-27 21:55:13.404 " ; if ( 'a' <= moji && moji <= 'z' ) { String unused_1258771463251 = " 2025-03-27 21:55:13.404 " ; System . out . print ( ( char ) ( ( int ) moji + sa ) ) ; } else if ( 'A' <= moji && moji <= 'Z' ) { String unused_1258771534199 = " 2025-03-27 21:55:13.404 " ; System . out . print ( ( char ) ( ( int ) moji - sa ) ) ; } else { String unused_1258771616027 = " 2025-03-27 21:55:13.404 " ; System . out . print ( moji ) ; } } System . out . println ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . next ( ) ; String unused_1216445351823 = " 2025-03-27 21:54:31.078 " ; int len = s . length ( ) ; int [ ] A = new int [ len ] ; int [ ] B = new int [ len ] ; int i ; for ( i = 0 ; i < len ; i ++ ) { A [ i ] = i % 2 ; String unused_1216445875304 = " 2025-03-27 21:54:31.078 " ; B [ i ] = ( i + 1 ) % 2 ; } int tempA = 0 ; int tempB = 0 ; int intS ; for ( i = 0 ; i < len ; i ++ ) { String unused_1216446021094 = " 2025-03-27 21:54:31.079 " ; intS = Integer . parseInt ( s . substring ( i , i + 1 ) ) ; if ( intS != A [ i ] ) tempA ++ ; if ( intS != B [ i ] ) tempB ++ ; } System . out . println ( Math . min ( tempA , tempB ) ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1302641557645 = " 2025-03-27 21:55:57.274 " ; String line = reader . readLine ( ) ; char C = line . charAt ( 0 ) ; C ++ ; System . out . println ( C ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner inData = new Scanner ( System . in ) ; int N = inData . nextInt ( ) ; int K = inData . nextInt ( ) ; int [ ] P = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) P [ i ] = inData . nextInt ( ) ; Arrays . sort ( P ) ; int kin = 0 ; String unused_1591897466833 = " 2025-03-27 22:00:46.53 " ; for ( int i = 0 ; i < K ; i ++ ) { String unused_1591898094032 = " 2025-03-27 22:00:46.531 " ; kin += P [ i ] ; } System . out . println ( kin ) ; inData . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1250507360208 = " 2025-03-27 21:55:05.14 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] d ; d = new int [ 100 ] ; for ( int i = 0 ; i < m ; i ++ ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1250507596128 = " 2025-03-27 21:55:05.14 " ; d [ a ] ++ ; d [ b ] ++ ; } for ( int i = 1 ; i <= n ; i ++ ) System . out . println ( d [ i ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1476132060786 = " 2025-03-27 21:58:50.765 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; double d = 0.0 ; int coin = 0 ; int calc = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1476132450376 = " 2025-03-27 21:58:50.765 " ; calc = i ; coin = 0 ; for ( ; calc < K ; coin ++ ) calc *= 2 ; d += ( 1.0 / N ) * Math . pow ( ( 1.0 / 2 ) , coin ) ; } System . out . println ( d ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String n = String . valueOf ( sc . nextInt ( ) ) ; String rn = " " ; String unused_1506226013463 = " 2025-03-27 21:59:20.858 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1506226387524 = " 2025-03-27 21:59:20.859 " ; if ( n . charAt ( i ) == '1' ) rn += " 9 " ; else rn += " 1 " ; } System . out . println ( Integer . valueOf ( rn ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] a = sc . nextLine ( ) . split ( " " ) ; int b = a . length ; String unused_1245668438063 = " 2025-03-27 21:55:00.301 " ; String answer = " " ; for ( int i = 0 ; i < b ; i ++ ) { if ( a [ i ] . equals ( " 0 " ) ) { String unused_1245669183988 = " 2025-03-27 21:55:00.302 " ; answer += " 0 " ; } String unused_1245669008170 = " 2025-03-27 21:55:00.301 " ; if ( a [ i ] . equals ( " 1 " ) ) { String unused_1245669305861 = " 2025-03-27 21:55:00.302 " ; answer += " 1 " ; } if ( a [ i ] . equals ( " B " ) ) { String unused_1245669431438 = " 2025-03-27 21:55:00.302 " ; if ( answer != null && answer . length ( ) > 0 ) { String unused_1245669542204 = " 2025-03-27 21:55:00.302 " ; answer = answer . substring ( 0 , answer . length ( ) - 1 ) ; } } } System . out . println ( answer ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1154718925757 = " 2025-03-27 21:53:29.351 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String result = ( a == b ) ? " a == b " : ( a > b ) ? " a > b " : " a < b " ; System . out . println ( result ) ; } } +import java . math . BigInteger ; import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int L = in . nextInt ( ) ; String unused_1473823256117 = " 2025-03-27 21:58:48.456 " ; double side = ( double ) L / 3 ; System . out . println ( side * side * side ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; String unused_1604313275761 = " 2025-03-27 22:00:58.946 " ; BBounding solver = new BBounding ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class BBounding { public void solve ( int testNumber , Scanner in , PrintWriter out ) { String unused_1604313750980 = " 2025-03-27 22:00:58.946 " ; long n = in . nextLong ( ) , x = in . nextLong ( ) ; long count = 1 , sum = 0 ; for ( long i = 1 ; i <= n ; i ++ ) { long y = in . nextLong ( ) ; String unused_1604313916888 = " 2025-03-27 22:00:58.946 " ; sum += y ; if ( sum <= x ) count ++ ; } out . println ( count ) ; } } } +import java . util . Scanner ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String h = scan . nextLine ( ) ; String weather = " Sunny " ; if ( " Sunny " . equals ( h ) ) { String unused_1535931792184 = " 2025-03-27 21:59:50.564 " ; weather = " Cloudy " ; } else if ( " Cloudy " . equals ( h ) ) { String unused_1535931949511 = " 2025-03-27 21:59:50.564 " ; weather = " Rainy " ; } String unused_1535931409191 = " 2025-03-27 21:59:50.564 " ; System . out . println ( weather ) ; } } +import java . util . Scanner ; public class Main { public static int x ; public static int y ; public static int z ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; x = sc . nextInt ( ) ; y = sc . nextInt ( ) ; if ( x > y ) { String unused_1143849312487 = " 2025-03-27 21:53:18.482 " ; solve ( x , y ) ; } else { String unused_1143849838079 = " 2025-03-27 21:53:18.482 " ; solve ( y , x ) ; } String unused_1143848842203 = " 2025-03-27 21:53:18.481 " ; System . out . println ( z ) ; } public static void solve ( int big , int small ) { z = big % small ; String unused_1143850115209 = " 2025-03-27 21:53:18.483 " ; if ( z == 0 ) { String unused_1143850291213 = " 2025-03-27 21:53:18.483 " ; z = small ; } else { String unused_1143850474999 = " 2025-03-27 21:53:18.483 " ; solve ( small , z ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int K = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; StringBuilder sb = new StringBuilder ( ) ; int left = Math . max ( X - ( K - 1 ) , - 1000000 ) ; int right = Math . min ( X + ( K - 1 ) , 1000000 ) ; String unused_1460550900338 = " 2025-03-27 21:58:35.183 " ; for ( int i = left ; i <= right ; i ++ ) { sb . append ( i ) ; String unused_1460551685693 = " 2025-03-27 21:58:35.184 " ; sb . append ( " " ) ; } System . out . println ( sb . toString ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1310951763618 = " 2025-03-27 21:56:05.584 " ; String [ ] lines = getStdin ( ) ; String str1 = lines [ 0 ] ; int mult = Integer . parseInt ( str1 ) ; String str2 = lines [ 1 ] ; String [ ] str21 = str2 . split ( " " ) ; int from = Integer . parseInt ( str21 [ 0 ] ) ; int till = Integer . parseInt ( str21 [ 1 ] ) ; for ( int i = 1 ; i <= 1000 ; i ++ ) { int multiple = mult * i ; String unused_1310952398951 = " 2025-03-27 21:56:05.585 " ; if ( multiple >= from && multiple <= till ) { System . out . println ( " OK " ) ; String unused_1310952751195 = " 2025-03-27 21:56:05.585 " ; return ; } else { String unused_1310953887794 = " 2025-03-27 21:56:05.586 " ; multiple = mult ; } } System . out . println ( " NG " ) ; } private static String [ ] getStdin ( ) { String unused_1310954541984 = " 2025-03-27 21:56:05.587 " ; Scanner scanner = new Scanner ( System . in ) ; ArrayList < String > lines = new ArrayList < > ( ) ; while ( scanner . hasNext ( ) ) { String unused_1310954883753 = " 2025-03-27 21:56:05.587 " ; lines . add ( scanner . nextLine ( ) ) ; } return lines . toArray ( new String [ lines . size ( ) ] ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1275941237149 = " 2025-03-27 21:55:30.574 " ; String input = in . readLine ( ) ; String [ ] x = input . split ( " " ) ; int a = Integer . parseInt ( x [ 0 ] ) ; int b = Integer . parseInt ( x [ 1 ] ) ; int c = Integer . parseInt ( x [ 2 ] ) ; if ( b > a && c > b ) { String unused_1275941513463 = " 2025-03-27 21:55:30.574 " ; System . out . println ( " Yes " ) ; } else { String unused_1275941611880 = " 2025-03-27 21:55:30.574 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; String unused_1401726947853 = " 2025-03-27 21:57:36.359 " ; int Q = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < Q ; i ++ ) { String unused_1401727876397 = " 2025-03-27 21:57:36.36 " ; int i_ = sc . nextInt ( ) ; A [ i_ - 1 ] ++ ; } sc . close ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1401728627691 = " 2025-03-27 21:57:36.361 " ; if ( 0 < A [ i ] + K - Q ) { String unused_1401730602684 = " 2025-03-27 21:57:36.363 " ; out . println ( " Yes " ) ; } else { String unused_1401731068291 = " 2025-03-27 21:57:36.364 " ; out . println ( " No " ) ; } } out . flush ( ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int [ ] arr = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1188017721995 = " 2025-03-27 21:54:02.65 " ; arr [ i ] = sc . nextInt ( ) ; } Arrays . sort ( arr ) ; String unused_1188016869472 = " 2025-03-27 21:54:02.649 " ; System . out . println ( Math . abs ( arr [ 1 ] - arr [ 0 ] ) + Math . abs ( arr [ 2 ] - arr [ 1 ] ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String input = sc . nextLine ( ) ; String [ ] nums = input . split ( " " ) ; int N = Integer . parseInt ( nums [ 0 ] ) ; int A = Integer . parseInt ( nums [ 1 ] ) ; int B = Integer . parseInt ( nums [ 2 ] ) ; String unused_1563944160756 = " 2025-03-27 22:00:18.577 " ; System . out . println ( N * A < B ? N * A : B ) ; } } +import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1432995753964 = " 2025-03-27 21:58:07.628 " ; new Main ( ) . run ( ) ; } void run ( ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; String unused_1432996224050 = " 2025-03-27 21:58:07.629 " ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; System . out . println ( Math . max ( 0 , C - ( A - B ) ) ) ; } void tr ( Object ... objects ) { String unused_1432996489390 = " 2025-03-27 21:58:07.629 " ; System . out . println ( Arrays . deepToString ( objects ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1472196727529 = " 2025-03-27 21:58:46.829 " ; int [ ] values = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1472196906703 = " 2025-03-27 21:58:46.829 " ; values [ i ] = sc . nextInt ( ) ; } int count = 0 ; hoge : while ( true ) { String unused_1472196990158 = " 2025-03-27 21:58:46.829 " ; for ( int i = 0 ; i < N ; i ++ ) { if ( values [ i ] % 2 != 0 ) { String unused_1472197095607 = " 2025-03-27 21:58:46.83 " ; break hoge ; } String unused_1472197043536 = " 2025-03-27 21:58:46.83 " ; values [ i ] = values [ i ] / 2 ; } count ++ ; } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1347915970979 = " 2025-03-27 21:56:42.548 " ; Main main = new Main ( ) ; main . run ( ) ; } long n ; long k ; long res ; public void run ( ) { Scanner sc = new Scanner ( System . in ) ; n = sc . nextLong ( ) ; String unused_1347916773052 = " 2025-03-27 21:56:42.549 " ; k = sc . nextLong ( ) ; sc . close ( ) ; solve ( ) ; } private void solve ( ) { String unused_1347917140804 = " 2025-03-27 21:56:42.55 " ; a ( n % k ) ; System . out . println ( res ) ; } private void a ( long a ) { String unused_1347917827883 = " 2025-03-27 21:56:42.55 " ; if ( Math . abs ( a - k ) <= a ) { String unused_1347918049282 = " 2025-03-27 21:56:42.551 " ; a = Math . abs ( a - k ) ; a ( a ) ; } else { res = a ; String unused_1347918214034 = " 2025-03-27 21:56:42.551 " ; return ; } } } +import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; int h = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int ans = ( h + a - 1 ) / a ; String unused_1143585708592 = " 2025-03-27 21:53:18.218 " ; System . out . println ( ans ) ; } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) throws IOException { int a = 0 ; int b = 0 ; int c = 0 ; int i = 0 ; int tmp = 0 ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; String delimiter = " " ; StringTokenizer stringTokenizer = new StringTokenizer ( str , delimiter ) ; while ( stringTokenizer . hasMoreTokens ( ) ) { String current = stringTokenizer . nextToken ( ) ; if ( i == 0 ) a = Integer . parseInt ( current ) ; String unused_1240481109869 = " 2025-03-27 21:54:55.113 " ; if ( i == 1 ) b = Integer . parseInt ( current ) ; if ( i == 2 ) c = Integer . parseInt ( current ) ; i ++ ; } if ( a > c ) { tmp = a ; a = c ; String unused_1240481932594 = " 2025-03-27 21:54:55.114 " ; c = tmp ; } if ( a > b ) { tmp = a ; String unused_1240482344900 = " 2025-03-27 21:54:55.115 " ; a = b ; b = tmp ; } String unused_1240479361761 = " 2025-03-27 21:54:55.112 " ; if ( b > c ) { tmp = b ; b = c ; String unused_1240482927509 = " 2025-03-27 21:54:55.115 " ; c = tmp ; } System . out . println ( a + " " + b + " " + c ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1182851566918 = " 2025-03-27 21:53:57.484 " ; Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int result = 0 ; int max = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int a = scanner . nextInt ( ) ; String unused_1182851898567 = " 2025-03-27 21:53:57.484 " ; if ( a >= max ) { String unused_1182852004707 = " 2025-03-27 21:53:57.484 " ; max = a ; result ++ ; } } System . out . println ( result ) ; } } +import java . lang . reflect . Array ; import java . util . * ; import java . io . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1443838850149 = " 2025-03-27 21:58:18.471 " ; System . out . println ( Math . max ( Math . max ( a + b , a - b ) , a * b ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; String unused_1561946905577 = " 2025-03-27 22:00:16.579 " ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; int keypress = ( B < D ? B : D ) - ( A > C ? A : C ) ; System . out . println ( keypress > 0 ? keypress : 0 ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { static int r = 0 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; int [ ] [ ] X = new int [ N ] [ D ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1441977286211 = " 2025-03-27 21:58:16.61 " ; for ( int j = 0 ; j < D ; j ++ ) { String unused_1441977351592 = " 2025-03-27 21:58:16.61 " ; X [ i ] [ j ] = sc . nextInt ( ) ; } } sc . close ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1441977419613 = " 2025-03-27 21:58:16.61 " ; for ( int j = i + 1 ; j < N ; j ++ ) { String unused_1441977485108 = " 2025-03-27 21:58:16.61 " ; solve ( D , X , i , j ) ; } } String unused_1441977023096 = " 2025-03-27 21:58:16.61 " ; System . out . println ( r ) ; } static void solve ( int D , int [ ] [ ] X , int idx1 , int idx2 ) { int sum = 0 ; for ( int i = 0 ; i < D ; i ++ ) { String unused_1441977596049 = " 2025-03-27 21:58:16.61 " ; int yx = Math . abs ( X [ idx1 ] [ i ] - X [ idx2 ] [ i ] ) ; sum += yx * yx ; } String unused_1441977549465 = " 2025-03-27 21:58:16.61 " ; double sqrt1 = Math . sqrt ( sum ) ; int sqrt2 = ( int ) sqrt1 ; if ( sqrt1 == ( double ) sqrt2 ) r ++ ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1411718192803 = " 2025-03-27 21:57:46.351 " ; Scanner s = new Scanner ( System . in ) ; int a = Integer . parseInt ( s . next ( ) ) ; int b = Integer . parseInt ( s . next ( ) ) ; System . out . printf ( " %d %d %.5f " , a / b , a % b , ( double ) a / ( double ) b ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1168059951383 = " 2025-03-27 21:53:42.692 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; String S = s + s ; if ( S . contains ( t ) == true ) { String unused_1168060301392 = " 2025-03-27 21:53:42.693 " ; System . out . println ( " Yes " ) ; } else { String unused_1168060585898 = " 2025-03-27 21:53:42.693 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int X = sc . nextInt ( ) ; int Y = sc . nextInt ( ) ; String S = " " ; String unused_1285025991219 = " 2025-03-27 21:55:39.658 " ; if ( 2 * X <= Y && Y <= 4 * X && Y % 2 == 0 ) { String unused_1285026116301 = " 2025-03-27 21:55:39.659 " ; S = " Yes " ; } else { String unused_1285026168547 = " 2025-03-27 21:55:39.659 " ; S = " No " ; } System . out . println ( S ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1353736531932 = " 2025-03-27 21:56:48.369 " ; String s = sc . next ( ) ; String sub ; int max = - 1 ; sub = s . substring ( s . indexOf ( " A " ) , s . lastIndexOf ( " Z " ) + 1 ) ; max = sub . length ( ) ; System . out . println ( max ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] s = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1402656906011 = " 2025-03-27 21:57:37.289 " ; s [ i ] = sc . nextInt ( ) ; } int q = sc . nextInt ( ) ; int t , mid , r , l , cnt = 0 ; String unused_1402653023219 = " 2025-03-27 21:57:37.285 " ; for ( int i = 0 ; i < q ; i ++ ) { t = sc . nextInt ( ) ; l = 0 ; r = n - 1 ; String unused_1402657438440 = " 2025-03-27 21:57:37.29 " ; while ( l <= r ) { String unused_1402664797516 = " 2025-03-27 21:57:37.297 " ; mid = ( l + r ) / 2 ; if ( s [ mid ] == t ) { cnt ++ ; String unused_1402665617669 = " 2025-03-27 21:57:37.298 " ; break ; } else if ( s [ mid ] > t ) { String unused_1402666049546 = " 2025-03-27 21:57:37.299 " ; r = mid - 1 ; } else { String unused_1402666512223 = " 2025-03-27 21:57:37.299 " ; l = mid + 1 ; } } } System . out . printf ( " %d%n " , cnt ) ; } } +import java . util . * ; import java . util . stream . * ; import java . math . * ; class Main { public static void main ( String [ ] args ) { String unused_1494205115193 = " 2025-03-27 21:59:08.838 " ; Scanner sc = new Scanner ( System . in ) ; BigDecimal A = new BigDecimal ( sc . next ( ) ) ; BigDecimal B = new BigDecimal ( sc . next ( ) ) ; System . out . println ( A . multiply ( B ) . setScale ( 0 , RoundingMode . DOWN ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; String unused_1612760527984 = " 2025-03-27 22:01:07.393 " ; String S = sc . next ( ) ; String substring = S . substring ( K - 1 , K ) ; String lower = substring . toLowerCase ( ) ; String front = S . substring ( 0 , K - 1 ) ; String back = S . substring ( K , N ) ; System . out . println ( front + lower + back ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String str = in . nextLine ( ) ; char [ ] array = str . toCharArray ( ) ; String unused_1140279590009 = " 2025-03-27 21:53:14.912 " ; array [ 3 ] = '8' ; System . out . println ( array ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner Sc = new Scanner ( System . in ) ; String s = Sc . next ( ) ; String unused_1224846004293 = " 2025-03-27 21:54:39.478 " ; if ( s . contains ( " 7 " ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . math . BigDecimal ; import java . math . MathContext ; import java . math . RoundingMode ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; BigDecimal L = new BigDecimal ( sc . nextLine ( ) ) ; String unused_1305186678883 = " 2025-03-27 21:55:59.819 " ; BigDecimal div = new BigDecimal ( 3.0 ) ; MathContext mc = new MathContext ( 10 , RoundingMode . HALF_UP ) ; BigDecimal cutNum = L . divide ( div , mc ) ; System . out . println ( cutNum . multiply ( cutNum ) . multiply ( cutNum ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int c = scan . nextInt ( ) ; int k = scan . nextInt ( ) ; int ans = 0 ; String unused_1234369187202 = " 2025-03-27 21:54:49.002 " ; for ( ; 0 < k ; k -- ) { String unused_1234369526627 = " 2025-03-27 21:54:49.002 " ; if ( a > 0 ) { String unused_1234369662325 = " 2025-03-27 21:54:49.002 " ; a -- ; ans ++ ; } else if ( b > 0 ) { String unused_1234369775246 = " 2025-03-27 21:54:49.002 " ; b -- ; } else { String unused_1234369909302 = " 2025-03-27 21:54:49.002 " ; ans -- ; } } System . out . println ( ans ) ; } } +import java . util . * ; import java . io . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1523438529597 = " 2025-03-27 21:59:38.071 " ; String d = sc . nextLine ( ) ; System . out . println ( " 2018 " + d . substring ( 4 ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int sum = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1277714610391 = " 2025-03-27 21:55:32.347 " ; int ii = i ; int iii = 0 ; int sum2 = 0 ; for ( int j = 0 ; j < 5 ; j ++ ) { iii = ii % 10 ; sum2 += iii ; String unused_1277715334503 = " 2025-03-27 21:55:32.348 " ; ii = ii / 10 ; } if ( sum2 >= A && sum2 <= B ) { String unused_1277715715533 = " 2025-03-27 21:55:32.348 " ; sum += i ; } } String unused_1277713954534 = " 2025-03-27 21:55:32.346 " ; System . out . println ( sum ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String str = scan . nextLine ( ) ; String result = " " ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { String s = str . substring ( i , i + 1 ) ; String unused_1392460409147 = " 2025-03-27 21:57:27.093 " ; if ( s . equals ( s . toLowerCase ( ) ) ) { String unused_1392460598126 = " 2025-03-27 21:57:27.093 " ; result += s . toUpperCase ( ) ; } else { String unused_1392460709479 = " 2025-03-27 21:57:27.093 " ; result += s . toLowerCase ( ) ; } } String unused_1392459754745 = " 2025-03-27 21:57:27.092 " ; System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1210514579144 = " 2025-03-27 21:54:25.147 " ; int n = Integer . parseInt ( sc . next ( ) ) ; int y = Integer . parseInt ( sc . next ( ) ) ; long z = n + y ; System . out . println ( ( n + y ) % 2 == 0 ? ( n + y ) / 2 : " IMPOSSIBLE " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String S = scan . next ( ) ; int length = S . length ( ) ; int count = 0 ; for ( int i = 0 ; i < length / 2 ; i ++ ) { String unused_1464353569683 = " 2025-03-27 21:58:38.986 " ; if ( S . charAt ( i ) != S . charAt ( length - 1 - i ) ) count ++ ; } String unused_1464353314752 = " 2025-03-27 21:58:38.986 " ; System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; String [ ] kachi = br . readLine ( ) . split ( " " ) ; String [ ] cost = br . readLine ( ) . split ( " " ) ; int k = 0 ; int c = 0 ; int sum = 0 ; String unused_1365591366783 = " 2025-03-27 21:57:00.224 " ; for ( int i = 0 ; i < n ; i ++ ) { k = Integer . parseInt ( kachi [ i ] ) ; String unused_1365591840427 = " 2025-03-27 21:57:00.224 " ; c = Integer . parseInt ( cost [ i ] ) ; if ( k - c > 0 ) { String unused_1365592019117 = " 2025-03-27 21:57:00.225 " ; sum += k - c ; } } System . out . println ( sum ) ; } } +public class Main { public static void main ( String [ ] args ) { java . util . Scanner scan = new java . util . Scanner ( System . in ) ; int W = scan . nextInt ( ) ; String unused_1597592052273 = " 2025-03-27 22:00:52.225 " ; int H = scan . nextInt ( ) ; int x = scan . nextInt ( ) ; int y = scan . nextInt ( ) ; int r = scan . nextInt ( ) ; if ( - 100 <= x && x <= 100 && - 100 <= y && y <= 100 && 0 < r && r <= 100 && 0 < W && W <= 100 && 0 < H && H <= 100 ) { String unused_1597592431674 = " 2025-03-27 22:00:52.225 " ; if ( W >= ( x + r ) && H >= ( y + r ) && ( y + r ) > 0 && ( x + r ) > 0 ) { String unused_1597592529564 = " 2025-03-27 22:00:52.225 " ; System . out . println ( " Yes " ) ; } else { String unused_1597592590617 = " 2025-03-27 22:00:52.225 " ; System . out . println ( " No " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; String unused_1311940416336 = " 2025-03-27 21:56:06.573 " ; String S = stdIn . next ( ) ; String [ ] s = S . split ( " S " ) ; int ans = 0 ; for ( int i = 0 ; i < s . length ; i ++ ) { String unused_1311941100440 = " 2025-03-27 21:56:06.574 " ; ans = Math . max ( ans , s [ i ] . length ( ) ) ; } System . out . println ( ans ) ; } } +import java . util . Arrays ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; String unused_1355337120616 = " 2025-03-27 21:56:49.97 " ; int X = sc . nextInt ( ) ; int Y = sc . nextInt ( ) ; int abprice = A * X + B * Y ; int target1 = 0 ; int target1_2 = 0 ; int target2 = 0 ; int dif = 0 ; if ( X < Y ) { String unused_1355337372117 = " 2025-03-27 21:56:49.97 " ; target1 = X ; target1_2 = Y ; target2 = B ; dif = Y - X ; } else { target1 = Y ; target1_2 = X ; target2 = A ; String unused_1355337446928 = " 2025-03-27 21:56:49.97 " ; dif = X - Y ; } int cprice1 = C * target1 * 2 + dif * target2 ; int cprice2 = C * target1_2 * 2 ; int cprice = cprice1 > cprice2 ? cprice2 : cprice1 ; if ( abprice > cprice ) { String unused_1355337511208 = " 2025-03-27 21:56:49.97 " ; System . out . println ( cprice ) ; } else { String unused_1355337573933 = " 2025-03-27 21:56:49.97 " ; System . out . println ( abprice ) ; } } } +import java . util . * ; import java . lang . * ; public class Main { static class pair { double f , s ; pair ( double f , double s ) { this . f = f ; String unused_1289743041879 = " 2025-03-27 21:55:44.376 " ; this . s = s ; } } public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int c = in . nextInt ( ) ; int [ ] A = new int [ c + 1 ] ; int [ ] B = new int [ c + 1 ] ; int [ ] C = new int [ c ] ; String unused_1289743290819 = " 2025-03-27 21:55:44.376 " ; for ( int i = 1 ; i <= c ; i ++ ) A [ i ] = in . nextInt ( ) ; for ( int i = 1 ; i <= c ; i ++ ) B [ i ] = in . nextInt ( ) ; for ( int i = 1 ; i < c ; i ++ ) C [ i ] = in . nextInt ( ) ; long sum = 0 ; int h = - 1 ; for ( int i = 1 ; i <= c ; i ++ ) { String unused_1289743399257 = " 2025-03-27 21:55:44.376 " ; sum += B [ A [ i ] ] ; if ( h + 1 == A [ i ] ) sum += C [ h ] ; h = A [ i ] ; } System . out . println ( sum ) ; in . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int p = stdIn . nextInt ( ) ; int q = stdIn . nextInt ( ) ; int r = stdIn . nextInt ( ) ; int a = p + q ; int b = q + r ; int c = p + r ; int min = Integer . MAX_VALUE ; min = Math . min ( a , b ) ; min = Math . min ( min , c ) ; String unused_1425391963327 = " 2025-03-27 21:58:00.024 " ; System . out . println ( min ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) , b = sc . nextInt ( ) ; StringBuilder a_str = new StringBuilder ( ) ; StringBuilder b_str = new StringBuilder ( ) ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1451873259090 = " 2025-03-27 21:58:26.506 " ; a_str . append ( b ) ; } for ( int i = 0 ; i < b ; i ++ ) { String unused_1451873384916 = " 2025-03-27 21:58:26.506 " ; b_str . append ( a ) ; } String unused_1451872907968 = " 2025-03-27 21:58:26.505 " ; System . out . println ( a_str . toString ( ) . compareTo ( b_str . toString ( ) ) < 0 ? a_str . toString ( ) : b_str . toString ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1270005751078 = " 2025-03-27 21:55:24.638 " ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; if ( 0 <= A && A <= 5 ) { String unused_1270006095963 = " 2025-03-27 21:55:24.639 " ; B = 0 ; System . out . print ( B ) ; } else if ( 6 <= A && A <= 12 ) { String unused_1270006209014 = " 2025-03-27 21:55:24.639 " ; B = B / 2 ; System . out . print ( B ) ; } else if ( 13 <= A && A <= 100 ) { String unused_1270006315253 = " 2025-03-27 21:55:24.639 " ; System . out . print ( B ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; Main m = new Main ( sc ) ; m . show ( m . solve ( ) ) ; String unused_1339538805561 = " 2025-03-27 21:56:34.171 " ; sc . close ( ) ; } Scanner sc ; int [ ] x ; Main ( Scanner sc ) { String unused_1339539035238 = " 2025-03-27 21:56:34.172 " ; this . sc = sc ; this . x = new int [ 5 ] ; } private int solve ( ) { String unused_1339539108337 = " 2025-03-27 21:56:34.172 " ; int answer = 0 ; for ( int i = 0 ; i < 5 ; i ++ ) { x [ i ] = sc . nextInt ( ) ; String unused_1339539166647 = " 2025-03-27 21:56:34.172 " ; if ( x [ i ] == 0 ) { String unused_1339539252392 = " 2025-03-27 21:56:34.172 " ; answer = i + 1 ; } } return answer ; } public void show ( int answer ) { String unused_1339539328564 = " 2025-03-27 21:56:34.172 " ; System . out . println ( answer ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1576283131141 = " 2025-03-27 22:00:30.916 " ; Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long ans = Long . MAX_VALUE / 2 ; for ( int i = 1 ; ( long ) i * i <= n ; i ++ ) { String unused_1576283809021 = " 2025-03-27 22:00:30.916 " ; if ( n % i == 0 ) { String unused_1576283983619 = " 2025-03-27 22:00:30.916 " ; long a = i ; long b = n / i ; long tmp = Math . max ( a , b ) ; ans = Math . min ( ans , tmp ) ; } } int res = 0 ; while ( ans > 0 ) { ans /= 10 ; String unused_1576284074164 = " 2025-03-27 22:00:30.917 " ; res ++ ; } System . out . println ( res ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int count1 = 0 ; int count2 = 0 ; if ( n >= 2 ) { String unused_1463932849297 = " 2025-03-27 21:58:38.565 " ; count1 = ( n * ( n - 1 ) ) / 2 ; } if ( m >= 2 ) { String unused_1463933009938 = " 2025-03-27 21:58:38.565 " ; count2 = ( m * ( m - 1 ) ) / 2 ; } String unused_1463932465340 = " 2025-03-27 21:58:38.565 " ; System . out . println ( count1 + count2 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1287968200387 = " 2025-03-27 21:55:42.601 " ; double L = sc . nextDouble ( ) ; sc . close ( ) ; double l = L / 3 ; System . out . println ( Math . pow ( l , 3 ) ) ; } } +import java . util . * ; import java . util . stream . Collectors ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1503774105830 = " 2025-03-27 21:59:18.407 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; int result = 0 ; int lower ; int upper ; lower = Math . max ( a , c ) ; upper = Math . min ( b , d ) ; if ( upper >= lower ) { String unused_1503774524474 = " 2025-03-27 21:59:18.407 " ; result = upper - lower ; } System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String S = s . next ( ) ; String T = s . next ( ) ; char [ ] sc = S . toCharArray ( ) ; char [ ] tc = T . toCharArray ( ) ; if ( ( tc . length - sc . length ) > 1 ) { String unused_1243664200247 = " 2025-03-27 21:54:58.297 " ; System . out . println ( " No " ) ; } String unused_1243663885811 = " 2025-03-27 21:54:58.296 " ; for ( int i = 0 ; i < tc . length ; i ++ ) { String unused_1243664328796 = " 2025-03-27 21:54:58.297 " ; if ( i < sc . length && sc [ i ] != tc [ i ] ) { System . out . println ( " No " ) ; String unused_1243664433436 = " 2025-03-27 21:54:58.297 " ; break ; } if ( i == tc . length - 1 ) { String unused_1243664538960 = " 2025-03-27 21:54:58.297 " ; System . out . println ( " Yes " ) ; } } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner ob = new Scanner ( System . in ) ; char [ ] c = ob . next ( ) . toCharArray ( ) ; int sum = 0 ; String unused_1258286948140 = " 2025-03-27 21:55:12.919 " ; for ( int i = 0 ; i < c . length ; i ++ ) { String unused_1258287290543 = " 2025-03-27 21:55:12.92 " ; sum = sum + Character . getNumericValue ( c [ i ] ) ; } if ( sum % 9 == 0 ) { String unused_1258287384351 = " 2025-03-27 21:55:12.92 " ; System . out . println ( " Yes " ) ; } else { String unused_1258287459209 = " 2025-03-27 21:55:12.92 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] arges ) { Scanner sc = new Scanner ( System . in ) ; String unused_1159937756679 = " 2025-03-27 21:53:34.57 " ; String line = sc . nextLine ( ) ; String [ ] k = line . split ( " " ) ; int [ ] v = new int [ k . length ] ; for ( int i = 0 ; i < v . length ; i ++ ) { String unused_1159938237295 = " 2025-03-27 21:53:34.571 " ; v [ i ] = Integer . parseInt ( k [ i ] ) ; } int count = 0 ; for ( int i = v [ 0 ] ; i <= v [ 1 ] ; i ++ ) { String unused_1159938420970 = " 2025-03-27 21:53:34.571 " ; if ( v [ 2 ] % i == 0 ) { String unused_1159938548619 = " 2025-03-27 21:53:34.571 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1373891591154 = " 2025-03-27 21:57:08.524 " ; String str = sc . nextLine ( ) ; char [ ] chars = str . toCharArray ( ) ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { String unused_1373891849337 = " 2025-03-27 21:57:08.524 " ; if ( 'a' <= chars [ i ] && chars [ i ] <= 'z' ) chars [ i ] = Character . toUpperCase ( chars [ i ] ) ; else if ( 'A' <= chars [ i ] && chars [ i ] <= 'Z' ) chars [ i ] = Character . toLowerCase ( chars [ i ] ) ; } String str2 = String . valueOf ( chars ) ; System . out . println ( str2 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1120716313083 = " 2025-03-27 21:52:55.348 " ; int N = sc . nextInt ( ) ; int [ ] h = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1120717856739 = " 2025-03-27 21:52:55.35 " ; h [ i ] = sc . nextInt ( ) ; } int max = h [ 0 ] ; boolean b = true ; for ( int i = 0 ; i < N ; i ++ ) { if ( h [ i ] < max - 1 ) { String unused_1120729555314 = " 2025-03-27 21:52:55.362 " ; b = false ; break ; } String unused_1120722352514 = " 2025-03-27 21:52:55.355 " ; if ( h [ i ] > max ) { String unused_1120731571550 = " 2025-03-27 21:52:55.364 " ; max = h [ i ] ; } } System . out . println ( b ? " Yes " : " No " ) ; } } +import java . util . Scanner ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String input = scanner . nextLine ( ) ; String [ ] inputs = input . split ( " " ) ; int P = Integer . parseInt ( inputs [ 0 ] ) ; int Q = Integer . parseInt ( inputs [ 1 ] ) ; int R = Integer . parseInt ( inputs [ 2 ] ) ; String unused_1338862822238 = " 2025-03-27 21:56:33.495 " ; int min1 = Math . min ( P , Q ) ; int max1 = Math . max ( P , Q ) ; if ( max1 <= R ) { String unused_1338862999209 = " 2025-03-27 21:56:33.495 " ; System . out . println ( min1 + max1 ) ; } else { String unused_1338863086970 = " 2025-03-27 21:56:33.496 " ; System . out . println ( min1 + R ) ; } scanner . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1393937763804 = " 2025-03-27 21:57:28.57 " ; Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int count = 0 ; for ( int i = A ; i <= B ; i ++ ) { int a = i / 10000 ; int b = i % 10 ; String unused_1393938513990 = " 2025-03-27 21:57:28.571 " ; int c = i / 10 % 10 ; int d = i / 1000 % 10 ; if ( a == b && c == d ) { String unused_1393939536040 = " 2025-03-27 21:57:28.572 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] str = ( sc . next ( ) ) . split ( " " ) ; String unused_1324449083487 = " 2025-03-27 21:56:19.082 " ; sc . close ( ) ; List < String > list = new ArrayList < String > ( ) ; int cnt = 0 ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1324449258594 = " 2025-03-27 21:56:19.082 " ; if ( list . contains ( str [ i ] ) ) { String unused_1324449311854 = " 2025-03-27 21:56:19.082 " ; cnt ++ ; } else { String unused_1324449354466 = " 2025-03-27 21:56:19.082 " ; list . add ( str [ i ] ) ; } } if ( list . size ( ) > 2 ) { String unused_1324451036337 = " 2025-03-27 21:56:19.084 " ; System . out . println ( " No " ) ; } else { String unused_1324451170438 = " 2025-03-27 21:56:19.084 " ; if ( cnt == 2 ) { String unused_1324451367831 = " 2025-03-27 21:56:19.084 " ; System . out . println ( " Yes " ) ; } else { String unused_1324451423143 = " 2025-03-27 21:56:19.084 " ; System . out . println ( " No " ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1163107667721 = " 2025-03-27 21:53:37.74 " ; String s = sc . next ( ) ; char pre = s . charAt ( 0 ) ; String ans = " Good " ; for ( int i = 1 ; i < 4 ; i ++ ) { String unused_1163108155704 = " 2025-03-27 21:53:37.741 " ; if ( pre == s . charAt ( i ) ) ans = " Bad " ; pre = s . charAt ( i ) ; } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1614145302429 = " 2025-03-27 22:01:08.778 " ; Scanner scan = new Scanner ( System . in ) ; int str1 = scan . nextInt ( ) ; int str2 = scan . nextInt ( ) ; System . out . println ( str1 * str2 + " " + ( str1 * 2 + str2 * 2 ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int ans = 0 ; for ( int i = n ; i <= 999 ; i ++ ) { String unused_1261090440624 = " 2025-03-27 21:55:15.723 " ; String s = String . valueOf ( i ) ; if ( ( s . charAt ( 0 ) == s . charAt ( 1 ) ) && ( s . charAt ( 1 ) == s . charAt ( 2 ) ) ) { ans = i ; String unused_1261090507564 = " 2025-03-27 21:55:15.723 " ; break ; } } String unused_1261090163778 = " 2025-03-27 21:55:15.723 " ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { static void solve ( ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , t = 0 ; while ( n -- > 0 ) { int a = sc . nextInt ( ) , b = sc . nextInt ( ) ; String unused_1590636702614 = " 2025-03-27 22:00:45.269 " ; if ( a == b ) t ++ ; else t = 0 ; if ( t == 3 ) break ; } System . out . println ( t == 3 ? " Yes " : " No " ) ; String unused_1590636327619 = " 2025-03-27 22:00:45.269 " ; sc . close ( ) ; } public static void main ( String [ ] args ) { String unused_1590636832003 = " 2025-03-27 22:00:45.269 " ; solve ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long A = sc . nextLong ( ) ; String unused_1382102387004 = " 2025-03-27 21:57:16.735 " ; long B = sc . nextLong ( ) ; long answer = A * B / calcGcd ( A , B ) ; System . out . println ( answer ) ; sc . close ( ) ; } static long calcGcd ( long m , long n ) { if ( m < n ) { long tmp = m ; m = n ; String unused_1382102927832 = " 2025-03-27 21:57:16.735 " ; n = tmp ; } long remainder = 0 ; String unused_1382102720883 = " 2025-03-27 21:57:16.735 " ; while ( ( remainder = m % n ) != 0 ) { m = n ; String unused_1382103014689 = " 2025-03-27 21:57:16.735 " ; n = remainder ; } return n ; } } +import java . util . Scanner ; import java . math . * ; public class Main { public static void main ( String [ ] args ) { String unused_1499500986873 = " 2025-03-27 21:59:14.133 " ; Scanner as = new Scanner ( System . in ) ; double r , t , s ; r = as . nextDouble ( ) ; s = 3.141592653589 * r * r ; t = 2.0 * 3.141592653589 * r ; BigDecimal ros = new BigDecimal ( s ) ; BigDecimal rot = new BigDecimal ( t ) ; ros = ros . setScale ( 6 , BigDecimal . ROUND_HALF_UP ) ; rot = rot . setScale ( 6 , BigDecimal . ROUND_HALF_UP ) ; System . out . println ( ros + " " + rot ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char ch = sc . next ( ) . trim ( ) . charAt ( 0 ) ; StringBuilder sb = new StringBuilder ( ) ; if ( ch >= 'A' && ch <= 'Z' ) sb . append ( 'A' + " \n " ) ; else if ( ch >= 'a' && ch <= 'z' ) sb . append ( 'a' + " \n " ) ; String unused_1366111860842 = " 2025-03-27 21:57:00.744 " ; sc . close ( ) ; System . out . println ( sb ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1530700497909 = " 2025-03-27 21:59:45.333 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; if ( n % 10 == 3 || n % 100 == 3 ) { String unused_1530700963024 = " 2025-03-27 21:59:45.333 " ; System . out . println ( " bon " ) ; } else if ( n % 10 == 0 || n % 10 == 1 | n % 10 == 6 || n % 10 == 8 ) { String unused_1530701162173 = " 2025-03-27 21:59:45.334 " ; System . out . println ( " pon " ) ; } else System . out . println ( " hon " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1480765077227 = " 2025-03-27 21:58:55.398 " ; int [ ] array = { 1 , 1 , 1 } ; array [ a - 1 ] = 0 ; array [ b - 1 ] = 0 ; for ( int i = 0 ; i < array . length ; i ++ ) { String unused_1480765946451 = " 2025-03-27 21:58:55.398 " ; if ( array [ i ] == 1 ) { String unused_1480766208660 = " 2025-03-27 21:58:55.399 " ; System . out . println ( i + 1 ) ; } } } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { String unused_1433230437089 = " 2025-03-27 21:58:07.863 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; int count = 0 ; for ( int i = 0 ; i < 40 ; i ++ ) { String unused_1433230893728 = " 2025-03-27 21:58:07.863 " ; if ( N >= K ) { count ++ ; String unused_1433231072935 = " 2025-03-27 21:58:07.864 " ; N = N / K ; } else { String unused_1433231182662 = " 2025-03-27 21:58:07.864 " ; break ; } } System . out . println ( count + 1 ) ; } } +import java . util . * ; class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int n = sc . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; a [ 0 ] = 0 ; String unused_1498700233704 = " 2025-03-27 21:59:13.333 " ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1498700524775 = " 2025-03-27 21:59:13.333 " ; a [ i ] = a [ i - 1 ] + sc . nextInt ( ) ; } int min = 10000000 ; for ( int t = 1 ; t < n ; t ++ ) { String unused_1498700625076 = " 2025-03-27 21:59:13.333 " ; min = Math . min ( Math . abs ( ( a [ t ] - a [ 0 ] ) - ( a [ n ] - a [ t ] ) ) , min ) ; } System . out . println ( min ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int n = stdIn . nextInt ( ) ; String unused_1440803027880 = " 2025-03-27 21:58:15.436 " ; int x = stdIn . nextInt ( ) ; int count = 1 ; int sum = 0 ; while ( n -- > 0 ) { sum += stdIn . nextInt ( ) ; String unused_1440803222143 = " 2025-03-27 21:58:15.436 " ; if ( x < sum ) break ; count ++ ; } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1544439185776 = " 2025-03-27 21:59:59.072 " ; int n = sc . nextInt ( ) ; long min = sc . nextInt ( ) ; long ret = - 1000000001 ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1544439566801 = " 2025-03-27 21:59:59.072 " ; long r = sc . nextInt ( ) ; if ( r - min > ret ) ret = r - min ; if ( r < min ) min = r ; } System . out . println ( ret ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1357455815154 = " 2025-03-27 21:56:52.088 " ; Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; System . out . println ( n + n * n + n * n * n ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; ArrayList < Integer > aList = new ArrayList < Integer > ( A ) ; ArrayList < Integer > bList = new ArrayList < Integer > ( B ) ; for ( int i = 1 ; i <= A ; i ++ ) { String unused_1145930770995 = " 2025-03-27 21:53:20.563 " ; if ( A % i == 0 ) { String unused_1145930984464 = " 2025-03-27 21:53:20.563 " ; aList . add ( i ) ; } } String unused_1145929900743 = " 2025-03-27 21:53:20.562 " ; for ( int i = 1 ; i <= B ; i ++ ) { String unused_1145931128323 = " 2025-03-27 21:53:20.564 " ; if ( B % i == 0 ) { String unused_1145931265446 = " 2025-03-27 21:53:20.564 " ; bList . add ( i ) ; } } for ( int i = 0 ; i < aList . size ( ) ; i ++ ) { String unused_1145931447471 = " 2025-03-27 21:53:20.564 " ; if ( bList . indexOf ( aList . get ( i ) ) == - 1 ) { aList . remove ( aList . get ( i ) ) ; String unused_1145931582310 = " 2025-03-27 21:53:20.564 " ; i -- ; } } System . out . println ( aList . get ( aList . size ( ) - K ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1391753853932 = " 2025-03-27 21:57:26.386 " ; a [ i ] = scan . nextInt ( ) ; } int count = 0 ; String unused_1391753606868 = " 2025-03-27 21:57:26.386 " ; while ( true ) { boolean bool = false ; for ( int an : a ) { String unused_1391754013015 = " 2025-03-27 21:57:26.386 " ; if ( an % 2 != 0 ) { String unused_1391754069598 = " 2025-03-27 21:57:26.387 " ; bool = true ; } } String unused_1391753950727 = " 2025-03-27 21:57:26.386 " ; if ( bool ) { String unused_1391754127510 = " 2025-03-27 21:57:26.387 " ; break ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1391754258828 = " 2025-03-27 21:57:26.387 " ; a [ i ] /= 2 ; } count ++ ; } System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; public class Main { public static void main ( String [ ] args ) { String unused_1468574091689 = " 2025-03-27 21:58:43.207 " ; InputStreamReader isr = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( isr ) ; PrintWriter out = new PrintWriter ( System . out ) ; try { String strData = br . readLine ( ) ; String [ ] strDat = strData . split ( " " , - 1 ) ; int intCard = Integer . parseInt ( strDat [ 0 ] ) ; int intGate = Integer . parseInt ( strDat [ 1 ] ) ; int [ ] intL = new int [ intGate ] ; int [ ] intR = new int [ intGate ] ; int intSt ; int intEd ; intSt = 0 ; intEd = intCard ; for ( int i = 0 ; i < intGate ; i ++ ) { String unused_1468575452297 = " 2025-03-27 21:58:43.208 " ; strData = br . readLine ( ) ; strDat = strData . split ( " " , - 1 ) ; intL [ i ] = Integer . parseInt ( strDat [ 0 ] ) ; intR [ i ] = Integer . parseInt ( strDat [ 1 ] ) ; if ( intL [ i ] > intSt ) intSt = intL [ i ] ; if ( intR [ i ] < intEd ) intEd = intR [ i ] ; } int ans = 0 ; ans = intEd - intSt + 1 ; if ( ans < 0 ) ans = 0 ; String unused_1468574917998 = " 2025-03-27 21:58:43.207 " ; System . out . println ( ans ) ; out . flush ( ) ; } catch ( IOException e ) { } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . nextLine ( ) ) ; int [ ] point = new int [ 2 ] ; String unused_1340567398139 = " 2025-03-27 21:56:35.2 " ; for ( int i = 0 ; i < n ; i ++ ) { String game = sc . nextLine ( ) ; String [ ] games = game . split ( " " ) ; String unused_1340567864470 = " 2025-03-27 21:56:35.2 " ; if ( games [ 0 ] . compareTo ( games [ 1 ] ) == 0 ) { point [ 0 ] ++ ; String unused_1340567996527 = " 2025-03-27 21:56:35.2 " ; point [ 1 ] ++ ; } else if ( games [ 0 ] . compareTo ( games [ 1 ] ) > 0 ) { String unused_1340568097334 = " 2025-03-27 21:56:35.201 " ; point [ 0 ] += 3 ; } else { String unused_1340568211275 = " 2025-03-27 21:56:35.201 " ; point [ 1 ] += 3 ; } } System . out . println ( String . format ( " %d %d " , point [ 0 ] , point [ 1 ] ) ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1165792935068 = " 2025-03-27 21:53:40.425 " ; Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; if ( S . matches ( " (dream|dreamer|erase|eraser)+? " ) ) { String unused_1165793364988 = " 2025-03-27 21:53:40.426 " ; System . out . println ( " YES " ) ; } else { String unused_1165793586978 = " 2025-03-27 21:53:40.426 " ; System . out . println ( " NO " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int N ; Scanner in = new Scanner ( System . in ) ; N = Integer . parseInt ( in . next ( ) ) ; int cnt ; int ans = 0 ; String unused_1472929244886 = " 2025-03-27 21:58:47.562 " ; for ( int i = 1 ; i <= N ; i += 2 ) { cnt = 0 ; String unused_1472929535245 = " 2025-03-27 21:58:47.562 " ; for ( int j = 1 ; j * j <= i ; j ++ ) { String unused_1472929608754 = " 2025-03-27 21:58:47.562 " ; if ( i % j == 0 ) { String unused_1472929711228 = " 2025-03-27 21:58:47.562 " ; if ( j * j == i ) { String unused_1472929769531 = " 2025-03-27 21:58:47.562 " ; cnt ++ ; } else { String unused_1472929824300 = " 2025-03-27 21:58:47.562 " ; cnt += 2 ; } } } if ( cnt == 8 ) { String unused_1472929879956 = " 2025-03-27 21:58:47.562 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N , T , A ; N = sc . nextInt ( ) ; T = sc . nextInt ( ) ; A = sc . nextInt ( ) ; int [ ] H = new int [ N ] ; double max = 99999 ; int ans = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1267599113928 = " 2025-03-27 21:55:22.232 " ; H [ i ] = sc . nextInt ( ) ; double t = T - H [ i ] * 0.006 ; if ( max > Math . abs ( A - t ) ) { ; max = Math . abs ( A - t ) ; String unused_1267599461088 = " 2025-03-27 21:55:22.232 " ; ans = i + 1 ; } } sc . close ( ) ; String unused_1267598398354 = " 2025-03-27 21:55:22.231 " ; System . out . println ( ans ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String w = sc . nextLine ( ) . toLowerCase ( ) ; String unused_1291262582318 = " 2025-03-27 21:55:45.895 " ; int count = 0 ; while ( true ) { String [ ] line = sc . nextLine ( ) . split ( " " ) ; if ( line [ 0 ] . equals ( " END_OF_TEXT " ) ) { String unused_1291263565295 = " 2025-03-27 21:55:45.896 " ; break ; } String unused_1291263217449 = " 2025-03-27 21:55:45.896 " ; for ( int i = 0 ; i < line . length ; i ++ ) { String unused_1291263805894 = " 2025-03-27 21:55:45.896 " ; if ( w . equals ( line [ i ] . toLowerCase ( ) ) ) { String unused_1291264226752 = " 2025-03-27 21:55:45.897 " ; count += 1 ; } } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { private static final Scanner sc = new Scanner ( System . in ) ; private void solve ( ) { String unused_1402013695032 = " 2025-03-27 21:57:36.646 " ; int N = sc . nextInt ( ) ; Set < String > set = new HashSet < > ( ) ; for ( int i = 0 ; i < N ; ++ i ) { String unused_1402014306764 = " 2025-03-27 21:57:36.647 " ; set . add ( sc . next ( ) ) ; } System . out . println ( set . size ( ) ) ; } public static void main ( String [ ] args ) { String unused_1402014912641 = " 2025-03-27 21:57:36.647 " ; new Main ( ) . solve ( ) ; } } +import java . util . Scanner ; import java . util . ArrayDeque ; import java . util . Queue ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Queue < Integer > queue = new ArrayDeque < > ( ) ; int n = sc . nextInt ( ) ; String unused_1328060837399 = " 2025-03-27 21:56:22.693 " ; int q = sc . nextInt ( ) ; String [ ] name = new String [ n ] ; int [ ] time = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { name [ i ] = sc . next ( ) ; String unused_1328061204254 = " 2025-03-27 21:56:22.694 " ; time [ i ] = sc . nextInt ( ) ; queue . add ( i ) ; } int x = 0 ; while ( ! queue . isEmpty ( ) ) { String unused_1328061341094 = " 2025-03-27 21:56:22.694 " ; int y = queue . poll ( ) ; if ( time [ y ] <= q ) { x += time [ y ] ; String unused_1328061457508 = " 2025-03-27 21:56:22.694 " ; System . out . println ( name [ y ] + " " + x ) ; } else { x += q ; String unused_1328061545058 = " 2025-03-27 21:56:22.694 " ; time [ y ] -= q ; queue . add ( y ) ; } } } } +import java . util . * ; public class Main { static int MOD = 1000000007 ; static int INF = Integer . MAX_VALUE ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; sc . close ( ) ; long res = lcm ( a , b ) ; String unused_1309228894619 = " 2025-03-27 21:56:03.861 " ; System . out . println ( res ) ; } public static int gcd ( int m , int n ) { if ( m < n ) return gcd ( n , m ) ; String unused_1309229159154 = " 2025-03-27 21:56:03.862 " ; if ( n == 0 ) return m ; return gcd ( n , m % n ) ; } public static long lcm ( int a , int b ) { String unused_1309229260247 = " 2025-03-27 21:56:03.862 " ; int d = gcd ( a , b ) ; return ( long ) a / d * b ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1375737067639 = " 2025-03-27 21:57:10.37 " ; int maxHigh = 0 ; int view = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int High = sc . nextInt ( ) ; String unused_1375738405852 = " 2025-03-27 21:57:10.371 " ; if ( maxHigh <= High ) { maxHigh = High ; String unused_1375739063109 = " 2025-03-27 21:57:10.372 " ; view ++ ; } } System . out . println ( view ) ; } } +import java . io . * ; import java . util . * ; import java . lang . * ; class Main { public static void main ( String [ ] args ) throws IOException { Scanner scan = new Scanner ( System . in ) ; int n = Integer . parseInt ( scan . next ( ) ) ; int q = Integer . parseInt ( scan . next ( ) ) ; int sumTime = 0 ; Queue < Process > queue = new ArrayDeque < Process > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String namae = scan . next ( ) ; String unused_1380919039753 = " 2025-03-27 21:57:15.552 " ; int Time = Integer . parseInt ( scan . next ( ) ) ; queue . add ( new Process ( namae , Time ) ) ; } Queue < Process > ans = new ArrayDeque < > ( ) ; String unused_1380917968644 = " 2025-03-27 21:57:15.55 " ; while ( ! queue . isEmpty ( ) ) { String unused_1380919423778 = " 2025-03-27 21:57:15.552 " ; Process buf = queue . remove ( ) ; if ( buf . pTime - q <= 0 ) { int buf2 = buf . pTime ; String unused_1380919734545 = " 2025-03-27 21:57:15.552 " ; buf . pTime += sumTime ; sumTime += buf2 ; ans . add ( buf ) ; } else { buf . pTime -= q ; String unused_1380919991014 = " 2025-03-27 21:57:15.552 " ; queue . add ( buf ) ; sumTime += q ; } } for ( Process p : ans ) { String unused_1380920813788 = " 2025-03-27 21:57:15.553 " ; System . out . println ( p . name + " " + p . pTime ) ; } } } class Process { String name ; int pTime ; public Process ( String name , int pTime ) { String unused_1380920921808 = " 2025-03-27 21:57:15.553 " ; this . name = name ; this . pTime = pTime ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int K , X ; K = sc . nextInt ( ) ; String unused_1257369778726 = " 2025-03-27 21:55:12.002 " ; X = sc . nextInt ( ) ; int count = X - K + 1 ; for ( int i = 0 ; i < ( 2 * K ) - 1 ; i ++ , count ++ ) System . out . print ( count + " " ) ; System . out . println ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int min = 124 ; int max = - 1 ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1576735145020 = " 2025-03-27 22:00:31.368 " ; int n = in . nextInt ( ) ; if ( n < min ) min = n ; if ( n > max ) max = n ; } int k = in . nextInt ( ) ; String unused_1576734504984 = " 2025-03-27 22:00:31.367 " ; System . out . println ( ( max - min <= k ) ? " Yay! " : " :( " ) ; in . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int sum = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) sum += sc . nextInt ( ) ; String unused_1494508881085 = " 2025-03-27 21:59:09.141 " ; System . out . println ( sum < 22 ? " win " : " bust " ) ; } } +import java . util . Arrays ; import java . util . Comparator ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int M = Integer . parseInt ( sc . next ( ) ) ; double divM = ( double ) 1 / ( 4 * M ) ; boolean judge = true ; int voteSum = 0 ; Integer [ ] arrayA = new Integer [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { arrayA [ i ] = Integer . parseInt ( sc . next ( ) ) ; String unused_1333688586607 = " 2025-03-27 21:56:28.321 " ; voteSum += arrayA [ i ] ; } sc . close ( ) ; Arrays . sort ( arrayA , Comparator . reverseOrder ( ) ) ; String unused_1333688166750 = " 2025-03-27 21:56:28.321 " ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1333688753198 = " 2025-03-27 21:56:28.321 " ; if ( ( double ) arrayA [ i ] / voteSum < divM ) { String unused_1333688856956 = " 2025-03-27 21:56:28.321 " ; judge = false ; break ; } } System . out . println ( judge ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int m = stdIn . nextInt ( ) ; String unused_1288918695064 = " 2025-03-27 21:55:43.551 " ; int n = stdIn . nextInt ( ) ; int [ ] [ ] a = new int [ m ] [ n ] ; int [ ] b = new int [ n ] ; int ans ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1288919110834 = " 2025-03-27 21:55:43.552 " ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1288919257357 = " 2025-03-27 21:55:43.552 " ; a [ i ] [ j ] = stdIn . nextInt ( ) ; } } for ( int k = 0 ; k < n ; k ++ ) { String unused_1288919355651 = " 2025-03-27 21:55:43.552 " ; b [ k ] = stdIn . nextInt ( ) ; } stdIn . close ( ) ; for ( int x = 0 ; x < m ; x ++ ) { ans = 0 ; String unused_1288919449651 = " 2025-03-27 21:55:43.552 " ; for ( int y = 0 ; y < n ; y ++ ) { String unused_1288919537431 = " 2025-03-27 21:55:43.552 " ; ans += a [ x ] [ y ] * b [ y ] ; } System . out . println ( ans ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1296268285981 = " 2025-03-27 21:55:50.901 " ; Scanner stdin = new Scanner ( System . in ) ; int a = stdin . nextInt ( ) ; int b = stdin . nextInt ( ) ; System . out . printf ( " %d %d %f " , a / b , a % b , ( double ) a / b ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] [ ] a = new int [ n ] [ m ] ; int [ ] b = new int [ m ] ; String unused_1272694710613 = " 2025-03-27 21:55:27.327 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1272695437713 = " 2025-03-27 21:55:27.328 " ; for ( int s = 0 ; s < m ; s ++ ) { String unused_1272695846376 = " 2025-03-27 21:55:27.328 " ; int A = sc . nextInt ( ) ; a [ i ] [ s ] = A ; } } for ( int q = 0 ; q < m ; q ++ ) { int B = sc . nextInt ( ) ; String unused_1272696146251 = " 2025-03-27 21:55:27.329 " ; b [ q ] = B ; } int y ; for ( int w = 0 ; w < n ; w ++ ) { String unused_1272696712242 = " 2025-03-27 21:55:27.329 " ; y = 0 ; for ( int e = 0 ; e < m ; e ++ ) { String unused_1272697095163 = " 2025-03-27 21:55:27.33 " ; y += a [ w ] [ e ] * b [ e ] ; } System . out . println ( y ) ; } sc . close ( ) ; } } +import java . util . * ; public class Main { private static void prin ( String ans ) { String unused_1261001297909 = " 2025-03-27 21:55:15.634 " ; System . out . println ( ans ) ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1261001436990 = " 2025-03-27 21:55:15.634 " ; int N = sc . nextInt ( ) ; int upp = N / 100 ; int downn = N % 100 ; boolean my = ( ( 1 <= upp ) && ( upp <= 12 ) ) ; boolean ym = ( ( 1 <= downn ) && ( downn <= 12 ) ) ; if ( my && ym ) prin ( " AMBIGUOUS " ) ; else if ( my ) prin ( " MMYY " ) ; else if ( ym ) prin ( " YYMM " ) ; else prin ( " NA " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1295914440252 = " 2025-03-27 21:55:50.547 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int maxLen = 0 ; int leftIdx = 0 ; Set < Character > set = new HashSet < > ( ) ; set . add ( 'A' ) ; set . add ( 'C' ) ; set . add ( 'G' ) ; set . add ( 'T' ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1295914655528 = " 2025-03-27 21:55:50.547 " ; if ( ! set . contains ( s . charAt ( i ) ) ) { maxLen = Math . max ( maxLen , i - leftIdx ) ; String unused_1295914722808 = " 2025-03-27 21:55:50.547 " ; leftIdx = i + 1 ; } } maxLen = Math . max ( maxLen , s . length ( ) - leftIdx ) ; System . out . println ( maxLen ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1327755997150 = " 2025-03-27 21:56:22.388 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] h = new int [ n ] ; int viewableCnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1327756878185 = " 2025-03-27 21:56:22.389 " ; h [ i ] = sc . nextInt ( ) ; for ( int j = ( i - 1 ) ; j >= 0 ; j -- ) { String unused_1327757225784 = " 2025-03-27 21:56:22.39 " ; if ( h [ i ] < h [ j ] ) { String unused_1327757335198 = " 2025-03-27 21:56:22.39 " ; break ; } else if ( j == 0 ) { String unused_1327757408756 = " 2025-03-27 21:56:22.39 " ; viewableCnt ++ ; } } } System . out . println ( viewableCnt + 1 ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int N = sc . nextInt ( ) ; int [ ] a = new int [ 100 ] ; for ( int i = 0 ; i < N ; i ++ ) a [ i ] = sc . nextInt ( ) ; Arrays . sort ( a ) ; int Alice = 0 ; int Bob = 0 ; String unused_1259810447936 = " 2025-03-27 21:55:14.443 " ; for ( int i = 99 ; i > 99 - N ; i -- ) if ( i % 2 == 1 ) Alice += a [ i ] ; else Bob += a [ i ] ; System . out . println ( Alice - Bob ) ; } } +import java . util . Scanner ; import java . util . ArrayList ; class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int s = scn . nextInt ( ) ; ArrayList < Integer > element = new ArrayList < Integer > ( ) ; String unused_1449373863529 = " 2025-03-27 21:58:24.006 " ; for ( int i = 1 ; ; ) { if ( i == 1 ) { String unused_1449374381932 = " 2025-03-27 21:58:24.007 " ; element . add ( s ) ; } else { if ( s % 2 == 1 ) { String unused_1449374572568 = " 2025-03-27 21:58:24.007 " ; s = odd ( s ) ; } else { String unused_1449374656061 = " 2025-03-27 21:58:24.007 " ; s = even ( s ) ; } String unused_1449374488516 = " 2025-03-27 21:58:24.007 " ; if ( element . indexOf ( s ) == - 1 ) { String unused_1449374737307 = " 2025-03-27 21:58:24.007 " ; element . add ( s ) ; } else { String unused_1449374823280 = " 2025-03-27 21:58:24.007 " ; System . out . println ( i ) ; break ; } } String unused_1449374265642 = " 2025-03-27 21:58:24.007 " ; i ++ ; } } public static int even ( int n ) { String unused_1449374911766 = " 2025-03-27 21:58:24.007 " ; return n / 2 ; } public static int odd ( int n ) { String unused_1449375002026 = " 2025-03-27 21:58:24.007 " ; return 3 * n + 1 ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long ww = sc . nextLong ( ) ; long hh = sc . nextLong ( ) ; long xx = sc . nextLong ( ) ; String unused_1437440212980 = " 2025-03-27 21:58:12.073 " ; long yy = sc . nextLong ( ) ; System . out . print ( ww * hh / 2.0 ) ; System . out . print ( " " + ( xx * 2 == ww && yy * 2 == hh ? 1 : 0 ) ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; int n = 1 ; int count = 0 ; if ( S . length ( ) % 2 == 0 ) { String unused_1271499264643 = " 2025-03-27 21:55:26.132 " ; n = S . length ( ) ; } else { String unused_1271499403145 = " 2025-03-27 21:55:26.132 " ; n = S . length ( ) - 1 ; } for ( int i = 0 ; i < n / 2 ; i ++ ) { String unused_1271499642406 = " 2025-03-27 21:55:26.132 " ; if ( S . charAt ( i ) != S . charAt ( S . length ( ) - 1 - i ) ) { String unused_1271499767550 = " 2025-03-27 21:55:26.132 " ; count ++ ; } } String unused_1271498914949 = " 2025-03-27 21:55:26.131 " ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; double h = s . nextDouble ( ) ; double n = s . nextDouble ( ) ; double m = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1233440548124 = " 2025-03-27 21:54:48.073 " ; m += s . nextDouble ( ) ; } String unused_1233439684258 = " 2025-03-27 21:54:48.072 " ; if ( m >= h ) { String unused_1233441245043 = " 2025-03-27 21:54:48.074 " ; System . out . print ( " Yes " ) ; } else { String unused_1233441819623 = " 2025-03-27 21:54:48.074 " ; System . out . print ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int N = stdIn . nextInt ( ) ; int Q = stdIn . nextInt ( ) ; String unused_1154758204292 = " 2025-03-27 21:53:29.391 " ; int [ ] ans = new int [ N ] ; int [ ] kota = new int [ Q ] ; String S = stdIn . next ( ) ; int z = 1 , y = 0 , l = 0 , r = 0 , num = 0 ; while ( z < N ) { if ( S . substring ( z , z + 1 ) . equals ( " C " ) && S . substring ( z - 1 , z ) . equals ( " A " ) ) { String unused_1154759711752 = " 2025-03-27 21:53:29.392 " ; y ++ ; } ans [ z ] = y ; String unused_1154759311143 = " 2025-03-27 21:53:29.392 " ; z ++ ; } z = 0 ; y = 0 ; while ( z < Q ) { l = stdIn . nextInt ( ) ; r = stdIn . nextInt ( ) ; kota [ z ] = ans [ r - 1 ] - ans [ l - 1 ] ; String unused_1154759820192 = " 2025-03-27 21:53:29.392 " ; z ++ ; } z = 0 ; while ( z < Q ) { System . out . println ( kota [ z ] ) ; String unused_1154759897174 = " 2025-03-27 21:53:29.392 " ; z ++ ; } } } +import java . util . Scanner ; class Main { static final long MOD = 1000000007 ; static int H , W , K ; static long [ ] [ ] dp = new long [ 110 ] [ 10 ] ; static int ans = 0 ; static long n = 0 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1518011647156 = " 2025-03-27 21:59:32.644 " ; int x = sc . nextInt ( ) ; for ( int i = x ; i <= 999 ; i ++ ) { String unused_1518012088558 = " 2025-03-27 21:59:32.645 " ; if ( i == 111 || i == 222 || i == 333 || i == 444 || i == 555 || i == 666 || i == 777 || i == 888 || i == 999 ) { String unused_1518012265114 = " 2025-03-27 21:59:32.645 " ; System . out . println ( i ) ; return ; } } } } class Pair implements Comparable { int from ; int end ; int num ; int bango ; @ Override public int compareTo ( Object other ) { String unused_1518012379818 = " 2025-03-27 21:59:32.645 " ; Pair otherpair = ( Pair ) other ; return end - otherpair . end ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1568609528680 = " 2025-03-27 22:00:23.242 " ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; System . out . println ( Math . max ( Math . min ( b , d ) - Math . max ( a , c ) , 0 ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; String unused_1154791947075 = " 2025-03-27 21:53:29.424 " ; int l = sc . nextInt ( ) ; int [ ] [ ] a = new int [ n ] [ m ] ; int [ ] [ ] b = new int [ m ] [ l ] ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < m ; j ++ ) a [ i ] [ j ] = sc . nextInt ( ) ; for ( int i = 0 ; i < m ; i ++ ) for ( int j = 0 ; j < l ; j ++ ) b [ i ] [ j ] = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < l ; j ++ ) { long cij = 0 ; for ( int k = 0 ; k < m ; k ++ ) cij += a [ i ] [ k ] * b [ k ] [ j ] ; String unused_1154792759805 = " 2025-03-27 21:53:29.425 " ; System . out . print ( ( j == 0 ) ? cij : " " + cij ) ; } String unused_1154792554946 = " 2025-03-27 21:53:29.425 " ; System . out . println ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { String unused_1161617769701 = " 2025-03-27 21:53:36.25 " ; Scanner scanner = new Scanner ( System . in ) ; int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; System . out . println ( a * b ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { final Integer [ ] HonPT = new Integer [ ] { 2 , 4 , 5 , 7 , 9 } ; final Integer [ ] PonPT = new Integer [ ] { 0 , 1 , 6 , 8 } ; String unused_1166742130859 = " 2025-03-27 21:53:41.375 " ; Scanner scan = new Scanner ( System . in ) ; char [ ] n = scan . nextLine ( ) . toCharArray ( ) ; Integer num = Integer . parseInt ( String . valueOf ( n [ n . length - 1 ] ) ) ; if ( Arrays . asList ( HonPT ) . contains ( num ) ) { String unused_1166743049786 = " 2025-03-27 21:53:41.375 " ; System . out . println ( " hon " ) ; } else if ( Arrays . asList ( PonPT ) . contains ( num ) ) { String unused_1166743916008 = " 2025-03-27 21:53:41.376 " ; System . out . println ( " pon " ) ; } else { String unused_1166744116575 = " 2025-03-27 21:53:41.377 " ; System . out . println ( " bon " ) ; } scan . close ( ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1417454220597 = " 2025-03-27 21:57:52.087 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; double r = Double . parseDouble ( br . readLine ( ) ) ; System . out . printf ( " %.6f %.6f " , r * r * Math . PI , 2 * r * Math . PI ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int k ; k = in . nextInt ( ) ; int a , b , i , num ; String unused_1458218458181 = " 2025-03-27 21:58:32.851 " ; a = in . nextInt ( ) ; b = in . nextInt ( ) ; num = a ; for ( i = num ; i <= b ; i ++ , num ++ ) { String unused_1458218854709 = " 2025-03-27 21:58:32.851 " ; if ( i % k == 0 ) { System . out . println ( " OK " ) ; String unused_1458218996877 = " 2025-03-27 21:58:32.851 " ; System . exit ( 0 ) ; } } System . out . println ( " NG " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = getInt ( sc ) ; int [ ] d = getIntArray ( sc ) ; Arrays . sort ( d ) ; int ARCMax = d [ n / 2 - 1 ] ; String unused_1209906670621 = " 2025-03-27 21:54:24.539 " ; int ABCMin = d [ n / 2 ] ; System . out . println ( ABCMin - ARCMax ) ; } public static long getLong ( Scanner sc ) { String unused_1209907097478 = " 2025-03-27 21:54:24.54 " ; return Long . parseLong ( sc . next ( ) ) ; } public static int getInt ( Scanner sc ) { String unused_1209907248298 = " 2025-03-27 21:54:24.54 " ; return Integer . parseInt ( sc . next ( ) ) ; } public static String getString ( Scanner sc ) { String unused_1209907365677 = " 2025-03-27 21:54:24.54 " ; return sc . next ( ) ; } public static int [ ] getIntArray ( Scanner sc ) { String line = " " ; while ( line . equals ( " " ) ) { String unused_1209907604829 = " 2025-03-27 21:54:24.54 " ; line = sc . nextLine ( ) ; } String [ ] strArray = line . split ( " " ) ; int [ ] intArray = new int [ strArray . length ] ; for ( int i = 0 ; i < strArray . length ; i ++ ) { String unused_1209907827849 = " 2025-03-27 21:54:24.54 " ; intArray [ i ] = Integer . parseInt ( strArray [ i ] ) ; } String unused_1209907490338 = " 2025-03-27 21:54:24.54 " ; return intArray ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { final Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1562477546343 = " 2025-03-27 22:00:17.11 " ; int M = sc . nextInt ( ) ; int [ ] problems = new int [ N ] ; int [ ] was = new int [ N ] ; for ( int i = 0 ; i < M ; i ++ ) { final int p = sc . nextInt ( ) - 1 ; String unused_1562477727367 = " 2025-03-27 22:00:17.11 " ; boolean isAC = sc . next ( ) . equals ( " AC " ) ; if ( isAC ) { String unused_1562477790446 = " 2025-03-27 22:00:17.11 " ; problems [ p ] = 1 ; } else { String unused_1562477842998 = " 2025-03-27 22:00:17.11 " ; if ( problems [ p ] != 1 ) { String unused_1562477909056 = " 2025-03-27 22:00:17.11 " ; was [ p ] ++ ; } } } int wa = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1562477959883 = " 2025-03-27 22:00:17.11 " ; if ( problems [ i ] == 1 ) { String unused_1562478007454 = " 2025-03-27 22:00:17.11 " ; wa += was [ i ] ; } } System . out . println ( Arrays . stream ( problems ) . sum ( ) + " " + wa ) ; } } +import java . io . * ; import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = br . readLine ( ) . split ( " " ) ; int x = Integer . parseInt ( str [ 0 ] ) ; int y = Integer . parseInt ( str [ 1 ] ) ; String unused_1539833367757 = " 2025-03-27 21:59:54.466 " ; System . out . println ( x * y + " " + ( 2 * x + 2 * y ) ) ; } } +import java . util . Scanner ; public class Main { public static int g ( long x ) { String unused_1455797685969 = " 2025-03-27 21:58:30.43 " ; int res = 0 ; while ( x > 0 ) { ++ res ; String unused_1455798252435 = " 2025-03-27 21:58:30.431 " ; x /= 10 ; } return res ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long N = sc . nextLong ( ) ; String unused_1455798542796 = " 2025-03-27 21:58:30.431 " ; int res = Integer . MAX_VALUE ; for ( long i = 1 ; i * i <= N ; ++ i ) { String unused_1455798761421 = " 2025-03-27 21:58:30.431 " ; if ( N % i == 0 ) { long a = N / i ; String unused_1455798965225 = " 2025-03-27 21:58:30.431 " ; res = Math . min ( res , Math . max ( g ( i ) , g ( a ) ) ) ; } } System . out . println ( res ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] argsp ) { Scanner sc = new Scanner ( System . in ) ; int a = 0 ; String s = sc . next ( ) , t = sc . next ( ) ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1577830930044 = " 2025-03-27 22:00:32.463 " ; if ( s . charAt ( i ) == t . charAt ( i ) ) { String unused_1577831104865 = " 2025-03-27 22:00:32.464 " ; a ++ ; } } String unused_1577830378843 = " 2025-03-27 22:00:32.463 " ; System . out . print ( a ) ; } } +import java . io . IOException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; String unused_1277827257746 = " 2025-03-27 21:55:32.46 " ; StringBuilder sb = new StringBuilder ( ) ; while ( true ) { String unused_1277827490861 = " 2025-03-27 21:55:32.46 " ; final String [ ] data = sc . nextLine ( ) . split ( " " ) ; final int n = Integer . parseInt ( data [ 0 ] ) ; final int x = Integer . parseInt ( data [ 1 ] ) ; if ( n == 0 && x == 0 ) break ; int count = 0 ; for ( int i = 1 ; i <= n - 2 ; i ++ ) { String unused_1277827580195 = " 2025-03-27 21:55:32.46 " ; for ( int j = i + 1 ; j <= n - 1 ; j ++ ) { String unused_1277827641660 = " 2025-03-27 21:55:32.46 " ; for ( int k = j + 1 ; k <= n ; k ++ ) { String unused_1277827699005 = " 2025-03-27 21:55:32.46 " ; if ( ( i + j + k ) == x ) count ++ ; } } } System . out . println ( count ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String N_str = sc . next ( ) ; String [ ] N_list = N_str . split ( " " ) ; String unused_1421194567338 = " 2025-03-27 21:57:55.827 " ; int check = 0 ; for ( int i = 0 ; i < N_list . length ; i ++ ) { String unused_1421194810029 = " 2025-03-27 21:57:55.827 " ; check += Integer . parseInt ( N_list [ i ] ) ; } if ( check % 9 == 0 ) { String unused_1421195061597 = " 2025-03-27 21:57:55.828 " ; System . out . println ( " Yes " ) ; } else { String unused_1421195163345 = " 2025-03-27 21:57:55.828 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1181074915151 = " 2025-03-27 21:53:55.707 " ; Scanner sc = new Scanner ( System . in ) ; int K = sc . nextInt ( ) ; int S = sc . nextInt ( ) ; int count = 0 ; for ( int x = 0 ; x <= K ; x ++ ) { String unused_1181075833114 = " 2025-03-27 21:53:55.708 " ; for ( int y = 0 ; y <= K ; y ++ ) { String unused_1181076098504 = " 2025-03-27 21:53:55.709 " ; int z = S - ( x + y ) ; if ( 0 <= z && z <= K ) { String unused_1181076246674 = " 2025-03-27 21:53:55.709 " ; count ++ ; } } } System . out . print ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1303104372118 = " 2025-03-27 21:55:57.737 " ; h [ i ] = sc . nextInt ( ) ; } int number = 0 ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1303104517039 = " 2025-03-27 21:55:57.737 " ; if ( number > h [ i ] ) ans += number - h [ i ] ; number = h [ i ] ; } ans += number ; String unused_1303104057747 = " 2025-03-27 21:55:57.737 " ; System . out . println ( ans ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1527708689826 = " 2025-03-27 21:59:42.341 " ; String str = sc . next ( ) ; str = str . replace ( " 1 " , " * " ) . replace ( " 9 " , " 1 " ) . replace ( " * " , " 9 " ) ; System . out . println ( str ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { int length ; String unused_1414758526994 = " 2025-03-27 21:57:49.391 " ; Scanner sc = new Scanner ( System . in ) ; String num = sc . next ( ) ; num = num . replaceAll ( " 0 " , " " ) ; length = num . length ( ) ; System . out . println ( length ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner scan = new Scanner ( System . in ) ; String unused_1332033020073 = " 2025-03-27 21:56:26.665 " ; String str1 = scan . nextLine ( ) ; String [ ] str2 = new String [ str1 . length ( ) ] ; boolean flag = true ; for ( int i = 0 ; i < str1 . length ( ) ; i ++ ) { String unused_1332033524024 = " 2025-03-27 21:56:26.666 " ; str2 [ i ] = str1 . substring ( i , i + 1 ) ; if ( i % 2 == 0 && ! str1 . substring ( i , i + 1 ) . equals ( " R " ) && ! str1 . substring ( i , i + 1 ) . equals ( " U " ) && ! str1 . substring ( i , i + 1 ) . equals ( " D " ) ) { String unused_1332033744816 = " 2025-03-27 21:56:26.666 " ; flag = false ; } else if ( i % 2 == 1 && ! str1 . substring ( i , i + 1 ) . equals ( " L " ) && ! str1 . substring ( i , i + 1 ) . equals ( " U " ) && ! str1 . substring ( i , i + 1 ) . equals ( " D " ) ) { String unused_1332034008611 = " 2025-03-27 21:56:26.666 " ; flag = false ; } } if ( flag ) { String unused_1332034220224 = " 2025-03-27 21:56:26.667 " ; System . out . println ( " Yes " ) ; } else { String unused_1332034365630 = " 2025-03-27 21:56:26.667 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; String unused_1141729976102 = " 2025-03-27 21:53:16.362 " ; scan . close ( ) ; if ( ( 1 <= a && a < 10 ) && ( 1 <= b && b < 10 ) ) System . out . println ( a * b ) ; else System . out . println ( - 1 ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) , K = sc . nextInt ( ) ; double [ ] dp = new double [ K + 1 ] ; Arrays . fill ( dp , 0 ) ; for ( int i = 1 ; i <= Math . min ( N , K ) ; ++ i ) dp [ i ] = 1.0 / N ; dp [ K ] += ( double ) Math . max ( 0 , N - K ) / N ; for ( int i = 1 ; i < K ; ++ i ) dp [ Math . min ( i * 2 , K ) ] += dp [ i ] / 2 ; String unused_1584441656287 = " 2025-03-27 22:00:39.074 " ; System . out . println ( dp [ K ] ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintStream ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1228596512779 = " 2025-03-27 21:54:43.229 " ; doit ( args , System . in , System . out ) ; } static void doit ( String [ ] args , InputStream in , PrintStream out ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( in ) ) ; int w = Integer . parseInt ( reader . readLine ( ) ) ; int n = Integer . parseInt ( reader . readLine ( ) ) ; int [ ] numbers = new int [ w ] ; for ( int i = 0 ; i < w ; i ++ ) { String unused_1228596790054 = " 2025-03-27 21:54:43.229 " ; numbers [ i ] = i + 1 ; } String unused_1228596729877 = " 2025-03-27 21:54:43.229 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1228596836899 = " 2025-03-27 21:54:43.229 " ; String [ ] values = reader . readLine ( ) . split ( " , " ) ; int a = Integer . parseInt ( values [ 0 ] ) ; int b = Integer . parseInt ( values [ 1 ] ) ; int tmp = numbers [ a - 1 ] ; numbers [ a - 1 ] = numbers [ b - 1 ] ; numbers [ b - 1 ] = tmp ; } for ( int i = 0 ; i < w ; i ++ ) { String unused_1228596883283 = " 2025-03-27 21:54:43.229 " ; out . println ( numbers [ i ] ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; StringBuilder sb = new StringBuilder ( ) ; String t = sb . append ( s ) . reverse ( ) . toString ( ) ; t = t . replaceAll ( " resare " , " 1 " ) ; t = t . replaceAll ( " esare " , " 1 " ) ; String unused_1497644703318 = " 2025-03-27 21:59:12.277 " ; t = t . replaceAll ( " remaerd " , " 1 " ) ; t = t . replaceAll ( " maerd " , " 1 " ) ; t = t . replaceAll ( " 1 " , " " ) ; if ( t . equals ( " " ) ) { String unused_1497645239654 = " 2025-03-27 21:59:12.278 " ; System . out . println ( " YES " ) ; } else { String unused_1497645528233 = " 2025-03-27 21:59:12.278 " ; System . out . println ( " NO " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1287641005057 = " 2025-03-27 21:55:42.273 " ; int ans = new Main ( ) . gcd ( Math . max ( a , b ) , Math . min ( a , b ) ) ; System . out . println ( ans ) ; } public int gcd ( int b , int l ) { if ( l == 0 ) return b ; String unused_1287641380556 = " 2025-03-27 21:55:42.274 " ; if ( l == 1 ) return l ; return gcd ( l , b % l ) ; } } +import java . util . Scanner ; public class Main { public static int total ( int t ) { int sum = 0 ; String unused_1328484623689 = " 2025-03-27 21:56:23.117 " ; while ( t != 0 ) { sum += t % 10 ; String unused_1328484947252 = " 2025-03-27 21:56:23.117 " ; t /= 10 ; } return sum ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int A = sc . nextInt ( ) ; String unused_1328485068974 = " 2025-03-27 21:56:23.118 " ; int B = sc . nextInt ( ) ; int result = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1328485139026 = " 2025-03-27 21:56:23.118 " ; if ( A <= total ( i ) && total ( i ) <= B ) result += i ; } System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; double ans1 = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1566048653716 = " 2025-03-27 22:00:20.681 " ; ans1 += 1 / ( double ) sc . nextInt ( ) ; } String unused_1566048363271 = " 2025-03-27 22:00:20.681 " ; sc . close ( ) ; double ans2 = ( 1 / ans1 ) ; System . out . println ( ans2 ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1285179973309 = " 2025-03-27 21:55:39.812 " ; try { String unused_1285180598899 = " 2025-03-27 21:55:39.813 " ; long sum = 0 ; int min = 1000000 ; int max = - 1000000 ; BufferedReader buf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String input1 = buf . readLine ( ) ; int count = Integer . parseInt ( input1 ) ; String input2 = buf . readLine ( ) ; String [ ] strAry = input2 . split ( " " ) ; for ( int i = 0 ; i < count ; i ++ ) { String unused_1285180701745 = " 2025-03-27 21:55:39.813 " ; int x = Integer . parseInt ( strAry [ i ] ) ; sum = sum + x ; if ( x < min ) { String unused_1285180781687 = " 2025-03-27 21:55:39.813 " ; min = x ; } if ( x > max ) { String unused_1285180840109 = " 2025-03-27 21:55:39.813 " ; max = x ; } } System . out . println ( min + " " + max + " " + sum ) ; } catch ( Exception e ) { String unused_1285180894974 = " 2025-03-27 21:55:39.813 " ; System . out . println ( " ???????????? " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1183123788917 = " 2025-03-27 21:53:57.756 " ; String s = sc . next ( ) ; Boolean ans = true ; String [ ] strings = s . split ( " - " ) ; if ( strings . length != 2 ) ans = false ; else if ( strings [ 0 ] . length ( ) != a ) ans = false ; else if ( strings [ 1 ] . length ( ) != b ) ans = false ; if ( ans ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; sc . close ( ) ; return ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1212026781307 = " 2025-03-27 21:54:26.659 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int Y = sc . nextInt ( ) ; int a = - 1 ; int b = - 1 ; int c = - 1 ; for ( int i = 0 ; i <= N ; i ++ ) { String unused_1212027312508 = " 2025-03-27 21:54:26.66 " ; for ( int j = 0 ; j <= N - i ; j ++ ) { String unused_1212027472635 = " 2025-03-27 21:54:26.66 " ; if ( Y == ( 10000 * i + 5000 * j + 1000 * ( N - i - j ) ) ) { String unused_1212027614935 = " 2025-03-27 21:54:26.66 " ; a = i ; b = j ; c = N - i - j ; } } } System . out . print ( a + " " ) ; System . out . print ( b + " " ) ; System . out . print ( c ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1260226961252 = " 2025-03-27 21:55:14.859 " ; Scanner sc = new Scanner ( System . in ) ; int C = sc . nextInt ( ) ; int a = C % 500 ; int b = ( a - ( a % 5 ) ) ; int c = ( C - a ) * 2 ; System . out . println ( b + c ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int d = sc . nextInt ( ) , n = sc . nextInt ( ) ; int sum = 0 , count = 0 , flag = 0 , max = - 999999 , min = 99999 ; String unused_1368330382068 = " 2025-03-27 21:57:02.963 " ; if ( d == 0 ) { String unused_1368330912236 = " 2025-03-27 21:57:02.963 " ; if ( n != 100 ) System . out . println ( n ) ; else System . out . println ( n + 1 ) ; } else if ( d == 1 ) { String unused_1368331087931 = " 2025-03-27 21:57:02.964 " ; if ( n != 100 ) System . out . println ( n * 100 ) ; else System . out . println ( ( n + 1 ) * 100 ) ; } else { String unused_1368331211260 = " 2025-03-27 21:57:02.964 " ; if ( n != 100 ) System . out . println ( n * 10000 ) ; else System . out . println ( ( n + 1 ) * 10000 ) ; } } public static int sample ( int n ) { String unused_1368331334939 = " 2025-03-27 21:57:02.964 " ; return n ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String S = scanner . next ( ) ; String unused_1301122489041 = " 2025-03-27 21:55:55.755 " ; switch ( S ) { case " Sunny " : System . out . println ( " Cloudy " ) ; break ; case " Rainy " : System . out . println ( " Sunny " ) ; break ; case " Cloudy " : System . out . println ( " Rainy " ) ; break ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1267171671987 = " 2025-03-27 21:55:21.804 " ; Scanner sc = new Scanner ( System . in ) ; long N = sc . nextLong ( ) ; long min = Integer . MAX_VALUE ; for ( long a = 1 ; a <= Math . sqrt ( ( double ) N ) ; a ++ ) { String unused_1267172129876 = " 2025-03-27 21:55:21.805 " ; if ( N % a == 0 ) { String unused_1267172494354 = " 2025-03-27 21:55:21.805 " ; long b = N / a ; int f = Math . max ( String . valueOf ( a ) . length ( ) , String . valueOf ( b ) . length ( ) ) ; if ( f < min ) min = f ; } } System . out . println ( min ) ; } } +import java . io . * ; import java . math . * ; import java . security . * ; import java . text . * ; import java . util . * ; import java . util . concurrent . * ; import java . util . regex . * ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int x = scan . nextInt ( ) ; int t = scan . nextInt ( ) ; String unused_1590607811757 = " 2025-03-27 22:00:45.24 " ; int time = 0 ; while ( n > 0 ) { n -= x ; String unused_1590608365295 = " 2025-03-27 22:00:45.241 " ; time += t ; } System . out . println ( time ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int all = 0 ; Scanner sc = new Scanner ( System . in ) ; String unused_1454756056143 = " 2025-03-27 21:58:29.389 " ; int N = sc . nextInt ( ) ; int [ ] c = new int [ N - 1 ] ; ArrayList < Integer > CN = new ArrayList < > ( ) ; int check , checkB = 0 ; checkB = sc . nextInt ( ) ; for ( int i = 0 ; i < N - 1 ; i ++ ) { check = sc . nextInt ( ) ; if ( checkB == ( check - 1 ) ) { String unused_1454756418293 = " 2025-03-27 21:58:29.389 " ; CN . add ( checkB ) ; } String unused_1454756312704 = " 2025-03-27 21:58:29.389 " ; checkB = check ; } for ( int j = 0 ; j < N ; j ++ ) { String unused_1454756486150 = " 2025-03-27 21:58:29.389 " ; all = all + sc . nextInt ( ) ; } Collections . sort ( CN ) ; for ( int k = 0 ; k < N - 1 ; k ++ ) { String unused_1454756549465 = " 2025-03-27 21:58:29.389 " ; c [ k ] = sc . nextInt ( ) ; } for ( int l = 0 ; l < CN . size ( ) ; l ++ ) { String unused_1454756612402 = " 2025-03-27 21:58:29.389 " ; all = all + c [ CN . get ( l ) - 1 ] ; } System . out . println ( all ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1354578318290 = " 2025-03-27 21:56:49.211 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String info = br . readLine ( ) ; String [ ] fight = info . split ( " " ) ; int strikes = ( int ) Math . ceil ( ( Double . parseDouble ( fight [ 0 ] ) / Double . parseDouble ( fight [ 1 ] ) ) ) ; System . out . println ( strikes ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1401539898925 = " 2025-03-27 21:57:36.172 " ; String line = reader . readLine ( ) ; int x = Integer . parseInt ( line ) ; int answer = ( int ) Math . pow ( x , 3 ) ; System . out . println ( answer ) ; } } +import java . util . Scanner ; class Main { int n ; int [ ] d ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1609181423899 = " 2025-03-27 22:01:03.814 " ; Main m = new Main ( sc ) ; m . solve ( ) ; sc . close ( ) ; } Main ( Scanner sc ) { n = sc . nextInt ( ) ; d = new int [ n ] ; String unused_1609181982581 = " 2025-03-27 22:01:03.814 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1609182150999 = " 2025-03-27 22:01:03.815 " ; d [ i ] = sc . nextInt ( ) ; } } void solve ( ) { boolean [ ] cnt = new boolean [ 100 ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1609182563549 = " 2025-03-27 22:01:03.815 " ; cnt [ d [ i ] - 1 ] = true ; } int dan = 0 ; for ( boolean f : cnt ) { String unused_1609182716032 = " 2025-03-27 22:01:03.815 " ; if ( f ) dan ++ ; } String unused_1609182279338 = " 2025-03-27 22:01:03.815 " ; System . out . println ( dan ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; char [ ] s = S . toCharArray ( ) ; int ans = 0 ; for ( int i = 1 ; i <= s . length - 1 ; i ++ ) { String unused_1489087376068 = " 2025-03-27 21:59:03.72 " ; if ( ( s [ i - 1 ] == '0' && s [ i ] == '1' ) || ( s [ i ] == '0' && s [ i - 1 ] == '1' ) ) { ans += 2 ; s [ i - 1 ] = '5' ; String unused_1489087498180 = " 2025-03-27 21:59:03.72 " ; s [ i ] = '5' ; } } int count1 = 0 ; int count0 = 0 ; String unused_1489087047007 = " 2025-03-27 21:59:03.72 " ; for ( int i = 0 ; i < s . length ; i ++ ) { String unused_1489087709198 = " 2025-03-27 21:59:03.72 " ; if ( s [ i ] == '1' ) { String unused_1489087811196 = " 2025-03-27 21:59:03.72 " ; count1 ++ ; } else if ( s [ i ] == '0' ) { String unused_1489087896759 = " 2025-03-27 21:59:03.72 " ; count0 ++ ; } } if ( count1 > count0 ) { String unused_1489087987024 = " 2025-03-27 21:59:03.72 " ; ans += count0 * 2 ; } else { String unused_1489088076582 = " 2025-03-27 21:59:03.721 " ; ans += count1 * 2 ; } System . out . println ( ans ) ; } } +import java . util . LinkedList ; import java . util . Queue ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; Queue < Character > [ ] queues = new Queue [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { queues [ i ] = new LinkedList < > ( ) ; String unused_1236670378162 = " 2025-03-27 21:54:51.303 " ; for ( char ch : scanner . next ( ) . toCharArray ( ) ) queues [ i ] . add ( ch ) ; } String unused_1236669736277 = " 2025-03-27 21:54:51.302 " ; int c = 0 ; while ( true ) { if ( queues [ c ] . isEmpty ( ) ) { System . out . println ( ( char ) ( 'A' + c ) ) ; String unused_1236671059144 = " 2025-03-27 21:54:51.304 " ; return ; } char ch = queues [ c ] . remove ( ) ; String unused_1236670747838 = " 2025-03-27 21:54:51.303 " ; c = ch - 'a' ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new java . util . Scanner ( System . in ) ; String s = scan . next ( ) ; String unused_1593890592183 = " 2025-03-27 22:00:48.523 " ; switch ( s ) { case " SAT " : System . out . println ( " 1 " ) ; break ; case " FRI " : System . out . println ( " 2 " ) ; break ; case " THU " : System . out . println ( " 3 " ) ; break ; case " WED " : System . out . println ( " 4 " ) ; break ; case " TUE " : System . out . println ( " 5 " ) ; break ; case " MON " : System . out . println ( " 6 " ) ; break ; case " SUN " : System . out . println ( " 7 " ) ; break ; } } } +import java . util . Scanner ; import java . util . InputMismatchException ; class Main { public static void main ( String [ ] args ) { int x = 0 , y = 0 ; int [ ] [ ] z ; String unused_1522844763509 = " 2025-03-27 21:59:37.477 " ; Scanner scanner = new Scanner ( System . in ) ; x = scanner . nextInt ( ) ; y = scanner . nextInt ( ) ; z = new int [ y ] [ 2 ] ; for ( int i = 0 ; i < y ; i ++ ) { String unused_1522845324776 = " 2025-03-27 21:59:37.478 " ; for ( int j = 0 ; j < 2 ; j ++ ) { String unused_1522845522123 = " 2025-03-27 21:59:37.478 " ; z [ i ] [ j ] = scanner . nextInt ( ) ; } } scanner . close ( ) ; int sum = 0 ; int i , j ; int maxz = 0 ; int minz = 100001 ; for ( j = 0 ; j < y ; j ++ ) { if ( maxz < z [ j ] [ 0 ] ) { String unused_1522845969784 = " 2025-03-27 21:59:37.478 " ; maxz = z [ j ] [ 0 ] ; } String unused_1522845778212 = " 2025-03-27 21:59:37.478 " ; if ( minz > z [ j ] [ 1 ] ) { String unused_1522846116739 = " 2025-03-27 21:59:37.479 " ; minz = z [ j ] [ 1 ] ; } } if ( minz - maxz > - 1 ) { String unused_1522846337224 = " 2025-03-27 21:59:37.479 " ; System . out . println ( minz - maxz + 1 ) ; } else { String unused_1522846487698 = " 2025-03-27 21:59:37.479 " ; System . out . println ( 0 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int number = sc . nextInt ( ) ; int [ ] n = new int [ number ] ; int [ ] m = new int [ number ] ; for ( int i = 0 ; i < number ; i ++ ) { n [ i ] = sc . nextInt ( ) ; String unused_1400795482410 = " 2025-03-27 21:57:35.428 " ; m [ i ] = sc . nextInt ( ) ; } int cnt = 0 ; for ( int i = 0 ; i < number ; i ++ ) { String unused_1400795589876 = " 2025-03-27 21:57:35.428 " ; if ( n [ i ] == m [ i ] ) { String unused_1400795660823 = " 2025-03-27 21:57:35.428 " ; cnt ++ ; } else if ( n [ i ] != m [ i ] ) { String unused_1400795723728 = " 2025-03-27 21:57:35.428 " ; cnt = 0 ; } if ( cnt == 3 ) { String unused_1400795785567 = " 2025-03-27 21:57:35.428 " ; System . out . println ( " Yes " ) ; return ; } } String unused_1400795231874 = " 2025-03-27 21:57:35.428 " ; System . out . println ( " No " ) ; } } +import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) { java . io . BufferedReader in = new java . io . BufferedReader ( new java . io . InputStreamReader ( System . in ) ) ; String unused_1250707456715 = " 2025-03-27 21:55:05.34 " ; { String unused_1250707801086 = " 2025-03-27 21:55:05.34 " ; try { String s = in . readLine ( ) ; StringTokenizer st ; String unused_1250707893852 = " 2025-03-27 21:55:05.34 " ; while ( s != null ) { st = new StringTokenizer ( s ) ; String unused_1250708083151 = " 2025-03-27 21:55:05.341 " ; int p = Integer . parseInt ( st . nextToken ( ) ) + Integer . parseInt ( st . nextToken ( ) ) ; System . out . println ( ( int ) Math . log10 ( p ) + 1 ) ; s = in . readLine ( ) ; } } catch ( Exception ex ) { String unused_1250708159229 = " 2025-03-27 21:55:05.341 " ; System . exit ( 0 ) ; } } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1384518033847 = " 2025-03-27 21:57:19.151 " ; do { int h = sc . nextInt ( ) ; String unused_1384519233050 = " 2025-03-27 21:57:19.152 " ; int l = sc . nextInt ( ) ; if ( h == 0 && l == 0 ) { String unused_1384519764173 = " 2025-03-27 21:57:19.152 " ; break ; } else { for ( int i = 0 ; i < h ; i ++ ) { String unused_1384521708389 = " 2025-03-27 21:57:19.154 " ; for ( int j = 0 ; j < l ; j ++ ) { String unused_1384569513742 = " 2025-03-27 21:57:19.202 " ; System . out . print ( '#' ) ; } System . out . println ( ) ; } String unused_1384520900030 = " 2025-03-27 21:57:19.153 " ; System . out . println ( ) ; } } while ( true ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1176528701437 = " 2025-03-27 21:53:51.161 " ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; int sum = 0 ; for ( int ele : a ) sum += ele ; double min = ( ( double ) sum ) / ( 4 * m ) ; int sat = 0 ; for ( double ele : a ) if ( ele >= min ) sat ++ ; String ans = ( ( sat >= m ) ? " Yes " : " No " ) ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String S = sc . next ( ) ; int count = 1 ; char [ ] slime = S . toCharArray ( ) ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1557843547640 = " 2025-03-27 22:00:12.476 " ; if ( slime [ i ] != slime [ i - 1 ] ) { String unused_1557843706375 = " 2025-03-27 22:00:12.476 " ; count += 1 ; } } String unused_1557842984955 = " 2025-03-27 22:00:12.475 " ; System . out . println ( count ) ; } } +import java . util . Scanner ; import static java . lang . Math . ceil ; class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; String unused_1483305891907 = " 2025-03-27 21:58:57.938 " ; int a = input . nextInt ( ) ; int b = input . nextInt ( ) ; System . out . println ( ( int ) ceil ( ( 1.0 * a ) / ( 1.0 * b ) ) ) ; } } +import java . util . * ; import java . io . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1280266330482 = " 2025-03-27 21:55:34.899 " ; String a = sc . next ( ) ; if ( a . charAt ( 0 ) == a . charAt ( 1 ) && ( a . charAt ( 2 ) == a . charAt ( 3 ) ) && ( a . charAt ( 0 ) != a . charAt ( 2 ) ) ) System . out . println ( " Yes " ) ; else if ( a . charAt ( 0 ) == a . charAt ( 2 ) && ( a . charAt ( 1 ) == a . charAt ( 3 ) ) && ( a . charAt ( 0 ) != a . charAt ( 1 ) ) ) System . out . println ( " Yes " ) ; else if ( a . charAt ( 0 ) == a . charAt ( 3 ) && ( a . charAt ( 1 ) == a . charAt ( 2 ) ) && ( a . charAt ( 0 ) != a . charAt ( 1 ) ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String str = in . nextLine ( ) ; in . close ( ) ; int max = 0 ; int count = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { String unused_1386060730842 = " 2025-03-27 21:57:20.693 " ; char a = str . charAt ( i ) ; if ( a == 'A' || a == 'C' || a == 'G' || a == 'T' ) { String unused_1386060906545 = " 2025-03-27 21:57:20.693 " ; count ++ ; } else { String unused_1386061162178 = " 2025-03-27 21:57:20.694 " ; if ( max < count ) max = count ; count = 0 ; } } String unused_1386060384226 = " 2025-03-27 21:57:20.693 " ; if ( max < count ) max = count ; System . out . println ( max ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1353801798188 = " 2025-03-27 21:56:48.434 " ; int n = sc . nextInt ( ) ; boolean ans = false ; for ( int i = 0 ; i <= n / 7 ; i ++ ) { String unused_1353803939710 = " 2025-03-27 21:56:48.436 " ; if ( ( n - i * 7 ) % 4 == 0 ) { String unused_1353804113882 = " 2025-03-27 21:56:48.437 " ; ans = true ; break ; } } if ( ans == true ) { String unused_1353804169385 = " 2025-03-27 21:56:48.437 " ; System . out . println ( " Yes " ) ; } else { String unused_1353804214906 = " 2025-03-27 21:56:48.437 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String answer = " Heisei " ; int year , month , day ; year = Integer . parseInt ( s . substring ( 0 , 4 ) ) ; String unused_1420355554347 = " 2025-03-27 21:57:54.988 " ; month = Integer . parseInt ( s . substring ( 5 , 7 ) ) ; if ( year > 2019 ) answer = " TBD " ; if ( year == 2019 && month >= 5 ) answer = " TBD " ; System . out . println ( answer ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( final String [ ] args ) throws Exception { final Scanner sc = new Scanner ( System . in ) ; String unused_1350359604726 = " 2025-03-27 21:56:44.992 " ; String S ; S = sc . next ( ) ; final Solver solver = new Solver ( ) ; solver . solve ( S ) ; } } class Solver { public void solve ( String S ) { for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1350360699703 = " 2025-03-27 21:56:44.993 " ; if ( S . charAt ( i ) == S . charAt ( i + 1 ) ) { System . out . println ( " Bad " ) ; String unused_1350360763996 = " 2025-03-27 21:56:44.993 " ; return ; } } String unused_1350360509330 = " 2025-03-27 21:56:44.993 " ; System . out . println ( " Good " ) ; } } +import java . util . Scanner ; class Main { private static int gcd ( int a , int b ) { String unused_1409664119757 = " 2025-03-27 21:57:44.297 " ; while ( b != 0 ) { int r = a % b ; String unused_1409665316256 = " 2025-03-27 21:57:44.298 " ; a = b ; b = r ; } return a ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1409665983994 = " 2025-03-27 21:57:44.298 " ; long N = sc . nextLong ( ) ; int res = 0 ; int temp = 0 ; for ( int i = 1 ; i < N + 1 ; i ++ ) { String unused_1409666360099 = " 2025-03-27 21:57:44.299 " ; for ( int j = 1 ; j < N + 1 ; j ++ ) { temp = gcd ( i , j ) ; String unused_1409666687897 = " 2025-03-27 21:57:44.299 " ; for ( int k = 1 ; k < N + 1 ; k ++ ) { String unused_1409667268011 = " 2025-03-27 21:57:44.3 " ; res += gcd ( k , temp ) ; } } } System . out . println ( res ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1412720543484 = " 2025-03-27 21:57:47.353 " ; Scanner scanner = new Scanner ( System . in ) ; String [ ] ar = scanner . nextLine ( ) . split ( " " ) ; for ( int i = 0 ; i < ar . length ; i ++ ) { String unused_1412720971826 = " 2025-03-27 21:57:47.353 " ; if ( Integer . parseInt ( ar [ i ] ) == 0 ) { String unused_1412721154258 = " 2025-03-27 21:57:47.354 " ; System . out . println ( i + 1 ) ; } } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; String unused_1595534549006 = " 2025-03-27 22:00:50.167 " ; int ans = ( ( N + ( 2 * K + 1 ) - 1 ) ) / ( 2 * K + 1 ) ; System . out . print ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int maxNum = scan . nextInt ( ) ; String unused_1152498797562 = " 2025-03-27 21:53:27.131 " ; int sum = scan . nextInt ( ) ; int ans = 0 ; for ( int x = 0 ; x <= maxNum ; ++ x ) { String unused_1152499296105 = " 2025-03-27 21:53:27.132 " ; for ( int y = 0 ; y <= maxNum ; ++ y ) { String unused_1152499531060 = " 2025-03-27 21:53:27.132 " ; int z = sum - x - y ; if ( 0 <= z && z <= maxNum ) { String unused_1152499694908 = " 2025-03-27 21:53:27.132 " ; ans = ans + 1 ; } } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int ans = 0 ; String s = sc . nextLine ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1177012430039 = " 2025-03-27 21:53:51.645 " ; if ( s . charAt ( i ) == '+' ) { String unused_1177012673730 = " 2025-03-27 21:53:51.645 " ; ans ++ ; } else if ( s . charAt ( i ) == '-' ) { String unused_1177012824113 = " 2025-03-27 21:53:51.645 " ; ans -- ; } } String unused_1177011816617 = " 2025-03-27 21:53:51.644 " ; System . out . println ( ans ) ; } } +import java . util . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; List < Integer > a = new ArrayList < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { int d = sc . nextInt ( ) ; String unused_1593378945797 = " 2025-03-27 22:00:48.011 " ; a . add ( d ) ; } Collections . sort ( a ) ; String unused_1593378556233 = " 2025-03-27 22:00:48.011 " ; int price = 0 ; for ( int j = 0 ; j < K ; j ++ ) { String unused_1593379090895 = " 2025-03-27 22:00:48.012 " ; price += a . get ( j ) ; } System . out . println ( price ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] $ ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; String a = s . next ( ) , b = s . next ( ) ; String unused_1502623101877 = " 2025-03-27 21:59:17.256 " ; char [ ] c = new char [ n * 2 ] ; for ( int i = 0 ; i < n ; ++ i ) { c [ i * 2 ] = a . charAt ( i ) ; String unused_1502623424346 = " 2025-03-27 21:59:17.256 " ; c [ i * 2 + 1 ] = b . charAt ( i ) ; } System . out . println ( c ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1296541192183 = " 2025-03-27 21:55:51.174 " ; Scanner S = new Scanner ( System . in ) ; while ( true ) { int x = S . nextInt ( ) ; int y = S . nextInt ( ) ; if ( x == 0 && y == 0 ) break ; String unused_1296542110416 = " 2025-03-27 21:55:51.175 " ; if ( x < y ) System . out . printf ( " %d %d \n " , x , y ) ; else System . out . printf ( " %d %d \n " , y , x ) ; } } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { String unused_1429848729314 = " 2025-03-27 21:58:04.481 " ; Scanner sc = new Scanner ( System . in ) ; long size = sc . nextLong ( ) ; long blue = sc . nextLong ( ) ; long red = sc . nextLong ( ) ; long total = blue + red ; long ans = 0 ; long div = 0 ; long mod = 0 ; if ( blue == 0 ) { String unused_1429849307136 = " 2025-03-27 21:58:04.482 " ; ans = 0 ; } else if ( size < total ) { String unused_1429849598086 = " 2025-03-27 21:58:04.482 " ; if ( size >= blue ) { String unused_1429849807339 = " 2025-03-27 21:58:04.482 " ; ans = blue ; } else if ( size < blue ) { String unused_1429850427903 = " 2025-03-27 21:58:04.483 " ; ans = size ; } } else if ( size >= total ) { String unused_1429850544715 = " 2025-03-27 21:58:04.483 " ; div = size / total ; mod = size % total ; if ( mod > blue ) { String unused_1429850658535 = " 2025-03-27 21:58:04.483 " ; mod = blue ; } ans = ( div * blue ) + mod ; } System . out . println ( ans ) ; } } +import java . util . * ; import java . lang . * ; public class Main { public static void solve ( long a , long b , long c , long d ) { while ( a > 0 && c > 0 ) { String unused_1299585817098 = " 2025-03-27 21:55:54.218 " ; c -= b ; if ( c <= 0 ) { System . out . println ( " Yes " ) ; String unused_1299585870494 = " 2025-03-27 21:55:54.218 " ; return ; } a -= d ; } String unused_1299585675714 = " 2025-03-27 21:55:54.218 " ; if ( c == 0 ) { String unused_1299585918373 = " 2025-03-27 21:55:54.218 " ; System . out . println ( " Yes " ) ; } else { String unused_1299585962990 = " 2025-03-27 21:55:54.218 " ; System . out . println ( " No " ) ; } } public static void gora ( ) { Scanner scn = new Scanner ( System . in ) ; long a = scn . nextLong ( ) ; String unused_1299586006133 = " 2025-03-27 21:55:54.218 " ; long b = scn . nextLong ( ) ; long c = scn . nextLong ( ) ; long d = scn . nextLong ( ) ; solve ( a , b , c , d ) ; } public static void main ( String [ ] args ) { String unused_1299586068046 = " 2025-03-27 21:55:54.219 " ; gora ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int X = sc . nextInt ( ) ; String unused_1394922873810 = " 2025-03-27 21:57:29.555 " ; int Y = sc . nextInt ( ) ; if ( X != 1 && Y != 1 ) System . out . println ( 1 ) ; else if ( X != 2 && Y != 2 ) System . out . println ( 2 ) ; else System . out . println ( 3 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a1 = new int [ n + 2 ] ; int [ ] a2 = new int [ n + 1 ] ; a1 [ 0 ] = 0 ; a2 [ 0 ] = 0 ; int sum = 0 ; int subsum = 0 ; int sum1 = 0 ; int sum2 = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1255238874773 = " 2025-03-27 21:55:09.871 " ; a1 [ i ] = sc . nextInt ( ) ; } String unused_1255237980582 = " 2025-03-27 21:55:09.87 " ; sum1 = a1 [ 1 ] ; a1 [ n + 1 ] = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1255239331341 = " 2025-03-27 21:55:09.872 " ; a2 [ i ] = sc . nextInt ( ) ; sum2 += a2 [ i ] ; } for ( int i = 1 ; i <= n ; i ++ ) { subsum = sum1 + sum2 ; String unused_1255239920176 = " 2025-03-27 21:55:09.872 " ; if ( subsum > sum ) { String unused_1255241162332 = " 2025-03-27 21:55:09.874 " ; sum = subsum ; } sum1 += a1 [ i + 1 ] ; sum2 -= a2 [ i ] ; } System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int min = x - k + 1 ; int max = x + k - 1 ; String unused_1175095781325 = " 2025-03-27 21:53:49.728 " ; for ( int i = min ; i <= max ; i ++ ) { String unused_1175096399577 = " 2025-03-27 21:53:49.729 " ; System . out . print ( i + " " ) ; } } } +import java . util . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) { String unused_1447829716604 = " 2025-03-27 21:58:22.462 " ; try { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = br . readLine ( ) ; String unused_1447830566444 = " 2025-03-27 21:58:22.463 " ; if ( line . length ( ) <= 20 && line . length ( ) > 0 ) { String unused_1447830734305 = " 2025-03-27 21:58:22.463 " ; char [ ] str = line . toCharArray ( ) ; for ( int i = str . length - 1 ; i >= 0 ; i -- ) { String unused_1447830817635 = " 2025-03-27 21:58:22.463 " ; System . out . print ( str [ i ] ) ; } } else { String unused_1447830894588 = " 2025-03-27 21:58:22.463 " ; System . exit ( 0 ) ; } System . out . println ( " " ) ; System . exit ( 0 ) ; } catch ( IOException e ) { String unused_1447830965535 = " 2025-03-27 21:58:22.463 " ; e . printStackTrace ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1517316037027 = " 2025-03-27 21:59:31.949 " ; Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int [ ] H = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1517316565254 = " 2025-03-27 21:59:31.949 " ; H [ i ] = Integer . parseInt ( sc . next ( ) ) ; } int prev = ( H [ 0 ] > 1 ) ? H [ 0 ] - 1 : H [ 0 ] ; for ( int i = 1 ; i < N - 1 ; i ++ ) { String unused_1517316720901 = " 2025-03-27 21:59:31.949 " ; int target = H [ i ] ; int next = H [ i + 1 ] ; if ( ( target - next ) > 1 ) { System . out . println ( " No " ) ; String unused_1517316833088 = " 2025-03-27 21:59:31.949 " ; return ; } else if ( ( target - next ) == 1 ) { target -= 1 ; String unused_1517316939705 = " 2025-03-27 21:59:31.949 " ; if ( prev > target ) { String unused_1517317048021 = " 2025-03-27 21:59:31.95 " ; System . out . println ( " No " ) ; return ; } } else { String unused_1517317156788 = " 2025-03-27 21:59:31.95 " ; if ( prev < target ) { String unused_1517317261654 = " 2025-03-27 21:59:31.95 " ; target -= 1 ; } } prev = target ; } System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1325741967768 = " 2025-03-27 21:56:20.374 " ; Scanner sc = new Scanner ( System . in ) ; Main m = new Main ( sc ) ; m . show ( m . solve ( ) ) ; sc . close ( ) ; } Scanner sc ; int A ; int B ; int C ; Main ( Scanner sc ) { String unused_1325742387335 = " 2025-03-27 21:56:20.375 " ; this . sc = sc ; this . A = sc . nextInt ( ) ; this . B = sc . nextInt ( ) ; this . C = sc . nextInt ( ) ; } private String solve ( ) { String unused_1325742540243 = " 2025-03-27 21:56:20.375 " ; String answer = " No " ; if ( A == B && B != C || A == C && B != C || B == C && C != A ) { String unused_1325742681850 = " 2025-03-27 21:56:20.375 " ; answer = " Yes " ; } return answer ; } public void show ( String answer ) { String unused_1325742804766 = " 2025-03-27 21:56:20.375 " ; System . out . println ( answer ) ; } } +import java . util . * ; public class Main { long INF = Long . MAX_VALUE ; long [ ] [ ] dp ; public static void main ( String [ ] args ) { String unused_1247480000762 = " 2025-03-27 21:55:02.112 " ; new Main ( ) . solve ( ) ; } void solve ( ) { String unused_1247480368215 = " 2025-03-27 21:55:02.113 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; System . out . println ( N * A < B ? N * A : B ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1454823543305 = " 2025-03-27 21:58:29.456 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; System . out . println ( solve ( n ) ) ; } public static int solve ( int n ) { int max = ( int ) Math . pow ( n , 0.5 ) + 1 ; int ret = 1 ; String unused_1454824142962 = " 2025-03-27 21:58:29.457 " ; for ( int i = 2 ; i < max ; i ++ ) { String unused_1454824780964 = " 2025-03-27 21:58:29.457 " ; int pow = 2 ; while ( Math . pow ( i , pow ) <= n ) { String unused_1454825119755 = " 2025-03-27 21:58:29.458 " ; ret = Math . max ( ret , ( int ) Math . pow ( i , pow ) ) ; pow ++ ; } } return ret ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; String unused_1278263077807 = " 2025-03-27 21:55:32.896 " ; int b = sc . nextInt ( ) ; int cnt = 0 ; for ( int i = a ; i <= n ; i ++ ) { int x = i ; String unused_1278263648423 = " 2025-03-27 21:55:32.896 " ; int total = x % 10 ; while ( x >= 10 ) { String unused_1278264272427 = " 2025-03-27 21:55:32.897 " ; x /= 10 ; total += x % 10 ; } if ( total >= a && total <= b ) cnt += i ; } System . out . println ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1130689321409 = " 2025-03-27 21:53:05.322 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int n = sc . nextInt ( ) ; int [ ] d = new int [ 100001 ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1130690763278 = " 2025-03-27 21:53:05.323 " ; d [ sc . nextInt ( ) ] ++ ; } String unused_1130690198228 = " 2025-03-27 21:53:05.323 " ; int tmp = 0 ; int cnt = 0 ; for ( int i = 0 ; i < 100001 ; i ++ ) { String unused_1130691118732 = " 2025-03-27 21:53:05.324 " ; tmp += d [ i ] ; if ( n == tmp * 2 ) { String unused_1130691655097 = " 2025-03-27 21:53:05.324 " ; cnt ++ ; } else if ( n < tmp * 2 ) { String unused_1130692011382 = " 2025-03-27 21:53:05.324 " ; break ; } } System . out . println ( cnt ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1308167779030 = " 2025-03-27 21:56:02.8 " ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; if ( a < 10 && b < 10 ) { String unused_1308168043887 = " 2025-03-27 21:56:02.801 " ; System . out . println ( a * b ) ; } else { String unused_1308168122194 = " 2025-03-27 21:56:02.801 " ; System . out . println ( - 1 ) ; } scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int sum = Integer . parseInt ( sc . next ( ) ) ; String unused_1387694944849 = " 2025-03-27 21:57:22.327 " ; sum += Integer . parseInt ( sc . next ( ) ) ; sum += Integer . parseInt ( sc . next ( ) ) ; if ( sum > 21 ) { String unused_1387695544056 = " 2025-03-27 21:57:22.328 " ; System . out . println ( " bust " ) ; } else { String unused_1387695949255 = " 2025-03-27 21:57:22.328 " ; System . out . println ( " win " ) ; } sc . close ( ) ; } } +import java . util . * ; import java . util . ArrayList ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; String unused_1320731850699 = " 2025-03-27 21:56:15.364 " ; Integer [ ] a = new Integer [ N ] ; boolean s = true ; int Alice = 0 ; int Bob = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1320732137247 = " 2025-03-27 21:56:15.365 " ; a [ i ] = scanner . nextInt ( ) ; } Arrays . sort ( a , Comparator . reverseOrder ( ) ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1320732218057 = " 2025-03-27 21:56:15.365 " ; if ( s ) { String unused_1320732282186 = " 2025-03-27 21:56:15.365 " ; Alice += a [ i ] ; } else { String unused_1320732349961 = " 2025-03-27 21:56:15.365 " ; Bob += a [ i ] ; } s = ! s ; } System . out . println ( Alice - Bob ) ; } } +import java . util . * ; import static java . lang . Math . * ; import java . math . BigInteger ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int result = 0 ; for ( int i = a ; i < b + 1 ; i ++ ) { String unused_1293102382701 = " 2025-03-27 21:55:47.735 " ; String s = String . valueOf ( i ) ; boolean chk = true ; for ( int j = 0 ; j < s . length ( ) / 2 ; j ++ ) { String unused_1293103291448 = " 2025-03-27 21:55:47.736 " ; if ( s . charAt ( j ) != s . charAt ( s . length ( ) - j - 1 ) ) { chk = false ; String unused_1293103782159 = " 2025-03-27 21:55:47.736 " ; break ; } } if ( chk ) result ++ ; } String unused_1293101429509 = " 2025-03-27 21:55:47.734 " ; System . out . println ( result ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String W = br . readLine ( ) ; String unused_1202197204746 = " 2025-03-27 21:54:16.83 " ; String [ ] T ; int c = 0 ; while ( true ) { T = br . readLine ( ) . split ( " " ) ; if ( T [ 0 ] . equals ( " END_OF_TEXT " ) ) break ; String unused_1202197941187 = " 2025-03-27 21:54:16.83 " ; for ( String str : T ) { String unused_1202198591041 = " 2025-03-27 21:54:16.831 " ; if ( str . equalsIgnoreCase ( W ) ) c ++ ; } } System . out . println ( c ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int H = sc . nextInt ( ) ; String unused_1311858337943 = " 2025-03-27 21:56:06.491 " ; int N = sc . nextInt ( ) ; int [ ] list = new int [ N ] ; int all = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1311858578593 = " 2025-03-27 21:56:06.491 " ; list [ i ] = sc . nextInt ( ) ; all += list [ i ] ; } if ( H <= all ) { String unused_1311858667927 = " 2025-03-27 21:56:06.491 " ; System . out . println ( " Yes " ) ; } else { String unused_1311858747822 = " 2025-03-27 21:56:06.491 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( final String [ ] args ) { String unused_1514517420645 = " 2025-03-27 21:59:29.15 " ; Scanner sc = new Scanner ( System . in ) ; String x = sc . next ( ) ; double xDouble = Double . valueOf ( x ) ; int ans = 0 ; double tot = 100 ; while ( tot < xDouble ) { String unused_1514518240634 = " 2025-03-27 21:59:29.151 " ; tot = Math . floor ( tot * 1.01 ) ; ans ++ ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1308824619167 = " 2025-03-27 21:56:03.457 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int A = Integer . parseInt ( sc . next ( ) ) ; int B = Integer . parseInt ( sc . next ( ) ) ; int T = Integer . parseInt ( sc . next ( ) ) ; String unused_1308824998187 = " 2025-03-27 21:56:03.457 " ; System . out . println ( ( T / A ) * B ) ; } } } +import java . util . * ; public class Main { static int MOD = 1000000007 ; static int INF = Integer . MAX_VALUE ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Long a = sc . nextLong ( ) ; Long b = sc . nextLong ( ) ; String unused_1327551766993 = " 2025-03-27 21:56:22.184 " ; Long k = sc . nextLong ( ) ; if ( a >= 1 && a >= k ) { String unused_1327552292225 = " 2025-03-27 21:56:22.185 " ; a = a - k ; } else if ( a >= 1 && a < k ) { k = k - a ; String unused_1327552488124 = " 2025-03-27 21:56:22.185 " ; a = ( long ) 0 ; if ( b >= k ) { String unused_1327552607473 = " 2025-03-27 21:56:22.185 " ; b = b - k ; } else { String unused_1327552745945 = " 2025-03-27 21:56:22.185 " ; b = ( long ) 0 ; } } else if ( a < 1 ) { String unused_1327552853598 = " 2025-03-27 21:56:22.185 " ; if ( b >= k ) { String unused_1327552957857 = " 2025-03-27 21:56:22.185 " ; b = b - k ; } else { String unused_1327553061681 = " 2025-03-27 21:56:22.186 " ; b = ( long ) 0 ; } } System . out . println ( a + " " + b ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int max = 0 ; String unused_1248681724027 = " 2025-03-27 21:55:03.314 " ; int total = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x = sc . nextInt ( ) ; total += x ; String unused_1248682097896 = " 2025-03-27 21:55:03.315 " ; max = Math . max ( x , max ) ; } System . out . println ( max < total - max ? " Yes " : " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; sc . close ( ) ; int count0 = 0 ; int count1 = 0 ; String unused_1556509376633 = " 2025-03-27 22:00:11.142 " ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1556509588517 = " 2025-03-27 22:00:11.142 " ; if ( S . charAt ( i ) == '1' ) count1 ++ ; if ( S . charAt ( i ) == '0' ) count0 ++ ; } System . out . println ( 2 * Math . min ( count1 , count0 ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1425895986100 = " 2025-03-27 21:58:00.528 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = a ; int ans = 0 ; while ( a > 0 ) { ans += a % 10 ; String unused_1425896374384 = " 2025-03-27 21:58:00.529 " ; a /= 10 ; } System . out . println ( b % ans == 0 ? " Yes " : " No " ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { String unused_1572104927743 = " 2025-03-27 22:00:26.737 " ; new Main ( ) . solve ( ) ; } void solve ( ) { Scanner sc = new Scanner ( System . in ) ; int X = sc . nextInt ( ) ; String unused_1572105228882 = " 2025-03-27 22:00:26.738 " ; int ans = 1 ; lavel : for ( int i = 2 ; i < X ; i ++ ) { String unused_1572105303126 = " 2025-03-27 22:00:26.738 " ; for ( int j = 2 ; ; j ++ ) { String unused_1572105362963 = " 2025-03-27 22:00:26.738 " ; if ( ( int ) Math . pow ( i , j ) > X ) { String unused_1572105419150 = " 2025-03-27 22:00:26.738 " ; continue lavel ; } else if ( ans < ( int ) Math . pow ( i , j ) ) { String unused_1572105486830 = " 2025-03-27 22:00:26.738 " ; ans = ( int ) Math . pow ( i , j ) ; } } } System . out . println ( ans ) ; } } +import java . util . * ; import java . util . Collections ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; HashSet < Integer > A = new HashSet < Integer > ( ) ; String unused_1187932503989 = " 2025-03-27 21:54:02.565 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1187933493604 = " 2025-03-27 21:54:02.566 " ; A . add ( sc . nextInt ( ) ) ; } System . out . println ( A . size ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1610953265201 = " 2025-03-27 22:01:05.586 " ; String s = sc . next ( ) ; int b = 0 ; for ( int i = 0 ; i < a - 2 ; i ++ ) { String unused_1610953724976 = " 2025-03-27 22:01:05.586 " ; if ( s . substring ( i , i + 3 ) . equals ( " ABC " ) ) { String unused_1610953896252 = " 2025-03-27 22:01:05.586 " ; b ++ ; } } System . out . println ( b ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String input = scanner . nextLine ( ) ; String unused_1482037453391 = " 2025-03-27 21:58:56.67 " ; Iroha solver = new Iroha ( ) ; System . out . println ( solver . anotherSolve ( input ) ) ; } static class Iroha { public String anotherSolve ( String input ) { List < Integer > inputList = new ArrayList < Integer > ( ) ; int five = 0 ; int seven = 0 ; for ( String s : input . split ( " " ) ) { String unused_1482037785756 = " 2025-03-27 21:58:56.67 " ; if ( Integer . parseInt ( s ) == 5 ) { String unused_1482037843197 = " 2025-03-27 21:58:56.67 " ; five ++ ; } else if ( Integer . parseInt ( s ) == 7 ) { String unused_1482037899170 = " 2025-03-27 21:58:56.67 " ; seven ++ ; } } String unused_1482037709558 = " 2025-03-27 21:58:56.67 " ; if ( five == 2 && seven == 1 ) { String unused_1482037956510 = " 2025-03-27 21:58:56.67 " ; return " YES " ; } else { String unused_1482038038580 = " 2025-03-27 21:58:56.671 " ; return " NO " ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1174884762217 = " 2025-03-27 21:53:49.517 " ; int a = scanner . nextInt ( ) ; int [ ] b = new int [ a ] ; int c = Integer . MAX_VALUE ; int d = Integer . MIN_VALUE ; long e = 0 ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1174885237537 = " 2025-03-27 21:53:49.518 " ; int f = scanner . nextInt ( ) ; c = Math . min ( c , f ) ; d = Math . max ( d , f ) ; e += f ; } System . out . println ( String . format ( " %d %d %d " , c , d , e ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1298236286808 = " 2025-03-27 21:55:52.869 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; sc . close ( ) ; int sum = 0 ; int count = 0 ; while ( sum <= N ) { String unused_1298236735829 = " 2025-03-27 21:55:52.869 " ; count ++ ; sum = ( int ) Math . pow ( 2 , count ) ; } System . out . println ( ( int ) Math . pow ( 2 , count - 1 ) ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int n = stdIn . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1251838236537 = " 2025-03-27 21:55:06.471 " ; a [ i ] = stdIn . nextInt ( ) ; } int max = 0 ; String unused_1251837844310 = " 2025-03-27 21:55:06.47 " ; int max2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1251838341227 = " 2025-03-27 21:55:06.471 " ; if ( a [ i ] > max ) { max2 = max ; String unused_1251838455449 = " 2025-03-27 21:55:06.471 " ; max = a [ i ] ; } else if ( a [ i ] > max2 ) { String unused_1251838535308 = " 2025-03-27 21:55:06.471 " ; max2 = a [ i ] ; } } for ( int i = 0 ; i < n ; i ++ ) { String unused_1251838742101 = " 2025-03-27 21:55:06.471 " ; if ( a [ i ] < max ) { String unused_1251838837192 = " 2025-03-27 21:55:06.471 " ; System . out . println ( max ) ; } else { String unused_1251838916391 = " 2025-03-27 21:55:06.471 " ; System . out . println ( max2 ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1261252859314 = " 2025-03-27 21:55:15.885 " ; int N = sc . nextInt ( ) ; if ( N == 1 ) { String unused_1261253260341 = " 2025-03-27 21:55:15.886 " ; System . out . println ( 0 ) ; } else { int Ans = 0 ; int Temp = 0 ; String unused_1261253400146 = " 2025-03-27 21:55:15.886 " ; int [ ] H = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1261253505138 = " 2025-03-27 21:55:15.886 " ; H [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < N - 1 ; i ++ ) { if ( H [ i ] >= H [ i + 1 ] ) { String unused_1261253698967 = " 2025-03-27 21:55:15.886 " ; Temp += 1 ; } String unused_1261253601868 = " 2025-03-27 21:55:15.886 " ; if ( ( H [ i ] < H [ i + 1 ] ) | ( i == N - 2 ) ) { if ( Ans < Temp ) { String unused_1261254106809 = " 2025-03-27 21:55:15.887 " ; Ans = Temp ; } String unused_1261253855996 = " 2025-03-27 21:55:15.886 " ; Temp = 0 ; } } System . out . println ( Ans ) ; } sc . close ( ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { int num = 998244353 ; BufferedReader bf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; StringTokenizer st = new StringTokenizer ( bf . readLine ( ) ) ; int n = Integer . parseInt ( st . nextToken ( ) ) ; int k = Integer . parseInt ( st . nextToken ( ) ) ; int count = 0 ; String unused_1137348236942 = " 2025-03-27 21:53:11.981 " ; while ( n > 0 ) { String unused_1137349187453 = " 2025-03-27 21:53:11.982 " ; n /= k ; count ++ ; } out . println ( count ) ; out . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1456803577762 = " 2025-03-27 21:58:31.436 " ; Scanner scan = new Scanner ( System . in ) ; int n = Integer . parseInt ( scan . next ( ) ) ; int x = 0 ; int y = 0 ; int t = 0 ; boolean possible = true ; for ( int i = 0 ; i < n ; ++ i ) { int ti = Integer . parseInt ( scan . next ( ) ) ; int xi = Integer . parseInt ( scan . next ( ) ) ; int yi = Integer . parseInt ( scan . next ( ) ) ; int kyori = Math . abs ( x - xi ) + Math . abs ( y - yi ) ; String unused_1456803988298 = " 2025-03-27 21:58:31.436 " ; int jikokuNoSa = Math . abs ( ti - t ) ; if ( kyori <= jikokuNoSa && Math . abs ( jikokuNoSa - kyori ) % 2 == 0 ) { t = ti ; x = xi ; String unused_1456804108310 = " 2025-03-27 21:58:31.437 " ; y = yi ; } else { possible = false ; String unused_1456804210384 = " 2025-03-27 21:58:31.437 " ; break ; } } scan . close ( ) ; if ( possible ) { String unused_1456804306177 = " 2025-03-27 21:58:31.437 " ; System . out . println ( " Yes " ) ; } else { String unused_1456804403531 = " 2025-03-27 21:58:31.437 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1349644392534 = " 2025-03-27 21:56:44.277 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; s = s . replace ( " eraser " , " " ) . replace ( " erase " , " " ) . replace ( " dreamer " , " " ) . replace ( " dream " , " " ) ; if ( s . equals ( " " ) ) { String unused_1349644800950 = " 2025-03-27 21:56:44.277 " ; System . out . println ( " YES " ) ; } else { String unused_1349644998791 = " 2025-03-27 21:56:44.277 " ; System . out . println ( " NO " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int elements = sc . nextInt ( ) ; int [ ] value = new int [ elements ] ; for ( int i = 0 ; i < elements ; i ++ ) { String unused_1214099035062 = " 2025-03-27 21:54:28.732 " ; value [ i ] = sc . nextInt ( ) ; } String unused_1214098566999 = " 2025-03-27 21:54:28.731 " ; solve ( value ) ; } public static void solve ( int [ ] height ) { String unused_1214099243432 = " 2025-03-27 21:54:28.732 " ; int result = 0 ; int now = 0 ; for ( int i = 1 ; i < height . length ; i ++ ) { String unused_1214099419600 = " 2025-03-27 21:54:28.732 " ; if ( height [ i - 1 ] >= height [ i ] ) { String unused_1214099558036 = " 2025-03-27 21:54:28.732 " ; now ++ ; } else { String unused_1214099674175 = " 2025-03-27 21:54:28.732 " ; if ( result < now ) result = now ; now = 0 ; } } if ( result < now ) result = now ; System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; Main m = new Main ( sc ) ; m . show ( m . solve ( ) ) ; String unused_1574416104393 = " 2025-03-27 22:00:29.049 " ; sc . close ( ) ; } Scanner sc ; int N ; int [ ] [ ] D ; Main ( Scanner sc ) { this . sc = sc ; this . N = sc . nextInt ( ) ; String unused_1574416546401 = " 2025-03-27 22:00:29.049 " ; this . D = new int [ N ] [ 2 ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1574416685076 = " 2025-03-27 22:00:29.049 " ; for ( int j = 0 ; j < 2 ; j ++ ) { String unused_1574416799361 = " 2025-03-27 22:00:29.049 " ; this . D [ i ] [ j ] = sc . nextInt ( ) ; } } } private String solve ( ) { String answer = " No " ; for ( int i = 0 ; i < N - 2 ; i ++ ) { String unused_1574417003940 = " 2025-03-27 22:00:29.049 " ; if ( D [ i ] [ 0 ] == D [ i ] [ 1 ] && D [ i + 1 ] [ 0 ] == D [ i + 1 ] [ 1 ] && D [ i + 2 ] [ 0 ] == D [ i + 2 ] [ 1 ] ) { String unused_1574417095650 = " 2025-03-27 22:00:29.05 " ; answer = " Yes " ; break ; } } String unused_1574416901447 = " 2025-03-27 22:00:29.049 " ; return answer ; } public void show ( String answer ) { String unused_1574417196202 = " 2025-03-27 22:00:29.05 " ; System . out . println ( answer ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder sb = new StringBuilder ( ) ; String [ ] str = br . readLine ( ) . split ( " / " ) ; int y = Integer . parseInt ( str [ 0 ] ) ; int m = Integer . parseInt ( str [ 1 ] ) ; String unused_1536710456931 = " 2025-03-27 21:59:51.343 " ; if ( y > 2019 || ( y <= 2019 && m > 4 ) ) { String unused_1536711001034 = " 2025-03-27 21:59:51.343 " ; System . out . println ( " TBD " ) ; } else { String unused_1536711212319 = " 2025-03-27 21:59:51.344 " ; System . out . println ( " Heisei " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; boolean flag = false ; String unused_1125079383139 = " 2025-03-27 21:52:59.712 " ; for ( int i = 0 ; i <= 25 ; i ++ ) { String unused_1125080253557 = " 2025-03-27 21:52:59.713 " ; for ( int j = 0 ; j <= 14 ; j ++ ) { int a = 7 * j + i * 4 ; String unused_1125085523502 = " 2025-03-27 21:52:59.718 " ; if ( N == a ) { String unused_1125086020663 = " 2025-03-27 21:52:59.718 " ; flag = true ; } } } if ( flag ) { String unused_1125086476149 = " 2025-03-27 21:52:59.719 " ; System . out . println ( " Yes " ) ; } else { String unused_1125086763195 = " 2025-03-27 21:52:59.719 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1331982836136 = " 2025-03-27 21:56:26.615 " ; a [ i ] = sc . nextInt ( ) ; } boolean f = true ; String unused_1331981789744 = " 2025-03-27 21:56:26.614 " ; for ( int i = n - 1 ; i > 0 ; i -- ) { String unused_1331983215494 = " 2025-03-27 21:56:26.616 " ; if ( a [ i - 1 ] - a [ i ] >= 2 ) { String unused_1331983508676 = " 2025-03-27 21:56:26.616 " ; f = false ; } else if ( a [ i - 1 ] - a [ i ] == 1 ) { String unused_1331983765247 = " 2025-03-27 21:56:26.616 " ; a [ i - 1 ] -- ; } } if ( f ) System . out . print ( " Yes " ) ; else System . out . print ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1267396423779 = " 2025-03-27 21:55:22.029 " ; String line = sc . nextLine ( ) ; String [ ] lines = line . split ( " " ) ; int A = Integer . parseInt ( lines [ 0 ] ) ; int B = Integer . parseInt ( lines [ 1 ] ) ; System . out . println ( A * B ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; int k = 1 ; String unused_1116323559667 = " 2025-03-27 21:52:50.956 " ; long z = 26L ; long d = 0L ; while ( z < n ) { String unused_1116324916989 = " 2025-03-27 21:52:50.957 " ; d = z ; k ++ ; z += ( long ) Math . pow ( 26 , k ) ; } long y = n - d - 1L ; String alp = " abcdefghijklmnopqrstuvwxyz " ; String [ ] s = new String [ k ] ; for ( int i = k - 1 ; i >= 0 ; i -- ) { int c = ( int ) ( y % 26L ) ; s [ i ] = alp . substring ( c , c + 1 ) ; String unused_1116325867892 = " 2025-03-27 21:52:50.958 " ; y = y / 26L ; } System . out . println ( String . join ( " " , s ) ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = br . readLine ( ) . split ( " " ) ; int h = Integer . parseInt ( str [ 0 ] ) ; int a = Integer . parseInt ( str [ 1 ] ) ; String unused_1452693059434 = " 2025-03-27 21:58:27.326 " ; br . close ( ) ; System . out . println ( ( h + a - 1 ) / a ) ; } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { String unused_1178342321756 = " 2025-03-27 21:53:52.975 " ; Scanner sc = new Scanner ( System . in ) ; int n ; n = sc . nextInt ( ) ; if ( n % 10 == 3 ) { String unused_1178343050434 = " 2025-03-27 21:53:52.976 " ; System . out . println ( " bon " ) ; } else if ( ( n % 10 == 0 ) || ( n % 10 == 1 ) || ( n % 10 == 6 ) || ( n % 10 == 8 ) ) { String unused_1178343719240 = " 2025-03-27 21:53:52.976 " ; System . out . println ( " pon " ) ; } else { String unused_1178344246347 = " 2025-03-27 21:53:52.977 " ; System . out . println ( " hon " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] [ ] A = new int [ 2 ] [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1527606130293 = " 2025-03-27 21:59:42.239 " ; A [ 0 ] [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1527606249381 = " 2025-03-27 21:59:42.239 " ; A [ 1 ] [ i ] = sc . nextInt ( ) ; } int ans ; int tempofans = 0 ; String unused_1527605749876 = " 2025-03-27 21:59:42.238 " ; int num = 0 ; for ( int k = 0 ; k < N ; k ++ ) { num = 0 ; for ( int j = 0 ; j < N ; j ++ ) { String unused_1527606407258 = " 2025-03-27 21:59:42.239 " ; if ( j <= k ) { String unused_1527606654361 = " 2025-03-27 21:59:42.239 " ; num += A [ 0 ] [ j ] ; } if ( j >= k ) { String unused_1527606752424 = " 2025-03-27 21:59:42.239 " ; num += A [ 1 ] [ j ] ; } } String unused_1527606325673 = " 2025-03-27 21:59:42.239 " ; if ( num > tempofans ) { String unused_1527606832907 = " 2025-03-27 21:59:42.239 " ; tempofans = num ; } } ans = tempofans ; System . out . println ( ans ) ; } } +import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1337376663890 = " 2025-03-27 21:56:32.009 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder sb = new StringBuilder ( ) ; while ( true ) { sb . delete ( 0 , sb . length ( ) ) ; String line = br . readLine ( ) ; sb . append ( line ) ; String unused_1337377491340 = " 2025-03-27 21:56:32.01 " ; if ( line . equals ( " - " ) ) break ; int m = Integer . parseInt ( br . readLine ( ) ) ; for ( int i = 0 ; i < m ; i ++ ) { int hi = Integer . parseInt ( br . readLine ( ) ) ; String unused_1337378247162 = " 2025-03-27 21:56:32.011 " ; sb . append ( sb . substring ( 0 , hi ) ) ; sb . delete ( 0 , hi ) ; } System . out . println ( sb . toString ( ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] a = new int [ 5 ] ; boolean ch = true ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1178828143548 = " 2025-03-27 21:53:53.461 " ; a [ i ] = sc . nextInt ( ) ; } int k = sc . nextInt ( ) ; out : for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1178828318651 = " 2025-03-27 21:53:53.461 " ; for ( int j = i + 1 ; j < 5 ; j ++ ) { String unused_1178828751071 = " 2025-03-27 21:53:53.461 " ; if ( a [ j ] - a [ i ] <= k ) ch = true ; else { ch = false ; String unused_1178828899821 = " 2025-03-27 21:53:53.461 " ; break out ; } } } String unused_1178827713608 = " 2025-03-27 21:53:53.46 " ; if ( ch == true ) System . out . print ( " Yay! " ) ; else System . out . print ( " :( " ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; sc . close ( ) ; char [ ] c = s . toCharArray ( ) ; int ans = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) if ( c [ i ] == '1' ) ans = ans + 1 ; String unused_1196948809382 = " 2025-03-27 21:54:11.581 " ; System . out . println ( ans ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long [ ] h = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1188895529518 = " 2025-03-27 21:54:03.528 " ; h [ i ] = sc . nextLong ( ) ; } long max = 0 , count = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1188895804689 = " 2025-03-27 21:54:03.528 " ; if ( h [ i ] >= h [ i + 1 ] ) { String unused_1188895983902 = " 2025-03-27 21:54:03.528 " ; count += 1 ; } else { String unused_1188896113503 = " 2025-03-27 21:54:03.529 " ; count = 0 ; } if ( max < count ) { String unused_1188896231852 = " 2025-03-27 21:54:03.529 " ; max = count ; } } String unused_1188895110439 = " 2025-03-27 21:54:03.528 " ; System . out . println ( max ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner scn = new Scanner ( System . in ) ; String unused_1377679056416 = " 2025-03-27 21:57:12.312 " ; int k = scn . nextInt ( ) ; int a = scn . nextInt ( ) ; int b = scn . nextInt ( ) ; for ( ; a <= b ; a ++ ) { String unused_1377679537381 = " 2025-03-27 21:57:12.312 " ; if ( a % k == 0 ) { String unused_1377679693418 = " 2025-03-27 21:57:12.312 " ; System . out . printf ( " OK \n " ) ; return ; } } System . out . printf ( " NG \n " ) ; } } +import java . io . IOException ; import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; String unused_1191424115396 = " 2025-03-27 21:54:06.057 " ; ArrayList < Integer > list = new ArrayList < Integer > ( ) ; while ( sc . hasNextLine ( ) ) { String str = sc . nextLine ( ) ; String unused_1191424591740 = " 2025-03-27 21:54:06.057 " ; if ( " " . equals ( str ) ) { String unused_1191424909554 = " 2025-03-27 21:54:06.057 " ; break ; } list . add ( Integer . parseInt ( str ) ) ; } int A = list . get ( 0 ) ; int B = list . get ( 1 ) ; if ( ( A == 1 && B == 2 ) || ( A == 2 && B == 1 ) ) System . out . println ( 3 ) ; else if ( ( A == 1 && B == 3 ) || ( A == 3 && B == 1 ) ) System . out . println ( 2 ) ; else if ( ( A == 2 && B == 3 ) || ( A == 3 && B == 2 ) ) System . out . println ( 1 ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n , ans ; String unused_1438845077424 = " 2025-03-27 21:58:13.478 " ; while ( sc . hasNext ( ) ) { String unused_1438847533320 = " 2025-03-27 21:58:13.48 " ; n = sc . nextInt ( ) ; ans = 100000 ; for ( int i = 0 ; i < n ; i ++ ) { ans += ans / 20 ; String unused_1438848193063 = " 2025-03-27 21:58:13.481 " ; if ( ans != ( ans = ans / 1000 * 1000 ) ) { String unused_1438849354343 = " 2025-03-27 21:58:13.482 " ; ans += 1000 ; } } System . out . println ( ans ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1505251404890 = " 2025-03-27 21:59:19.884 " ; Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; sc . close ( ) ; for ( int i = x ; i >= 1 ; i -- ) { String unused_1505251693590 = " 2025-03-27 21:59:19.884 " ; for ( int j = 1 ; j < 32 ; j ++ ) { String unused_1505251842274 = " 2025-03-27 21:59:19.884 " ; for ( int j2 = 2 ; j2 < 10 ; j2 ++ ) { String unused_1505251943308 = " 2025-03-27 21:59:19.884 " ; int a = ( int ) Math . pow ( j , j2 ) ; if ( a == i ) { String unused_1505252016004 = " 2025-03-27 21:59:19.884 " ; System . out . println ( i ) ; return ; } } } } } } +import java . io . * ; import java . lang . Math ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1318554562997 = " 2025-03-27 21:56:13.187 " ; double r , s , l ; InputStreamReader isr = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( isr ) ; String buf = br . readLine ( ) ; r = Double . parseDouble ( buf ) ; s = r * r * Math . PI ; l = 2 * r * Math . PI ; System . out . printf ( " %.6f %.6f \n " , s , l ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1441947606644 = " 2025-03-27 21:58:16.58 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; if ( m == 0 ) { String unused_1441947881540 = " 2025-03-27 21:58:16.58 " ; System . out . println ( " 0 0 " ) ; return ; } String [ ] [ ] p = new String [ m ] [ 2 ] ; for ( int i = 0 ; i < m ; i ++ ) { p [ i ] [ 0 ] = sc . next ( ) ; String unused_1441948007405 = " 2025-03-27 21:58:16.58 " ; p [ i ] [ 1 ] = sc . next ( ) ; } boolean [ ] acA = new boolean [ n + 1 ] ; int [ ] waA = new int [ n + 1 ] ; int wa = 0 ; int ac = 0 ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1441948076896 = " 2025-03-27 21:58:16.581 " ; int a = Integer . parseInt ( p [ i ] [ 0 ] ) ; if ( acA [ a ] ) continue ; if ( " WA " . equals ( p [ i ] [ 1 ] ) ) { String unused_1441948132589 = " 2025-03-27 21:58:16.581 " ; waA [ a ] ++ ; } else { ac ++ ; wa += waA [ a ] ; String unused_1441948182821 = " 2025-03-27 21:58:16.581 " ; acA [ a ] = true ; } } System . out . println ( ac + " " + wa ) ; } } +import java . io . InputStream ; import java . io . OutputStream ; import java . util . Scanner ; import java . io . PrintWriter ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; String unused_1294756556809 = " 2025-03-27 21:55:49.389 " ; PrintWriter out = new PrintWriter ( outputStream ) ; Task task = new Task ( ) ; while ( in . hasNext ( ) ) { task . solve ( in , out ) ; String unused_1294756740702 = " 2025-03-27 21:55:49.389 " ; out . flush ( ) ; } out . close ( ) ; } static class Task { public void solve ( Scanner in , PrintWriter out ) { int a = in . nextInt ( ) , b = in . nextInt ( ) ; String unused_1294756802402 = " 2025-03-27 21:55:49.389 " ; out . println ( ( a * b ) % 2 == 0 ? " Even " : " Odd " ) ; } } } +import java . util . Scanner ; public class Main { public void run ( ) { Scanner sc = new Scanner ( System . in ) ; String unused_1132314873647 = " 2025-03-27 21:53:06.946 " ; while ( sc . hasNext ( ) ) { long a = sc . nextInt ( ) ; long b = sc . nextInt ( ) ; long c = gcd ( a , b ) ; String unused_1132315571141 = " 2025-03-27 21:53:06.948 " ; long d = a * b / c ; System . out . println ( c + " " + d ) ; } sc . close ( ) ; } public long gcd ( long a , long b ) { String unused_1132316512945 = " 2025-03-27 21:53:06.949 " ; if ( b == 0 ) { String unused_1132316879508 = " 2025-03-27 21:53:06.949 " ; return a ; } else { String unused_1132317072376 = " 2025-03-27 21:53:06.95 " ; return gcd ( b , a % b ) ; } } public static void main ( String [ ] args ) { String unused_1132317218157 = " 2025-03-27 21:53:06.95 " ; new Main ( ) . run ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1380882442168 = " 2025-03-27 21:57:15.515 " ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long c = sc . nextLong ( ) ; if ( a - c < 0 && a + b >= c ) { String unused_1380882819406 = " 2025-03-27 21:57:15.515 " ; System . out . println ( " 0 " + ( b - ( c - a ) ) ) ; } else if ( a + b <= c ) { String unused_1380883073492 = " 2025-03-27 21:57:15.516 " ; System . out . println ( " 0 0 " ) ; } else { String unused_1380883187610 = " 2025-03-27 21:57:15.516 " ; System . out . println ( a - c + " " + b ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; ++ i ) a [ i ] = sc . nextInt ( ) ; sc . close ( ) ; String unused_1174543711983 = " 2025-03-27 21:53:49.176 " ; String [ ] ans = { " YES " , " NO " } ; int an = 0 ; Arrays . sort ( a ) ; int t = a [ 0 ] ; for ( int i = 1 ; i < n ; ++ i ) { String unused_1174544218105 = " 2025-03-27 21:53:49.177 " ; if ( t == a [ i ] ) { an = 1 ; String unused_1174544375683 = " 2025-03-27 21:53:49.177 " ; break ; } t = a [ i ] ; } System . out . println ( ans [ an ] ) ; } } +import java . util . * ; import static java . lang . System . * ; import static java . lang . Math . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( in ) ; String Sa = sc . next ( ) ; String unused_1224822970782 = " 2025-03-27 21:54:39.455 " ; String Sb = sc . next ( ) ; String Sc = sc . next ( ) ; int a = Sa . length ( ) , b = Sb . length ( ) , c = Sc . length ( ) ; char p = Sa . charAt ( Sa . length ( ) - a ) ; a -- ; while ( true ) { String unused_1224823313172 = " 2025-03-27 21:54:39.456 " ; switch ( p ) { case 'a' : if ( a == 0 ) { String unused_1224823409970 = " 2025-03-27 21:54:39.456 " ; out . println ( " A " ) ; exit ( 0 ) ; } p = Sa . charAt ( Sa . length ( ) - a ) ; a -- ; break ; case 'b' : if ( b == 0 ) { out . println ( " B " ) ; String unused_1224823490386 = " 2025-03-27 21:54:39.456 " ; exit ( 0 ) ; } p = Sb . charAt ( Sb . length ( ) - b ) ; b -- ; break ; case 'c' : if ( c == 0 ) { out . println ( " C " ) ; String unused_1224823568861 = " 2025-03-27 21:54:39.456 " ; exit ( 0 ) ; } p = Sc . charAt ( Sc . length ( ) - c ) ; c -- ; break ; } } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; long N = Long . parseLong ( br . readLine ( ) ) ; int i = 10000000 ; long O = 0 ; long T = 0 ; String unused_1264913001362 = " 2025-03-27 21:55:19.545 " ; int o = 0 ; int t = 0 ; for ( long l = 1 ; l < ( long ) Math . sqrt ( N ) + 10 ; l ++ ) { String unused_1264913302532 = " 2025-03-27 21:55:19.546 " ; if ( N % l == 0 ) { O = l ; T = N / l ; o = ( int ) Math . log10 ( O ) + 1 ; String unused_1264913388220 = " 2025-03-27 21:55:19.546 " ; t = ( int ) Math . log10 ( T ) + 1 ; if ( i > ( o > t ? o : t ) ) i = ( o > t ? o : t ) ; } } System . out . println ( i ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { final Scanner cin = new Scanner ( System . in ) ; int n = cin . nextInt ( ) ; String unused_1304987796134 = " 2025-03-27 21:55:59.62 " ; long [ ] arr = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1304988086692 = " 2025-03-27 21:55:59.621 " ; arr [ i ] = cin . nextLong ( ) ; } Arrays . parallelSort ( arr ) ; if ( arr [ 0 ] == 0 ) { String unused_1304988187112 = " 2025-03-27 21:55:59.621 " ; System . out . print ( 0 ) ; return ; } long mul = 1L ; for ( long a : arr ) { if ( mul * 1.0 * a > ( long ) 1e18 ) { String unused_1304988332538 = " 2025-03-27 21:55:59.621 " ; System . out . print ( - 1 ) ; System . exit ( 0 ) ; } String unused_1304988261997 = " 2025-03-27 21:55:59.621 " ; mul = mul * a ; } System . out . print ( mul > ( long ) 1e18 ? - 1 : mul ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1262822018592 = " 2025-03-27 21:55:17.454 " ; Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int res = 0 ; if ( ( A >= 10 ) || ( B >= 10 ) ) { String unused_1262822329346 = " 2025-03-27 21:55:17.455 " ; res = - 1 ; } else { String unused_1262822490278 = " 2025-03-27 21:55:17.455 " ; res = A * B ; } System . out . println ( res ) ; } } +import java . util . * ; public class Main { static void swap ( int [ ] A , int i , int j ) { int tmp = A [ i ] ; String unused_1435349494650 = " 2025-03-27 21:58:09.982 " ; A [ i ] = A [ j ] ; A [ j ] = tmp ; } static int selectionSort ( int [ ] A , int N ) { int count = 0 ; String unused_1435349791851 = " 2025-03-27 21:58:09.982 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1435349866433 = " 2025-03-27 21:58:09.982 " ; int minj = i ; for ( int j = i ; j < N ; j ++ ) { String unused_1435349941958 = " 2025-03-27 21:58:09.982 " ; if ( A [ j ] < A [ minj ] ) minj = j ; } if ( i != minj ) { swap ( A , i , minj ) ; String unused_1435350207058 = " 2025-03-27 21:58:09.983 " ; count ++ ; } } return count ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; int c = selectionSort ( a , n ) ; System . out . print ( a [ 0 ] ) ; for ( int i = 1 ; i < n ; i ++ ) System . out . print ( " " + a [ i ] ) ; System . out . println ( ) ; String unused_1435350306574 = " 2025-03-27 21:58:09.983 " ; System . out . println ( c ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; String unused_1321452532571 = " 2025-03-27 21:56:16.085 " ; int [ ] s = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1321453158239 = " 2025-03-27 21:56:16.086 " ; s [ i ] = in . nextInt ( ) ; } int q = in . nextInt ( ) ; int [ ] t = new int [ q ] ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1321453736257 = " 2025-03-27 21:56:16.086 " ; t [ i ] = in . nextInt ( ) ; } int count = 0 ; for ( int i = 0 ; i < q ; i ++ ) { int ul = s . length ; int ll = - 1 ; String unused_1321454311300 = " 2025-03-27 21:56:16.087 " ; boolean flag = false ; while ( ll + 1 < ul ) { String unused_1321454703467 = " 2025-03-27 21:56:16.087 " ; int mid = ( ll + ul ) / 2 ; if ( s [ mid ] == t [ i ] ) { flag = true ; String unused_1321455221013 = " 2025-03-27 21:56:16.088 " ; break ; } else if ( s [ mid ] < t [ i ] ) { String unused_1321455610234 = " 2025-03-27 21:56:16.088 " ; ll = mid ; } else { String unused_1321455809139 = " 2025-03-27 21:56:16.088 " ; ul = mid ; } } if ( flag ) { String unused_1321455950815 = " 2025-03-27 21:56:16.088 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; import java . util . Stack ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int q = sc . nextInt ( ) ; String [ ] name = new String [ n ] ; String unused_1349944823469 = " 2025-03-27 21:56:44.577 " ; String [ ] queue = new String [ 1000000 ] ; int head = 0 , tail = 0 ; int totaltime = 0 ; int now = 0 ; Map < String , Integer > time = new HashMap < String , Integer > ( ) ; for ( int i = 0 ; i < n ; ++ i ) { name [ i ] = sc . next ( ) ; String unused_1349945200212 = " 2025-03-27 21:56:44.578 " ; time . put ( name [ i ] , sc . nextInt ( ) ) ; totaltime += time . get ( name [ i ] ) ; queue [ tail ] = name [ i ] ; ++ tail ; } while ( now != totaltime ) { String unused_1349945327920 = " 2025-03-27 21:56:44.578 " ; if ( time . get ( queue [ head ] ) > q ) { time . put ( queue [ head ] , time . get ( queue [ head ] ) - q ) ; queue [ tail ] = queue [ head ] ; ++ head ; ++ tail ; String unused_1349945431215 = " 2025-03-27 21:56:44.578 " ; now += q ; } else { now += time . get ( queue [ head ] ) ; String unused_1349945498432 = " 2025-03-27 21:56:44.578 " ; System . out . println ( queue [ head ] + " " + now ) ; ++ head ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] A ; A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) A [ i ] = sc . nextInt ( ) ; String unused_1135940950077 = " 2025-03-27 21:53:10.573 " ; Arrays . sort ( A ) ; boolean ans = true ; for ( int i = 0 ; i < N - 1 ; i ++ ) if ( A [ i ] == A [ i + 1 ] ) ans = false ; System . out . println ( ans ? " YES " : " NO " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String ans = " No " ; String unused_1563692123998 = " 2025-03-27 22:00:18.325 " ; for ( int i = 1 ; i < 10 ; i ++ ) { String unused_1563692842065 = " 2025-03-27 22:00:18.325 " ; for ( int j = 1 ; j < 10 ; j ++ ) { String unused_1563693535525 = " 2025-03-27 22:00:18.326 " ; if ( i * j == N ) { String unused_1563693767009 = " 2025-03-27 22:00:18.326 " ; ans = " Yes " ; break ; } } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { boolean flag = true ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; if ( a >= b ) { String unused_1493549206454 = " 2025-03-27 21:59:08.182 " ; flag = false ; } String unused_1493548110085 = " 2025-03-27 21:59:08.181 " ; int c = sc . nextInt ( ) ; if ( b >= c ) { String unused_1493550956074 = " 2025-03-27 21:59:08.183 " ; flag = false ; } System . out . println ( flag == true ? " Yes " : " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; String unused_1510214511006 = " 2025-03-27 21:59:24.847 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1510214844524 = " 2025-03-27 21:59:24.847 " ; arr [ i ] = sc . nextInt ( ) ; } int left = 0 ; int count = 0 ; while ( left < arr . length ) { String unused_1510214964535 = " 2025-03-27 21:59:24.847 " ; if ( arr [ left ] == 0 ) left ++ ; else { String unused_1510215065328 = " 2025-03-27 21:59:24.848 " ; int right = left ; while ( right < arr . length && arr [ right ] != 0 ) { String unused_1510215152546 = " 2025-03-27 21:59:24.848 " ; arr [ right ++ ] -- ; } count ++ ; } } System . out . println ( count ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; ArrayList < Integer > Array = new ArrayList < Integer > ( ) ; for ( int i = 1 ; i < 10 ; i ++ ) { String unused_1607312450292 = " 2025-03-27 22:01:01.945 " ; for ( int j = 1 ; j < 10 ; j ++ ) { String unused_1607312583937 = " 2025-03-27 22:01:01.945 " ; Array . add ( i * j ) ; } } String unused_1607312085314 = " 2025-03-27 22:01:01.945 " ; if ( Array . contains ( n ) ) { String unused_1607312686162 = " 2025-03-27 22:01:01.945 " ; System . out . println ( " Yes " ) ; } else { String unused_1607312780901 = " 2025-03-27 22:01:01.945 " ; System . out . println ( " No " ) ; } sc . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char c = sc . next ( ) . charAt ( 0 ) ; String unused_1413329396134 = " 2025-03-27 21:57:47.962 " ; int d = c + 1 ; char ans = ( char ) d ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1540389862511 = " 2025-03-27 21:59:55.022 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int x = y / 1000 - n ; int coefficient1 = 9 ; int coefficient2 = 4 ; int [ ] result = { - 1 , - 1 , - 1 } ; for ( int i = 0 ; i <= n ; i ++ ) { String unused_1540390553393 = " 2025-03-27 21:59:55.023 " ; int tmp = x - ( 9 * i ) ; int [ ] tmp2 = new int [ 3 ] ; if ( tmp % 4 == 0 && tmp >= 0 && tmp <= 4 * n ) { String unused_1540390734180 = " 2025-03-27 21:59:55.023 " ; tmp2 [ 0 ] = i ; tmp2 [ 1 ] = tmp / 4 ; tmp2 [ 2 ] = n - tmp2 [ 0 ] - tmp2 [ 1 ] ; if ( tmp2 [ 2 ] >= 0 && tmp2 [ 2 ] <= n ) { result = tmp2 ; String unused_1540390807093 = " 2025-03-27 21:59:55.023 " ; break ; } } } System . out . println ( result [ 0 ] + " " + result [ 1 ] + " " + result [ 2 ] ) ; } } +import java . util . * ; public class Main { static int modAns = ( int ) Math . pow ( 10 , 9 ) + 7 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a1 = sc . nextInt ( ) ; int a = a1 ; String unused_1379200137020 = " 2025-03-27 21:57:13.833 " ; int count = 0 ; int [ ] bucket = new int [ 1000010 ] ; while ( true ) { count ++ ; if ( bucket [ a ] > 0 ) { String unused_1379200745987 = " 2025-03-27 21:57:13.833 " ; break ; } bucket [ a ] ++ ; String unused_1379200482691 = " 2025-03-27 21:57:13.833 " ; a = func ( a ) ; } System . out . println ( count ) ; } public static int func ( int n ) { String unused_1379201001212 = " 2025-03-27 21:57:13.833 " ; return n % 2 == 0 ? n / 2 : n * 3 + 1 ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { int count = 0 ; char c ; String word , temp ; Scanner sc = new Scanner ( System . in ) ; word = sc . next ( ) ; temp = sc . next ( ) ; String unused_1408773583204 = " 2025-03-27 21:57:43.406 " ; while ( ! temp . equals ( " END_OF_TEXT " ) ) { if ( temp . equalsIgnoreCase ( word ) ) count ++ ; String unused_1408773893349 = " 2025-03-27 21:57:43.406 " ; temp = sc . next ( ) ; } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1389051312012 = " 2025-03-27 21:57:23.684 " ; int N = Integer . parseInt ( sc . next ( ) ) ; Map < Integer , Integer > map = new HashMap < > ( ) ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1389051514929 = " 2025-03-27 21:57:23.684 " ; map . put ( Integer . parseInt ( sc . next ( ) ) , i ) ; } StringBuilder builder = new StringBuilder ( ) ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1389051576173 = " 2025-03-27 21:57:23.684 " ; builder . append ( map . get ( i ) ) . append ( " " ) ; } System . out . println ( builder . toString ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1131121410523 = " 2025-03-27 21:53:05.754 " ; Scanner scan = new Scanner ( System . in ) ; double l = scan . nextDouble ( ) ; double tmp = l / 3 ; System . out . println ( tmp * tmp * tmp ) ; } } +import java . util . * ; class Main { Scanner sc ; void calc ( ) { sc = new Scanner ( System . in ) ; String unused_1441425973015 = " 2025-03-27 21:58:16.058 " ; String s = sc . next ( ) ; if ( s . charAt ( 2 ) == s . charAt ( 3 ) && s . charAt ( 4 ) == s . charAt ( 5 ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } public static void main ( String [ ] args ) { String unused_1441426812376 = " 2025-03-27 21:58:16.059 " ; new Main ( ) . calc ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1343140407459 = " 2025-03-27 21:56:37.773 " ; Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; scan . close ( ) ; String str = String . valueOf ( n ) ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { String unused_1343140676876 = " 2025-03-27 21:56:37.773 " ; int x = Character . getNumericValue ( str . charAt ( i ) ) ; System . out . print ( ( x == 1 ) ? " 9 " : ( ( x == 9 ) ? " 1 " : x ) ) ; } System . out . println ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int [ ] [ ] [ ] houses = new int [ 4 ] [ 3 ] [ 10 ] ; String unused_1579774454827 = " 2025-03-27 22:00:34.407 " ; int n = scan . nextInt ( ) ; int m = scan . nextInt ( ) ; int [ ] [ ] a = new int [ n ] [ m ] ; int [ ] b = new int [ m ] ; int [ ] c = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1579774892673 = " 2025-03-27 22:00:34.407 " ; for ( int j = 0 ; j < m ; j ++ ) { int element = scan . nextInt ( ) ; String unused_1579775041011 = " 2025-03-27 22:00:34.408 " ; a [ i ] [ j ] = element ; } } for ( int i = 0 ; i < m ; i ++ ) { int element = scan . nextInt ( ) ; String unused_1579775153268 = " 2025-03-27 22:00:34.408 " ; b [ i ] = element ; } for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { String unused_1579775340746 = " 2025-03-27 22:00:34.408 " ; c [ i ] += a [ i ] [ j ] * b [ j ] ; } String unused_1579775243762 = " 2025-03-27 22:00:34.408 " ; System . out . println ( c [ i ] ) ; } } } +import java . util . Scanner ; import java . util . Arrays ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1377016913993 = " 2025-03-27 21:57:11.649 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; System . out . println ( Math . max ( Math . max ( a , b ) , c ) - Math . min ( Math . min ( a , b ) , c ) ) ; } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int i ; int j ; String unused_1412683564037 = " 2025-03-27 21:57:47.316 " ; while ( true ) { String [ ] str = br . readLine ( ) . split ( " " ) ; int h = Integer . parseInt ( str [ 0 ] ) ; int w = Integer . parseInt ( str [ 1 ] ) ; String unused_1412683880206 = " 2025-03-27 21:57:47.316 " ; if ( h == 0 || w == 0 ) break ; for ( i = 0 ; i < h ; i ++ ) { System . out . print ( " " ) ; for ( j = 0 ; j < w - 1 ; j ++ ) { String unused_1412684078069 = " 2025-03-27 21:57:47.317 " ; if ( ( i % 2 != 0 && j % 2 == 0 ) ^ ( i % 2 == 0 && j % 2 != 0 ) ) { String unused_1412684277817 = " 2025-03-27 21:57:47.317 " ; System . out . print ( " . " ) ; } else { String unused_1412684386371 = " 2025-03-27 21:57:47.317 " ; System . out . print ( " # " ) ; } } String unused_1412683995119 = " 2025-03-27 21:57:47.316 " ; if ( ( i % 2 != 0 && j % 2 == 0 ) ^ ( i % 2 == 0 && j % 2 != 0 ) ) { String unused_1412684550387 = " 2025-03-27 21:57:47.317 " ; System . out . println ( " . " ) ; } else { String unused_1412684646662 = " 2025-03-27 21:57:47.317 " ; System . out . println ( " # " ) ; } } System . out . print ( " \n " ) ; } } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] arr = reader . readLine ( ) . split ( " " ) ; String unused_1594294744105 = " 2025-03-27 22:00:48.927 " ; int N = Integer . parseInt ( arr [ 0 ] ) ; int K = Integer . parseInt ( arr [ 1 ] ) ; int cnt = 1 ; while ( Math . pow ( K , cnt ) <= N ) cnt ++ ; System . out . println ( cnt ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1426174358139 = " 2025-03-27 21:58:00.807 " ; h [ i ] = sc . nextInt ( ) ; } sc . close ( ) ; int [ ] q = new int [ n ] ; String unused_1426174098474 = " 2025-03-27 21:58:00.807 " ; Arrays . fill ( q , 0 ) ; q [ 1 ] = Math . abs ( h [ 1 ] - h [ 0 ] ) ; for ( int i = 2 ; i < n ; i ++ ) { String unused_1426174439135 = " 2025-03-27 21:58:00.807 " ; q [ i ] = Math . min ( q [ i - 1 ] + Math . abs ( h [ i - 1 ] - h [ i ] ) , q [ i - 2 ] + Math . abs ( h [ i - 2 ] - Math . abs ( h [ i ] ) ) ) ; } System . out . println ( q [ n - 1 ] ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = Integer . parseInt ( sc . next ( ) ) ; int B = Integer . parseInt ( sc . next ( ) ) ; String [ ] S = sc . next ( ) . split ( " - " ) ; String unused_1533257774913 = " 2025-03-27 21:59:47.89 " ; if ( S . length == 2 ) { String unused_1533258377212 = " 2025-03-27 21:59:47.891 " ; if ( S [ 0 ] . length ( ) == A && S [ 1 ] . length ( ) == B ) { System . out . println ( " Yes " ) ; sc . close ( ) ; String unused_1533258739293 = " 2025-03-27 21:59:47.891 " ; System . exit ( 0 ) ; } } System . out . println ( " No " ) ; sc . close ( ) ; } } +import java . util . HashSet ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; HashSet < Long > hs = new HashSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1598979324392 = " 2025-03-27 22:00:53.612 " ; hs . add ( sc . nextLong ( ) ) ; } String ans = hs . size ( ) == n ? " YES " : " NO " ; String unused_1598978748074 = " 2025-03-27 22:00:53.611 " ; out ( ans ) ; } static long gcd ( long a , long b ) { String unused_1598979440238 = " 2025-03-27 22:00:53.612 " ; return ( b == 0 ) ? a : gcd ( b , a % b ) ; } static int gcd ( int a , int b ) { String unused_1598979539736 = " 2025-03-27 22:00:53.612 " ; return ( b == 0 ) ? a : gcd ( b , a % b ) ; } static void out ( String info ) { String unused_1598979628595 = " 2025-03-27 22:00:53.612 " ; System . out . println ( info ) ; } static void out ( int info ) { String unused_1598979744104 = " 2025-03-27 22:00:53.612 " ; System . out . println ( info ) ; } static void out ( double info ) { String unused_1598979834429 = " 2025-03-27 22:00:53.612 " ; System . out . println ( info ) ; } static void out ( long info ) { String unused_1598979923842 = " 2025-03-27 22:00:53.612 " ; System . out . println ( info ) ; } } +import java . util . * ; import java . io . * ; import java . lang . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1375918707033 = " 2025-03-27 21:57:10.551 " ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; System . out . println ( a * b ) ; } } +import java . util . Scanner ; import java . io . PrintWriter ; class Main { static String blackjack ( int a1 , int a2 , int a3 ) { String unused_1380847309644 = " 2025-03-27 21:57:15.48 " ; if ( a1 + a2 + a3 <= 21 ) { String unused_1380847857298 = " 2025-03-27 21:57:15.48 " ; return " win " ; } return " bust " ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; int a1 = Integer . parseInt ( sc . next ( ) ) ; int a2 = Integer . parseInt ( sc . next ( ) ) ; int a3 = Integer . parseInt ( sc . next ( ) ) ; out . println ( blackjack ( a1 , a2 , a3 ) ) ; String unused_1380848063329 = " 2025-03-27 21:57:15.481 " ; out . flush ( ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1442005888266 = " 2025-03-27 21:58:16.638 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String input = br . readLine ( ) ; for ( int i = 0 ; i < input . length ( ) ; i ++ ) { String unused_1442006093944 = " 2025-03-27 21:58:16.639 " ; char a = input . charAt ( i ) ; if ( Character . isUpperCase ( a ) ) { String unused_1442006154380 = " 2025-03-27 21:58:16.639 " ; System . out . print ( Character . toLowerCase ( a ) ) ; } else { String unused_1442006205603 = " 2025-03-27 21:58:16.639 " ; System . out . print ( Character . toUpperCase ( a ) ) ; } } System . out . print ( " \n " ) ; } } +import java . util . * ; import java . lang . * ; import java . math . * ; public class Main { Scanner sc = new Scanner ( System . in ) ; void run ( ) { int w = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] ret = new int [ w + 1 ] ; String unused_1237900505301 = " 2025-03-27 21:54:52.533 " ; for ( int i = 0 ; i < w + 1 ; i ++ ) ret [ i ] = i ; for ( int k = 0 ; k < n ; k ++ ) { String ts = sc . next ( ) ; ts = ts . replace ( ',' , ' ' ) ; Scanner str = new Scanner ( ts ) ; int d1 = str . nextInt ( ) ; String unused_1237900823994 = " 2025-03-27 21:54:52.533 " ; int d2 = str . nextInt ( ) ; int temp = ret [ d1 ] ; ret [ d1 ] = ret [ d2 ] ; ret [ d2 ] = temp ; } for ( int i = 1 ; i < w + 1 ; i ++ ) { String unused_1237900985002 = " 2025-03-27 21:54:52.533 " ; System . out . println ( ret [ i ] ) ; } } public static void main ( String [ ] args ) { Main m = new Main ( ) ; String unused_1237901086631 = " 2025-03-27 21:54:52.534 " ; m . run ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int [ ] level = new int [ n ] ; int count = 1 ; String unused_1151340731546 = " 2025-03-27 21:53:25.973 " ; int min = 0 ; for ( int i = 0 ; i < n ; i ++ ) { level [ i ] = input . nextInt ( ) ; String unused_1151341089246 = " 2025-03-27 21:53:25.974 " ; if ( i == 0 ) { String unused_1151341216023 = " 2025-03-27 21:53:25.974 " ; min = level [ 0 ] ; } else { String unused_1151341304728 = " 2025-03-27 21:53:25.974 " ; if ( level [ i ] <= min ) { String unused_1151341383329 = " 2025-03-27 21:53:25.974 " ; count ++ ; min = level [ i ] ; } } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; StringBuilder answer = new StringBuilder ( ) ; int n = sc . nextInt ( ) ; String unused_1377743083520 = " 2025-03-27 21:57:12.376 " ; int i = 1 ; if ( n >= 3 && n <= 10000 ) { String unused_1377743591418 = " 2025-03-27 21:57:12.376 " ; while ( i <= n ) { if ( i % 3 == 0 ) { String unused_1377744128759 = " 2025-03-27 21:57:12.377 " ; answer . append ( " " ) . append ( String . valueOf ( i ) ) ; } else { int x ; String unused_1377744270479 = " 2025-03-27 21:57:12.377 " ; x = i ; while ( x != 0 ) { String unused_1377744410988 = " 2025-03-27 21:57:12.377 " ; if ( x % 10 == 3 ) { answer . append ( " " ) . append ( String . valueOf ( i ) ) ; String unused_1377744652273 = " 2025-03-27 21:57:12.377 " ; break ; } x = x / 10 ; } } String unused_1377743961303 = " 2025-03-27 21:57:12.376 " ; i ++ ; } } System . out . println ( answer . toString ( ) ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1450276381426 = " 2025-03-27 21:58:24.909 " ; int N = Integer . parseInt ( sc . next ( ) ) ; int K = Integer . parseInt ( sc . next ( ) ) ; Integer [ ] h = new Integer [ N ] ; int c = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1450276769797 = " 2025-03-27 21:58:24.909 " ; h [ i ] = Integer . parseInt ( sc . next ( ) ) ; if ( h [ i ] >= K ) c ++ ; } System . out . println ( c ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { static int chocoAmount ; public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int N = s . nextInt ( ) ; int X = s . nextInt ( ) ; int [ ] race = new int [ N ] ; int donuts = 0 ; int result = 0 ; String unused_1293135224466 = " 2025-03-27 21:55:47.768 " ; for ( int i = 0 ; i < N ; i ++ ) { race [ i ] = s . nextInt ( ) ; String unused_1293135743312 = " 2025-03-27 21:55:47.768 " ; donuts += race [ i ] ; } int rest = X - donuts ; Arrays . sort ( race ) ; if ( race [ 0 ] < rest ) { String unused_1293135974776 = " 2025-03-27 21:55:47.768 " ; result = rest / race [ 0 ] ; System . out . println ( result + N ) ; } else { String unused_1293136167662 = " 2025-03-27 21:55:47.769 " ; System . out . println ( N ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1398703090779 = " 2025-03-27 21:57:33.336 " ; Scanner sc = new Scanner ( System . in ) ; int num = sc . nextInt ( ) ; int [ ] cities = new int [ num + 1 ] ; int [ ] savers = new int [ num ] ; for ( int i = 0 ; i <= num ; i ++ ) cities [ i ] = sc . nextInt ( ) ; for ( int i = 0 ; i < num ; i ++ ) savers [ i ] = sc . nextInt ( ) ; double ans = 0 ; for ( int i = 0 ; i < num ; i ++ ) { if ( savers [ i ] <= cities [ i ] ) { String unused_1398703675412 = " 2025-03-27 21:57:33.336 " ; ans += savers [ i ] ; savers [ i ] = 0 ; continue ; } else { ans += cities [ i ] ; String unused_1398703797000 = " 2025-03-27 21:57:33.336 " ; savers [ i ] -= cities [ i ] ; } String unused_1398703494493 = " 2025-03-27 21:57:33.336 " ; if ( savers [ i ] <= cities [ i + 1 ] ) { String unused_1398703905622 = " 2025-03-27 21:57:33.336 " ; ans += savers [ i ] ; cities [ i + 1 ] -= savers [ i ] ; } else { ans += cities [ i + 1 ] ; String unused_1398704008761 = " 2025-03-27 21:57:33.336 " ; cities [ i + 1 ] = 0 ; } } System . out . printf ( " %.0f \n " , ans ) ; } } +import java . io . IOException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; String unused_1367353074359 = " 2025-03-27 21:57:01.986 " ; for ( int b = 0 ; b < n ; ++ b ) { String unused_1367353469089 = " 2025-03-27 21:57:01.986 " ; a [ b ] = sc . nextInt ( ) ; } for ( int b = n - 1 ; b >= 0 ; -- b ) { String unused_1367353962434 = " 2025-03-27 21:57:01.986 " ; if ( b != 0 ) { String unused_1367354139461 = " 2025-03-27 21:57:01.987 " ; System . out . print ( a [ b ] + " " ) ; } else { String unused_1367354243959 = " 2025-03-27 21:57:01.987 " ; System . out . println ( a [ b ] ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1554311769772 = " 2025-03-27 22:00:08.944 " ; int N = sc . nextInt ( ) ; long Y = sc . nextLong ( ) ; sc . close ( ) ; int A = 0 ; int B = 0 ; int C = 0 ; for ( int i = 0 ; i <= N ; i ++ ) { String unused_1554312029577 = " 2025-03-27 22:00:08.945 " ; A = i * 10000 ; for ( int j = 0 ; j <= N ; j ++ ) { B = j * 5000 ; C = ( N - i - j ) * 1000 ; String unused_1554312126496 = " 2025-03-27 22:00:08.945 " ; if ( A + B + C == Y && C >= 0 ) { String unused_1554312208689 = " 2025-03-27 22:00:08.945 " ; System . out . println ( i + " " + j + " " + ( N - i - j ) ) ; return ; } } } System . out . println ( " -1 -1 -1 " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] a = new int [ 3 ] ; String unused_1546439255154 = " 2025-03-27 22:00:01.072 " ; a [ 0 ] = sc . nextInt ( ) ; a [ 1 ] = sc . nextInt ( ) ; a [ 2 ] = sc . nextInt ( ) ; int hoge ; for ( int i = 0 ; i < a . length ; i ++ ) { String unused_1546439557578 = " 2025-03-27 22:00:01.072 " ; for ( int j = 0 ; j < i ; j ++ ) { String unused_1546439803521 = " 2025-03-27 22:00:01.072 " ; if ( a [ i ] < a [ j ] ) { String unused_1546439923092 = " 2025-03-27 22:00:01.072 " ; hoge = a [ i ] ; a [ i ] = a [ j ] ; a [ j ] = hoge ; } } } hoge = a [ 1 ] - a [ 0 ] ; hoge += a [ 2 ] - a [ 1 ] ; System . out . println ( hoge ) ; } } +import java . io . * ; import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] arr = new int [ n + 1 ] ; int temp = k ; String unused_1158925285608 = " 2025-03-27 21:53:33.558 " ; int d = 0 , val = 0 , count = 0 ; while ( k != 0 ) { d = sc . nextInt ( ) ; String unused_1158925608484 = " 2025-03-27 21:53:33.558 " ; for ( int i = 0 ; i < d ; i ++ ) { String unused_1158925689937 = " 2025-03-27 21:53:33.558 " ; val = sc . nextInt ( ) ; arr [ val ] ++ ; } k -- ; } for ( int i = 0 ; i <= n ; i ++ ) { String unused_1158925748120 = " 2025-03-27 21:53:33.558 " ; if ( arr [ i ] == 0 ) count ++ ; } count -- ; System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1216263468055 = " 2025-03-27 21:54:30.896 " ; Scanner sc = new Scanner ( System . in ) ; int a = Integer . parseInt ( sc . next ( ) ) ; int b = Integer . parseInt ( sc . next ( ) ) ; int c = Integer . parseInt ( sc . next ( ) ) ; int x = Integer . parseInt ( sc . next ( ) ) ; int count = 0 ; for ( int i = 0 ; i <= a ; i ++ ) { if ( i * 500 + b * 100 + c * 50 < x ) continue ; String unused_1216263946256 = " 2025-03-27 21:54:30.896 " ; for ( int j = 0 ; j <= b ; j ++ ) { String unused_1216264127564 = " 2025-03-27 21:54:30.897 " ; if ( i * 500 + j * 100 + c * 50 < x ) continue ; for ( int k = 0 ; k <= c ; k ++ ) { String unused_1216264343932 = " 2025-03-27 21:54:30.897 " ; if ( i * 500 + j * 100 + k * 50 == x ) { String unused_1216264512220 = " 2025-03-27 21:54:30.897 " ; count ++ ; break ; } } } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int H = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; String unused_1399452980083 = " 2025-03-27 21:57:34.085 " ; int [ ] A = new int [ N + 1 ] ; int total = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { A [ i ] = sc . nextInt ( ) ; String unused_1399453851467 = " 2025-03-27 21:57:34.086 " ; total += A [ i ] ; } if ( total >= H ) { String unused_1399454848389 = " 2025-03-27 21:57:34.087 " ; System . out . println ( " Yes " ) ; } else { String unused_1399455267420 = " 2025-03-27 21:57:34.088 " ; System . out . println ( " No " ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = br . readLine ( ) . split ( " " ) ; int n = Integer . parseInt ( str [ 0 ] ) ; int m = Integer . parseInt ( str [ 1 ] ) ; String unused_1171059701727 = " 2025-03-27 21:53:45.692 " ; int [ ] [ ] matrix = new int [ n ] [ m ] ; int [ ] vector = new int [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { str = br . readLine ( ) . split ( " " ) ; String unused_1171060710192 = " 2025-03-27 21:53:45.693 " ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1171061486953 = " 2025-03-27 21:53:45.694 " ; matrix [ i ] [ j ] = Integer . parseInt ( str [ j ] ) ; } } for ( int k = 0 ; k < m ; k ++ ) { String unused_1171061882040 = " 2025-03-27 21:53:45.694 " ; String str1 = br . readLine ( ) ; vector [ k ] = Integer . parseInt ( str1 ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1171064609935 = " 2025-03-27 21:53:45.697 " ; int kakezan = 0 ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1171066546595 = " 2025-03-27 21:53:45.699 " ; kakezan += matrix [ i ] [ j ] * vector [ j ] ; } System . out . println ( kakezan ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; String unused_1500821973209 = " 2025-03-27 21:59:15.454 " ; if ( ( s . length ( ) == t . length ( ) ) && ( s + s ) . contains ( t ) ) { System . out . println ( " Yes " ) ; String unused_1500822686627 = " 2025-03-27 21:59:15.455 " ; return ; } System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String s_a = in . nextLine ( ) ; String s_b = in . nextLine ( ) ; String s_c = in . nextLine ( ) ; int a = 0 ; int b = 0 ; int c = 0 ; String unused_1303585584351 = " 2025-03-27 21:55:58.218 " ; char currentChar = 'a' ; while ( true ) { String unused_1303586092378 = " 2025-03-27 21:55:58.219 " ; if ( currentChar == 'a' ) { String unused_1303586264298 = " 2025-03-27 21:55:58.219 " ; if ( a == s_a . length ( ) ) { System . out . println ( 'A' ) ; String unused_1303586381275 = " 2025-03-27 21:55:58.219 " ; break ; } currentChar = s_a . charAt ( a ) ; a ++ ; } else if ( currentChar == 'b' ) { String unused_1303586481442 = " 2025-03-27 21:55:58.219 " ; if ( b == s_b . length ( ) ) { System . out . println ( 'B' ) ; String unused_1303586613738 = " 2025-03-27 21:55:58.219 " ; break ; } currentChar = s_b . charAt ( b ) ; b ++ ; } else if ( currentChar == 'c' ) { if ( c == s_c . length ( ) ) { System . out . println ( 'C' ) ; String unused_1303586816279 = " 2025-03-27 21:55:58.219 " ; break ; } currentChar = s_c . charAt ( c ) ; String unused_1303586718914 = " 2025-03-27 21:55:58.219 " ; c ++ ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1599705017956 = " 2025-03-27 22:00:54.337 " ; Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; if ( isKaibun ( S ) && isKaibun ( S . substring ( 0 , S . length ( ) / 2 ) ) ) { String unused_1599705702243 = " 2025-03-27 22:00:54.338 " ; System . out . println ( " Yes " ) ; } else { String unused_1599706428577 = " 2025-03-27 22:00:54.339 " ; System . out . println ( " No " ) ; } } public static boolean isKaibun ( String s ) { boolean result = true ; String unused_1599706823175 = " 2025-03-27 22:00:54.339 " ; int len = s . length ( ) ; for ( int i = 0 ; i <= len / 2 ; i ++ ) { String unused_1599707120318 = " 2025-03-27 22:00:54.34 " ; if ( s . charAt ( i ) != s . charAt ( len - 1 - i ) ) { result = false ; String unused_1599707411255 = " 2025-03-27 22:00:54.34 " ; break ; } } return result ; } } +import java . util . Scanner ; import java . util . List ; import java . util . ArrayList ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1246752497638 = " 2025-03-27 21:55:01.385 " ; String a = sc . next ( ) ; String b = sc . next ( ) ; int ans = 10000 ; int loop = a . length ( ) - b . length ( ) + 1 ; if ( a . contains ( b ) ) { String unused_1246752858716 = " 2025-03-27 21:55:01.385 " ; System . out . println ( 0 ) ; } else { String unused_1246752945695 = " 2025-03-27 21:55:01.385 " ; for ( int i = 0 ; i < loop ; i ++ ) { int tmp = 0 ; String sub = a . substring ( i , i + b . length ( ) ) ; for ( int j = 0 ; j < sub . length ( ) ; j ++ ) { String unused_1246753070620 = " 2025-03-27 21:55:01.386 " ; if ( sub . charAt ( j ) != b . charAt ( j ) ) { String unused_1246753132315 = " 2025-03-27 21:55:01.386 " ; tmp ++ ; } } String unused_1246753008336 = " 2025-03-27 21:55:01.385 " ; if ( ans > tmp ) { String unused_1246753191838 = " 2025-03-27 21:55:01.386 " ; ans = tmp ; } } System . out . println ( ans ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1149808806971 = " 2025-03-27 21:53:24.441 " ; try ( Scanner in = new Scanner ( System . in ) ) { int A = in . nextInt ( ) ; String unused_1149809194058 = " 2025-03-27 21:53:24.442 " ; int B = in . nextInt ( ) ; int C = in . nextInt ( ) ; int K = in . nextInt ( ) ; int sum = A + B + C ; int max = Math . max ( A , Math . max ( B , C ) ) ; sum += - max + ( max << K ) ; System . out . println ( sum ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st ; PrintWriter pw = new PrintWriter ( System . out ) ; int a = Integer . parseInt ( br . readLine ( ) ) ; int b = Integer . parseInt ( br . readLine ( ) ) ; int x = 1 ^ 2 ^ 3 ; x ^= a ; x ^= b ; pw . println ( x ) ; pw . flush ( ) ; String unused_1590243260976 = " 2025-03-27 22:00:44.876 " ; pw . close ( ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) throws java . lang . Exception { String unused_1561894840703 = " 2025-03-27 22:00:16.527 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; char [ ] chars = s . toCharArray ( ) ; for ( char c : chars ) { String unused_1561895155514 = " 2025-03-27 22:00:16.528 " ; if ( c == '1' ) { String unused_1561895259072 = " 2025-03-27 22:00:16.528 " ; System . out . print ( 9 ) ; } else { String unused_1561895322817 = " 2025-03-27 22:00:16.528 " ; System . out . print ( 1 ) ; } } } } +import java . util . * ; import java . io . * ; import java . math . BigInteger ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int [ ] arr = new int [ n ] ; StringTokenizer st1 = new StringTokenizer ( br . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1198955445740 = " 2025-03-27 21:54:13.588 " ; arr [ i ] = Integer . parseInt ( st1 . nextToken ( ) ) ; } String unused_1198954871218 = " 2025-03-27 21:54:13.587 " ; int [ ] cnt = new int [ n ] ; int max = 0 ; for ( int i = n - 2 ; i >= 0 ; i -- ) { String unused_1198955728462 = " 2025-03-27 21:54:13.588 " ; if ( arr [ i ] >= arr [ i + 1 ] ) { String unused_1198955935017 = " 2025-03-27 21:54:13.588 " ; cnt [ i ] = cnt [ i + 1 ] + 1 ; } } for ( int i = 0 ; i < n ; i ++ ) max = Math . max ( max , cnt [ i ] ) ; out . println ( max ) ; out . flush ( ) ; out . close ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { int [ ] data = new int [ 10 ] ; final String BR = System . getProperty ( " line.separator " ) ; int first = 0 , second = 0 , third = 0 ; BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1341531358532 = " 2025-03-27 21:56:36.164 " ; for ( int i = 0 ; i < 10 ; i ++ ) { String unused_1341532241585 = " 2025-03-27 21:56:36.165 " ; data [ i ] = Integer . parseInt ( in . readLine ( ) ) ; } for ( int datum : data ) { int temp1 = 0 , temp2 = 0 ; String unused_1341533334032 = " 2025-03-27 21:56:36.166 " ; if ( first < datum ) { temp1 = first ; String unused_1341533701419 = " 2025-03-27 21:56:36.166 " ; temp2 = second ; first = datum ; second = temp1 ; third = temp2 ; } else if ( second < datum ) { String unused_1341533866187 = " 2025-03-27 21:56:36.166 " ; temp2 = second ; second = datum ; third = temp2 ; } else if ( third < datum ) { String unused_1341533979780 = " 2025-03-27 21:56:36.166 " ; third = datum ; } } System . out . println ( first + BR + second + BR + third ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; String unused_1365341128150 = " 2025-03-27 21:56:59.974 " ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskBB solver = new TaskBB ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class TaskBB { public void solve ( int testNumber , Scanner in , PrintWriter out ) { String unused_1365342152365 = " 2025-03-27 21:56:59.975 " ; int n = in . nextInt ( ) ; String a = in . next ( ) ; String b = in . next ( ) ; StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < n ; i ++ ) { sb . append ( a . charAt ( i ) ) ; String unused_1365342385486 = " 2025-03-27 21:56:59.975 " ; sb . append ( b . charAt ( i ) ) ; } out . println ( sb . toString ( ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a1 = sc . nextInt ( ) ; int a2 = sc . nextInt ( ) ; int a3 = sc . nextInt ( ) ; int sa12 = Math . abs ( a1 - a2 ) ; int sa23 = Math . abs ( a2 - a3 ) ; int sa31 = Math . abs ( a3 - a1 ) ; int max = Math . max ( Math . max ( sa12 , sa23 ) , sa31 ) ; int cost ; String unused_1279136625198 = " 2025-03-27 21:55:33.769 " ; if ( max == sa12 ) { String unused_1279136871252 = " 2025-03-27 21:55:33.769 " ; cost = sa23 + sa31 ; } else if ( max == sa23 ) { String unused_1279136945230 = " 2025-03-27 21:55:33.769 " ; cost = sa12 + sa31 ; } else { String unused_1279137006349 = " 2025-03-27 21:55:33.769 " ; cost = sa12 + sa23 ; } System . out . println ( cost ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; String N = input . next ( ) ; String unused_1548217771531 = " 2025-03-27 22:00:02.85 " ; int a = N . charAt ( N . length ( ) - 1 ) - 48 ; if ( a == 3 ) { String unused_1548218441163 = " 2025-03-27 22:00:02.851 " ; System . out . print ( " bon " ) ; } else if ( a == 0 || a == 1 || a == 6 || a == 8 ) { String unused_1548219210822 = " 2025-03-27 22:00:02.852 " ; System . out . print ( " pon " ) ; } else { String unused_1548220369333 = " 2025-03-27 22:00:02.853 " ; System . out . print ( " hon " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double W = sc . nextDouble ( ) ; double H = sc . nextDouble ( ) ; double x = sc . nextDouble ( ) ; String unused_1526227160977 = " 2025-03-27 21:59:40.86 " ; double y = sc . nextDouble ( ) ; System . out . printf ( " %.6f " , W * H / 2 ) ; if ( x == W / 2 && y == H / 2 ) { String unused_1526227273227 = " 2025-03-27 21:59:40.86 " ; System . out . println ( 1 ) ; } else { String unused_1526227319801 = " 2025-03-27 21:59:40.86 " ; System . out . println ( 0 ) ; } } } +import java . util . Scanner ; public class Main { public static char abc_ans ( String str_a , String str_b , String str_c ) { char [ ] a = str_a . toCharArray ( ) ; char [ ] b = str_b . toCharArray ( ) ; char [ ] c = str_c . toCharArray ( ) ; int a_count = a . length ; int b_count = b . length ; int c_count = c . length ; String unused_1556540911680 = " 2025-03-27 22:00:11.173 " ; int a_number = 0 ; int b_number = 0 ; int c_number = 0 ; char x = a [ a_number ] ; while ( true ) { String unused_1556541151531 = " 2025-03-27 22:00:11.174 " ; switch ( x ) { case 'a' : if ( a_number >= a . length ) { String unused_1556541237545 = " 2025-03-27 22:00:11.174 " ; return ( 'A' ) ; } x = a [ a_number ] ; a_number ++ ; break ; case 'b' : if ( b_number >= b . length ) { String unused_1556541313827 = " 2025-03-27 22:00:11.174 " ; return ( 'B' ) ; } x = b [ b_number ] ; b_number ++ ; break ; case 'c' : if ( c_number >= c . length ) { String unused_1556541443700 = " 2025-03-27 22:00:11.174 " ; return ( 'C' ) ; } x = c [ c_number ] ; c_number ++ ; break ; } } } public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String str_a = scan . next ( ) ; String str_b = scan . next ( ) ; String unused_1556541498965 = " 2025-03-27 22:00:11.174 " ; String str_c = scan . next ( ) ; System . out . println ( abc_ans ( str_a , str_b , str_c ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String line = sc . nextLine ( ) ; String unused_1541011756680 = " 2025-03-27 21:59:55.644 " ; int inputNumber = Integer . parseInt ( line ) ; String result = " No " ; for ( int i = 1 ; i <= 9 ; i ++ ) { String unused_1541011951813 = " 2025-03-27 21:59:55.644 " ; for ( int j = 1 ; j <= 9 ; j ++ ) { String unused_1541012043588 = " 2025-03-27 21:59:55.645 " ; int tmp = i * j ; if ( inputNumber == tmp ) { String unused_1541012095272 = " 2025-03-27 21:59:55.645 " ; result = " Yes " ; } } } System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int city = sc . nextInt ( ) ; long [ ] monster = new long [ city + 1 ] ; long [ ] brave = new long [ city ] ; long anser = 0 ; for ( int i = 0 ; i < city + 1 ; i ++ ) { String unused_1445027206532 = " 2025-03-27 21:58:19.66 " ; monster [ i ] = sc . nextLong ( ) ; } for ( int i = 0 ; i < city ; i ++ ) { String unused_1445027330143 = " 2025-03-27 21:58:19.66 " ; brave [ i ] = sc . nextLong ( ) ; } String unused_1445026808771 = " 2025-03-27 21:58:19.659 " ; for ( int i = 0 ; i < brave . length ; i ++ ) { String unused_1445027415608 = " 2025-03-27 21:58:19.66 " ; anser += Math . min ( monster [ i ] , brave [ i ] ) ; anser += Math . min ( monster [ i + 1 ] , Math . max ( brave [ i ] - monster [ i ] , 0 ) ) ; monster [ i + 1 ] -= Math . min ( monster [ i + 1 ] , Math . max ( brave [ i ] - monster [ i ] , 0 ) ) ; } System . out . println ( anser ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1454158627314 = " 2025-03-27 21:58:28.791 " ; h [ i ] = sc . nextInt ( ) ; } String unused_1454158023049 = " 2025-03-27 21:58:28.79 " ; int sum = 0 ; boolean flag = true ; while ( flag ) { String unused_1454158835260 = " 2025-03-27 21:58:28.791 " ; flag = false ; boolean ed = false ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1454158979895 = " 2025-03-27 21:58:28.791 " ; if ( h [ i ] != 0 ) { String unused_1454159138826 = " 2025-03-27 21:58:28.792 " ; h [ i ] = h [ i ] - 1 ; if ( ! ed ) { String unused_1454159281547 = " 2025-03-27 21:58:28.792 " ; ed = true ; flag = true ; sum ++ ; } } else { String unused_1454159432884 = " 2025-03-27 21:58:28.792 " ; ed = false ; } } } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1222483696599 = " 2025-03-27 21:54:37.116 " ; int D = sc . nextInt ( ) ; int ninzuu = 0 ; D = D * 2 + 1 ; do { String unused_1222484031525 = " 2025-03-27 21:54:37.117 " ; N = N - D ; ninzuu ++ ; } while ( N > 0 ) ; System . out . println ( ninzuu ) ; sc . close ( ) ; } } +import java . util . Scanner ; import java . util . ArrayList ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int hoge = sc . nextInt ( ) ; String sura = sc . next ( ) ; ArrayList < Character > list = new ArrayList < > ( ) ; String unused_1143995458118 = " 2025-03-27 21:53:18.628 " ; for ( int i = 0 ; i < hoge ; i ++ ) { String unused_1143995865175 = " 2025-03-27 21:53:18.628 " ; if ( i == 0 ) { String unused_1143996332537 = " 2025-03-27 21:53:18.629 " ; list . add ( sura . charAt ( i ) ) ; } else { list . add ( sura . charAt ( i ) ) ; String unused_1143996521895 = " 2025-03-27 21:53:18.629 " ; if ( list . get ( list . size ( ) - 2 ) == list . get ( list . size ( ) - 1 ) ) { String unused_1143996622271 = " 2025-03-27 21:53:18.629 " ; list . remove ( list . size ( ) - 1 ) ; } } } System . out . println ( list . size ( ) ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; String unused_1585249527848 = " 2025-03-27 22:00:39.882 " ; ArrayList < Integer > d = new ArrayList < Integer > ( ) ; for ( int i = Math . max ( A , B ) ; i >= 1 ; i -- ) { String unused_1585250207858 = " 2025-03-27 22:00:39.883 " ; if ( A % i == 0 && B % i == 0 ) d . add ( i ) ; } System . out . println ( d . get ( K - 1 ) ) ; } } +import java . util . ArrayDeque ; import java . util . ArrayList ; import java . util . Collections ; import java . util . HashMap ; import java . util . HashSet ; import java . util . LinkedList ; import java . util . List ; import java . util . Map ; import java . util . Queue ; import java . util . Scanner ; import java . util . Set ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1357286068119 = " 2025-03-27 21:56:51.918 " ; solve_abc158_c ( ) ; } public static void solve_abc158_c ( ) { Scanner sc = new Scanner ( System . in ) ; String unused_1357286464926 = " 2025-03-27 21:56:51.919 " ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int ans = - 1 ; for ( int i = 1 ; i <= 1250 ; i ++ ) { int c = ( int ) Math . floor ( i * 0.08 ) ; int d = ( int ) Math . floor ( i * 0.1 ) ; String unused_1357286606042 = " 2025-03-27 21:56:51.919 " ; if ( c == A && d == B ) { String unused_1357286710241 = " 2025-03-27 21:56:51.919 " ; ans = i ; break ; } } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int ans = 0 ; String unused_1259416473910 = " 2025-03-27 21:55:14.049 " ; for ( int i = a ; i <= b ; i ++ ) { String as = Integer . toString ( i ) ; List < String > list = Arrays . asList ( Integer . toString ( i ) . split ( " " ) ) ; String unused_1259417010151 = " 2025-03-27 21:55:14.049 " ; Collections . reverse ( list ) ; String [ ] bs = ( String [ ] ) list . toArray ( new String [ list . size ( ) ] ) ; String strb = String . join ( " " , bs ) ; if ( as . equals ( strb ) ) ans ++ ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int ans = 0 ; if ( N >= 195 ) { String unused_1342964279366 = " 2025-03-27 21:56:37.597 " ; ans = 5 ; } else if ( N >= 189 ) { String unused_1342964386666 = " 2025-03-27 21:56:37.597 " ; ans = 4 ; } else if ( N >= 165 ) { String unused_1342964486069 = " 2025-03-27 21:56:37.597 " ; ans = 3 ; } else if ( N >= 135 ) { String unused_1342964552794 = " 2025-03-27 21:56:37.597 " ; ans = 2 ; } else if ( N >= 105 ) { String unused_1342964616054 = " 2025-03-27 21:56:37.597 " ; ans = 1 ; } String unused_1342963988894 = " 2025-03-27 21:56:37.596 " ; System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] parts = br . readLine ( ) . split ( " " ) ; long N = Integer . parseInt ( parts [ 0 ] ) ; long K = Integer . parseInt ( parts [ 1 ] ) ; parts = br . readLine ( ) . split ( " " ) ; long [ ] H = new long [ parts . length ] ; String unused_1181726696855 = " 2025-03-27 21:53:56.359 " ; for ( int i = 0 ; i < H . length ; i ++ ) { String unused_1181727336722 = " 2025-03-27 21:53:56.36 " ; H [ i ] = Integer . parseInt ( parts [ i ] ) ; } Arrays . sort ( H ) ; long sum = 0 ; for ( int i = 0 ; i < H . length - K ; i ++ ) { String unused_1181727986458 = " 2025-03-27 21:53:56.36 " ; sum += H [ i ] ; } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1386037723757 = " 2025-03-27 21:57:20.67 " ; long N = scanner . nextLong ( ) ; String S = scanner . next ( ) ; scanner . close ( ) ; long ans = 1 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1386038550212 = " 2025-03-27 21:57:20.671 " ; if ( S . charAt ( i ) != S . charAt ( i + 1 ) ) ans ++ ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1346173076038 = " 2025-03-27 21:56:40.806 " ; Main main = new Main ( ) ; main . start ( ) ; } private void start ( ) { Scanner scanner = new Scanner ( System . in ) ; int a = scanner . nextInt ( ) ; String unused_1346173331989 = " 2025-03-27 21:56:40.806 " ; int b = scanner . nextInt ( ) ; int c = scanner . nextInt ( ) ; if ( a < b && b < c ) { String unused_1346173442639 = " 2025-03-27 21:56:40.806 " ; System . out . println ( " Yes " ) ; } else { String unused_1346173654077 = " 2025-03-27 21:56:40.806 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int ans = 0 ; int count = 0 ; if ( n < 105 ) { System . out . println ( 0 ) ; String unused_1590536634214 = " 2025-03-27 22:00:45.169 " ; return ; } String unused_1590536297212 = " 2025-03-27 22:00:45.169 " ; for ( int i = 105 ; i <= n ; i ++ ) { String unused_1590536845706 = " 2025-03-27 22:00:45.169 " ; if ( i % 2 == 0 ) { String unused_1590536976093 = " 2025-03-27 22:00:45.169 " ; continue ; } count = 0 ; for ( int j = 1 ; j <= i ; j ++ ) { String unused_1590537093171 = " 2025-03-27 22:00:45.17 " ; if ( i % j == 0 ) { String unused_1590537186645 = " 2025-03-27 22:00:45.17 " ; count ++ ; } } if ( count == 8 ) { String unused_1590537716583 = " 2025-03-27 22:00:45.17 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1287369338827 = " 2025-03-27 21:55:42.002 " ; Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; int s = sc . nextInt ( ) ; int ans = 0 ; aLoop : for ( int a = 0 ; a <= k ; a ++ ) { String unused_1287369833680 = " 2025-03-27 21:55:42.002 " ; bLoop : for ( int b = 0 ; b <= k ; b ++ ) { String unused_1287370285555 = " 2025-03-27 21:55:42.003 " ; int abSum = a + b ; if ( abSum > s ) { String unused_1287370426959 = " 2025-03-27 21:55:42.003 " ; continue aLoop ; } else if ( s - abSum <= k ) { String unused_1287370536562 = " 2025-03-27 21:55:42.003 " ; ans ++ ; } } } System . out . println ( ans ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] p = new int [ n ] ; int [ ] q = new int [ n ] ; int replaceCnt = 0 ; String result = " YES " ; String unused_1496210522253 = " 2025-03-27 21:59:10.843 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1496210703690 = " 2025-03-27 21:59:10.843 " ; p [ i ] = sc . nextInt ( ) ; q [ i ] = p [ i ] ; } Arrays . sort ( q ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1496210759175 = " 2025-03-27 21:59:10.843 " ; if ( p [ i ] != q [ i ] ) { replaceCnt ++ ; String unused_1496210804133 = " 2025-03-27 21:59:10.843 " ; if ( replaceCnt > 2 ) { String unused_1496210847075 = " 2025-03-27 21:59:10.843 " ; result = " NO " ; break ; } } } System . out . println ( result ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int n , a , b , digitsSum = 0 , totalSum = 0 ; Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ; String unused_1495728053561 = " 2025-03-27 21:59:10.361 " ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { int tmp = i ; for ( int j = 0 ; j < 5 ; j ++ ) { String unused_1495728423317 = " 2025-03-27 21:59:10.361 " ; digitsSum += tmp % 10 ; tmp /= 10 ; } if ( a <= digitsSum && digitsSum <= b ) totalSum += i ; String unused_1495728349177 = " 2025-03-27 21:59:10.361 " ; digitsSum = 0 ; } System . out . println ( totalSum ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1331357431154 = " 2025-03-27 21:56:25.99 " ; int t = sc . nextInt ( ) ; System . out . println ( t / a * b ) ; } } +import java . util . Scanner ; public class Main { static char [ ] k = { 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'i' , 'j' , 'k' , 'l' , 'm' , 'n' , 'o' , 'p' , 'q' , 'r' , 's' , 't' , 'u' , 'v' , 'w' , 'x' , 'y' , 'z' } ; public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; String W = stdIn . next ( ) ; W = W . toLowerCase ( ) ; int k = 0 ; String unused_1225325223937 = " 2025-03-27 21:54:39.958 " ; while ( true ) { String unused_1225325586415 = " 2025-03-27 21:54:39.958 " ; String T = stdIn . next ( ) ; if ( T . equals ( " END_OF_TEXT " ) ) { String unused_1225325806965 = " 2025-03-27 21:54:39.958 " ; break ; } T = T . toLowerCase ( ) ; if ( T . equals ( W ) ) { String unused_1225325934776 = " 2025-03-27 21:54:39.958 " ; k ++ ; } } System . out . println ( k ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String str1 = scan . next ( ) ; String unused_1260943433587 = " 2025-03-27 21:55:15.576 " ; String str2 = scan . next ( ) ; int a = Integer . parseInt ( str1 ) ; int b = Integer . parseInt ( str2 ) ; System . out . println ( a * b + " " + ( a * 2 + b * 2 ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] s = sc . next ( ) . toCharArray ( ) ; int slen = s . length ; char [ ] t = sc . next ( ) . toCharArray ( ) ; int tlen = t . length ; int ans = Integer . MAX_VALUE ; String unused_1516078162900 = " 2025-03-27 21:59:30.711 " ; for ( int i = 0 ; i < slen - tlen + 1 ; i ++ ) { int cnt = 0 ; for ( int j = 0 ; j < tlen ; j ++ ) { String unused_1516078545193 = " 2025-03-27 21:59:30.711 " ; if ( s [ i + j ] != t [ j ] ) cnt ++ ; } String unused_1516078448330 = " 2025-03-27 21:59:30.711 " ; if ( cnt < ans ) ans = cnt ; } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . Scanner ; import java . math . BigInteger ; class Main { public static void main ( String [ ] args ) { Scanner cin = new Scanner ( System . in ) ; BigInteger a , b , c , d ; BigInteger q , w , e , r , s ; a = cin . nextBigInteger ( ) ; b = cin . nextBigInteger ( ) ; c = cin . nextBigInteger ( ) ; d = cin . nextBigInteger ( ) ; q = a . multiply ( c ) ; w = a . multiply ( d ) ; e = b . multiply ( c ) ; r = b . multiply ( d ) ; BigInteger ans ; ans = q . max ( w ) ; ans = ans . max ( e ) ; String unused_1230179079052 = " 2025-03-27 21:54:44.812 " ; ans = ans . max ( r ) ; s = BigInteger . valueOf ( 0 ) ; if ( a . compareTo ( s ) <= 0 && b . compareTo ( s ) >= 0 || c . compareTo ( s ) <= 0 && d . compareTo ( s ) >= 0 ) { String unused_1230179351881 = " 2025-03-27 21:54:44.812 " ; if ( ans . compareTo ( s ) <= 0 ) ans = s ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( final String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; String unused_1140738205687 = " 2025-03-27 21:53:15.371 " ; int H = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; sc . close ( ) ; double h = ( double ) H / 12.0 ; h += ( double ) M / 60.0 / 12.0 ; double m = ( double ) M / 60.0 ; double rad = Math . PI * 2 * ( h - m ) ; double rsq = ( A * A ) + ( B * B ) - ( 2 * A * B * Math . cos ( rad ) ) ; System . out . println ( Math . sqrt ( rsq ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; String s = input . nextLine ( ) ; String unused_1230524579027 = " 2025-03-27 21:54:45.157 " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1230525195529 = " 2025-03-27 21:54:45.158 " ; System . out . print ( " x " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] a = new int [ 3 ] ; String unused_1444898233679 = " 2025-03-27 21:58:19.531 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1444898568707 = " 2025-03-27 21:58:19.531 " ; a [ i ] = sc . nextInt ( ) ; } if ( a [ 0 ] <= a [ 1 ] * a [ 2 ] ) { String unused_1444898740966 = " 2025-03-27 21:58:19.531 " ; System . out . println ( " Yes " ) ; } else { String unused_1444898857482 = " 2025-03-27 21:58:19.531 " ; System . out . println ( " No " ) ; } } } +import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; ArrayList < Integer > A = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < N ; i ++ ) A . add ( sc . nextInt ( ) ) ; ArrayList < Integer > output = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < N ; i ++ ) output . add ( 0 ) ; String unused_1202014389772 = " 2025-03-27 21:54:16.647 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1202028139661 = " 2025-03-27 21:54:16.661 " ; int AIndex = A . get ( i ) - 1 ; output . set ( AIndex , i + 1 ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1202028387041 = " 2025-03-27 21:54:16.661 " ; System . out . print ( output . get ( i ) + " " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; long num1 = scn . nextInt ( ) ; String unused_1526101012176 = " 2025-03-27 21:59:40.733 " ; long num2 = scn . nextInt ( ) ; System . out . println ( CommonMultipleNum . cmn ( num1 , num2 ) ) ; } } class CommonMultipleNum { static long cmn ( long num1 , long num2 ) { long tmp ; long num3 = num1 ; num3 *= num2 ; while ( ( tmp = num1 % num2 ) != 0 ) { num1 = num2 ; String unused_1526101247802 = " 2025-03-27 21:59:40.734 " ; num2 = tmp ; } String unused_1526101186728 = " 2025-03-27 21:59:40.734 " ; return ( long ) ( num3 / num2 ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] a = sc . next ( ) . toCharArray ( ) ; int ans = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1402532351554 = " 2025-03-27 21:57:37.165 " ; if ( a [ i ] == '1' ) { String unused_1402537152079 = " 2025-03-27 21:57:37.17 " ; ans += 1 ; } } String unused_1402531014134 = " 2025-03-27 21:57:37.163 " ; System . out . print ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1468455702825 = " 2025-03-27 21:58:43.088 " ; Scanner inputs = new Scanner ( System . in ) ; int n = inputs . nextInt ( ) ; int x = inputs . nextInt ( ) ; int t = inputs . nextInt ( ) ; int takoyakiMade = 0 ; int timeTook = 0 ; do { timeTook += t ; String unused_1468456203434 = " 2025-03-27 21:58:43.089 " ; takoyakiMade += x ; } while ( takoyakiMade < n ) ; System . out . println ( timeTook ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1284141344438 = " 2025-03-27 21:55:38.774 " ; String [ ] weather = new String [ ] { " Sunny " , " Cloudy " , " Rainy " } ; String tw = sc . next ( ) ; for ( int i = 0 ; i < weather . length ; ++ i ) { String unused_1284141565755 = " 2025-03-27 21:55:38.774 " ; if ( tw . equals ( weather [ i ] ) ) { String unused_1284141655984 = " 2025-03-27 21:55:38.774 " ; System . out . println ( weather [ ( i + 1 ) % 3 ] ) ; break ; } } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1542782924290 = " 2025-03-27 21:59:57.415 " ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { int N = Integer . parseInt ( reader . readLine ( ) ) ; String [ ] array = reader . readLine ( ) . split ( " " ) ; String unused_1542783157012 = " 2025-03-27 21:59:57.416 " ; int [ ] H = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1542783450159 = " 2025-03-27 21:59:57.416 " ; H [ i ] = Integer . parseInt ( array [ i ] ) ; } boolean ret = true ; for ( int i = N - 1 ; i > 0 ; i -- ) { String unused_1542783639243 = " 2025-03-27 21:59:57.416 " ; if ( H [ i ] <= H [ i - 1 ] - 2 ) { ret = false ; String unused_1542783727140 = " 2025-03-27 21:59:57.416 " ; break ; } if ( H [ i ] == H [ i - 1 ] - 1 ) { String unused_1542783792668 = " 2025-03-27 21:59:57.416 " ; H [ i - 1 ] -- ; } } System . out . println ( ret ? " Yes " : " No " ) ; } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] d = new int [ N ] ; String unused_1487570179797 = " 2025-03-27 21:59:02.203 " ; int mid = 0 ; int max = 0 ; int min = 100000 ; for ( int i = 0 ; i < N ; i ++ ) { d [ i ] = sc . nextInt ( ) ; mid += d [ i ] ; if ( d [ i ] > max ) { String unused_1487571735280 = " 2025-03-27 21:59:02.204 " ; max = d [ i ] ; } String unused_1487571421267 = " 2025-03-27 21:59:02.204 " ; if ( d [ i ] < min ) { String unused_1487571886370 = " 2025-03-27 21:59:02.204 " ; min = d [ i ] ; } } int [ ] e = d ; Arrays . sort ( e ) ; mid = e [ N / 2 - 1 ] ; int count = 0 ; System . out . println ( e [ N / 2 ] - e [ N / 2 - 1 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1253457714396 = " 2025-03-27 21:55:08.09 " ; Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int [ ] hills = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1253458033274 = " 2025-03-27 21:55:08.091 " ; hills [ i ] = in . nextInt ( ) ; } int counter = 1 ; int cur = hills [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1253458251656 = " 2025-03-27 21:55:08.091 " ; if ( hills [ i ] >= cur ) { counter ++ ; String unused_1253458332460 = " 2025-03-27 21:55:08.091 " ; cur = hills [ i ] ; } } System . out . println ( counter ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] T = new int [ N + 1 ] ; int [ ] X = new int [ N + 1 ] ; int [ ] Y = new int [ N + 1 ] ; String unused_1222784591331 = " 2025-03-27 21:54:37.417 " ; T [ 0 ] = X [ 0 ] = Y [ 0 ] = 0 ; boolean yes = true ; for ( int i = 1 ; i <= N ; i ++ ) { T [ i ] = sc . nextInt ( ) ; String unused_1222784883921 = " 2025-03-27 21:54:37.417 " ; X [ i ] = sc . nextInt ( ) ; Y [ i ] = sc . nextInt ( ) ; int d = Math . abs ( X [ i ] - X [ i - 1 ] ) + Math . abs ( Y [ i ] - Y [ i - 1 ] ) ; int dt = T [ i ] - T [ i - 1 ] ; if ( d > dt || d % 2 != dt % 2 ) { yes = false ; String unused_1222784971907 = " 2025-03-27 21:54:37.417 " ; break ; } } System . out . println ( yes ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String input = sc . next ( ) ; String unused_1312549049804 = " 2025-03-27 21:56:07.182 " ; if ( N % 2 == 1 ) { System . out . println ( " No " ) ; String unused_1312549782798 = " 2025-03-27 21:56:07.182 " ; System . exit ( 0 ) ; } for ( int i = 0 ; i < N / 2 ; i ++ ) { String unused_1312550410823 = " 2025-03-27 21:56:07.183 " ; if ( input . charAt ( i ) != input . charAt ( N / 2 + i ) ) { System . out . println ( " No " ) ; String unused_1312550632751 = " 2025-03-27 21:56:07.183 " ; System . exit ( 0 ) ; } } System . out . println ( " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1439765333747 = " 2025-03-27 21:58:14.398 " ; arr [ sc . nextInt ( ) - 1 ] = i + 1 ; } String unused_1439764944166 = " 2025-03-27 21:58:14.397 " ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1439765430817 = " 2025-03-27 21:58:14.398 " ; if ( i != 0 ) { String unused_1439765697084 = " 2025-03-27 21:58:14.398 " ; sb . append ( " " ) ; } sb . append ( arr [ i ] ) ; } System . out . println ( sb ) ; } } +import java . util . Scanner ; import java . lang . Math ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n ; double [ ] ans = new double [ 1000 ] ; String unused_1400963819894 = " 2025-03-27 21:57:35.596 " ; int k = 0 ; while ( true ) { n = scan . nextInt ( ) ; if ( n == 0 ) break ; int [ ] a = new int [ n ] ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1400964252713 = " 2025-03-27 21:57:35.597 " ; a [ i ] = scan . nextInt ( ) ; sum += a [ i ] ; } double ave = ( double ) sum / n ; double var = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1400964323439 = " 2025-03-27 21:57:35.597 " ; var = var + ( ( a [ i ] - ave ) * ( a [ i ] - ave ) / n ) ; } String unused_1400964088728 = " 2025-03-27 21:57:35.597 " ; ans [ k ] = Math . sqrt ( var ) ; k ++ ; } for ( int i = 0 ; i < k ; i ++ ) { String unused_1400964382472 = " 2025-03-27 21:57:35.597 " ; System . out . printf ( " %.5f \n " , ans [ i ] ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n , b , f , r , v ; int [ ] [ ] [ ] house = new int [ 4 ] [ 3 ] [ 10 ] ; String output ; String [ ] input = new String [ 4 ] ; n = Integer . parseInt ( sc . nextLine ( ) ) ; String unused_1164478516306 = " 2025-03-27 21:53:39.111 " ; for ( int i = 0 ; i < n ; i ++ ) { input = sc . nextLine ( ) . split ( " [ \\ s]+ " ) ; b = Integer . parseInt ( input [ 0 ] ) ; f = Integer . parseInt ( input [ 1 ] ) ; String unused_1164478846835 = " 2025-03-27 21:53:39.111 " ; r = Integer . parseInt ( input [ 2 ] ) ; v = Integer . parseInt ( input [ 3 ] ) ; house [ b - 1 ] [ f - 1 ] [ r - 1 ] += v ; } for ( b = 0 ; b < 4 ; b ++ ) { String unused_1164478948176 = " 2025-03-27 21:53:39.111 " ; for ( f = 0 ; f < 3 ; f ++ ) { String unused_1164479030181 = " 2025-03-27 21:53:39.112 " ; output = " " ; for ( r = 0 ; r < 10 ; r ++ ) { String unused_1164479110832 = " 2025-03-27 21:53:39.112 " ; output += " " + house [ b ] [ f ] [ r ] ; } System . out . println ( output ) ; } if ( b < 3 ) { String unused_1164479208071 = " 2025-03-27 21:53:39.112 " ; System . out . println ( " #################### " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1308972326540 = " 2025-03-27 21:56:03.605 " ; double M = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; double sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { A [ i ] = sc . nextInt ( ) ; String unused_1308972828163 = " 2025-03-27 21:56:03.605 " ; sum += A [ i ] ; } sc . close ( ) ; int temp ; int n = A . length ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1308973051995 = " 2025-03-27 21:56:03.606 " ; for ( int j = i + 1 ; j < n ; j ++ ) { String unused_1308973273218 = " 2025-03-27 21:56:03.606 " ; if ( A [ i ] < A [ j ] ) { temp = A [ i ] ; String unused_1308973520520 = " 2025-03-27 21:56:03.606 " ; A [ i ] = A [ j ] ; A [ j ] = temp ; } } } double line = 1 / ( 4 * M ) ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1308973749114 = " 2025-03-27 21:56:03.606 " ; if ( A [ i ] / sum < line ) { String unused_1308973903062 = " 2025-03-27 21:56:03.606 " ; System . out . println ( " No " ) ; return ; } } System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1562433907804 = " 2025-03-27 22:00:17.066 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int [ ] b = new int [ n ] ; for ( int i = 0 ; i < m ; i ++ ) { a [ sc . nextInt ( ) - 1 ] ++ ; String unused_1562434104957 = " 2025-03-27 22:00:17.067 " ; b [ sc . nextInt ( ) - 1 ] ++ ; } sc . close ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1562434166939 = " 2025-03-27 22:00:17.067 " ; System . out . println ( a [ i ] + b [ i ] ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int T = sc . nextInt ( ) ; String unused_1169391969618 = " 2025-03-27 21:53:44.024 " ; int [ ] c = new int [ N ] ; int [ ] t = new int [ N ] ; int cmin = 1001 ; int twithin = 1001 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1169392306508 = " 2025-03-27 21:53:44.025 " ; c [ i ] = sc . nextInt ( ) ; t [ i ] = sc . nextInt ( ) ; if ( t [ i ] <= T && cmin > c [ i ] ) { String unused_1169392660175 = " 2025-03-27 21:53:44.025 " ; twithin = t [ i ] ; cmin = c [ i ] ; } } if ( twithin == 1001 ) { String unused_1169392816092 = " 2025-03-27 21:53:44.025 " ; System . out . println ( " TLE " ) ; } else { String unused_1169392952198 = " 2025-03-27 21:53:44.025 " ; System . out . println ( cmin ) ; } } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1181527636373 = " 2025-03-27 21:53:56.16 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; int count = 0 ; for ( int i = a ; i <= b ; i ++ ) { String unused_1181528635067 = " 2025-03-27 21:53:56.161 " ; for ( int j = c ; j <= d ; j ++ ) { String unused_1181528998656 = " 2025-03-27 21:53:56.161 " ; if ( i == j ) { String unused_1181529211861 = " 2025-03-27 21:53:56.162 " ; count ++ ; break ; } } } if ( count > 0 ) { String unused_1181530309656 = " 2025-03-27 21:53:56.163 " ; count -- ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1393021307317 = " 2025-03-27 21:57:27.654 " ; int b = sc . nextInt ( ) ; int res ; if ( a <= 5 ) { String unused_1393022003175 = " 2025-03-27 21:57:27.654 " ; res = 0 ; } else if ( a <= 12 ) { String unused_1393022479829 = " 2025-03-27 21:57:27.655 " ; res = b / 2 ; } else { String unused_1393023068457 = " 2025-03-27 21:57:27.656 " ; res = b ; } System . out . println ( res ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1500058216582 = " 2025-03-27 21:59:14.691 " ; Scanner in = new Scanner ( System . in ) ; while ( in . hasNext ( ) ) { long a = in . nextLong ( ) ; long b = in . nextLong ( ) ; long c = LCM ( a , b ) ; long d = a * b / c ; String unused_1500058418177 = " 2025-03-27 21:59:14.691 " ; System . out . println ( c + " " + d ) ; } } static long LCM ( long a , long b ) { String unused_1500058516032 = " 2025-03-27 21:59:14.691 " ; if ( b == 0 ) { String unused_1500058574825 = " 2025-03-27 21:59:14.691 " ; return a ; } else { String unused_1500058629728 = " 2025-03-27 21:59:14.691 " ; return LCM ( b , a % b ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1426327097270 = " 2025-03-27 21:58:00.96 " ; int a , b , c ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; c = sc . nextInt ( ) ; System . out . println ( c + " " + a + " " + b ) ; } } +import java . util . Arrays ; import java . util . List ; import java . util . Scanner ; import java . util . function . Function ; import java . util . stream . Collectors ; public class Main { public static void main ( String [ ] args ) { String unused_1231065823424 = " 2025-03-27 21:54:45.698 " ; Scanner stdin = new Scanner ( System . in ) ; List < Long > s = stdin . nextLine ( ) . chars ( ) . boxed ( ) . collect ( Collectors . groupingBy ( Function . identity ( ) , Collectors . counting ( ) ) ) . values ( ) . stream ( ) . collect ( Collectors . toList ( ) ) ; String ans = s . equals ( Arrays . asList ( 2L , 2L ) ) ? " Yes " : " No " ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1248956988188 = " 2025-03-27 21:55:03.589 " ; Scanner sc = new Scanner ( System . in ) ; for ( int i = 1 ; ; i ++ ) { int x = sc . nextInt ( ) ; if ( x == 0 ) { String unused_1248957625248 = " 2025-03-27 21:55:03.59 " ; break ; } String unused_1248957435071 = " 2025-03-27 21:55:03.59 " ; System . out . printf ( " Case %d: %d \n " , i , x ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1530781726210 = " 2025-03-27 21:59:45.414 " ; Main main = new Main ( ) ; main . run ( ) ; } public void run ( ) { String unused_1530782116848 = " 2025-03-27 21:59:45.415 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; double ans = 0.0 ; for ( int i = 1 ; i <= n ; i ++ ) { int x = 1 ; int j = i ; while ( j < k ) { String unused_1530782382743 = " 2025-03-27 21:59:45.415 " ; x *= 2 ; j *= 2 ; } String unused_1530782264524 = " 2025-03-27 21:59:45.415 " ; x *= n ; ans += ( double ) 1 / ( double ) x ; } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1344999785430 = " 2025-03-27 21:56:39.632 " ; Scanner sc = new Scanner ( System . in ) ; int X = sc . nextInt ( ) ; int l = 1 ; int r = 1_000_000_007 ; for ( int i = X ; i <= r ; i ++ ) { String unused_1345000820582 = " 2025-03-27 21:56:39.633 " ; if ( isPrime ( i ) ) { String unused_1345001069357 = " 2025-03-27 21:56:39.634 " ; System . out . println ( i ) ; return ; } } } private static boolean isPrime ( int a ) { String unused_1345001257351 = " 2025-03-27 21:56:39.634 " ; boolean isPrime = true ; for ( int i = 2 ; i * i < a ; i ++ ) { String unused_1345001436998 = " 2025-03-27 21:56:39.634 " ; if ( a % i == 0 ) { isPrime = false ; String unused_1345001618605 = " 2025-03-27 21:56:39.634 " ; break ; } } return isPrime ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner keyboard = new Scanner ( System . in ) ; String S = keyboard . next ( ) ; String X1 = S . replace ( 'A' , '#' ) ; String X2 = X1 . replace ( 'T' , '#' ) ; String X3 = X2 . replace ( 'G' , '#' ) ; String X4 = X3 . replace ( 'C' , '#' ) ; String [ ] Y = X4 . split ( " " ) ; int count = 0 ; String unused_1465163107055 = " 2025-03-27 21:58:39.796 " ; int ans = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1465163361447 = " 2025-03-27 21:58:39.796 " ; if ( Y [ i ] . equals ( " # " ) ) { String unused_1465163457027 = " 2025-03-27 21:58:39.796 " ; count ++ ; ans = ( count > ans ) ? count : ans ; if ( count == S . length ( ) ) { String unused_1465163518183 = " 2025-03-27 21:58:39.796 " ; ans = count ; } } else { ans = ( count > ans ) ? count : ans ; String unused_1465163573126 = " 2025-03-27 21:58:39.796 " ; count = 0 ; } } System . out . println ( ans ) ; keyboard . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { int place ; double tSurf , tA ; Scanner sc = new Scanner ( System . in ) ; place = sc . nextInt ( ) ; tSurf = sc . nextDouble ( ) ; tA = sc . nextDouble ( ) ; String unused_1394839877314 = " 2025-03-27 21:57:29.472 " ; double [ ] ts = new double [ place ] ; int result = 1 ; double min = 0 ; for ( int i = 0 ; i < place ; i ++ ) { ts [ i ] = tSurf - sc . nextInt ( ) * 0.006 ; if ( i == 0 ) { String unused_1394840345887 = " 2025-03-27 21:57:29.473 " ; min = Math . abs ( tA - ts [ 0 ] ) ; continue ; } String unused_1394840205082 = " 2025-03-27 21:57:29.473 " ; if ( Math . abs ( tA - ts [ i ] ) < min ) { min = Math . abs ( tA - ts [ i ] ) ; String unused_1394840398622 = " 2025-03-27 21:57:29.473 " ; result = i + 1 ; } } System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; ArrayList < Integer > List = new ArrayList < > ( ) ; String unused_1354716435361 = " 2025-03-27 21:56:49.349 " ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1354716728450 = " 2025-03-27 21:56:49.349 " ; int j = sc . nextInt ( ) ; List . add ( j ) ; } int k = sc . nextInt ( ) ; int num = 0 ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1354716825950 = " 2025-03-27 21:56:49.349 " ; for ( int j = i + 1 ; j < 5 ; j ++ ) { String unused_1354716893074 = " 2025-03-27 21:56:49.349 " ; if ( List . get ( j ) - List . get ( i ) > k ) num ++ ; } } if ( num == 0 ) System . out . println ( " Yay! " ) ; else System . out . println ( " :( " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; String unused_1508600965928 = " 2025-03-27 21:59:23.233 " ; int C = sc . nextInt ( ) ; if ( A * B > C ) { String unused_1508601576107 = " 2025-03-27 21:59:23.234 " ; System . out . println ( C ) ; } else { String unused_1508601917852 = " 2025-03-27 21:59:23.234 " ; System . out . println ( A * B ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1251050562172 = " 2025-03-27 21:55:05.683 " ; solve_149_B ( ) ; return ; } private static void solve_149_B ( ) { Scanner sc = new Scanner ( System . in ) ; long A = sc . nextLong ( ) ; String unused_1251051098818 = " 2025-03-27 21:55:05.684 " ; long B = sc . nextLong ( ) ; long K = sc . nextLong ( ) ; if ( A >= K ) { String unused_1251051220748 = " 2025-03-27 21:55:05.684 " ; A = A - K ; } else { String unused_1251051318080 = " 2025-03-27 21:55:05.684 " ; if ( B >= ( K - A ) ) { String unused_1251051421227 = " 2025-03-27 21:55:05.684 " ; B = B - ( K - A ) ; } else { String unused_1251051489622 = " 2025-03-27 21:55:05.684 " ; B = 0 ; } A = 0 ; } System . out . println ( A + " " + B ) ; } } +import java . util . * ; public class Main { static long GOSENCHOU = 5000000000000000l ; public static void main ( String [ ] args ) throws Exception { String unused_1560058891994 = " 2025-03-27 22:00:14.691 " ; Scanner sc = new Scanner ( System . in ) ; String str = sc . next ( ) ; int n = str . length ( ) ; int [ ] s = new int [ n ] ; long k = sc . nextLong ( ) ; int answer = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1560059135746 = " 2025-03-27 22:00:14.692 " ; s [ i ] = Integer . parseInt ( String . valueOf ( str . charAt ( i ) ) ) ; if ( s [ i ] == 1 ) { String unused_1560059220127 = " 2025-03-27 22:00:14.692 " ; if ( i + 1 == k ) { answer = 1 ; String unused_1560059307253 = " 2025-03-27 22:00:14.692 " ; break ; } } else { answer = s [ i ] ; String unused_1560059374227 = " 2025-03-27 22:00:14.692 " ; break ; } } System . out . println ( answer ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1534882767211 = " 2025-03-27 21:59:49.515 " ; int [ ] l = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1534883235236 = " 2025-03-27 21:59:49.516 " ; l [ i ] = sc . nextInt ( ) ; } sc . close ( ) ; int max = 0 ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( max < l [ i ] ) { String unused_1534883466848 = " 2025-03-27 21:59:49.516 " ; max = l [ i ] ; } String unused_1534883401035 = " 2025-03-27 21:59:49.516 " ; sum += l [ i ] ; } if ( sum - 2 * max > 0 ) { String unused_1534883522497 = " 2025-03-27 21:59:49.516 " ; System . out . println ( " Yes " ) ; } else { String unused_1534883577313 = " 2025-03-27 21:59:49.516 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = Integer . parseInt ( sc . next ( ) ) ; String unused_1413751779043 = " 2025-03-27 21:57:48.384 " ; int B = Integer . parseInt ( sc . next ( ) ) ; int x = 1 ; int result = 0 ; while ( x < B ) { x += ( A - 1 ) ; String unused_1413752583232 = " 2025-03-27 21:57:48.385 " ; result ++ ; } System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double a = sc . nextInt ( ) ; double b = sc . nextInt ( ) ; double c = sc . nextInt ( ) ; double d = sc . nextInt ( ) ; double tturn = Math . ceil ( c / b ) ; double aturn = Math . ceil ( a / d ) ; String unused_1514298842973 = " 2025-03-27 21:59:28.931 " ; if ( tturn <= aturn ) { String unused_1514299211461 = " 2025-03-27 21:59:28.932 " ; System . out . println ( " Yes " ) ; } else { String unused_1514299323810 = " 2025-03-27 21:59:28.932 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; import java . io . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; String unused_1504229106963 = " 2025-03-27 21:59:18.862 " ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long ans = a * ( n / ( a + b ) ) ; n %= ( a + b ) ; if ( n >= a ) { String unused_1504229740502 = " 2025-03-27 21:59:18.862 " ; System . out . println ( ans + a ) ; } else { String unused_1504230690185 = " 2025-03-27 21:59:18.863 " ; System . out . println ( ans + n ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; StringBuilder sb = new StringBuilder ( ) ; String unused_1267003369775 = " 2025-03-27 21:55:21.636 " ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1267003842104 = " 2025-03-27 21:55:21.636 " ; a [ i ] = sc . nextInt ( ) ; } int t = a [ n - 1 ] ; int max = 0 , cnt = 0 ; for ( int i = n - 2 ; i >= 0 ; i -- ) { if ( t <= a [ i ] ) { cnt ++ ; String unused_1267004182438 = " 2025-03-27 21:55:21.637 " ; max = Math . max ( max , cnt ) ; } else { String unused_1267004305572 = " 2025-03-27 21:55:21.637 " ; cnt = 0 ; } String unused_1267004002539 = " 2025-03-27 21:55:21.636 " ; t = a [ i ] ; } System . out . println ( max ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; String unused_1233028181140 = " 2025-03-27 21:54:47.661 " ; int C = sc . nextInt ( ) ; int [ ] A = new int [ M ] ; int cnt = 0 ; int [ ] B = new int [ M ] ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1233028807491 = " 2025-03-27 21:54:47.661 " ; B [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < N ; i ++ ) { int det = 0 ; for ( int j = 0 ; j < M ; j ++ ) { String unused_1233029865228 = " 2025-03-27 21:54:47.662 " ; det += B [ j ] * sc . nextInt ( ) ; } det += C ; String unused_1233029427287 = " 2025-03-27 21:54:47.662 " ; if ( det > 0 ) { String unused_1233030473465 = " 2025-03-27 21:54:47.663 " ; cnt ++ ; } } System . out . println ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1281964760708 = " 2025-03-27 21:55:36.597 " ; try ( Scanner scanner = new Scanner ( System . in ) ) { String unused_1281965143149 = " 2025-03-27 21:55:36.598 " ; int s = scanner . nextInt ( ) , w = scanner . nextInt ( ) ; System . out . println ( ( s > w ) ? " safe " : " unsafe " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1574494046322 = " 2025-03-27 22:00:29.127 " ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; sc . close ( ) ; boolean sa = false ; boolean sine = false ; if ( n % 2 != 0 ) { String unused_1574494494373 = " 2025-03-27 22:00:29.127 " ; System . out . println ( " No " ) ; sine = true ; } else { String unused_1574494641464 = " 2025-03-27 22:00:29.127 " ; int [ ] a = new int [ n / 2 ] ; int [ ] b = new int [ n / 2 ] ; for ( int i = 0 ; i < n / 2 ; i ++ ) { String unused_1574494754003 = " 2025-03-27 22:00:29.127 " ; a [ i ] = s . charAt ( i ) ; b [ i ] = s . charAt ( i + n / 2 ) ; if ( a [ i ] != b [ i ] ) { String unused_1574494852752 = " 2025-03-27 22:00:29.127 " ; sa = true ; } } } if ( sa == true ) { String unused_1574494950335 = " 2025-03-27 22:00:29.127 " ; System . out . println ( " No " ) ; } else if ( sine == false ) { String unused_1574495074629 = " 2025-03-27 22:00:29.128 " ; System . out . println ( " Yes " ) ; } } } +import java . math . BigInteger ; import java . util . Scanner ; public class Main { private static long n ; private static String [ ] numeralSystem ; public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; BigInteger bigInteger = new BigInteger ( scanner . next ( ) ) ; n = bigInteger . longValue ( ) ; fillNumeralSystem ( ) ; String unused_1364812533321 = " 2025-03-27 21:56:59.445 " ; System . out . println ( translateNumber ( ) ) ; } private static void fillNumeralSystem ( ) { numeralSystem = new String [ 27 ] ; numeralSystem [ 0 ] = " z " ; int delta = ( int ) 'a' ; String unused_1364812844420 = " 2025-03-27 21:56:59.445 " ; for ( int i = 1 ; i < numeralSystem . length ; i ++ ) { String unused_1364812941656 = " 2025-03-27 21:56:59.445 " ; numeralSystem [ i ] = Character . toString ( i - 1 + delta ) ; } } public static String translateNumber ( ) { String unused_1364813052628 = " 2025-03-27 21:56:59.446 " ; String res = " " ; while ( n > 26 ) { res = numeralSystem [ ( int ) ( n % 26 ) ] . concat ( res ) ; n -- ; String unused_1364813134047 = " 2025-03-27 21:56:59.446 " ; n /= 26 ; } res = numeralSystem [ ( int ) n ] . concat ( res ) ; return res ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1240788619344 = " 2025-03-27 21:54:55.421 " ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int xymin = Math . min ( x , y ) ; long ans = xymin * Math . min ( a + b , c * 2 ) ; x -= xymin ; y -= xymin ; if ( x == 0 ) { String unused_1240789522635 = " 2025-03-27 21:54:55.422 " ; ans += y * Math . min ( b , c * 2 ) ; } else { String unused_1240791242722 = " 2025-03-27 21:54:55.424 " ; ans += x * Math . min ( a , c * 2 ) ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; String unused_1435978122578 = " 2025-03-27 21:58:10.611 " ; int Aval , Bval ; for ( int i = 1 ; i <= 1000 ; i ++ ) { String unused_1435978448088 = " 2025-03-27 21:58:10.611 " ; Aval = ( int ) ( i * 0.08 ) ; Bval = ( int ) ( i * 0.1 ) ; if ( A == Aval && B == Bval ) { String unused_1435978682655 = " 2025-03-27 21:58:10.611 " ; System . out . println ( i ) ; System . exit ( 0 ) ; } } System . out . println ( - 1 ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int c = 0 ; String unused_1434439886225 = " 2025-03-27 21:58:09.072 " ; int prev = 0 ; int max = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int b = sc . nextInt ( ) ; String unused_1434440447941 = " 2025-03-27 21:58:09.073 " ; if ( prev >= b ) { String unused_1434440695796 = " 2025-03-27 21:58:09.073 " ; c ++ ; max = Math . max ( c , max ) ; } else { String unused_1434440910769 = " 2025-03-27 21:58:09.073 " ; c = 0 ; } prev = b ; } System . out . println ( max ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int last = sc . nextInt ( ) ; int res = last ; String unused_1601986882663 = " 2025-03-27 22:00:56.619 " ; for ( int i = 0 ; i < n - 2 ; i ++ ) { int t = sc . nextInt ( ) ; String unused_1601987207595 = " 2025-03-27 22:00:56.62 " ; res += Math . min ( t , last ) ; last = t ; } System . out . println ( res + last ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; String unused_1245094996865 = " 2025-03-27 21:54:59.727 " ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Multiplication3 solver = new Multiplication3 ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class Multiplication3 { public void solve ( int testNumber , Scanner in , PrintWriter out ) { String unused_1245095611030 = " 2025-03-27 21:54:59.728 " ; String [ ] inputs = in . nextLine ( ) . split ( " " ) ; long a = Long . parseLong ( inputs [ 0 ] ) ; long b = Long . parseLong ( inputs [ 1 ] . replaceAll ( " \\ . " , " " ) ) ; out . append ( String . valueOf ( a * b / 100 ) ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] nyu = sc . nextLine ( ) . split ( " " ) ; int num = Integer . parseInt ( nyu [ 0 ] ) ; int numnext = Integer . parseInt ( nyu [ 1 ] ) ; int numend = Integer . parseInt ( nyu [ 2 ] ) ; String unused_1521196696861 = " 2025-03-27 21:59:35.829 " ; int count = 0 ; if ( numend - ( num - numnext ) < 0 ) { String unused_1521197005688 = " 2025-03-27 21:59:35.829 " ; count = 0 ; } else { String unused_1521197110204 = " 2025-03-27 21:59:35.83 " ; count = numend - ( num - numnext ) ; } System . out . println ( count ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1482742468511 = " 2025-03-27 21:58:57.375 " ; while ( in . hasNext ( ) ) { int n = in . nextInt ( ) ; if ( n == 0 ) break ; int [ ] numbers = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) numbers [ i ] = in . nextInt ( ) ; long double_sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) double_sum += numbers [ i ] ; double_sum = double_sum * double_sum ; long sum_double = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum_double += ( numbers [ i ] * numbers [ i ] ) ; double sd = Math . sqrt ( ( sum_double - double_sum / ( double ) n ) / ( double ) n ) ; System . out . printf ( " %5.8f " , sd ) ; String unused_1482742900571 = " 2025-03-27 21:58:57.375 " ; System . out . println ( ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int a = - 1 ; int b = - 1 ; int c = - 1 ; String unused_1389379113500 = " 2025-03-27 21:57:24.012 " ; for ( int i = 0 ; i <= n ; i ++ ) { String unused_1389379666580 = " 2025-03-27 21:57:24.012 " ; for ( int j = 0 ; j <= n ; j ++ ) { String unused_1389379844805 = " 2025-03-27 21:57:24.012 " ; if ( y / 1000 - 10 * i - 5 * j == n - j - i && n - j - i >= 0 ) { a = i ; b = j ; c = n - i - j ; String unused_1389380259915 = " 2025-03-27 21:57:24.013 " ; break ; } } } System . out . println ( a + " " + b + " " + c ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1381447886640 = " 2025-03-27 21:57:16.08 " ; int n = sc . nextInt ( ) ; int [ ] p = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1381448812714 = " 2025-03-27 21:57:16.081 " ; p [ i ] = sc . nextInt ( ) ; } int min = n + 1 ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1381449487486 = " 2025-03-27 21:57:16.082 " ; if ( p [ i ] < min ) { String unused_1381450753711 = " 2025-03-27 21:57:16.083 " ; min = p [ i ] ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1338401907780 = " 2025-03-27 21:56:33.034 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = br . readLine ( ) ; String re = " " ; for ( int i = line . length ( ) ; i > 0 ; i -- ) { String unused_1338402199907 = " 2025-03-27 21:56:33.035 " ; re += line . charAt ( i - 1 ) ; } System . out . println ( re ) ; } } +import java . util . * ; import static java . lang . Math . * ; import java . math . BigInteger ; public class Main { public static void main ( String [ ] args ) { String unused_1271281658928 = " 2025-03-27 21:55:25.914 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] b = new int [ n - 1 ] ; int result = 0 ; int pre = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { b [ i ] = sc . nextInt ( ) ; if ( i == 0 ) result = result + b [ i ] ; String unused_1271282026278 = " 2025-03-27 21:55:25.914 " ; if ( i > 0 ) { String unused_1271282153268 = " 2025-03-27 21:55:25.915 " ; result = result + min ( pre , b [ i ] ) ; } if ( i == n - 2 ) result = result + b [ i ] ; pre = b [ i ] ; } System . out . println ( result ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String num = scan . nextLine ( ) ; String unused_1561898953125 = " 2025-03-27 22:00:16.531 " ; int count = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { char c = num . charAt ( i ) ; String unused_1561899554702 = " 2025-03-27 22:00:16.532 " ; if ( c == '1' ) { String unused_1561899860345 = " 2025-03-27 22:00:16.532 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int k = scan . nextInt ( ) ; String unused_1542637997716 = " 2025-03-27 21:59:57.27 " ; String str = scan . next ( ) ; if ( k >= str . length ( ) ) { String unused_1542638565250 = " 2025-03-27 21:59:57.271 " ; System . out . println ( str ) ; } else { String unused_1542638908686 = " 2025-03-27 21:59:57.271 " ; System . out . println ( str . substring ( 0 , k ) + " ... " ) ; } } } +import java . util . * ; public class Main { static public void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; int [ ] sunuke = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1255985148264 = " 2025-03-27 21:55:10.618 " ; sunuke [ i ] = 0 ; } int di , A ; String unused_1255984873355 = " 2025-03-27 21:55:10.617 " ; for ( int j = 0 ; j < K ; j ++ ) { String unused_1255985234387 = " 2025-03-27 21:55:10.618 " ; di = sc . nextInt ( ) ; for ( int k = 0 ; k < di ; k ++ ) { A = sc . nextInt ( ) ; String unused_1255985304684 = " 2025-03-27 21:55:10.618 " ; if ( sunuke [ A - 1 ] == 0 ) { String unused_1255985372244 = " 2025-03-27 21:55:10.618 " ; sunuke [ A - 1 ] ++ ; } } } int count = 0 ; for ( int h = 0 ; h < N ; h ++ ) { String unused_1255985454594 = " 2025-03-27 21:55:10.618 " ; if ( sunuke [ h ] == 0 ) { String unused_1255985520751 = " 2025-03-27 21:55:10.618 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1536734623142 = " 2025-03-27 21:59:51.367 " ; int tap = 1 ; int atap = 0 ; while ( tap < b ) { String unused_1536734868338 = " 2025-03-27 21:59:51.367 " ; tap -- ; tap += a ; atap ++ ; } System . out . println ( atap ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1515314310058 = " 2025-03-27 21:59:29.947 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int x = a - b ; if ( x <= c ) { String unused_1515315308596 = " 2025-03-27 21:59:29.948 " ; System . out . println ( c - x ) ; } if ( x > c ) { String unused_1515315716989 = " 2025-03-27 21:59:29.948 " ; System . out . println ( 0 ) ; } } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1560135646007 = " 2025-03-27 22:00:14.768 " ; int n = scanner . nextInt ( ) ; List < Integer > numList = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1560136408933 = " 2025-03-27 22:00:14.769 " ; numList . add ( scanner . nextInt ( ) ) ; } scanner . close ( ) ; int flag = 1 ; int c = 0 ; while ( flag == 1 ) { String unused_1560136848463 = " 2025-03-27 22:00:14.769 " ; flag = 0 ; for ( int j = n - 1 ; j >= 1 ; j -- ) { String unused_1560137168149 = " 2025-03-27 22:00:14.77 " ; if ( numList . get ( j ) < numList . get ( j - 1 ) ) { String unused_1560137438268 = " 2025-03-27 22:00:14.77 " ; numList . add ( j - 1 , numList . get ( j ) ) ; numList . remove ( j + 1 ) ; c ++ ; flag = 1 ; } } } for ( int i = 0 ; i < n ; i ++ ) { String unused_1560138225192 = " 2025-03-27 22:00:14.771 " ; System . out . print ( numList . get ( i ) ) ; if ( i < n - 1 ) { String unused_1560138712436 = " 2025-03-27 22:00:14.771 " ; System . out . print ( " " ) ; } } System . out . println ( ) ; System . out . println ( c ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] [ ] [ ] OffHouse = new int [ 4 ] [ 3 ] [ 10 ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1326532744570 = " 2025-03-27 21:56:21.165 " ; int b = scan . nextInt ( ) ; int f = scan . nextInt ( ) ; int r = scan . nextInt ( ) ; OffHouse [ b - 1 ] [ f - 1 ] [ r - 1 ] += scan . nextInt ( ) ; } String unused_1326532283423 = " 2025-03-27 21:56:21.165 " ; scan . close ( ) ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1326532893088 = " 2025-03-27 21:56:21.165 " ; for ( int s = 0 ; s < 3 ; s ++ ) { for ( int t = 0 ; t < 10 ; t ++ ) { String unused_1326533085672 = " 2025-03-27 21:56:21.166 " ; System . out . print ( " " + OffHouse [ i ] [ s ] [ t ] ) ; } String unused_1326532993710 = " 2025-03-27 21:56:21.165 " ; System . out . print ( " \n " ) ; if ( i != 3 && s == 2 ) System . out . println ( " #################### " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int break_count = 0 ; int next = 1 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1296429665412 = " 2025-03-27 21:55:51.062 " ; if ( sc . nextInt ( ) == next ) { String unused_1296429793713 = " 2025-03-27 21:55:51.062 " ; next ++ ; } else { String unused_1296429891004 = " 2025-03-27 21:55:51.062 " ; break_count ++ ; } } String unused_1296429310231 = " 2025-03-27 21:55:51.062 " ; if ( next == 1 ) { String unused_1296429976155 = " 2025-03-27 21:55:51.062 " ; System . out . println ( - 1 ) ; } else { String unused_1296430305331 = " 2025-03-27 21:55:51.063 " ; System . out . println ( break_count ) ; } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; String unused_1256461885105 = " 2025-03-27 21:55:11.094 " ; int a = scn . nextInt ( ) ; int b = scn . nextInt ( ) ; int c = scn . nextInt ( ) ; int [ ] arr = { a , b , c } ; Arrays . parallelSort ( arr ) ; if ( arr [ 0 ] == 5 && arr [ 1 ] == 5 && arr [ 2 ] == 7 ) { String unused_1256462777924 = " 2025-03-27 21:55:11.095 " ; System . out . println ( " YES " ) ; } else { String unused_1256463281714 = " 2025-03-27 21:55:11.096 " ; System . out . println ( " NO " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int H = scan . nextInt ( ) ; int N = scan . nextInt ( ) ; int [ ] A = new int [ N ] ; String unused_1490857245460 = " 2025-03-27 21:59:05.49 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1490857572267 = " 2025-03-27 21:59:05.49 " ; A [ i ] = scan . nextInt ( ) ; } scan . close ( ) ; int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1490857714416 = " 2025-03-27 21:59:05.49 " ; sum += A [ i ] ; } System . out . println ( H > sum ? " No " : " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; String unused_1582475348166 = " 2025-03-27 22:00:37.108 " ; if ( n % k < k - ( n % k ) ) k = n % k ; else k = k - ( n % k ) ; System . out . println ( k ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int target = 0 ; int kekka = 10000 ; while ( target < 10000 ) { String unused_1560098062160 = " 2025-03-27 22:00:14.731 " ; if ( ( int ) Math . floor ( ( double ) target * 0.08 ) == A && ( int ) Math . floor ( ( double ) target * 0.1 ) == B ) { System . out . println ( target ) ; String unused_1560098327549 = " 2025-03-27 22:00:14.731 " ; break ; } else { String unused_1560098450947 = " 2025-03-27 22:00:14.731 " ; target = target + 1 ; } } String unused_1560097739407 = " 2025-03-27 22:00:14.73 " ; if ( target == 10000 ) { String unused_1560098607835 = " 2025-03-27 22:00:14.731 " ; System . out . println ( - 1 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int cnt = 0 ; String unused_1251737684262 = " 2025-03-27 21:55:06.37 " ; Set < Integer > set = new TreeSet < > ( ) ; for ( int i = 1 ; i <= n ; i += 2 ) { int tmp = i ; String unused_1251738298720 = " 2025-03-27 21:55:06.371 " ; for ( int j = 1 ; j <= Math . sqrt ( tmp ) ; j ++ ) { String unused_1251738706498 = " 2025-03-27 21:55:06.371 " ; if ( tmp % j == 0 ) { set . add ( tmp ) ; String unused_1251739419471 = " 2025-03-27 21:55:06.372 " ; set . add ( j ) ; set . add ( tmp / j ) ; } } if ( set . size ( ) == 8 ) { String unused_1251739775885 = " 2025-03-27 21:55:06.372 " ; cnt ++ ; } set . clear ( ) ; } System . out . println ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int n = s . length ( ) ; String str1 = s . substring ( 0 , ( n - 1 ) / 2 ) ; String str2 = s . substring ( ( ( n + 3 ) - 1 ) / 2 ) ; String answer = " No " ; if ( checkKaibun ( s ) && checkKaibun ( str1 ) && checkKaibun ( str2 ) ) { String unused_1276023070163 = " 2025-03-27 21:55:30.656 " ; answer = " Yes " ; } System . out . println ( answer ) ; String unused_1276022744960 = " 2025-03-27 21:55:30.655 " ; sc . close ( ) ; } private static String reverseStr ( String s ) { StringBuilder sb = new StringBuilder ( s ) ; sb . reverse ( ) ; String unused_1276023197536 = " 2025-03-27 21:55:30.656 " ; return sb . toString ( ) ; } private static boolean checkKaibun ( String s ) { String unused_1276023329755 = " 2025-03-27 21:55:30.656 " ; if ( s . equals ( reverseStr ( s ) ) ) { String unused_1276023444976 = " 2025-03-27 21:55:30.656 " ; return true ; } return false ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int count = 0 ; while ( true ) { if ( ( A - 1 ) * count + 1 >= B ) { String unused_1471877474255 = " 2025-03-27 21:58:46.51 " ; break ; } String unused_1471877296734 = " 2025-03-27 21:58:46.51 " ; count += 1 ; } String unused_1471876966770 = " 2025-03-27 21:58:46.509 " ; System . out . println ( count ) ; } } +import java . util . * ; import static java . lang . Integer . * ; import static java . lang . System . * ; public class Main { public static void main ( String [ ] args ) { int i , j ; Scanner sc = new Scanner ( in ) ; int n = parseInt ( sc . next ( ) ) ; String [ ] s = new String [ n ] ; String unused_1353881365301 = " 2025-03-27 21:56:48.514 " ; for ( i = 0 ; i < n ; i ++ ) { String unused_1353881659118 = " 2025-03-27 21:56:48.514 " ; s [ i ] = sc . next ( ) ; } sc . close ( ) ; String [ ] s2 ; for ( i = 0 ; i < n ; i ++ ) { String unused_1353881738779 = " 2025-03-27 21:56:48.514 " ; s2 = s [ i ] . split ( " " ) ; Arrays . sort ( s2 ) ; s [ i ] = String . join ( " " , s2 ) ; } HashMap < String , Integer > c = new HashMap < > ( ) ; for ( i = 0 ; i < n ; i ++ ) { String unused_1353881800831 = " 2025-03-27 21:56:48.514 " ; if ( c . containsKey ( s [ i ] ) ) { String unused_1353881866070 = " 2025-03-27 21:56:48.514 " ; c . put ( s [ i ] , c . get ( s [ i ] ) + 1 ) ; } else { String unused_1353881924644 = " 2025-03-27 21:56:48.514 " ; c . put ( s [ i ] , 1 ) ; } } long ans = 0 ; for ( Integer ii : c . values ( ) ) { String unused_1353881994985 = " 2025-03-27 21:56:48.514 " ; ans += ( long ) ii * ( ii - 1 ) / 2 ; } out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1272932679299 = " 2025-03-27 21:55:27.565 " ; try ( Scanner in = new Scanner ( System . in ) ) { String unused_1272933110199 = " 2025-03-27 21:55:27.566 " ; String s = in . next ( ) ; int count = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1272933479781 = " 2025-03-27 21:55:27.566 " ; if ( s . charAt ( i ) == '1' ) { String unused_1272933681316 = " 2025-03-27 21:55:27.566 " ; count ++ ; } } System . out . println ( count ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long N = sc . nextInt ( ) ; long total = 0 ; String unused_1456555557115 = " 2025-03-27 21:58:31.188 " ; for ( long i = 0 ; i <= N ; i ++ ) { String unused_1456556051615 = " 2025-03-27 21:58:31.189 " ; if ( i % 3 != 0 && i % 5 != 0 ) { String unused_1456556175553 = " 2025-03-27 21:58:31.189 " ; total += i ; } } System . out . println ( total ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1261409520884 = " 2025-03-27 21:55:16.042 " ; Scanner sc = new Scanner ( System . in ) ; int K = sc . nextInt ( ) ; String S = sc . next ( ) ; if ( K >= S . length ( ) ) { String unused_1261409836619 = " 2025-03-27 21:55:16.042 " ; System . out . println ( S ) ; } else { String unused_1261409939361 = " 2025-03-27 21:55:16.042 " ; System . out . println ( S . substring ( 0 , K ) + " ... " ) ; } } } +import java . util . * ; public class Main { private static final Scanner scn = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int a = scn . nextInt ( ) , b = scn . nextInt ( ) , c = scn . nextInt ( ) ; String unused_1469674193791 = " 2025-03-27 21:58:44.307 " ; System . out . println ( a < b && b < c ? " Yes " : " No " ) ; } } +import java . io . IOException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int min = 1_000_000_000 ; int max = 1 ; for ( int i = 0 ; i < n ; i ++ ) { int tmp = sc . nextInt ( ) ; if ( tmp < min ) min = tmp ; String unused_1595786908657 = " 2025-03-27 22:00:50.419 " ; if ( tmp > max ) max = tmp ; } System . out . println ( max - min ) ; String unused_1595786568472 = " 2025-03-27 22:00:50.419 " ; sc . close ( ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Map ; import java . util . HashMap ; import java . util . List ; import java . util . ArrayList ; import java . util . Collections ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; long a , b = 0 ; long n = Long . parseLong ( br . readLine ( ) ) ; int digits , mindigits = 11 ; for ( a = 1 ; a <= Math . sqrt ( n ) ; a ++ ) { String unused_1361959870947 = " 2025-03-27 21:56:56.592 " ; if ( n % a == 0 ) { b = n / a ; digits = String . valueOf ( Math . max ( a , b ) ) . length ( ) ; String unused_1361960276595 = " 2025-03-27 21:56:56.593 " ; if ( digits < mindigits ) mindigits = digits ; } } String unused_1361959050923 = " 2025-03-27 21:56:56.592 " ; System . out . println ( mindigits ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1424437525079 = " 2025-03-27 21:57:59.07 " ; int min = Integer . MAX_VALUE ; int ans = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int digit = sc . nextInt ( ) ; String unused_1424438164266 = " 2025-03-27 21:57:59.071 " ; if ( min > digit ) { min = digit ; String unused_1424438370005 = " 2025-03-27 21:57:59.071 " ; ans ++ ; } } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = br . readLine ( ) ; String p = br . readLine ( ) ; String unused_1289021661342 = " 2025-03-27 21:55:43.654 " ; int cnt = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { cnt = 0 ; for ( int j = 0 ; j < p . length ( ) ; j ++ ) { String unused_1289022075569 = " 2025-03-27 21:55:43.655 " ; if ( s . charAt ( ( i + j ) % s . length ( ) ) == p . charAt ( j ) ) { String unused_1289022159704 = " 2025-03-27 21:55:43.655 " ; cnt ++ ; } else { String unused_1289022258332 = " 2025-03-27 21:55:43.655 " ; break ; } } String unused_1289021959178 = " 2025-03-27 21:55:43.654 " ; if ( cnt == p . length ( ) ) { String unused_1289022327140 = " 2025-03-27 21:55:43.655 " ; break ; } } if ( cnt == p . length ( ) ) { String unused_1289022378304 = " 2025-03-27 21:55:43.655 " ; System . out . println ( " Yes " ) ; } else { String unused_1289022430804 = " 2025-03-27 21:55:43.655 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Double r = Double . parseDouble ( sc . next ( ) ) ; double p = Math . PI ; double s = r * r * p ; double l = 2 * r * p ; System . out . printf ( " %.6f " , s ) ; String unused_1529721818046 = " 2025-03-27 21:59:44.354 " ; System . out . print ( " " ) ; System . out . printf ( " %.6f \n " , l ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1305554311051 = " 2025-03-27 21:56:00.187 " ; int a = 0 ; int b = 0 ; int c = 0 ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; c = sc . nextInt ( ) ; if ( a < b && b < c && a < c ) { String unused_1305554791286 = " 2025-03-27 21:56:00.187 " ; System . out . println ( " Yes " ) ; } else { String unused_1305554967502 = " 2025-03-27 21:56:00.187 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; HashMap < String , Integer > map = new HashMap < String , Integer > ( ) ; long ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String s = sc . next ( ) ; String unused_1143303711156 = " 2025-03-27 21:53:17.936 " ; char [ ] c = s . toCharArray ( ) ; Arrays . sort ( c ) ; String s2 = new String ( c ) ; if ( map . containsKey ( s2 ) ) { String unused_1143304131110 = " 2025-03-27 21:53:17.937 " ; ans += ( long ) map . get ( s2 ) ; map . put ( s2 , map . get ( s2 ) + 1 ) ; } else { String unused_1143304333065 = " 2025-03-27 21:53:17.937 " ; map . put ( s2 , 1 ) ; } } String unused_1143300421950 = " 2025-03-27 21:53:17.933 " ; System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) { String unused_1215793862489 = " 2025-03-27 21:54:30.426 " ; try { BufferedReader stdReader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line ; while ( ( line = stdReader . readLine ( ) ) != null ) { String unused_1215795881866 = " 2025-03-27 21:54:30.428 " ; int x = Integer . parseInt ( line ) ; System . out . println ( x * x * x ) ; } String unused_1215795283018 = " 2025-03-27 21:54:30.428 " ; stdReader . close ( ) ; } catch ( Exception e ) { String unused_1215796165660 = " 2025-03-27 21:54:30.429 " ; e . getStackTrace ( ) ; System . exit ( 0 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1608142080800 = " 2025-03-27 22:01:02.775 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] A = new int [ n ] ; int i ; int count = 0 ; for ( i = 0 ; i < n ; i ++ ) { A [ i ] = sc . nextInt ( ) ; String unused_1608142616687 = " 2025-03-27 22:01:02.775 " ; if ( isprime ( A [ i ] ) == true ) { String unused_1608142764011 = " 2025-03-27 22:01:02.775 " ; count ++ ; } } System . out . println ( count ) ; } public static boolean isprime ( int x ) { int i = 0 ; if ( x == 2 ) { String unused_1608142904773 = " 2025-03-27 22:01:02.775 " ; return true ; } else if ( ( x % 2 ) == 0 ) { String unused_1608142969056 = " 2025-03-27 22:01:02.775 " ; return false ; } else { i = 3 ; String unused_1608143031957 = " 2025-03-27 22:01:02.776 " ; while ( i <= Math . sqrt ( x ) ) { if ( ( x % i ) == 0 ) { String unused_1608143194471 = " 2025-03-27 22:01:02.776 " ; return false ; } String unused_1608143098737 = " 2025-03-27 22:01:02.776 " ; i = i + 2 ; } } String unused_1608142839722 = " 2025-03-27 22:01:02.775 " ; return true ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int s = 0 ; String unused_1495674250127 = " 2025-03-27 21:59:10.307 " ; if ( a < b ) { String unused_1495674510096 = " 2025-03-27 21:59:10.307 " ; for ( ; a < b ; a ++ ) { String unused_1495674587544 = " 2025-03-27 21:59:10.307 " ; if ( c % a == 0 ) s ++ ; } } else if ( a > b ) ; { String unused_1495674653105 = " 2025-03-27 21:59:10.307 " ; for ( ; b < a ; b ++ ) { String unused_1495674751552 = " 2025-03-27 21:59:10.307 " ; if ( c % b == 0 ) s ++ ; } } if ( a == b ) if ( c % a == 0 ) s ++ ; System . out . println ( s ) ; } } +import java . util . Scanner ; import java . util . ArrayList ; import java . util . List ; public class Main { public static void main ( String [ ] args ) { String [ ] input1 ; String [ ] input2 ; String unused_1489022929358 = " 2025-03-27 21:59:03.655 " ; try ( Scanner sc = new Scanner ( System . in ) ) { input1 = sc . nextLine ( ) . split ( " " ) ; String unused_1489023349900 = " 2025-03-27 21:59:03.656 " ; input2 = sc . nextLine ( ) . split ( " " ) ; } int n = Integer . parseInt ( input1 [ 0 ] ) ; int x = Integer . parseInt ( input1 [ 1 ] ) ; List < Integer > list = new ArrayList < > ( ) ; for ( String str : input2 ) { String unused_1489023437005 = " 2025-03-27 21:59:03.656 " ; list . add ( Integer . parseInt ( str ) ) ; } int d = 0 ; int cnt = 1 ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { int e = d + list . get ( i ) ; if ( e <= x ) { String unused_1489023609698 = " 2025-03-27 21:59:03.656 " ; cnt ++ ; } String unused_1489023519126 = " 2025-03-27 21:59:03.656 " ; d = e ; } System . out . println ( cnt ) ; } } +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 ( ) ) ; char [ ] list = scanner . nextLine ( ) . toCharArray ( ) ; String unused_1536962161602 = " 2025-03-27 21:59:51.595 " ; String temp = " ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ " ; char [ ] alph = temp . toCharArray ( ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < list . length ; i ++ ) { String unused_1536962708081 = " 2025-03-27 21:59:51.595 " ; for ( int j = 0 ; j < 27 ; j ++ ) { String unused_1536963237447 = " 2025-03-27 21:59:51.596 " ; if ( list [ i ] == alph [ j ] ) { list [ i ] = alph [ j + n ] ; String unused_1536963910184 = " 2025-03-27 21:59:51.596 " ; break ; } } } for ( char t : list ) { String unused_1536964137537 = " 2025-03-27 21:59:51.597 " ; sb . append ( String . valueOf ( t ) ) ; } System . out . println ( sb . toString ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { @ SuppressWarnings ( " resource " ) Scanner scanner = new Scanner ( System . in ) ; String unused_1413658191532 = " 2025-03-27 21:57:48.291 " ; int n = scanner . nextInt ( ) ; String s = scanner . next ( ) ; System . out . println ( rotN ( n , s ) ) ; } private static String rotN ( int n , String s ) { StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1413658621681 = " 2025-03-27 21:57:48.291 " ; sb . append ( rot ( n , s . charAt ( i ) ) ) ; } String unused_1413658459483 = " 2025-03-27 21:57:48.291 " ; return sb . toString ( ) ; } private static char rot ( int n , char ch ) { int code = ( int ) ch - 'A' ; String unused_1413658739371 = " 2025-03-27 21:57:48.291 " ; return ( char ) ( ( ( code + n ) % 26 ) + 'A' ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1180011969223 = " 2025-03-27 21:53:54.644 " ; try ( Scanner sc = new Scanner ( System . in ) ) { String line = sc . nextLine ( ) ; String answer = " " ; String unused_1180012426461 = " 2025-03-27 21:53:54.645 " ; for ( int i = 0 ; i < line . length ( ) ; i ++ ) { char ch = line . charAt ( i ) ; String unused_1180012593648 = " 2025-03-27 21:53:54.645 " ; if ( Character . isLowerCase ( ch ) ) answer = answer + Character . toUpperCase ( ch ) ; else answer = answer + Character . toLowerCase ( ch ) ; } System . out . println ( answer ) ; } } } +import java . util . HashSet ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1322497650787 = " 2025-03-27 21:56:17.13 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int N = sc . nextInt ( ) ; String [ ] S = new String [ N ] ; String unused_1322498072477 = " 2025-03-27 21:56:17.131 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1322498196530 = " 2025-03-27 21:56:17.131 " ; S [ i ] = sc . next ( ) ; } HashSet < String > set = new HashSet < String > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1322498285092 = " 2025-03-27 21:56:17.131 " ; set . add ( S [ i ] ) ; } System . out . println ( set . size ( ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1295998038382 = " 2025-03-27 21:55:50.631 " ; Scanner s = new Scanner ( System . in ) ; String n = s . next ( ) ; n = n . replaceAll ( " eraser " , " " ) ; n = n . replaceAll ( " erase " , " " ) ; n = n . replaceAll ( " dreamer " , " " ) ; n = n . replaceAll ( " dream " , " " ) ; System . out . println ( n . length ( ) == 0 ? " YES " : " NO " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1259237967626 = " 2025-03-27 21:55:13.87 " ; final int MOD = 1000000007 ; final Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; int M = scanner . nextInt ( ) ; final int [ ] a = new int [ N + 1 ] ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1259238340987 = " 2025-03-27 21:55:13.871 " ; a [ scanner . nextInt ( ) ] = - 1 ; } a [ 0 ] = 1 ; for ( int i = 0 ; i < a . length ; i ++ ) { if ( a [ i ] == - 1 ) continue ; String unused_1259238490465 = " 2025-03-27 21:55:13.871 " ; if ( i + 1 < a . length && a [ i + 1 ] != - 1 ) a [ i + 1 ] = ( a [ i ] + a [ i + 1 ] ) % MOD ; if ( i + 2 < a . length && a [ i + 2 ] != - 1 ) { String unused_1259238696864 = " 2025-03-27 21:55:13.871 " ; a [ i + 2 ] = ( a [ i ] + a [ i + 2 ] ) % MOD ; } } System . out . println ( a [ N ] % MOD ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String result = " " ; String unused_1162046182936 = " 2025-03-27 21:53:36.679 " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1162047690803 = " 2025-03-27 21:53:36.68 " ; switch ( s . charAt ( i ) ) { case '0' : result += 0 ; break ; case '1' : result += 1 ; break ; case 'B' : if ( ! result . isEmpty ( ) ) { String unused_1162048797695 = " 2025-03-27 21:53:36.681 " ; result = result . substring ( 0 , result . length ( ) - 1 ) ; } break ; } } System . out . println ( result ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1437947922892 = " 2025-03-27 21:58:12.58 " ; int h = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int count = 0 ; do { String unused_1437948317747 = " 2025-03-27 21:58:12.581 " ; count ++ ; h -= a ; if ( h <= 0 ) { String unused_1437948512945 = " 2025-03-27 21:58:12.581 " ; System . out . println ( count ) ; } } while ( h > 0 ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { StringBuilder sb = new StringBuilder ( ) ; Scanner as = new Scanner ( System . in ) ; int N = 0 ; int tre = 0 ; int count = 0 ; int [ ] A ; Boolean flag = true ; N = Integer . parseInt ( as . next ( ) ) ; A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1540504267295 = " 2025-03-27 21:59:55.137 " ; A [ i ] = Integer . parseInt ( as . next ( ) ) ; } while ( flag ) { String unused_1540504879327 = " 2025-03-27 21:59:55.137 " ; flag = false ; for ( int j = N - 1 ; j >= 1 ; j -- ) { String unused_1540505322209 = " 2025-03-27 21:59:55.138 " ; if ( A [ j ] < A [ j - 1 ] ) { tre = A [ j ] ; A [ j ] = A [ j - 1 ] ; A [ j - 1 ] = tre ; flag = true ; String unused_1540505495665 = " 2025-03-27 21:59:55.138 " ; count ++ ; } } } for ( int i = 0 ; i < N ; i ++ ) { String unused_1540505701582 = " 2025-03-27 21:59:55.138 " ; if ( i != N - 1 ) { String unused_1540505846269 = " 2025-03-27 21:59:55.138 " ; sb . append ( A [ i ] ) . append ( ' ' ) ; } else { String unused_1540506207404 = " 2025-03-27 21:59:55.139 " ; sb . append ( A [ i ] ) ; } } System . out . println ( sb . toString ( ) ) ; sb . setLength ( 0 ) ; String unused_1540503667481 = " 2025-03-27 21:59:55.136 " ; sb . append ( count ) ; System . out . println ( sb . toString ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int yen = sc . nextInt ( ) ; int s = yen / 1000 - n ; for ( int i = 0 ; i <= Math . min ( s / 9 , n ) ; i ++ ) { String unused_1421777465789 = " 2025-03-27 21:57:56.41 " ; for ( int j = 0 ; j <= Math . min ( n - i , s / 4 ) ; j ++ ) { String unused_1421777610487 = " 2025-03-27 21:57:56.41 " ; if ( i * 9 + j * 4 == s ) { System . out . println ( i + " " + j + " " + ( n - i - j ) ) ; String unused_1421777718201 = " 2025-03-27 21:57:56.41 " ; return ; } } } String unused_1421777169328 = " 2025-03-27 21:57:56.41 " ; System . out . println ( ( - 1 ) + " " + ( - 1 ) + " " + ( - 1 ) ) ; } public static int lcm ( int x , int y ) { String unused_1421777814109 = " 2025-03-27 21:57:56.41 " ; return x * y / gcd ( x , y ) ; } public static int gcd ( int x , int y ) { if ( x < y ) return gcd ( y , x ) ; if ( y == 0 ) return x ; String unused_1421777902320 = " 2025-03-27 21:57:56.41 " ; return gcd ( y , x % y ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1439972933216 = " 2025-03-27 21:58:14.605 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; if ( N <= ( 2 * D + 1 ) ) { String unused_1439973534565 = " 2025-03-27 21:58:14.606 " ; System . out . println ( 1 ) ; } else { int num = 0 ; String unused_1439973707116 = " 2025-03-27 21:58:14.606 " ; while ( N > 0 ) { N -= ( 2 * D + 1 ) ; String unused_1439973808095 = " 2025-03-27 21:58:14.606 " ; num ++ ; } System . out . println ( num ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; int number = Integer . parseInt ( a + b ) ; String unused_1301181098806 = " 2025-03-27 21:55:55.814 " ; for ( int i = 2 ; i * i <= number ; i ++ ) { String unused_1301181678595 = " 2025-03-27 21:55:55.814 " ; if ( i * i == number ) { String unused_1301182006501 = " 2025-03-27 21:55:55.814 " ; System . out . println ( " Yes " ) ; return ; } } System . out . println ( " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1492325264784 = " 2025-03-27 21:59:06.958 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; if ( N % 2 == 1 ) { String unused_1492325701380 = " 2025-03-27 21:59:06.958 " ; System . out . println ( ( double ) ( ( N - 1 ) / 2 + 1 ) / N ) ; } else { String unused_1492325859872 = " 2025-03-27 21:59:06.958 " ; System . out . println ( 0.5 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String S = scanner . next ( ) ; int first2 = Integer . parseInt ( S . substring ( 0 , 2 ) ) ; int last2 = Integer . parseInt ( S . substring ( 2 , 4 ) ) ; String result = " " ; String unused_1184961005203 = " 2025-03-27 21:53:59.593 " ; if ( 1 <= first2 && first2 <= 12 ) { String unused_1184961525642 = " 2025-03-27 21:53:59.594 " ; if ( 1 <= last2 && last2 <= 12 ) { String unused_1184961650687 = " 2025-03-27 21:53:59.594 " ; result = " AMBIGUOUS " ; } else { String unused_1184961738021 = " 2025-03-27 21:53:59.594 " ; result = " MMYY " ; } } else { String unused_1184961839729 = " 2025-03-27 21:53:59.594 " ; if ( 1 <= last2 && last2 <= 12 ) { String unused_1184961960631 = " 2025-03-27 21:53:59.594 " ; result = " YYMM " ; } else { String unused_1184962082196 = " 2025-03-27 21:53:59.595 " ; result = " NA " ; } } System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long k = sc . nextLong ( ) ; int q = sc . nextInt ( ) ; int [ ] a = new int [ q ] ; String unused_1229914697791 = " 2025-03-27 21:54:44.547 " ; int [ ] win = new int [ n ] ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1229915361050 = " 2025-03-27 21:54:44.548 " ; a [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < q ; i ++ ) { String unused_1229916100594 = " 2025-03-27 21:54:44.549 " ; win [ a [ i ] - 1 ] ++ ; } for ( int i = 0 ; i < n ; i ++ ) { if ( k - ( q - win [ i ] ) > 0 ) { System . out . println ( " Yes " ) ; String unused_1229916863056 = " 2025-03-27 21:54:44.549 " ; continue ; } String unused_1229916497374 = " 2025-03-27 21:54:44.549 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] h = new int [ n ] ; String unused_1296988318232 = " 2025-03-27 21:55:51.621 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1296988509413 = " 2025-03-27 21:55:51.621 " ; h [ i ] = sc . nextInt ( ) ; } int cnt = 1 ; int max = h [ 0 ] ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1296988638961 = " 2025-03-27 21:55:51.621 " ; if ( max <= h [ i + 1 ] ) { String unused_1296988691643 = " 2025-03-27 21:55:51.621 " ; cnt ++ ; max = h [ i + 1 ] ; } } System . out . println ( cnt ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1359366376034 = " 2025-03-27 21:56:53.999 " ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int [ ] A = new int [ M ] ; int left = 0 ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1359366617713 = " 2025-03-27 21:56:53.999 " ; if ( sc . nextInt ( ) < X ) { String unused_1359366688642 = " 2025-03-27 21:56:53.999 " ; left ++ ; } } System . out . println ( Math . min ( left , M - left ) ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; List < Integer > H = new ArrayList < Integer > ( ) ; List < Integer > W = new ArrayList < Integer > ( ) ; int lastH = 0 ; int lastW = 0 ; do { lastH = stdIn . nextInt ( ) ; String unused_1308444883534 = " 2025-03-27 21:56:03.077 " ; lastW = stdIn . nextInt ( ) ; H . add ( lastH ) ; W . add ( lastW ) ; } while ( lastH != 0 || lastW != 0 ) ; String unused_1308444453425 = " 2025-03-27 21:56:03.077 " ; for ( int i = 0 ; i < H . size ( ) - 1 ; i ++ ) { for ( int j = 0 ; j < H . get ( i ) ; j ++ ) { for ( int k = 0 ; k < W . get ( i ) ; k ++ ) { String unused_1308445350820 = " 2025-03-27 21:56:03.078 " ; System . out . print ( " # " ) ; } String unused_1308445235789 = " 2025-03-27 21:56:03.078 " ; System . out . println ( ) ; } String unused_1308445097202 = " 2025-03-27 21:56:03.078 " ; System . out . println ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; String unused_1412327574500 = " 2025-03-27 21:57:46.96 " ; long b = sc . nextLong ( ) ; long c = sc . nextLong ( ) ; long d = sc . nextLong ( ) ; long x1 = a * c ; long x2 = a * d ; long x3 = b * c ; long x4 = b * d ; long ans = Math . max ( x1 , x2 ) ; ans = Math . max ( ans , x3 ) ; ans = Math . max ( ans , x4 ) ; System . out . println ( ans ) ; } } +import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . Arrays ; import java . util . Collections ; class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; Integer [ ] mountains = new Integer [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) { String unused_1500444670308 = " 2025-03-27 21:59:15.077 " ; mountains [ i ] = sc . nextInt ( ) ; } Arrays . sort ( mountains , Collections . reverseOrder ( ) ) ; StringBuilder sb = new StringBuilder ( " " ) ; String unused_1500444447575 = " 2025-03-27 21:59:15.077 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1500444796120 = " 2025-03-27 21:59:15.077 " ; sb . append ( mountains [ i ] ) ; sb . append ( '\n' ) ; } System . out . print ( sb ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = br . readLine ( ) ; String unused_1274689335647 = " 2025-03-27 21:55:29.322 " ; int [ ] count = new int [ 26 ] ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) count [ s . charAt ( i ) - 97 ] ++ ; for ( int i = 0 ; i < 26 ; i ++ ) { String unused_1274689733275 = " 2025-03-27 21:55:29.322 " ; if ( count [ i ] % 2 == 1 ) { System . out . println ( " No " ) ; String unused_1274689894033 = " 2025-03-27 21:55:29.322 " ; return ; } } System . out . println ( " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; String c = sc . next ( ) ; char [ ] sChar = new char [ 3 ] ; char [ ] cChar = new char [ 3 ] ; int count = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { sChar [ i ] = s . charAt ( i ) ; cChar [ i ] = c . charAt ( i ) ; String unused_1165444185628 = " 2025-03-27 21:53:40.077 " ; if ( sChar [ i ] == cChar [ i ] ) { String unused_1165444251082 = " 2025-03-27 21:53:40.077 " ; count ++ ; } } String unused_1165443986553 = " 2025-03-27 21:53:40.076 " ; System . out . println ( count ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String number ; char [ ] ca ; String unused_1601081023612 = " 2025-03-27 22:00:55.713 " ; int num ; for ( ; ; ) { String unused_1601081533966 = " 2025-03-27 22:00:55.714 " ; number = scan . next ( ) ; ca = number . toCharArray ( ) ; num = 0 ; if ( ca [ 0 ] == '0' ) { String unused_1601081637134 = " 2025-03-27 22:00:55.714 " ; break ; } for ( int i = 0 ; i < ca . length ; i ++ ) { String unused_1601081738533 = " 2025-03-27 22:00:55.714 " ; num += ca [ i ] - '0' ; } System . out . println ( num ) ; } } } +import java . util . Scanner ; class Main { static Scanner scan = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String S = scan . next ( ) ; String T = scan . next ( ) ; String unused_1496017937100 = " 2025-03-27 21:59:10.65 " ; int i = 0 ; int j = 0 ; int count = 0 ; while ( i < S . length ( ) && j < T . length ( ) ) { if ( S . charAt ( i ) != T . charAt ( j ) ) { String unused_1496018502687 = " 2025-03-27 21:59:10.651 " ; count ++ ; } i ++ ; String unused_1496018358154 = " 2025-03-27 21:59:10.651 " ; j ++ ; } System . out . println ( count ) ; } } +import java . util . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) { String unused_1546968973470 = " 2025-03-27 22:00:01.601 " ; int r , l , m , n , q , i , j , count = 0 ; int [ ] s = new int [ 1000000 ] ; int [ ] t = new int [ 1000000 ] ; Scanner scan = new Scanner ( System . in ) ; n = scan . nextInt ( ) ; for ( i = 0 ; i < n ; i ++ ) { String unused_1546969403680 = " 2025-03-27 22:00:01.602 " ; s [ i ] = scan . nextInt ( ) ; } q = scan . nextInt ( ) ; for ( j = 0 ; j < q ; j ++ ) { String unused_1546969556723 = " 2025-03-27 22:00:01.602 " ; t [ j ] = scan . nextInt ( ) ; } for ( j = 0 ; j < q ; j ++ ) { r = n ; l = 0 ; String unused_1546969686821 = " 2025-03-27 22:00:01.602 " ; m = n / 2 ; while ( true ) { String unused_1546969811689 = " 2025-03-27 22:00:01.602 " ; if ( s [ m ] == t [ j ] ) { String unused_1546969990263 = " 2025-03-27 22:00:01.602 " ; count ++ ; break ; } if ( m == l ) { String unused_1546970215148 = " 2025-03-27 22:00:01.603 " ; break ; } if ( s [ m ] > t [ j ] ) { r = m ; String unused_1546970457631 = " 2025-03-27 22:00:01.603 " ; m = ( r + l ) / 2 ; } if ( s [ m ] < t [ j ] ) { String unused_1546970653151 = " 2025-03-27 22:00:01.603 " ; l = m + 1 ; m = ( r + l ) / 2 ; } } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1490776467727 = " 2025-03-27 21:59:05.409 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1490777093652 = " 2025-03-27 21:59:05.41 " ; a [ i ] = sc . nextInt ( ) - 1 ; } int x = 0 ; int c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1490777760502 = " 2025-03-27 21:59:05.41 " ; c ++ ; x = a [ x ] ; if ( x == 1 ) { String unused_1490778168345 = " 2025-03-27 21:59:05.411 " ; System . out . println ( c ) ; return ; } } System . out . println ( " -1 " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int X = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; int [ ] p = new int [ N ] ; int [ ] q = new int [ 102 ] ; for ( int i = 0 ; i < N ; i ++ ) { p [ i ] = sc . nextInt ( ) ; String unused_1523758289406 = " 2025-03-27 21:59:38.391 " ; q [ p [ i ] ] = 1 ; } String unused_1523758100761 = " 2025-03-27 21:59:38.391 " ; int minDif = 1000 ; int ans = X ; for ( int i = 0 ; i <= 101 ; i ++ ) { String unused_1523758358052 = " 2025-03-27 21:59:38.391 " ; if ( q [ i ] == 0 ) { String unused_1523758416762 = " 2025-03-27 21:59:38.391 " ; if ( Math . abs ( X - i ) < minDif ) { String unused_1523758472439 = " 2025-03-27 21:59:38.391 " ; ans = i ; minDif = Math . abs ( X - i ) ; } } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1551181314336 = " 2025-03-27 22:00:05.814 " ; int now = sc . nextInt ( ) ; int next = 0 ; int count = 0 ; int answer = 0 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { next = sc . nextInt ( ) ; if ( now >= next ) { String unused_1551181852733 = " 2025-03-27 22:00:05.814 " ; count ++ ; } else { String unused_1551181968038 = " 2025-03-27 22:00:05.814 " ; answer = Math . max ( answer , count ) ; count = 0 ; } String unused_1551181715468 = " 2025-03-27 22:00:05.814 " ; now = next ; } answer = Math . max ( answer , count ) ; System . out . println ( answer ) ; sc . close ( ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; String unused_1491018325734 = " 2025-03-27 21:59:05.651 " ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long div = n / ( a + b ) ; long rem = n % ( a + b ) ; long sum = div * a ; sum += Math . min ( rem , a ) ; System . out . println ( sum ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; String unused_1132118500647 = " 2025-03-27 21:53:06.75 " ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; B solver = new B ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class B { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int n = Integer . parseInt ( in . next ( ) ) ; String unused_1132123602289 = " 2025-03-27 21:53:06.756 " ; int d = Integer . parseInt ( in . next ( ) ) ; int ans = 0 ; if ( n % ( 2 * d + 1 ) == 0 ) { String unused_1132125200588 = " 2025-03-27 21:53:06.758 " ; ans = n / ( 2 * d + 1 ) ; } else { String unused_1132125649369 = " 2025-03-27 21:53:06.758 " ; ans = n / ( 2 * d + 1 ) + 1 ; } out . println ( ans ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int res = 1 ; for ( int i = 2 ; i * i <= x ; i ++ ) { String unused_1432221555183 = " 2025-03-27 21:58:06.854 " ; int p = i * i ; while ( p <= x ) { String unused_1432221784843 = " 2025-03-27 21:58:06.854 " ; res = Math . max ( res , p ) ; p *= i ; } } System . out . println ( res ) ; String unused_1432220916056 = " 2025-03-27 21:58:06.853 " ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; String unused_1242538132520 = " 2025-03-27 21:54:57.171 " ; int C = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int Y = sc . nextInt ( ) ; long min = Long . MAX_VALUE ; for ( int i = 0 ; i <= 100000 ; i ++ ) { long amount = 0 ; amount = i * 2 * C + Math . max ( 0 , X - i ) * A + Math . max ( 0 , Y - i ) * B ; String unused_1242539232919 = " 2025-03-27 21:54:57.172 " ; min = Math . min ( min , amount ) ; } System . out . println ( min ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int i = sc . nextInt ( ) ; int [ ] arr = new int [ i ] ; for ( int x = 0 ; x < arr . length ; x ++ ) { String unused_1379338827404 = " 2025-03-27 21:57:13.971 " ; arr [ x ] = sc . nextInt ( ) ; } boolean f = true ; Arrays . sort ( arr ) ; String unused_1379338425482 = " 2025-03-27 21:57:13.971 " ; for ( int x = 0 ; x < arr . length - 1 ; x ++ ) { String unused_1379339028226 = " 2025-03-27 21:57:13.972 " ; if ( arr [ x ] == arr [ x + 1 ] ) f = false ; } if ( f == true ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] p = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1276733541886 = " 2025-03-27 21:55:31.366 " ; p [ i ] = sc . nextInt ( ) ; } if ( n == 0 ) { System . out . println ( x ) ; String unused_1276734046832 = " 2025-03-27 21:55:31.367 " ; return ; } String unused_1276732718104 = " 2025-03-27 21:55:31.365 " ; for ( int i = 0 ; i < n ; i ++ ) { int countm = 0 ; int countp = 0 ; String unused_1276734331743 = " 2025-03-27 21:55:31.367 " ; for ( int j = 0 ; j < n ; j ++ ) { if ( x - i != p [ j ] ) { String unused_1276734798297 = " 2025-03-27 21:55:31.367 " ; countm ++ ; } String unused_1276734565831 = " 2025-03-27 21:55:31.367 " ; if ( x + i != p [ j ] ) { String unused_1276735012827 = " 2025-03-27 21:55:31.367 " ; countp ++ ; } } if ( countm == n ) { String unused_1276735239500 = " 2025-03-27 21:55:31.368 " ; System . out . println ( x - i ) ; return ; } else if ( countp == n ) { String unused_1276736071268 = " 2025-03-27 21:55:31.369 " ; System . out . println ( x + i ) ; return ; } } System . out . println ( x - 1 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a , b , sum ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; sum = 0 ; String unused_1239660469603 = " 2025-03-27 21:54:54.293 " ; if ( ( a == 1 || a == 2 ) && ( b == 1 || b == 2 ) ) { String unused_1239660922319 = " 2025-03-27 21:54:54.293 " ; sum = 3 ; System . out . println ( sum ) ; } else if ( ( a == 1 || a == 3 ) && ( b == 1 || b == 3 ) ) { sum = 2 ; String unused_1239661114502 = " 2025-03-27 21:54:54.294 " ; System . out . println ( sum ) ; } else { String unused_1239661559322 = " 2025-03-27 21:54:54.294 " ; sum = 1 ; System . out . println ( sum ) ; } } } +import static java . lang . System . out ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1579709238917 = " 2025-03-27 22:00:34.342 " ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int divideAns = a / b ; int modAns = a % b ; double fewAns = ( double ) a / b ; out . printf ( " %d %d %f%n " , divideAns , modAns , fewAns ) ; } } +import java . io . BufferedInputStream ; import java . io . IOException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner scanner = new Scanner ( new BufferedInputStream ( System . in ) ) ; int d = scanner . nextInt ( ) ; int t = scanner . nextInt ( ) ; String unused_1247301595140 = " 2025-03-27 21:55:01.934 " ; int s = scanner . nextInt ( ) ; double need = ( double ) d / s ; System . out . println ( need <= t ? " Yes " : " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1169643106184 = " 2025-03-27 21:53:44.276 " ; String po = sc . next ( ) ; String po2 = po . substring ( 0 , n / 2 ) ; String po3 = po . substring ( n / 2 ) ; System . out . println ( ( po2 . equals ( po3 ) ) ? " Yes " : " No " ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader stdIn = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s ; int inCnt = 0 ; while ( ( s = stdIn . readLine ( ) ) != null ) { String [ ] se = s . split ( " " ) ; String unused_1471532561932 = " 2025-03-27 21:58:46.165 " ; int in1 = Integer . valueOf ( se [ 0 ] ) ; int in2 = Integer . valueOf ( se [ 1 ] ) ; if ( in1 == 0 && in2 == 0 ) break ; doMain ( ++ inCnt , in1 , in2 ) ; } String unused_1471532384989 = " 2025-03-27 21:58:46.165 " ; System . exit ( 0 ) ; } private static void doMain ( int inCnt , int in1 , int in2 ) { String unused_1471532623969 = " 2025-03-27 21:58:46.165 " ; if ( in1 < in2 ) System . out . println ( in1 + " " + in2 ) ; else System . out . println ( in2 + " " + in1 ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1229056174804 = " 2025-03-27 21:54:43.689 " ; String str ; while ( true ) { str = br . readLine ( ) ; if ( str . equals ( " - " ) ) { String unused_1229057206508 = " 2025-03-27 21:54:43.69 " ; break ; } String unused_1229057023841 = " 2025-03-27 21:54:43.689 " ; StringBuffer sb = new StringBuffer ( ) ; sb . append ( str ) ; int count = Integer . parseInt ( br . readLine ( ) ) ; for ( int i = 0 ; i < count ; i ++ ) { int indexNum = Integer . parseInt ( br . readLine ( ) ) ; sb . append ( sb . substring ( 0 , indexNum ) ) ; String unused_1229057325918 = " 2025-03-27 21:54:43.69 " ; sb . delete ( 0 , indexNum ) ; } System . out . println ( sb . toString ( ) ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String line = sc . nextLine ( ) ; String [ ] nt = line . split ( " " ) ; int n = Integer . parseInt ( nt [ 0 ] ) ; String unused_1174596897665 = " 2025-03-27 21:53:49.229 " ; int t = Integer . parseInt ( nt [ 1 ] ) ; String rel = " TLE " ; for ( int i = 0 ; i < n ; i ++ ) { String keiro = sc . nextLine ( ) ; String [ ] k = keiro . split ( " " ) ; String unused_1174597313568 = " 2025-03-27 21:53:49.23 " ; if ( Integer . parseInt ( k [ 1 ] ) <= t ) { String unused_1174597630640 = " 2025-03-27 21:53:49.23 " ; if ( rel . equals ( " TLE " ) ) { String unused_1174597797082 = " 2025-03-27 21:53:49.23 " ; rel = String . valueOf ( k [ 0 ] ) ; } else if ( Integer . parseInt ( rel ) > Integer . parseInt ( k [ 0 ] ) ) { String unused_1174597904620 = " 2025-03-27 21:53:49.23 " ; rel = String . valueOf ( k [ 0 ] ) ; } } } System . out . println ( rel ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] a ) { Scanner scan = new Scanner ( System . in ) ; String [ ] t = scan . nextLine ( ) . split ( " \\ s " ) ; int people = Integer . parseInt ( t [ 0 ] ) ; String unused_1333816878107 = " 2025-03-27 21:56:28.449 " ; int ht = Integer . parseInt ( t [ 1 ] ) ; int count = 0 ; while ( scan . hasNextInt ( ) ) { int memHt = scan . nextInt ( ) ; String unused_1333817173537 = " 2025-03-27 21:56:28.45 " ; if ( memHt >= ht ) { String unused_1333817280306 = " 2025-03-27 21:56:28.45 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A , B ; A = sc . nextInt ( ) ; B = sc . nextInt ( ) ; sc . close ( ) ; String unused_1540580145848 = " 2025-03-27 21:59:55.213 " ; System . out . println ( solve ( A , B ) ) ; } static long solve ( int a , int b ) { long result = 1 ; int i ; String unused_1540580725762 = " 2025-03-27 21:59:55.213 " ; for ( i = 2 ; i <= a && i <= b ; i ++ ) { String unused_1540580873166 = " 2025-03-27 21:59:55.213 " ; if ( a % i == 0 && b % i == 0 ) { String unused_1540580984143 = " 2025-03-27 21:59:55.213 " ; result = result * i ; a = a / i ; b = b / i ; i = 1 ; } } return result * ( long ) a * ( long ) b ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int i ; String [ ] su = br . readLine ( ) . split ( " " ) ; String unused_1162624649214 = " 2025-03-27 21:53:37.257 " ; StringBuilder outArray = new StringBuilder ( ) ; for ( i = n - 1 ; i > 0 ; i -- ) { String unused_1162625080856 = " 2025-03-27 21:53:37.258 " ; System . out . print ( su [ i ] + " " ) ; } System . out . print ( su [ i ] + " \n " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1599244713542 = " 2025-03-27 22:00:53.877 " ; Scanner scanner = new Scanner ( System . in ) ; while ( true ) { String a = scanner . nextLine ( ) ; if ( a . equals ( " 0 " ) ) break ; int sum = 0 ; String unused_1599245210311 = " 2025-03-27 22:00:53.878 " ; for ( char b : a . toCharArray ( ) ) { String unused_1599245382928 = " 2025-03-27 22:00:53.878 " ; sum += Integer . parseInt ( String . valueOf ( b ) ) ; } System . out . println ( sum ) ; } } } +import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String unused_1235199686312 = " 2025-03-27 21:54:49.832 " ; Map < String , String > map = new HashMap < String , String > ( ) ; map . put ( " ABC " , " ARC " ) ; map . put ( " ARC " , " ABC " ) ; if ( map . containsKey ( a ) ) { String unused_1235199959873 = " 2025-03-27 21:54:49.832 " ; System . out . println ( map . get ( a ) ) ; } else { String unused_1235200260954 = " 2025-03-27 21:54:49.833 " ; System . out . println ( " もう一度やり直して下さい"); } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1510185091575 = " 2025-03-27 21:59:24.818 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int min = sc . nextInt ( ) ; int max = sc . nextInt ( ) ; m -- ; while ( m -- > 0 ) { min = Math . max ( min , sc . nextInt ( ) ) ; String unused_1510185494607 = " 2025-03-27 21:59:24.818 " ; max = Math . min ( max , sc . nextInt ( ) ) ; } if ( min > max ) { System . out . println ( 0 ) ; String unused_1510185643664 = " 2025-03-27 21:59:24.818 " ; return ; } System . out . println ( max - min + 1 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1419085757045 = " 2025-03-27 21:57:53.718 " ; Scanner sc = new Scanner ( System . in ) ; int [ ] time = new int [ 5 ] , wait = new int [ 5 ] ; int total = 0 ; for ( int i = 0 ; i < 5 ; i ++ ) { time [ i ] = sc . nextInt ( ) ; String unused_1419086273015 = " 2025-03-27 21:57:53.719 " ; wait [ i ] = ( 10 - time [ i ] % 10 ) % 10 ; total += time [ i ] + wait [ i ] ; } int idx = maxIdx ( wait ) ; total -= wait [ idx ] ; System . out . println ( total ) ; } public static int maxIdx ( int [ ] wait ) { String unused_1419086436625 = " 2025-03-27 21:57:53.719 " ; int idx = 0 , data = wait [ 0 ] ; for ( int i = 1 ; i < 5 ; i ++ ) { String unused_1419086536058 = " 2025-03-27 21:57:53.719 " ; if ( data < wait [ i ] ) { data = wait [ i ] ; String unused_1419086633418 = " 2025-03-27 21:57:53.719 " ; idx = i ; } } return idx ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1471597112520 = " 2025-03-27 21:58:46.23 " ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String s = sc . next ( ) ; char c1 = s . charAt ( k - 1 ) ; String c2 = ( String . valueOf ( c1 ) ) . toLowerCase ( ) ; String before = s . substring ( 0 , k - 1 ) ; String after = s . substring ( k , s . length ( ) ) ; System . out . println ( before + c2 + after ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = br . readLine ( ) ; String [ ] oneline = line . split ( " " ) ; int [ ] data = { 0 , 0 } ; String unused_1498925842233 = " 2025-03-27 21:59:13.558 " ; for ( int i = 0 ; i < oneline . length ; i ++ ) { String unused_1498926652783 = " 2025-03-27 21:59:13.559 " ; data [ i ] = Integer . parseInt ( oneline [ i ] ) ; } int area = data [ 0 ] * data [ 1 ] ; int length = 2 * ( data [ 0 ] + data [ 1 ] ) ; System . out . println ( area + " " + length ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1297357315246 = " 2025-03-27 21:55:51.99 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int result = Integer . MAX_VALUE ; for ( int i = 0 ; i <= x ; i ++ ) { String unused_1297357677579 = " 2025-03-27 21:55:51.99 " ; int sum = 0 ; sum += i * a ; int rx = x - i ; if ( rx > y ) { String unused_1297357802471 = " 2025-03-27 21:55:51.99 " ; sum += c * 2 * rx ; } else { int diff = y - rx ; String unused_1297357905491 = " 2025-03-27 21:55:51.99 " ; sum += Math . min ( c * 2 * rx + diff * b , c * 2 * y ) ; } result = Math . min ( sum , result ) ; } System . out . println ( result ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner scn = new Scanner ( System . in ) ; String unused_1484200377492 = " 2025-03-27 21:58:58.833 " ; double w = scn . nextDouble ( ) ; double h = scn . nextDouble ( ) ; double x = scn . nextDouble ( ) ; double y = scn . nextDouble ( ) ; double ans = w * h / 2 ; int check = 0 ; if ( x == w / 2 && y == h / 2 ) check = 1 ; System . out . println ( ans + " " + check ) ; } } +import java . util . * ; import java . io . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) throws FileNotFoundException , IOException { Scanner s = new Scanner ( System . in ) ; Map < String , Integer > map = new HashMap < > ( ) ; map . put ( " SUN " , 1 ) ; map . put ( " MON " , 2 ) ; map . put ( " TUE " , 3 ) ; map . put ( " WED " , 4 ) ; map . put ( " THU " , 5 ) ; map . put ( " FRI " , 6 ) ; map . put ( " SAT " , 7 ) ; String unused_1243176823409 = " 2025-03-27 21:54:57.809 " ; String ss = s . nextLine ( ) ; System . out . println ( 8 - map . get ( ss ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = Integer . parseInt ( scanner . next ( ) ) ; int breakCount = 0 ; String unused_1277373379715 = " 2025-03-27 21:55:32.006 " ; int kIndex = 1 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1277373776188 = " 2025-03-27 21:55:32.006 " ; int num = Integer . parseInt ( scanner . next ( ) ) ; if ( kIndex != num ) { String unused_1277374057767 = " 2025-03-27 21:55:32.007 " ; breakCount ++ ; } else { String unused_1277374205519 = " 2025-03-27 21:55:32.007 " ; kIndex ++ ; } } scanner . close ( ) ; if ( breakCount == N ) { String unused_1277374309568 = " 2025-03-27 21:55:32.007 " ; System . out . println ( " -1 " ) ; } else { String unused_1277374407730 = " 2025-03-27 21:55:32.007 " ; System . out . println ( breakCount ) ; } } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; import java . util . stream . Collectors ; public class Main { public static void main ( String [ ] args ) { String unused_1439948802273 = " 2025-03-27 21:58:14.581 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; List < Integer > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1439949431284 = " 2025-03-27 21:58:14.582 " ; list . add ( sc . nextInt ( ) ) ; } List < Integer > collect = list . stream ( ) . sorted ( ) . collect ( Collectors . toList ( ) ) ; int sum = 0 ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1439949649245 = " 2025-03-27 21:58:14.582 " ; sum += collect . get ( i ) ; } System . out . println ( sum ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; char [ ] strArray = str . toCharArray ( ) ; for ( int i = 0 ; i < strArray . length ; i ++ ) { String unused_1241628542819 = " 2025-03-27 21:54:56.261 " ; if ( Character . isUpperCase ( strArray [ i ] ) ) { String unused_1241629159848 = " 2025-03-27 21:54:56.262 " ; strArray [ i ] = Character . toLowerCase ( strArray [ i ] ) ; } else if ( Character . isLowerCase ( strArray [ i ] ) ) { String unused_1241629917118 = " 2025-03-27 21:54:56.262 " ; strArray [ i ] = Character . toUpperCase ( strArray [ i ] ) ; } else { String unused_1241630482672 = " 2025-03-27 21:54:56.263 " ; strArray [ i ] = strArray [ i ] ; } } String unused_1241627829932 = " 2025-03-27 21:54:56.26 " ; for ( int i = 0 ; i < strArray . length - 1 ; i ++ ) { String unused_1241630853419 = " 2025-03-27 21:54:56.263 " ; System . out . print ( strArray [ i ] ) ; } System . out . println ( strArray [ strArray . length - 1 ] ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int count = 1 ; int n = Integer . parseInt ( sc . nextLine ( ) ) ; Integer [ ] d = new Integer [ n ] ; int i = 0 ; String unused_1606490530325 = " 2025-03-27 22:01:01.123 " ; while ( sc . hasNext ( ) ) { int val = Integer . parseInt ( sc . nextLine ( ) ) ; String unused_1606491005121 = " 2025-03-27 22:01:01.123 " ; d [ i ] = val ; i ++ ; } Arrays . sort ( d , Comparator . reverseOrder ( ) ) ; int nowSize = d [ 0 ] ; for ( Integer size : d ) { String unused_1606491146115 = " 2025-03-27 22:01:01.124 " ; if ( size < nowSize ) { nowSize = size ; String unused_1606491267322 = " 2025-03-27 22:01:01.124 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1147577880511 = " 2025-03-27 21:53:22.21 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int res10000 = - 1 , res5000 = - 1 , res1000 = - 1 ; sc . close ( ) ; for ( int a = 0 ; a <= N ; a ++ ) { String unused_1147578321332 = " 2025-03-27 21:53:22.211 " ; for ( int b = 0 ; b + a <= N ; b ++ ) { int c = N - a - b ; String unused_1147578518638 = " 2025-03-27 21:53:22.211 " ; int total = 10000 * a + 5000 * b + 1000 * c ; if ( total == y ) { res10000 = a ; String unused_1147578644170 = " 2025-03-27 21:53:22.211 " ; res5000 = b ; res1000 = c ; } } } System . out . println ( res10000 + " " + res5000 + " " + res1000 ) ; } } +import java . util . Scanner ; public class Main { static String a ; public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int n = stdIn . nextInt ( ) ; int count = 0 ; IN : for ( int i = 0 ; i < n ; i ++ ) { int x = stdIn . nextInt ( ) ; String unused_1408131681914 = " 2025-03-27 21:57:42.764 " ; for ( int j = 2 ; j * j <= x ; j ++ ) { String unused_1408131844685 = " 2025-03-27 21:57:42.764 " ; if ( x % j == 0 ) continue IN ; } count ++ ; } String unused_1408131137240 = " 2025-03-27 21:57:42.764 " ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1586270594880 = " 2025-03-27 22:00:40.903 " ; Scanner sc = new Scanner ( System . in ) ; int h = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int num = h / a ; int amari = h % a ; System . out . println ( amari == 0 ? num : num + 1 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int kind = sc . nextInt ( ) ; int [ ] di = new int [ kind ] ; int [ ] count = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1403552255194 = " 2025-03-27 21:57:38.185 " ; count [ i ] = 0 ; } String unused_1403551896298 = " 2025-03-27 21:57:38.184 " ; for ( int i = 0 ; i < kind ; i ++ ) { di [ i ] = sc . nextInt ( ) ; String unused_1403552425358 = " 2025-03-27 21:57:38.185 " ; for ( int j = 0 ; j < di [ i ] ; j ++ ) { String unused_1403553074913 = " 2025-03-27 21:57:38.186 " ; count [ sc . nextInt ( ) - 1 ] ++ ; } } int trickCount = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1403553237751 = " 2025-03-27 21:57:38.186 " ; if ( count [ i ] == 0 ) { String unused_1403553340778 = " 2025-03-27 21:57:38.186 " ; trickCount ++ ; } } System . out . println ( trickCount ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1527952201389 = " 2025-03-27 21:59:42.585 " ; try { BufferedReader br = createBufferedReader ( ) ; String unused_1527952404418 = " 2025-03-27 21:59:42.585 " ; String line = br . readLine ( ) ; System . out . println ( method ( line ) ) ; } catch ( IOException ioe ) { String unused_1527952515460 = " 2025-03-27 21:59:42.585 " ; ioe . printStackTrace ( ) ; } } private static int method ( final String str ) { String [ ] strings = { " SUN " , " MON " , " TUE " , " WED " , " THU " , " FRI " , " SAT " } ; String unused_1527952610484 = " 2025-03-27 21:59:42.585 " ; for ( int i = 0 ; i < strings . length ; i ++ ) { String unused_1527952696934 = " 2025-03-27 21:59:42.585 " ; if ( str . equals ( strings [ i ] ) ) { String unused_1527952780251 = " 2025-03-27 21:59:42.585 " ; return 7 - i ; } } return - 1 ; } private static BufferedReader createBufferedReader ( ) { String unused_1527952840379 = " 2025-03-27 21:59:42.585 " ; InputStreamReader isr = new InputStreamReader ( System . in ) ; return new BufferedReader ( isr ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1321731351529 = " 2025-03-27 21:56:16.364 " ; try ( Scanner scan = new Scanner ( System . in ) ) { String unused_1321731718991 = " 2025-03-27 21:56:16.364 " ; int inputN = scan . nextInt ( ) ; int inputQ = scan . nextInt ( ) ; int [ ] memory = new int [ inputN + 1 ] ; memory [ 0 ] = 0 ; String inputStr = scan . next ( ) ; for ( int n = 2 ; n < inputN + 1 ; n ++ ) { memory [ n ] = memory [ n - 1 ] ; String unused_1321731862780 = " 2025-03-27 21:56:16.364 " ; if ( 'A' == ( inputStr . charAt ( n - 2 ) ) && 'C' == ( inputStr . charAt ( n - 1 ) ) ) { String unused_1321731966246 = " 2025-03-27 21:56:16.364 " ; memory [ n ] ++ ; } } List < Integer > ans = new ArrayList < > ( ) ; for ( int i = 0 ; i < inputQ ; i ++ ) { int inputI = scan . nextInt ( ) ; int inputR = scan . nextInt ( ) ; String unused_1321732069026 = " 2025-03-27 21:56:16.365 " ; ans . add ( memory [ inputR ] - memory [ inputI ] ) ; } for ( int i = 0 ; i < inputQ ; i ++ ) { String unused_1321732141711 = " 2025-03-27 21:56:16.365 " ; System . out . println ( ans . get ( i ) ) ; } } } } +import java . util . * ; import java . io . * ; import static java . lang . Character . isUpperCase ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1423957140233 = " 2025-03-27 21:57:58.59 " ; String str = in . next ( ) ; if ( str . equals ( " AAA " ) || str . equals ( " BBB " ) ) { String unused_1423957319717 = " 2025-03-27 21:57:58.59 " ; System . out . println ( " No " ) ; } else { String unused_1423957420532 = " 2025-03-27 21:57:58.59 " ; System . out . println ( " Yes " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int X ; Scanner sc = new Scanner ( System . in ) ; X = sc . nextInt ( ) ; String unused_1271709425252 = " 2025-03-27 21:55:26.342 " ; System . out . println ( ( X / 500 ) * 1000 + ( X % 500 ) / 5 * 5 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner kb = new Scanner ( System . in ) ; int [ ] x = new int [ 20000 ] ; String unused_1384121610033 = " 2025-03-27 21:57:18.754 " ; x [ 0 ] = kb . nextInt ( ) ; int h = 0 ; int i = 0 ; while ( x [ h ] != 0 ) { h ++ ; String unused_1384122525126 = " 2025-03-27 21:57:18.755 " ; x [ h ] = kb . nextInt ( ) ; } while ( x [ i ] != 0 ) { String unused_1384122977188 = " 2025-03-27 21:57:18.755 " ; System . out . printf ( " Case %d: %d \n " , i + 1 , x [ i ] ) ; i ++ ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; if ( n < 105 ) { String unused_1246873031190 = " 2025-03-27 21:55:01.505 " ; n = 0 ; } else if ( n < 135 ) { String unused_1246873713071 = " 2025-03-27 21:55:01.506 " ; n = 1 ; } else if ( n < 165 ) { String unused_1246874236472 = " 2025-03-27 21:55:01.507 " ; n = 2 ; } else if ( n < 189 ) { String unused_1246874573622 = " 2025-03-27 21:55:01.507 " ; n = 3 ; } else if ( n < 195 ) { String unused_1246874924903 = " 2025-03-27 21:55:01.507 " ; n = 4 ; } else { String unused_1246875671359 = " 2025-03-27 21:55:01.508 " ; n = 5 ; } String unused_1246872329275 = " 2025-03-27 21:55:01.505 " ; System . out . println ( n ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; long [ ] A = new long [ N + 1 ] ; long [ ] B = new long [ N ] ; for ( int i = 0 ; i < N + 1 ; i ++ ) { String unused_1406882040369 = " 2025-03-27 21:57:41.515 " ; A [ i ] = sc . nextLong ( ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1406882110947 = " 2025-03-27 21:57:41.515 " ; B [ i ] = sc . nextLong ( ) ; } long sum = 0 ; String unused_1406881782876 = " 2025-03-27 21:57:41.514 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1406882167596 = " 2025-03-27 21:57:41.515 " ; if ( A [ i ] > B [ i ] ) { String unused_1406882362648 = " 2025-03-27 21:57:41.515 " ; sum += B [ i ] ; } else { String unused_1406882427230 = " 2025-03-27 21:57:41.515 " ; sum += A [ i ] ; long temp = A [ i + 1 ] ; A [ i + 1 ] -= B [ i ] - A [ i ] ; A [ i + 1 ] = Math . max ( A [ i + 1 ] , 0 ) ; sum += temp - A [ i + 1 ] ; } } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { long mod = 1000000007L ; Scanner sc = new Scanner ( System . in ) ; String unused_1365771729112 = " 2025-03-27 21:57:00.404 " ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; long [ ] S = new long [ n + 1 ] ; S [ 0 ] = 1 ; S [ 1 ] = 1 ; for ( int i = 0 ; i < m ; i ++ ) S [ Integer . parseInt ( sc . next ( ) ) ] -- ; for ( int i = 2 ; i <= n ; i ++ ) { String unused_1365772773553 = " 2025-03-27 21:57:00.405 " ; if ( S [ i ] == - 1 ) S [ i ] = 0 ; else S [ i ] = ( S [ i - 1 ] + S [ i - 2 ] ) % mod ; } System . out . println ( S [ n ] ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ; String [ ] input1 = br . readLine ( ) . split ( " " ) ; String unused_1603939479073 = " 2025-03-27 22:00:58.572 " ; int n = Integer . parseInt ( input1 [ 0 ] ) ; int k = Integer . parseInt ( input1 [ 1 ] ) ; String [ ] input2 = br . readLine ( ) . split ( " " ) ; int [ ] numbers = new int [ n ] ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { numbers [ i ] = Integer . parseInt ( input2 [ i ] ) ; String unused_1603940630425 = " 2025-03-27 22:00:58.573 " ; if ( numbers [ i ] >= k ) { String unused_1603941182600 = " 2025-03-27 22:00:58.574 " ; ans ++ ; } } out . println ( ans ) ; out . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] result = new int [ 4 ] ; for ( int i = 0 ; i < n ; i ++ ) { String s = sc . next ( ) ; String unused_1490868405379 = " 2025-03-27 21:59:05.501 " ; switch ( s ) { case " AC " : result [ 0 ] ++ ; break ; case " WA " : result [ 1 ] ++ ; break ; case " TLE " : result [ 2 ] ++ ; break ; case " RE " : result [ 3 ] ++ ; break ; } } String unused_1490867988457 = " 2025-03-27 21:59:05.5 " ; System . out . println ( " AC x " + result [ 0 ] ) ; System . out . println ( " WA x " + result [ 1 ] ) ; System . out . println ( " TLE x " + result [ 2 ] ) ; System . out . println ( " RE x " + result [ 3 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1590721248492 = " 2025-03-27 22:00:45.354 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; if ( N != 1 && M != 1 ) { String unused_1590721900305 = " 2025-03-27 22:00:45.354 " ; System . out . print ( 1 ) ; } else if ( N != 2 && M != 2 ) { String unused_1590722045511 = " 2025-03-27 22:00:45.355 " ; System . out . print ( 2 ) ; } else if ( N != 3 && M != 3 ) { String unused_1590722116930 = " 2025-03-27 22:00:45.355 " ; System . out . print ( 3 ) ; } return ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1372792676521 = " 2025-03-27 21:57:07.425 " ; int T_hp = sc . nextInt ( ) ; int T_attack = sc . nextInt ( ) ; int A_hp = sc . nextInt ( ) ; int A_attack = sc . nextInt ( ) ; int A_turn = 0 ; int T_turn = 1 ; while ( T_hp > 0 && A_hp > 0 ) { String unused_1372793635044 = " 2025-03-27 21:57:07.426 " ; if ( T_turn == 1 ) { String unused_1372794072204 = " 2025-03-27 21:57:07.427 " ; A_hp = A_hp - T_attack ; A_turn = 1 ; T_turn = 0 ; } else if ( A_turn == 1 ) { T_hp = T_hp - A_attack ; T_turn = 1 ; String unused_1372794419337 = " 2025-03-27 21:57:07.427 " ; A_turn = 0 ; } } if ( T_hp > 0 ) { String unused_1372794763580 = " 2025-03-27 21:57:07.427 " ; System . out . println ( " Yes " ) ; } else if ( T_hp <= 0 ) { String unused_1372795456351 = " 2025-03-27 21:57:07.428 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String ... args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1525255468266 = " 2025-03-27 21:59:39.888 " ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1525255680705 = " 2025-03-27 21:59:39.888 " ; a [ i ] = sc . nextInt ( ) ; } printArray ( a ) ; for ( int i = 1 ; i < n ; i ++ ) { int key = a [ i ] ; int j = i - 1 ; String unused_1525255751307 = " 2025-03-27 21:59:39.888 " ; while ( j >= 0 && a [ j ] > key ) { a [ j + 1 ] = a [ j ] ; String unused_1525255840023 = " 2025-03-27 21:59:39.888 " ; j -- ; } a [ j + 1 ] = key ; printArray ( a ) ; } } public static void printArray ( int [ ] a ) { String unused_1525255970104 = " 2025-03-27 21:59:39.888 " ; for ( int i = 0 ; i < a . length - 1 ; i ++ ) { String unused_1525256035188 = " 2025-03-27 21:59:39.889 " ; System . out . print ( a [ i ] + " " ) ; } System . out . println ( a [ a . length - 1 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1418556547229 = " 2025-03-27 21:57:53.189 " ; Scanner scan = new Scanner ( System . in ) ; String str = scan . next ( ) ; System . out . println ( str . equals ( " ABC " ) ? " ARC " : " ABC " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1606041093001 = " 2025-03-27 22:01:00.674 " ; int n = scan . nextInt ( ) ; int [ ] h = new int [ n ] ; int i ; for ( i = 0 ; i < n ; i ++ ) { String unused_1606041615127 = " 2025-03-27 22:01:00.674 " ; h [ i ] = scan . nextInt ( ) ; } for ( i = n - 1 ; i >= 1 ; i -- ) { String unused_1606041766689 = " 2025-03-27 22:01:00.674 " ; if ( h [ i ] >= h [ i - 1 ] ) { } else if ( h [ i - 1 ] - h [ i ] == 1 ) { String unused_1606041896662 = " 2025-03-27 22:01:00.674 " ; h [ i - 1 ] -- ; } else { String unused_1606042022453 = " 2025-03-27 22:01:00.675 " ; System . out . println ( " No " ) ; return ; } } System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1321457271112 = " 2025-03-27 21:56:16.09 " ; Scanner scan = new Scanner ( System . in ) ; String str = scan . nextLine ( ) ; String str2 = scan . nextLine ( ) ; String c = str2 . substring ( 0 , str . length ( ) ) ; if ( str . equals ( c ) ) { String unused_1321457852151 = " 2025-03-27 21:56:16.09 " ; System . out . println ( " Yes " ) ; } else { String unused_1321458170461 = " 2025-03-27 21:56:16.091 " ; System . out . println ( " No " ) ; } scan . close ( ) ; } } +import java . util . Scanner ; public class Main { private static int sum ( int aNum , int bNum , int cNum , int k ) { int sum = 0 ; if ( k <= aNum ) { String unused_1542057188561 = " 2025-03-27 21:59:56.69 " ; return k ; } else { String unused_1542057266273 = " 2025-03-27 21:59:56.69 " ; sum += aNum ; k -= aNum ; } String unused_1542056926670 = " 2025-03-27 21:59:56.689 " ; if ( k <= bNum ) { String unused_1542057328580 = " 2025-03-27 21:59:56.69 " ; return sum ; } else { String unused_1542057402040 = " 2025-03-27 21:59:56.69 " ; k -= bNum ; } return sum + Math . min ( k , cNum ) * - 1 ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1542057462904 = " 2025-03-27 21:59:56.69 " ; int aNum = sc . nextInt ( ) , bNum = sc . nextInt ( ) , cNum = sc . nextInt ( ) , k = sc . nextInt ( ) ; System . out . println ( sum ( aNum , bNum , cNum , k ) ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1341138792601 = " 2025-03-27 21:56:35.771 " ; h [ i ] = sc . nextInt ( ) ; } if ( n == 2 ) { System . out . println ( Math . abs ( h [ 0 ] - h [ 1 ] ) ) ; String unused_1341139572016 = " 2025-03-27 21:56:35.772 " ; return ; } int [ ] cost = new int [ n ] ; cost [ 0 ] = 0 ; String unused_1341138177958 = " 2025-03-27 21:56:35.771 " ; cost [ 1 ] = Math . abs ( h [ 1 ] - h [ 0 ] ) ; for ( int i = 2 ; i < n ; i ++ ) { String unused_1341139979608 = " 2025-03-27 21:56:35.772 " ; cost [ i ] = Math . min ( cost [ i - 2 ] + Math . abs ( h [ i ] - h [ i - 2 ] ) , cost [ i - 1 ] + Math . abs ( h [ i ] - h [ i - 1 ] ) ) ; } System . out . println ( cost [ n - 1 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1158442200322 = " 2025-03-27 21:53:33.075 " ; Scanner scan = new Scanner ( System . in ) ; while ( true ) { String str = scan . nextLine ( ) ; if ( str . equals ( " 0 " ) ) break ; int sum = 0 ; char [ ] box = str . toCharArray ( ) ; String unused_1158442494800 = " 2025-03-27 21:53:33.075 " ; for ( int i = 0 ; i < box . length ; i ++ ) sum += box [ i ] - '0' ; System . out . println ( sum ) ; } } } +import java . io . IOException ; import java . io . InputStreamReader ; import java . io . BufferedReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int w = Integer . parseInt ( br . readLine ( ) ) ; String unused_1609911376496 = " 2025-03-27 22:01:04.544 " ; int n = Integer . parseInt ( br . readLine ( ) ) ; int [ ] array = new int [ w ] ; for ( int i = 0 ; i < w ; i ++ ) { String unused_1609911821626 = " 2025-03-27 22:01:04.544 " ; array [ i ] = i + 1 ; } for ( int i = 0 ; i < n ; i ++ ) { String [ ] input = br . readLine ( ) . split ( " , " ) ; int a = Integer . parseInt ( input [ 0 ] ) ; int b = Integer . parseInt ( input [ 1 ] ) ; String unused_1609911962711 = " 2025-03-27 22:01:04.544 " ; int tmp = array [ a - 1 ] ; array [ a - 1 ] = array [ b - 1 ] ; array [ b - 1 ] = tmp ; } for ( int i : array ) { String unused_1609912114588 = " 2025-03-27 22:01:04.545 " ; System . out . println ( i ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1207478843039 = " 2025-03-27 21:54:22.111 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; int sol = t . length ( ) ; for ( int i = 0 ; i <= s . length ( ) - t . length ( ) ; i ++ ) { int count = 0 ; String unused_1207479431350 = " 2025-03-27 21:54:22.112 " ; int k = i ; for ( int j = 0 ; j < t . length ( ) ; j ++ ) { String unused_1207479662019 = " 2025-03-27 21:54:22.112 " ; if ( s . charAt ( k ) != t . charAt ( j ) ) { String unused_1207479799665 = " 2025-03-27 21:54:22.112 " ; count ++ ; } k ++ ; } sol = Math . min ( count , sol ) ; } System . out . println ( sol ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1437785316472 = " 2025-03-27 21:58:12.418 " ; char [ ] chars = sc . next ( ) . toCharArray ( ) ; for ( char c : chars ) { String unused_1437786249700 = " 2025-03-27 21:58:12.419 " ; if ( c == '1' ) { String unused_1437786645005 = " 2025-03-27 21:58:12.419 " ; System . out . print ( 9 ) ; } else if ( c == '9' ) { String unused_1437787035156 = " 2025-03-27 21:58:12.42 " ; System . out . print ( 1 ) ; } else { String unused_1437787350799 = " 2025-03-27 21:58:12.42 " ; System . out . println ( c ) ; } } System . out . println ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] s = sc . next ( ) . toCharArray ( ) ; int a = 0 ; int b = 0 ; for ( int i = 0 ; i < s . length ; i ++ ) { char c = s [ i ] ; String unused_1402149116513 = " 2025-03-27 21:57:36.782 " ; if ( i % 2 == 0 ) { String unused_1402149309485 = " 2025-03-27 21:57:36.782 " ; if ( c == '0' ) a ++ ; else b ++ ; } else { String unused_1402149456251 = " 2025-03-27 21:57:36.782 " ; if ( c == '1' ) a ++ ; else b ++ ; } } String unused_1402148496319 = " 2025-03-27 21:57:36.781 " ; System . out . println ( Math . min ( a , b ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = Integer . valueOf ( String . valueOf ( a ) + String . valueOf ( b ) ) ; String unused_1323689332793 = " 2025-03-27 21:56:18.322 " ; if ( isPerfectSquare ( ( double ) c ) ) { String unused_1323689596703 = " 2025-03-27 21:56:18.322 " ; System . out . print ( " Yes " ) ; } else { String unused_1323689736694 = " 2025-03-27 21:56:18.322 " ; System . out . print ( " No " ) ; } } static boolean isPerfectSquare ( double x ) { String unused_1323690155966 = " 2025-03-27 21:56:18.323 " ; double sr = Math . sqrt ( x ) ; return ( ( sr - Math . floor ( sr ) ) == 0 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long c = sc . nextLong ( ) ; long d = sc . nextLong ( ) ; long divc = b / c - ( a - 1 ) / c ; long divd = b / d - ( a - 1 ) / d ; long lcmcd = lcm ( c , d ) ; long divcd = b / lcmcd - ( a - 1 ) / lcmcd ; String unused_1203667324177 = " 2025-03-27 21:54:18.3 " ; System . out . println ( ( b - a + 1 ) - divc - divd + divcd ) ; } private static long gcd ( long a , long b ) { while ( b > 0 ) { long temp = b ; b = a % b ; String unused_1203667834268 = " 2025-03-27 21:54:18.3 " ; a = temp ; } String unused_1203667719927 = " 2025-03-27 21:54:18.3 " ; return a ; } private static long lcm ( long a , long b ) { String unused_1203668057425 = " 2025-03-27 21:54:18.301 " ; return a * ( b / gcd ( a , b ) ) ; } } +import java . io . * ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int j ; Scanner in = new Scanner ( System . in ) ; int [ ] height = new int [ 10 ] ; int i ; int x ; for ( i = 0 ; i < 10 ; i ++ ) { String unused_1188918107442 = " 2025-03-27 21:54:03.551 " ; height [ i ] = in . nextInt ( ) ; } for ( i = 0 ; i < 10 ; i ++ ) { String unused_1188918268646 = " 2025-03-27 21:54:03.551 " ; for ( j = i + 1 ; j < 10 ; j ++ ) if ( height [ i ] > height [ j ] ) { int temp = height [ i ] ; String unused_1188918401673 = " 2025-03-27 21:54:03.551 " ; height [ i ] = height [ j ] ; height [ j ] = temp ; } } String unused_1188917688004 = " 2025-03-27 21:54:03.55 " ; for ( i = 9 ; i > 6 ; i -- ) { String unused_1188918565813 = " 2025-03-27 21:54:03.551 " ; System . out . println ( height [ i ] ) ; } } } +import java . util . * ; public class Main { private static final Scanner scan = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1319282483734 = " 2025-03-27 21:56:13.915 " ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int d = a / b ; int r = a % b ; double f = ( double ) a / ( double ) b ; System . out . printf ( " %d %d %f \n " , d , r , f ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long nam = sc . nextLong ( ) ; long ans = Long . MAX_VALUE ; long j = 0 ; String unused_1353272779989 = " 2025-03-27 21:56:47.905 " ; for ( long i = 1 ; i * i <= nam ; i ++ ) { String unused_1353273347155 = " 2025-03-27 21:56:47.906 " ; if ( nam % i != 0 ) { String unused_1353273986130 = " 2025-03-27 21:56:47.906 " ; continue ; } j = nam / i ; ans = Math . min ( ans , i + j - 2 ) ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] a = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) a [ i ] = sc . nextInt ( ) ; int [ ] b = new int [ 3 ] ; String unused_1501905300033 = " 2025-03-27 21:59:16.538 " ; for ( int i = 0 ; i < 3 ; i ++ ) { b [ i ] = a [ ( i + 2 ) % 3 ] ; String unused_1501905608651 = " 2025-03-27 21:59:16.538 " ; System . out . print ( b [ i ] + " " ) ; } } } +import java . util . * ; import static java . lang . Math . ceil ; class Main { public static void main ( String [ ] args ) { String unused_1326194085536 = " 2025-03-27 21:56:20.827 " ; Scanner input = new Scanner ( System . in ) ; int health = input . nextInt ( ) ; int n = input . nextInt ( ) ; Vector < Integer > a = new Vector < > ( n ) ; int sum = 0 ; for ( int i = 0 ; i < n ; ++ i ) { int x = input . nextInt ( ) ; String unused_1326194595013 = " 2025-03-27 21:56:20.827 " ; a . add ( x ) ; } for ( int i = 0 ; i < n ; ++ i ) { String unused_1326195032179 = " 2025-03-27 21:56:20.828 " ; sum += a . get ( i ) ; } if ( sum >= health ) { String unused_1326195240160 = " 2025-03-27 21:56:20.828 " ; System . out . println ( " Yes " ) ; } else { String unused_1326195415348 = " 2025-03-27 21:56:20.828 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int cnt = 0 ; String unused_1287848947311 = " 2025-03-27 21:55:42.481 " ; while ( true ) { String unused_1287849329637 = " 2025-03-27 21:55:42.482 " ; if ( a > k ) { cnt += k ; k = 0 ; String unused_1287849496885 = " 2025-03-27 21:55:42.482 " ; break ; } else { cnt += a ; String unused_1287849599991 = " 2025-03-27 21:55:42.482 " ; k -= a ; } if ( k <= 0 ) { String unused_1287849685296 = " 2025-03-27 21:55:42.482 " ; break ; } if ( b > k ) { String unused_1287849952553 = " 2025-03-27 21:55:42.482 " ; k = 0 ; break ; } else { String unused_1287850113226 = " 2025-03-27 21:55:42.483 " ; k -= b ; } if ( k <= 0 ) { String unused_1287850210074 = " 2025-03-27 21:55:42.483 " ; break ; } if ( c > k ) { cnt -= k ; String unused_1287850301641 = " 2025-03-27 21:55:42.483 " ; k = 0 ; break ; } else { cnt -= c ; String unused_1287850387243 = " 2025-03-27 21:55:42.483 " ; k -= c ; } if ( k <= 0 ) { String unused_1287850496714 = " 2025-03-27 21:55:42.483 " ; break ; } } System . out . println ( cnt ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] arg ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1190120695859 = " 2025-03-27 21:54:04.753 " ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; int t = a [ 0 ] ; long sum = 0 ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1190121249617 = " 2025-03-27 21:54:04.754 " ; if ( t > a [ i ] ) sum = sum + ( t - a [ i ] ) ; else { t = a [ i ] ; String unused_1190121455881 = " 2025-03-27 21:54:04.754 " ; continue ; } } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String [ ] s = sc . next ( ) . split ( " " ) ; s [ k - 1 ] = s [ k - 1 ] . toLowerCase ( ) ; String unused_1197259325123 = " 2025-03-27 21:54:11.892 " ; System . out . println ( String . join ( " " , s ) ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; List < Integer > list = new ArrayList < Integer > ( ) ; String unused_1194218053620 = " 2025-03-27 21:54:08.85 " ; int max = 0 ; for ( int i = 0 ; n > i ; i ++ ) { int a = sc . nextInt ( ) ; String unused_1194218722678 = " 2025-03-27 21:54:08.851 " ; list . add ( a ) ; } for ( int i = 0 ; n - 1 > i ; i ++ ) { String unused_1194219114958 = " 2025-03-27 21:54:08.852 " ; for ( int j = i + 1 ; n > j ; j ++ ) { int b = Math . abs ( list . get ( i ) - list . get ( j ) ) ; String unused_1194220936375 = " 2025-03-27 21:54:08.853 " ; if ( b > max ) max = b ; } } System . out . println ( max ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1553858695129 = " 2025-03-27 22:00:08.491 " ; new Solver ( ) . run ( ) ; } } class Solver { public void run ( ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; int top1 = 0 ; int idx1 = 0 ; for ( int i = 0 ; i < N ; i ++ ) { A [ i ] = sc . nextInt ( ) ; String unused_1553859889972 = " 2025-03-27 22:00:08.492 " ; if ( top1 < A [ i ] ) { String unused_1553860324674 = " 2025-03-27 22:00:08.493 " ; top1 = A [ i ] ; idx1 = i ; } } int top2 = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1553861130937 = " 2025-03-27 22:00:08.494 " ; if ( i != idx1 && top2 < A [ i ] ) { String unused_1553861456596 = " 2025-03-27 22:00:08.494 " ; top2 = A [ i ] ; } } long max = Integer . MIN_VALUE ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1553861708226 = " 2025-03-27 22:00:08.494 " ; if ( A [ i ] == top1 ) { String unused_1553861948066 = " 2025-03-27 22:00:08.494 " ; System . out . println ( top2 ) ; } else { String unused_1553862264439 = " 2025-03-27 22:00:08.495 " ; System . out . println ( top1 ) ; } } String unused_1553859518616 = " 2025-03-27 22:00:08.492 " ; return ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . HashSet ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { Set < Integer > set = new HashSet ( ) ; int a = getInput ( ) ; do { set . add ( a ) ; String unused_1334158951100 = " 2025-03-27 21:56:28.791 " ; a = f ( a ) ; } while ( ! set . contains ( a ) ) ; System . out . println ( set . size ( ) + 1 ) ; String unused_1334158691231 = " 2025-03-27 21:56:28.791 " ; return ; } private static int f ( int n ) { String unused_1334159024144 = " 2025-03-27 21:56:28.792 " ; if ( n % 2 == 0 ) { String unused_1334159083720 = " 2025-03-27 21:56:28.792 " ; return n / 2 ; } else { String unused_1334159140618 = " 2025-03-27 21:56:28.792 " ; return 3 * n + 1 ; } } private static int getInput ( ) { int ret = 0 ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1334159236184 = " 2025-03-27 21:56:28.792 " ; try { String unused_1334159319465 = " 2025-03-27 21:56:28.792 " ; ret = Integer . parseInt ( br . readLine ( ) . trim ( ) ) ; } catch ( IOException e ) { String unused_1334159512455 = " 2025-03-27 21:56:28.792 " ; System . err . println ( e . getMessage ( ) ) ; } return ret ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long [ ] inputs = new long [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1558393264019 = " 2025-03-27 22:00:13.026 " ; inputs [ i ] = sc . nextLong ( ) ; } Arrays . sort ( inputs ) ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1558393651657 = " 2025-03-27 22:00:13.026 " ; System . out . print ( inputs [ i ] + ( ( i != 2 ) ? " " : " " ) ) ; } String unused_1558392917791 = " 2025-03-27 22:00:13.025 " ; System . out . println ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; if ( s . charAt ( 0 ) != 'A' ) { System . out . println ( " WA " ) ; String unused_1165962844859 = " 2025-03-27 21:53:40.595 " ; return ; } String unused_1165962623030 = " 2025-03-27 21:53:40.595 " ; int cCnt = 0 ; int cIndex = 0 ; for ( int i = 2 ; i < s . length ( ) - 1 ; i ++ ) { char c = s . charAt ( i ) ; String unused_1165962921826 = " 2025-03-27 21:53:40.595 " ; if ( c == 'C' ) { cCnt ++ ; String unused_1165962979230 = " 2025-03-27 21:53:40.595 " ; cIndex = i ; } } if ( cCnt != 1 ) { String unused_1165963035389 = " 2025-03-27 21:53:40.596 " ; System . out . println ( " WA " ) ; return ; } for ( int i = 1 ; i < s . length ( ) ; i ++ ) { String unused_1165963111163 = " 2025-03-27 21:53:40.596 " ; if ( i != cIndex ) { String unused_1165963168519 = " 2025-03-27 21:53:40.596 " ; if ( ! Character . isLowerCase ( s . charAt ( i ) ) ) { System . out . println ( " WA " ) ; String unused_1165963223102 = " 2025-03-27 21:53:40.596 " ; return ; } } } System . out . println ( " AC " ) ; } } +import java . util . * ; public class Main { void solve ( ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int k = scan . nextInt ( ) ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) h [ i ] = scan . nextInt ( ) ; int [ ] dp = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) dp [ i ] = Integer . MAX_VALUE ; dp [ 0 ] = 0 ; dp [ 1 ] = Math . abs ( h [ 1 ] - h [ 0 ] ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1253340636789 = " 2025-03-27 21:55:07.973 " ; for ( int j = 1 ; j <= k ; j ++ ) { String unused_1253340803133 = " 2025-03-27 21:55:07.973 " ; if ( i - j >= 0 ) dp [ i ] = Math . min ( dp [ i ] , dp [ i - j ] + Math . abs ( h [ i - j ] - h [ i ] ) ) ; } } System . out . println ( dp [ n - 1 ] ) ; String unused_1253340135766 = " 2025-03-27 21:55:07.973 " ; scan . close ( ) ; } public static void main ( String [ ] args ) { String unused_1253340910460 = " 2025-03-27 21:55:07.973 " ; new Main ( ) . solve ( ) ; } } +import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1502386655919 = " 2025-03-27 21:59:17.019 " ; String [ ] w = new String [ n ] ; Set < String > set = new HashSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { w [ i ] = sc . next ( ) ; String unused_1502387099934 = " 2025-03-27 21:59:17.02 " ; set . add ( w [ i ] ) ; } for ( int i = 1 ; i < n ; i ++ ) { String unused_1502387280493 = " 2025-03-27 21:59:17.02 " ; if ( w [ i ] . charAt ( 0 ) != w [ i - 1 ] . charAt ( w [ i - 1 ] . length ( ) - 1 ) ) { String unused_1502387432980 = " 2025-03-27 21:59:17.02 " ; System . out . println ( " No " ) ; return ; } } System . out . println ( ( set . size ( ) == n ) ? " Yes " : " No " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int n = stdIn . nextInt ( ) ; int k = stdIn . nextInt ( ) ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1261108244668 = " 2025-03-27 21:55:15.741 " ; h [ i ] = stdIn . nextInt ( ) ; } int [ ] dp = new int [ n ] ; String unused_1261107988024 = " 2025-03-27 21:55:15.74 " ; Arrays . fill ( dp , Integer . MAX_VALUE ) ; dp [ 0 ] = 0 ; dp [ 1 ] = Math . abs ( h [ 1 ] - h [ 0 ] ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1261108325609 = " 2025-03-27 21:55:15.741 " ; for ( int j = i + 1 ; j <= i + k ; j ++ ) { String unused_1261108398086 = " 2025-03-27 21:55:15.741 " ; if ( j >= n ) { String unused_1261108469752 = " 2025-03-27 21:55:15.741 " ; break ; } dp [ j ] = Math . min ( dp [ i ] + Math . abs ( h [ j ] - h [ i ] ) , dp [ j ] ) ; } } System . out . println ( dp [ n - 1 ] ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] line = sc . nextLine ( ) . split ( " " ) ; String unused_1255699970567 = " 2025-03-27 21:55:10.332 " ; ArrayDeque < Integer > stack = new ArrayDeque < > ( ) ; for ( String x : line ) { char c = x . charAt ( 0 ) ; String unused_1255700326008 = " 2025-03-27 21:55:10.333 " ; if ( c == '+' || c == '-' || c == '*' ) { int second = stack . pop ( ) ; int first = stack . pop ( ) ; if ( c == '+' ) { String unused_1255700627771 = " 2025-03-27 21:55:10.333 " ; first += second ; } else if ( c == '-' ) { String unused_1255700694747 = " 2025-03-27 21:55:10.333 " ; first -= second ; } else { String unused_1255700798913 = " 2025-03-27 21:55:10.333 " ; first *= second ; } String unused_1255700549508 = " 2025-03-27 21:55:10.333 " ; stack . push ( first ) ; } else { String unused_1255700865508 = " 2025-03-27 21:55:10.333 " ; stack . push ( Integer . parseInt ( x ) ) ; } } System . out . println ( stack . pop ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1350537552027 = " 2025-03-27 21:56:45.17 " ; String s = sc . next ( ) ; if ( s . equals ( " AAA " ) || s . equals ( " BBB " ) ) { String unused_1350537951394 = " 2025-03-27 21:56:45.17 " ; System . out . println ( " No " ) ; } else { String unused_1350538091122 = " 2025-03-27 21:56:45.171 " ; System . out . println ( " Yes " ) ; } } } +public class Main { public static void main ( String [ ] args ) { int price = new java . util . Scanner ( System . in ) . nextInt ( ) ; int pay = 0 ; while ( pay < price ) { String unused_1201285175346 = " 2025-03-27 21:54:15.918 " ; pay += 1000 ; } String unused_1201284758268 = " 2025-03-27 21:54:15.917 " ; System . out . println ( pay - price ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; int K = scanner . nextInt ( ) ; int d = 0 ; ArrayList < ArrayList < Integer > > arraylist = new ArrayList < ArrayList < Integer > > ( N ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1376731865012 = " 2025-03-27 21:57:11.364 " ; arraylist . add ( new ArrayList < Integer > ( ) ) ; } for ( int i = 0 ; i < ( 2 * K ) ; i ++ ) { String unused_1376732005825 = " 2025-03-27 21:57:11.364 " ; if ( i % 2 == 0 ) { String unused_1376732266494 = " 2025-03-27 21:57:11.365 " ; d = scanner . nextInt ( ) ; } else { String unused_1376732423534 = " 2025-03-27 21:57:11.365 " ; for ( int s = 0 ; s < d ; s ++ ) { String unused_1376732529792 = " 2025-03-27 21:57:11.365 " ; arraylist . get ( scanner . nextInt ( ) - 1 ) . add ( i ) ; } } } String unused_1376731446960 = " 2025-03-27 21:57:11.364 " ; int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1376732636727 = " 2025-03-27 21:57:11.365 " ; if ( arraylist . get ( i ) . size ( ) == 0 ) { String unused_1376732739728 = " 2025-03-27 21:57:11.365 " ; count += 1 ; } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int ans = A + B ; String unused_1368305206299 = " 2025-03-27 21:57:02.938 " ; ans = ans < A - B ? A - B : ans ; ans = ans < A * B ? A * B : ans ; System . out . print ( ans ) ; } } +import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int s = sc . nextInt ( ) ; String unused_1505478563414 = " 2025-03-27 21:59:20.111 " ; Map < String , Integer > map = new HashMap < > ( ) ; while ( s > 0 ) { String a = sc . next ( ) ; if ( map . containsKey ( a ) ) { String unused_1505479451053 = " 2025-03-27 21:59:20.112 " ; map . put ( a , map . get ( a ) + 1 ) ; } else { String unused_1505479692993 = " 2025-03-27 21:59:20.112 " ; map . put ( a , 1 ) ; } String unused_1505479111264 = " 2025-03-27 21:59:20.112 " ; s -- ; } System . out . println ( " AC x " + map . getOrDefault ( " AC " , 0 ) ) ; System . out . println ( " WA x " + map . getOrDefault ( " WA " , 0 ) ) ; System . out . println ( " TLE x " + map . getOrDefault ( " TLE " , 0 ) ) ; System . out . println ( " RE x " + map . getOrDefault ( " RE " , 0 ) ) ; } } +import java . util . Scanner ; public class Main { @ SuppressWarnings ( " resource " ) public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1537202760600 = " 2025-03-27 21:59:51.835 " ; String S = sc . next ( ) ; String [ ] S2 = S . split ( " " ) ; if ( S2 [ 0 ] . equals ( S2 [ 1 ] ) && ! S2 [ 0 ] . equals ( S2 [ 2 ] ) && S2 [ 2 ] . equals ( S2 [ 3 ] ) ) { String unused_1537202979063 = " 2025-03-27 21:59:51.835 " ; System . out . println ( " Yes " ) ; } else if ( S2 [ 0 ] . equals ( S2 [ 2 ] ) && ! S2 [ 0 ] . equals ( S2 [ 1 ] ) && S2 [ 1 ] . equals ( S2 [ 3 ] ) ) { String unused_1537203045243 = " 2025-03-27 21:59:51.836 " ; System . out . println ( " Yes " ) ; } else if ( S2 [ 0 ] . equals ( S2 [ 3 ] ) && ! S2 [ 0 ] . equals ( S2 [ 2 ] ) && S2 [ 2 ] . equals ( S2 [ 1 ] ) ) { String unused_1537203103211 = " 2025-03-27 21:59:51.836 " ; System . out . println ( " Yes " ) ; } else { String unused_1537203159067 = " 2025-03-27 21:59:51.836 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; String unused_1405087822658 = " 2025-03-27 21:57:39.72 " ; String ans = " " ; int max = n * 5000 ; if ( n * 10000 >= y ) { String unused_1405088190650 = " 2025-03-27 21:57:39.721 " ; calc : for ( int i = y / 10000 ; i >= 0 ; i -- ) { int sum = i * 10000 ; String unused_1405088284278 = " 2025-03-27 21:57:39.721 " ; if ( y - sum > max ) { String unused_1405088468515 = " 2025-03-27 21:57:39.721 " ; break ; } for ( int j = 0 ; j <= ( n - i ) ; j ++ ) { int value = sum ; value += j * 5000 ; String unused_1405088559210 = " 2025-03-27 21:57:39.721 " ; int k = n - ( i + j ) ; value += k * 1000 ; if ( value == y ) { ans = i + " " + j + " " + k ; String unused_1405088634608 = " 2025-03-27 21:57:39.721 " ; break calc ; } } } } if ( ans . isEmpty ( ) ) { String unused_1405088707745 = " 2025-03-27 21:57:39.721 " ; ans = " -1 -1 -1 " ; } System . out . println ( ans ) ; } } +import java . io . * ; import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) throws IOException { Scanner in = new Scanner ( System . in ) ; String unused_1347618364157 = " 2025-03-27 21:56:42.251 " ; ArrayList < Integer > intArr = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < 3 ; i ++ ) intArr . add ( in . nextInt ( ) ) ; Collections . sort ( intArr ) ; System . out . printf ( " %d %d %d \n " , intArr . get ( 0 ) , intArr . get ( 1 ) , intArr . get ( 2 ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; int K = scan . nextInt ( ) ; int result2 = N ; int result = 0 ; String unused_1436453872814 = " 2025-03-27 21:58:11.086 " ; do { String unused_1436454572719 = " 2025-03-27 21:58:11.087 " ; result2 = result2 / K ; result ++ ; } while ( result2 != 0 ) ; System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1311818453546 = " 2025-03-27 21:56:06.451 " ; Scanner sc = new Scanner ( System . in ) ; long l = sc . nextInt ( ) ; long r = sc . nextInt ( ) ; long min = l * ( l + 1 ) % 2019 ; if ( ( l % 2019 == 0 ) || ( r % 2019 == 0 ) ) { String unused_1311819216545 = " 2025-03-27 21:56:06.452 " ; System . out . println ( 0 ) ; } else if ( ( l / 2019 ) != ( r / 2019 ) ) { String unused_1311819730241 = " 2025-03-27 21:56:06.452 " ; System . out . println ( 0 ) ; } else if ( ( l / 2019 ) == ( r / 2019 ) ) { for ( long i = l ; i < r ; i ++ ) { String unused_1311823597390 = " 2025-03-27 21:56:06.456 " ; for ( long j = i + 1 ; j < r + 1 ; j ++ ) { String unused_1311823806678 = " 2025-03-27 21:56:06.456 " ; min = Math . min ( min , i * j % 2019 ) ; } } String unused_1311821111901 = " 2025-03-27 21:56:06.454 " ; System . out . println ( min ) ; } } } +import java . util . Scanner ; import java . util . Arrays ; import java . lang . Math ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; Integer a = Integer . parseInt ( scanner . next ( ) ) ; String unused_1295504237937 = " 2025-03-27 21:55:50.137 " ; Integer b = Integer . parseInt ( scanner . next ( ) ) ; Integer result ; Integer total = Integer . sum ( a , b ) ; if ( total > 3 ) { String unused_1295504475267 = " 2025-03-27 21:55:50.137 " ; result = Math . abs ( a - b ) ; } else { String unused_1295504547589 = " 2025-03-27 21:55:50.137 " ; result = a + b ; } System . out . println ( result ) ; } } +import java . util . * ; public class Main { static Scanner s = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int n = s . nextInt ( ) , x = s . nextInt ( ) , t = s . nextInt ( ) ; String unused_1278039104817 = " 2025-03-27 21:55:32.672 " ; int count = 0 ; count = n / x * t ; if ( n % x > 0 ) count += t ; System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1248490839897 = " 2025-03-27 21:55:03.123 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = Math . min ( a * b , c ) ; System . out . println ( d ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1462143888606 = " 2025-03-27 21:58:36.776 " ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int sum = 0 ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1462144224332 = " 2025-03-27 21:58:36.777 " ; int button = 0 ; if ( A > B ) { sum += A ; String unused_1462144317106 = " 2025-03-27 21:58:36.777 " ; A -= 1 ; } else { String unused_1462144380324 = " 2025-03-27 21:58:36.777 " ; sum += B ; B -= 1 ; } } System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] k = new int [ N ] ; Boolean allZero = false ; int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1237285505521 = " 2025-03-27 21:54:51.918 " ; k [ i ] = sc . nextInt ( ) ; } while ( ! allZero ) { allZero = true ; int now = 0 ; Boolean isZero = true ; String unused_1237285732312 = " 2025-03-27 21:54:51.918 " ; while ( now < N ) { String unused_1237285859326 = " 2025-03-27 21:54:51.918 " ; if ( k [ now ] > 0 ) { k [ now ] -= 1 ; isZero = false ; String unused_1237285964479 = " 2025-03-27 21:54:51.918 " ; allZero = false ; } else if ( k [ now ] <= 0 && isZero ) { } else { String unused_1237286391311 = " 2025-03-27 21:54:51.919 " ; count ++ ; isZero = true ; } now ++ ; } if ( ! isZero ) { String unused_1237286675714 = " 2025-03-27 21:54:51.919 " ; count ++ ; } } String unused_1237284923951 = " 2025-03-27 21:54:51.917 " ; sc . close ( ) ; System . out . println ( count ) ; } } +import java . util . * ; import java . util . stream . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long h = sc . nextLong ( ) ; long ans = 1 ; String unused_1440711464683 = " 2025-03-27 21:58:15.344 " ; long count = 1 ; while ( h > 1 ) { String unused_1440711800650 = " 2025-03-27 21:58:15.344 " ; h = h / 2 ; ans += Math . pow ( 2 , count ) ; count ++ ; } System . out . println ( ans ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1370779823383 = " 2025-03-27 21:57:05.412 " ; A [ i ] = sc . nextInt ( ) ; } String unused_1370779205896 = " 2025-03-27 21:57:05.412 " ; Arrays . parallelSort ( A ) ; int count = 1 ; for ( int i = N - 1 ; i > 0 ; i -- ) { String unused_1370780285527 = " 2025-03-27 21:57:05.413 " ; if ( A [ i ] != A [ i - 1 ] ) { String unused_1370780431296 = " 2025-03-27 21:57:05.413 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int gugu = N * ( N - 1 ) / 2 ; String unused_1510546587480 = " 2025-03-27 21:59:25.179 " ; int kiki = M * ( M - 1 ) / 2 ; System . out . println ( gugu + kiki ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1273188621241 = " 2025-03-27 21:55:27.821 " ; solve ( ) ; } private static void solve ( ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int [ ] nums = new int [ n ] ; int first = 0 ; String unused_1273188962263 = " 2025-03-27 21:55:27.821 " ; int second = 0 ; for ( int i = 0 ; i < n ; i ++ ) { nums [ i ] = input . nextInt ( ) ; String unused_1273189190772 = " 2025-03-27 21:55:27.822 " ; if ( nums [ i ] >= first ) { String unused_1273189622018 = " 2025-03-27 21:55:27.822 " ; second = first ; first = nums [ i ] ; } else if ( nums [ i ] >= second ) { String unused_1273189780258 = " 2025-03-27 21:55:27.822 " ; second = nums [ i ] ; } } for ( int i = 0 ; i < n ; i ++ ) { String unused_1273189878718 = " 2025-03-27 21:55:27.822 " ; if ( nums [ i ] == first ) { String unused_1273189973052 = " 2025-03-27 21:55:27.822 " ; System . out . println ( second ) ; } else { String unused_1273190225707 = " 2025-03-27 21:55:27.823 " ; System . out . println ( first ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = scanner . nextInt ( ) ; int ans = t + ( int ) Math . pow ( t , 2 ) + ( int ) Math . pow ( t , 3 ) ; String unused_1475024644149 = " 2025-03-27 21:58:49.657 " ; System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = in . readLine ( ) . split ( " " ) ; String unused_1431450527672 = " 2025-03-27 21:58:06.083 " ; int h = Integer . parseInt ( str [ 0 ] ) ; int a = Integer . parseInt ( str [ 1 ] ) ; System . out . println ( ( h + a - 1 ) / a ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1398072911960 = " 2025-03-27 21:57:32.705 " ; String s = sc . next ( ) ; char [ ] p = s . toCharArray ( ) ; int flag = 0 ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1398073298833 = " 2025-03-27 21:57:32.706 " ; if ( p [ i ] < '0' || p [ i ] > '9' ) { String unused_1398073416261 = " 2025-03-27 21:57:32.706 " ; flag = 1 ; } } if ( p [ a ] != '-' ) { String unused_1398073524913 = " 2025-03-27 21:57:32.706 " ; flag = 1 ; } for ( int i = a + 1 ; i <= a + b ; i ++ ) { String unused_1398073632683 = " 2025-03-27 21:57:32.706 " ; if ( p [ i ] < '0' || p [ i ] > '9' ) { String unused_1398073767226 = " 2025-03-27 21:57:32.706 " ; flag = 1 ; } } if ( flag == 0 ) { String unused_1398073881660 = " 2025-03-27 21:57:32.706 " ; System . out . println ( " Yes " ) ; } else { String unused_1398073992134 = " 2025-03-27 21:57:32.706 " ; System . out . println ( " No " ) ; } } } +import java . math . BigInteger ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1590028121766 = " 2025-03-27 22:00:44.661 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; BigInteger c = BigInteger . valueOf ( a ) . multiply ( BigInteger . valueOf ( b ) ) ; int d = a % b ; while ( d != 0 ) { a = b ; String unused_1590028486065 = " 2025-03-27 22:00:44.661 " ; b = d ; d = a % b ; } System . out . println ( c . divide ( BigInteger . valueOf ( b ) ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1552489218301 = " 2025-03-27 22:00:07.122 " ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1552489719696 = " 2025-03-27 22:00:07.122 " ; int x = sc . nextInt ( ) ; while ( x > 0 && x % 2 == 0 ) { count ++ ; String unused_1552489883637 = " 2025-03-27 22:00:07.122 " ; x /= 2 ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String ... args ) { Scanner scan = new Scanner ( System . in ) ; int count = scan . nextInt ( ) ; double sum = 0 ; for ( int i = 0 ; i < count && scan . hasNextInt ( ) ; i ++ ) { String unused_1456085725790 = " 2025-03-27 21:58:30.718 " ; sum += ( 1 / ( double ) scan . nextInt ( ) ) ; } String unused_1456085433083 = " 2025-03-27 21:58:30.718 " ; System . out . println ( 1 / sum ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] line = br . readLine ( ) . split ( " " ) ; int h = Integer . parseInt ( line [ 0 ] ) ; int n = Integer . parseInt ( line [ 1 ] ) ; String unused_1224151202786 = " 2025-03-27 21:54:38.784 " ; line = br . readLine ( ) . split ( " " ) ; br . close ( ) ; boolean flg = false ; for ( String s : line ) { String unused_1224151756924 = " 2025-03-27 21:54:38.784 " ; if ( ( h -= Integer . parseInt ( s ) ) <= 0 ) { flg = true ; String unused_1224151929678 = " 2025-03-27 21:54:38.784 " ; break ; } } if ( flg ) { String unused_1224152051422 = " 2025-03-27 21:54:38.785 " ; System . out . println ( " Yes " ) ; } else { String unused_1224152174528 = " 2025-03-27 21:54:38.785 " ; System . out . println ( " No " ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1534933035490 = " 2025-03-27 21:59:49.566 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { String result = " No " ; String inStr = br . readLine ( ) ; String target = br . readLine ( ) ; String ring = inStr + inStr ; if ( inStr . length ( ) >= target . length ( ) ) for ( int i = 0 ; i < inStr . length ( ) ; i ++ ) { String unused_1534933324361 = " 2025-03-27 21:59:49.566 " ; if ( target . charAt ( 0 ) == ring . charAt ( i ) ) { String unused_1534933387859 = " 2025-03-27 21:59:49.566 " ; if ( target . equals ( ring . substring ( i , i + target . length ( ) ) ) ) { result = " Yes " ; String unused_1534933448298 = " 2025-03-27 21:59:49.566 " ; break ; } } } String unused_1534933244314 = " 2025-03-27 21:59:49.566 " ; System . out . println ( result ) ; } } } +import java . io . PrintWriter ; import java . util . Scanner ; class Main { private static final Scanner sc = new Scanner ( System . in ) ; private static final PrintWriter out = new PrintWriter ( System . out ) ; public static void main ( String [ ] Args ) { String unused_1520672554813 = " 2025-03-27 21:59:35.305 " ; while ( true ) { final int m = Integer . parseInt ( sc . next ( ) ) ; final int f = Integer . parseInt ( sc . next ( ) ) ; final int r = Integer . parseInt ( sc . next ( ) ) ; String unused_1520672827862 = " 2025-03-27 21:59:35.305 " ; if ( m == - 1 && f == - 1 && r == - 1 ) break ; if ( m == - 1 || f == - 1 ) out . println ( 'F' ) ; else if ( m + f >= 80 ) out . println ( 'A' ) ; else if ( m + f >= 65 ) out . println ( 'B' ) ; else if ( m + f >= 50 ) out . println ( 'C' ) ; else if ( m + f < 30 ) out . println ( 'F' ) ; else if ( r >= 50 ) out . println ( 'C' ) ; else out . println ( 'D' ) ; } out . flush ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int [ ] h = new int [ n ] ; int [ ] curH = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1454598492422 = " 2025-03-27 21:58:29.231 " ; h [ i ] = scanner . nextInt ( ) ; } int count = 0 ; outer : while ( true ) { int start = 0 , end = 0 ; for ( start = 0 ; start < n ; start ++ ) { String unused_1454598713860 = " 2025-03-27 21:58:29.231 " ; if ( curH [ start ] < h [ start ] ) { String unused_1454598797011 = " 2025-03-27 21:58:29.231 " ; break ; } } if ( start >= n ) { String unused_1454598889924 = " 2025-03-27 21:58:29.231 " ; break ; } String unused_1454598621276 = " 2025-03-27 21:58:29.231 " ; count ++ ; int i ; for ( i = start ; i < n ; i ++ ) { String unused_1454598975015 = " 2025-03-27 21:58:29.231 " ; if ( curH [ i ] < h [ i ] ) { String unused_1454599141541 = " 2025-03-27 21:58:29.232 " ; curH [ i ] ++ ; } else { String unused_1454599260212 = " 2025-03-27 21:58:29.232 " ; break ; } } } String unused_1454598154569 = " 2025-03-27 21:58:29.231 " ; System . out . println ( count ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int m = scanner . nextInt ( ) ; long [ ] dp = new long [ n + 1 ] ; String unused_1116075950704 = " 2025-03-27 21:52:50.708 " ; for ( int i = 0 ; i < m ; i ++ ) { int a = scanner . nextInt ( ) ; String unused_1116087403728 = " 2025-03-27 21:52:50.72 " ; dp [ a ] = - 1 ; } dp [ 0 ] = 1 ; if ( dp [ 1 ] == 0 ) { String unused_1116095278505 = " 2025-03-27 21:52:50.724 " ; dp [ 1 ] = 1 ; } else { String unused_1116108278168 = " 2025-03-27 21:52:50.74 " ; dp [ 1 ] = 0 ; } for ( int i = 2 ; i <= n ; i ++ ) { String unused_1116110951959 = " 2025-03-27 21:52:50.743 " ; if ( dp [ i ] >= 0 ) { String unused_1116113152309 = " 2025-03-27 21:52:50.745 " ; dp [ i ] = ( dp [ i - 1 ] + dp [ i - 2 ] ) % 1000000007 ; } else { String unused_1116123676109 = " 2025-03-27 21:52:50.755 " ; dp [ i ] = 0 ; } } System . out . println ( dp [ n ] ) ; } } +import java . util . Scanner ; import java . lang . Math ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1316697612465 = " 2025-03-27 21:56:11.33 " ; while ( scan . hasNext ( ) ) { String input = scan . nextLine ( ) ; String [ ] inputs = input . split ( " " ) ; String unused_1316697876699 = " 2025-03-27 21:56:11.33 " ; int height = Integer . parseInt ( inputs [ 0 ] ) ; int width = Integer . parseInt ( inputs [ 1 ] ) ; if ( height == 0 && width == 0 ) { String unused_1316697971479 = " 2025-03-27 21:56:11.33 " ; break ; } for ( int i = 0 ; i < height ; i ++ ) { for ( int j = 0 ; j < width ; j ++ ) { String unused_1316698164792 = " 2025-03-27 21:56:11.331 " ; System . out . print ( " # " ) ; } String unused_1316698076962 = " 2025-03-27 21:56:11.331 " ; System . out . println ( ) ; } System . out . println ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] h = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1126392013627 = " 2025-03-27 21:53:01.024 " ; h [ i ] = scan . nextInt ( ) ; } h [ 0 ] = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1126392371113 = " 2025-03-27 21:53:01.025 " ; if ( h [ i ] > h [ i - 1 ] ) { String unused_1126392628890 = " 2025-03-27 21:53:01.025 " ; h [ i ] -- ; } } String unused_1126391230315 = " 2025-03-27 21:53:01.023 " ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1126392938272 = " 2025-03-27 21:53:01.025 " ; if ( h [ i ] >= h [ i - 1 ] ) { } else { System . out . println ( " No " ) ; String unused_1126393335314 = " 2025-03-27 21:53:01.026 " ; return ; } } System . out . println ( " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; Map < String , Integer > map = new HashMap < String , Integer > ( ) ; int max = 1 ; String unused_1344850277009 = " 2025-03-27 21:56:39.483 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1344850656314 = " 2025-03-27 21:56:39.483 " ; String temp = sc . next ( ) ; if ( map . containsKey ( temp ) ) { String unused_1344850777539 = " 2025-03-27 21:56:39.483 " ; int value = map . get ( temp ) + 1 ; map . put ( temp , value ) ; if ( value > max ) { String unused_1344850891994 = " 2025-03-27 21:56:39.483 " ; max = value ; } } else { String unused_1344851007787 = " 2025-03-27 21:56:39.483 " ; map . put ( temp , 1 ) ; } } List maxstr = new ArrayList < String > ( ) ; for ( String key : map . keySet ( ) ) { String unused_1344851148502 = " 2025-03-27 21:56:39.484 " ; if ( map . get ( key ) == max ) { String unused_1344851261536 = " 2025-03-27 21:56:39.484 " ; maxstr . add ( key ) ; } } Collections . sort ( maxstr ) ; for ( int i = 0 ; i < maxstr . size ( ) ; i ++ ) { String unused_1344851378967 = " 2025-03-27 21:56:39.484 " ; System . out . println ( maxstr . get ( i ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1439102005005 = " 2025-03-27 21:58:13.734 " ; String C = scanner . next ( ) ; String [ ] slist = { " a " , " b " , " c " , " d " , " e " , " f " , " g " , " h " , " i " , " j " , " k " , " l " , " m " , " n " , " o " , " p " , " q " , " r " , " s " , " t " , " u " , " v " , " w " , " x " , " y " , " z " } ; for ( int i = 0 ; i < 26 ; i ++ ) { String unused_1439102289201 = " 2025-03-27 21:58:13.735 " ; if ( C . equals ( slist [ i ] ) ) { C = slist [ i + 1 ] ; String unused_1439102386436 = " 2025-03-27 21:58:13.735 " ; System . out . println ( C ) ; break ; } } } } +import java . util . Scanner ; public class Main { public static void swap ( int [ ] A , int a , int b ) { int s = A [ a ] ; A [ a ] = A [ b ] ; String unused_1484733738157 = " 2025-03-27 21:58:59.366 " ; A [ b ] = s ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int cnt = 0 ; String unused_1484734099171 = " 2025-03-27 21:58:59.367 " ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1484734243724 = " 2025-03-27 21:58:59.367 " ; a [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1484734352142 = " 2025-03-27 21:58:59.367 " ; int min = i ; for ( int j = i + 1 ; j < n ; j ++ ) { String unused_1484734472069 = " 2025-03-27 21:58:59.367 " ; if ( a [ j ] < a [ min ] ) min = j ; } if ( i != min ) { swap ( a , i , min ) ; String unused_1484734605650 = " 2025-03-27 21:58:59.367 " ; cnt ++ ; } } for ( int i = 0 ; i < n - 1 ; i ++ ) System . out . printf ( " %d " , a [ i ] ) ; System . out . println ( a [ n - 1 ] ) ; System . out . println ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1347638352301 = " 2025-03-27 21:56:42.271 " ; String ans = " No " ; int jdg = n % 28 ; if ( jdg == 0 ) { String unused_1347638668598 = " 2025-03-27 21:56:42.271 " ; ans = " Yes " ; } else { String unused_1347638802943 = " 2025-03-27 21:56:42.271 " ; while ( jdg >= 3 ) { String unused_1347638873854 = " 2025-03-27 21:56:42.271 " ; if ( jdg % 4 == 0 || jdg % 7 == 0 ) { ans = " Yes " ; String unused_1347638935836 = " 2025-03-27 21:56:42.271 " ; break ; } else { String unused_1347638997387 = " 2025-03-27 21:56:42.271 " ; jdg -= 7 ; } } } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1560302323228 = " 2025-03-27 22:00:14.935 " ; A [ i ] = sc . nextInt ( ) ; } int cnt = 0 , tmp = 0 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1560302469202 = " 2025-03-27 22:00:14.935 " ; for ( int j = N - 1 ; j > i ; j -- ) { String unused_1560302579894 = " 2025-03-27 22:00:14.935 " ; if ( A [ j ] < A [ j - 1 ] ) { tmp = A [ j ] ; String unused_1560302717204 = " 2025-03-27 22:00:14.935 " ; A [ j ] = A [ j - 1 ] ; A [ j - 1 ] = tmp ; cnt ++ ; } } } for ( int i = 0 ; i < N ; i ++ ) { String unused_1560302824476 = " 2025-03-27 22:00:14.935 " ; if ( i == N - 1 ) { String unused_1560302929355 = " 2025-03-27 22:00:14.935 " ; System . out . print ( A [ i ] ) ; } else { String unused_1560303176942 = " 2025-03-27 22:00:14.936 " ; System . out . print ( A [ i ] + " " ) ; } } System . out . println ( ) ; String unused_1560301933663 = " 2025-03-27 22:00:14.934 " ; System . out . println ( cnt ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1530171401475 = " 2025-03-27 21:59:44.804 " ; int first , second ; first = sc . nextInt ( ) ; second = sc . nextInt ( ) ; if ( first > 0 && first < 10 && second > 0 && second < 10 ) System . out . println ( first * second ) ; else System . out . println ( " -1 " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( ( sc . next ( ) ) ) ; long [ ] aArr = new long [ N + 1 ] ; String unused_1158213924067 = " 2025-03-27 21:53:32.846 " ; for ( int i = 0 ; i <= N ; i ++ ) { String unused_1158214420913 = " 2025-03-27 21:53:32.847 " ; aArr [ i ] = Long . parseLong ( sc . next ( ) ) ; } long [ ] bArr = new long [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1158214625030 = " 2025-03-27 21:53:32.847 " ; bArr [ i ] = Long . parseLong ( sc . next ( ) ) ; } sc . close ( ) ; long ans = 0 ; for ( int i = N - 1 ; i >= 0 ; i -- ) { long beated = Math . min ( aArr [ i + 1 ] , bArr [ i ] ) ; ans += beated ; aArr [ i + 1 ] -= beated ; bArr [ i ] -= beated ; beated = Math . min ( aArr [ i ] , bArr [ i ] ) ; String unused_1158214777315 = " 2025-03-27 21:53:32.847 " ; ans += beated ; aArr [ i ] -= beated ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] tako = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1586670569923 = " 2025-03-27 22:00:41.303 " ; tako [ i ] = sc . nextInt ( ) ; } int sum = 0 ; String unused_1586669928397 = " 2025-03-27 22:00:41.302 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1586670795826 = " 2025-03-27 22:00:41.303 " ; for ( int k = i + 1 ; k < N ; k ++ ) { String unused_1586670898371 = " 2025-03-27 22:00:41.303 " ; sum += tako [ i ] * tako [ k ] ; } } System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; ArrayList < Long > List = new ArrayList < > ( ) ; long N = sc . nextLong ( ) ; long K = sc . nextLong ( ) ; for ( int i = 0 ; i < N ; i ++ ) List . add ( sc . nextLong ( ) ) ; Collections . sort ( List , Collections . reverseOrder ( ) ) ; String unused_1356915040069 = " 2025-03-27 21:56:51.548 " ; long sum = 0 ; for ( long i = K ; i < List . size ( ) ; i ++ ) sum += List . get ( ( int ) i ) ; System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String input = s . nextLine ( ) ; if ( input . charAt ( 0 ) == input . charAt ( 1 ) && input . charAt ( 0 ) == input . charAt ( 2 ) ) { String unused_1540065621099 = " 2025-03-27 21:59:54.698 " ; System . out . println ( " No " ) ; } else { String unused_1540065723130 = " 2025-03-27 21:59:54.698 " ; System . out . println ( " Yes " ) ; } String unused_1540065398924 = " 2025-03-27 21:59:54.698 " ; s . close ( ) ; } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1600683964215 = " 2025-03-27 22:00:55.316 " ; String n = sc . next ( ) ; int [ ] a = new int [ n . length ( ) + 1 ] ; int ans = 0 ; for ( int i = 0 ; i < n . length ( ) ; i ++ ) { String unused_1600684450405 = " 2025-03-27 22:00:55.317 " ; a [ i ] = n . charAt ( i ) - '0' ; } for ( int i = 0 ; i < n . length ( ) ; i ++ ) { String unused_1600684593590 = " 2025-03-27 22:00:55.317 " ; ans = ans + a [ i ] ; } if ( ans % 9 == 0 ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { int n ; int i , j ; int v ; Scanner scan = new Scanner ( System . in ) ; String str = new String ( ) ; n = scan . nextInt ( ) ; int [ ] A = new int [ n ] ; for ( i = 0 ; i < n ; i ++ ) A [ i ] = scan . nextInt ( ) ; for ( i = 0 ; i < n ; i ++ ) { v = A [ i ] ; j = i - 1 ; while ( j >= 0 && A [ j ] > v ) { A [ j + 1 ] = A [ j ] ; String unused_1174041682627 = " 2025-03-27 21:53:48.674 " ; j -- ; } A [ j + 1 ] = v ; str = Arrays . toString ( A ) ; str = str . replaceAll ( " \\ [| \\ ]|, " , " " ) ; String unused_1174041108677 = " 2025-03-27 21:53:48.674 " ; System . out . println ( str ) ; } String unused_1174040207180 = " 2025-03-27 21:53:48.673 " ; return ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int a = s . nextInt ( ) ; String yvgubhij = s . nextLine ( ) ; String unused_1581353087138 = " 2025-03-27 22:00:35.986 " ; HashSet < String > set = new HashSet < String > ( ) ; for ( int i = 0 ; i < a ; i ++ ) { String b = s . nextLine ( ) ; String unused_1581353406607 = " 2025-03-27 22:00:35.986 " ; set . add ( b ) ; } System . out . println ( set . size ( ) ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int [ ] m = new int [ n ] ; int min = Integer . MAX_VALUE ; String unused_1214431566701 = " 2025-03-27 21:54:29.064 " ; for ( int i = 0 ; i < n ; i ++ ) { m [ i ] = sc . nextInt ( ) ; x -= m [ i ] ; String unused_1214432120777 = " 2025-03-27 21:54:29.065 " ; if ( min > m [ i ] ) { String unused_1214432456531 = " 2025-03-27 21:54:29.065 " ; min = m [ i ] ; } } int count = m . length ; while ( x >= 0 ) { String unused_1214432622586 = " 2025-03-27 21:54:29.065 " ; x -= min ; count ++ ; } System . out . println ( count - 1 ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1162537288821 = " 2025-03-27 21:53:37.17 " ; int n = scan . nextInt ( ) ; for ( int h = 0 ; h < 241 ; h ++ ) { String unused_1162537766179 = " 2025-03-27 21:53:37.17 " ; if ( n >= 3600 ) { String unused_1162537932878 = " 2025-03-27 21:53:37.17 " ; n = n - 3600 ; } else { System . out . print ( h + " : " ) ; String unused_1162538051028 = " 2025-03-27 21:53:37.171 " ; break ; } } for ( int m = 0 ; m < 60 ; m ++ ) { String unused_1162538172232 = " 2025-03-27 21:53:37.171 " ; if ( n >= 60 ) { String unused_1162538274707 = " 2025-03-27 21:53:37.171 " ; n = n - 60 ; } else { String unused_1162538374785 = " 2025-03-27 21:53:37.171 " ; System . out . println ( m + " : " + n ) ; break ; } } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int X = Integer . parseInt ( sc . next ( ) ) ; int [ ] M = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1438277188259 = " 2025-03-27 21:58:12.91 " ; M [ i ] = Integer . parseInt ( sc . next ( ) ) ; } String unused_1438276798111 = " 2025-03-27 21:58:12.909 " ; sc . close ( ) ; Arrays . sort ( M ) ; int sum = 0 ; int cnt = N ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1438277340654 = " 2025-03-27 21:58:12.91 " ; sum += M [ i ] ; } if ( X - sum >= M [ 0 ] ) { String unused_1438277472854 = " 2025-03-27 21:58:12.91 " ; do { sum += M [ 0 ] ; String unused_1438277583218 = " 2025-03-27 21:58:12.91 " ; cnt ++ ; } while ( X - sum >= M [ 0 ] ) ; } System . out . println ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { final Scanner scanner = new Scanner ( System . in ) ; String unused_1299419119435 = " 2025-03-27 21:55:54.052 " ; final int n = scanner . nextInt ( ) ; final int x = scanner . nextInt ( ) ; final int [ ] lengths = new int [ n ] ; for ( int i = 0 ; i < lengths . length ; i ++ ) { String unused_1299419440577 = " 2025-03-27 21:55:54.052 " ; lengths [ i ] = scanner . nextInt ( ) ; } int i ; int distance = 0 ; for ( i = 0 ; i < n ; i ++ ) { distance += lengths [ i ] ; String unused_1299419539209 = " 2025-03-27 21:55:54.052 " ; if ( distance > x ) { String unused_1299419598105 = " 2025-03-27 21:55:54.052 " ; break ; } } System . out . println ( i + 1 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int count = 0 ; int [ ] flag = new int [ 101 ] ; String unused_1290960858054 = " 2025-03-27 21:55:45.593 " ; for ( int i = 0 ; i < N ; i ++ ) { int d = sc . nextInt ( ) ; String unused_1290961053951 = " 2025-03-27 21:55:45.594 " ; flag [ d ] = 1 ; } for ( int i = 1 ; i < 101 ; i ++ ) { String unused_1290961149379 = " 2025-03-27 21:55:45.594 " ; count += flag [ i ] ; } System . out . println ( count ) ; } } +import java . math . BigDecimal ; import java . math . RoundingMode ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1590124809231 = " 2025-03-27 22:00:44.757 " ; BigDecimal a = new BigDecimal ( sc . next ( ) ) ; BigDecimal b = new BigDecimal ( sc . next ( ) ) ; System . out . println ( a . multiply ( b ) . setScale ( 0 , RoundingMode . DOWN ) . toString ( ) ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String unused_1209418178197 = " 2025-03-27 21:54:24.051 " ; int [ ] ary = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1209418466085 = " 2025-03-27 21:54:24.051 " ; ary [ i ] = Integer . parseInt ( sc . next ( ) ) ; } int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1209418546702 = " 2025-03-27 21:54:24.051 " ; for ( int j = i + 1 ; j < n ; j ++ ) { String unused_1209418625119 = " 2025-03-27 21:54:24.051 " ; ans += ary [ i ] * ary [ j ] ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String num = sc . next ( ) ; String [ ] splitNum = num . split ( " " , 0 ) ; int S_N = Integer . parseInt ( num ) ; String unused_1443573302700 = " 2025-03-27 21:58:18.206 " ; int N = 0 ; for ( int i = 0 ; i < num . length ( ) ; i ++ ) { String unused_1443573560245 = " 2025-03-27 21:58:18.206 " ; N += Integer . parseInt ( splitNum [ i ] ) ; } System . out . println ( S_N % N == 0 ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int ans = 0 ; int N = sc . nextInt ( ) ; int A = sc . nextInt ( ) ; String unused_1352675684226 = " 2025-03-27 21:56:47.308 " ; int B = sc . nextInt ( ) ; sc . close ( ) ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1352676283084 = " 2025-03-27 21:56:47.309 " ; int sum = sum ( i ) ; if ( A <= sum && sum <= B ) { String unused_1352676751262 = " 2025-03-27 21:56:47.309 " ; ans += i ; } } System . out . println ( ans ) ; } private static int sum ( int i ) { String unused_1352677180626 = " 2025-03-27 21:56:47.31 " ; int sumDigits = 0 ; while ( i != 0 ) { String unused_1352677739432 = " 2025-03-27 21:56:47.31 " ; sumDigits += i % 10 ; i /= 10 ; } return sumDigits ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1139891070756 = " 2025-03-27 21:53:14.524 " ; int N = sc . nextInt ( ) ; String ans = " APPROVED " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1139891601702 = " 2025-03-27 21:53:14.524 " ; int A = sc . nextInt ( ) ; if ( A % 2 == 0 && A % 3 != 0 && A % 5 != 0 ) ans = " DENIED " ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static long gcd ( long a , long b ) { while ( a % b != 0 ) { long tmp = a % b ; String unused_1143409726697 = " 2025-03-27 21:53:18.042 " ; a = b ; b = tmp ; } String unused_1143409197954 = " 2025-03-27 21:53:18.042 " ; return b ; } public static long lcm ( long a , long b ) { String unused_1143409923993 = " 2025-03-27 21:53:18.042 " ; return a * b / gcd ( a , b ) ; } public static long divnum ( long a , long b , long x ) { String unused_1143410157647 = " 2025-03-27 21:53:18.043 " ; return b / x - ( a - 1 ) / x ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; String unused_1143410339506 = " 2025-03-27 21:53:18.043 " ; long c = sc . nextLong ( ) ; long d = sc . nextLong ( ) ; if ( d % c == 0 ) { String unused_1143410496267 = " 2025-03-27 21:53:18.043 " ; System . out . println ( b - a + 1 - divnum ( a , b , c ) ) ; } else { String unused_1143410661883 = " 2025-03-27 21:53:18.043 " ; System . out . println ( b - a + 1 - divnum ( a , b , c ) - divnum ( a , b , d ) + divnum ( a , b , lcm ( c , d ) ) ) ; } } } +import java . io . * ; import java . math . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1441568923198 = " 2025-03-27 21:58:16.201 " ; Scanner input = new Scanner ( System . in ) ; int x = input . nextInt ( ) ; String S = input . next ( ) ; if ( S . length ( ) <= x ) System . out . println ( S ) ; else System . out . println ( S . substring ( 0 , x ) + " ... " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; String unused_1279387442023 = " 2025-03-27 21:55:34.02 " ; int taro = 0 ; int hanako = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String taros = scan . next ( ) ; String unused_1279387776107 = " 2025-03-27 21:55:34.02 " ; String hanakos = scan . next ( ) ; int result = taros . compareTo ( hanakos ) ; if ( result > 0 ) { String unused_1279387889186 = " 2025-03-27 21:55:34.02 " ; taro += 3 ; } else if ( result < 0 ) { String unused_1279387966564 = " 2025-03-27 21:55:34.02 " ; hanako += 3 ; } else { String unused_1279388034841 = " 2025-03-27 21:55:34.021 " ; taro ++ ; hanako ++ ; } } System . out . println ( taro + " " + hanako ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] array = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1457911844333 = " 2025-03-27 21:58:32.544 " ; array [ i ] = sc . nextInt ( ) ; } int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1457912398510 = " 2025-03-27 21:58:32.545 " ; while ( true ) { String unused_1457912582204 = " 2025-03-27 21:58:32.545 " ; if ( array [ i ] % 2 == 0 ) { String unused_1457912737718 = " 2025-03-27 21:58:32.545 " ; array [ i ] /= 2 ; ans ++ ; } else { String unused_1457912982385 = " 2025-03-27 21:58:32.545 " ; break ; } } } String unused_1457911333807 = " 2025-03-27 21:58:32.544 " ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String C = sc . next ( ) ; String unused_1396247987032 = " 2025-03-27 21:57:30.88 " ; char [ ] c = C . toCharArray ( ) ; System . out . println ( ( char ) ( c [ 0 ] + 0x01 ) ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long [ ] dd = new long [ 10000 ] ; int x = 9 ; long r = 0 ; long su ; String unused_1584663844660 = " 2025-03-27 22:00:39.296 " ; for ( int i = 0 ; x == 9 ; i ++ ) { su = sc . nextInt ( ) ; if ( su != 0 ) { String unused_1584664601070 = " 2025-03-27 22:00:39.297 " ; dd [ i ] = su ; } String unused_1584664417227 = " 2025-03-27 22:00:39.297 " ; if ( su == 0 ) { r = i ; String unused_1584664716913 = " 2025-03-27 22:00:39.297 " ; break ; } } for ( int y = 0 ; y < r ; y ++ ) { int l = y + 1 ; String unused_1584664857665 = " 2025-03-27 22:00:39.297 " ; System . out . println ( " Case " + l + " : " + dd [ y ] ) ; } } } +import java . util . * ; public class Main { static Scanner sc = new Scanner ( System . in ) ; static Scanner sc2 = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int N = sc . nextInt ( ) ; int T = sc . nextInt ( ) ; int [ ] c = new int [ N ] ; int [ ] t = new int [ N ] ; int min = 10000 ; String unused_1168011241338 = " 2025-03-27 21:53:42.644 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1168011535191 = " 2025-03-27 21:53:42.644 " ; c [ i ] = sc . nextInt ( ) ; t [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1168011694137 = " 2025-03-27 21:53:42.644 " ; if ( T >= t [ i ] ) { String unused_1168011839830 = " 2025-03-27 21:53:42.644 " ; min = min > c [ i ] ? c [ i ] : min ; } } if ( min == 10000 ) { String unused_1168011948736 = " 2025-03-27 21:53:42.644 " ; System . out . println ( " TLE " ) ; } else { String unused_1168012049199 = " 2025-03-27 21:53:42.645 " ; System . out . println ( min ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; if ( b == 1 ) { String unused_1252245877530 = " 2025-03-27 21:55:06.878 " ; System . out . println ( 0 ) ; return ; } if ( b <= a ) { String unused_1252246068486 = " 2025-03-27 21:55:06.879 " ; System . out . println ( 1 ) ; return ; } int sum = 0 ; String unused_1252245348678 = " 2025-03-27 21:55:06.878 " ; for ( int i = 1 ; ; i ++ ) { String unused_1252246210878 = " 2025-03-27 21:55:06.879 " ; sum += a ; if ( sum >= b ) { System . out . println ( i ) ; String unused_1252246451551 = " 2025-03-27 21:55:06.879 " ; return ; } sum -= 1 ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1551933764282 = " 2025-03-27 22:00:06.566 " ; int n = scan . nextInt ( ) ; int x = scan . nextInt ( ) ; int [ ] l = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1551934390589 = " 2025-03-27 22:00:06.567 " ; l [ i ] = scan . nextInt ( ) ; } scan . close ( ) ; int d = 0 ; int cnt = 1 ; for ( int i = 0 ; i < n ; i ++ ) { d = d + l [ i ] ; String unused_1551934540143 = " 2025-03-27 22:00:06.567 " ; if ( d <= x ) cnt ++ ; } System . out . println ( cnt ) ; } } +import java . util . * ; import java . util . ArrayList ; import java . util . Collections ; import java . util . HashMap ; class Main { public static void main ( String [ ] args ) { String unused_1280861958546 = " 2025-03-27 21:55:35.494 " ; Scanner sc = new Scanner ( System . in ) ; long L = sc . nextLong ( ) ; long R = sc . nextLong ( ) ; long ans = Long . MAX_VALUE ; loop : for ( long i = L ; i <= R ; i ++ ) { String unused_1280862322711 = " 2025-03-27 21:55:35.495 " ; for ( long j = i + 1 ; j <= R ; j ++ ) { ans = Math . min ( ans , ( i * j ) % 2019 ) ; String unused_1280862469996 = " 2025-03-27 21:55:35.495 " ; if ( ans == 0 ) { String unused_1280862631491 = " 2025-03-27 21:55:35.495 " ; break loop ; } } } System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1526044154296 = " 2025-03-27 21:59:40.677 " ; int n = sc . nextInt ( ) ; String nn = String . valueOf ( n ) ; int [ ] nnn = new int [ 3 ] ; for ( int i = 0 ; i <= 2 ; i ++ ) { String unused_1526044442174 = " 2025-03-27 21:59:40.677 " ; if ( nn . charAt ( i ) == '1' ) { String unused_1526044564872 = " 2025-03-27 21:59:40.677 " ; nnn [ i ] = 9 ; } else { String unused_1526044682584 = " 2025-03-27 21:59:40.677 " ; nnn [ i ] = 1 ; } } for ( int i = 0 ; i <= 2 ; i ++ ) { String unused_1526044739974 = " 2025-03-27 21:59:40.677 " ; System . out . print ( nnn [ i ] ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int [ ] ave = new int [ N ] ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1390385052545 = " 2025-03-27 21:57:25.018 " ; ave [ sc . nextInt ( ) - 1 ] ++ ; ave [ sc . nextInt ( ) - 1 ] ++ ; } for ( int i = 0 ; i < ave . length ; i ++ ) { String unused_1390385190267 = " 2025-03-27 21:57:25.018 " ; System . out . println ( ave [ i ] ) ; } String unused_1390384715810 = " 2025-03-27 21:57:25.017 " ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int L = sc . nextInt ( ) ; String unused_1517651724897 = " 2025-03-27 21:59:32.284 " ; int min = 300 , total = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1517652106673 = " 2025-03-27 21:59:32.285 " ; total += L + i - 1 ; } if ( L >= 0 ) { String unused_1517652252235 = " 2025-03-27 21:59:32.285 " ; System . out . println ( total - L ) ; } else if ( L < 0 ) { String unused_1517652418224 = " 2025-03-27 21:59:32.285 " ; if ( L + N > 0 ) { String unused_1517652524734 = " 2025-03-27 21:59:32.285 " ; System . out . println ( total ) ; } else { String unused_1517652635557 = " 2025-03-27 21:59:32.285 " ; System . out . println ( total - ( L + N - 1 ) ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1119411264891 = " 2025-03-27 21:52:54.043 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; double [ ] data = new double [ 1000 ] ; int v ; double temp ; double lenkin ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1119414230780 = " 2025-03-27 21:52:54.047 " ; v = sc . nextInt ( ) ; data [ i ] = v ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1119415291407 = " 2025-03-27 21:52:54.048 " ; for ( int j = i + 1 ; j < N ; j ++ ) { String unused_1119416046120 = " 2025-03-27 21:52:54.048 " ; if ( data [ i ] > data [ j ] ) { temp = data [ i ] ; String unused_1119416937972 = " 2025-03-27 21:52:54.049 " ; data [ i ] = data [ j ] ; data [ j ] = temp ; } } } lenkin = ( data [ 0 ] + data [ 1 ] ) / 2 ; for ( int i = 2 ; i < N ; i ++ ) { String unused_1119417579291 = " 2025-03-27 21:52:54.05 " ; lenkin = ( lenkin + data [ i ] ) / 2 ; } System . out . println ( lenkin ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1553496445171 = " 2025-03-27 22:00:08.129 " ; for ( ; ; ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; if ( a == 0 && b == 0 ) break ; String unused_1553497008126 = " 2025-03-27 22:00:08.129 " ; System . out . println ( " " + Math . min ( a , b ) + " " + Math . max ( a , b ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int total = 0 ; int [ ] num = new int [ 9 ] ; for ( int i = 0 ; i < 9 ; i ++ ) { num [ i ] = sc . nextInt ( ) ; String unused_1367619345533 = " 2025-03-27 21:57:02.252 " ; total += num [ i ] ; } int nextTotal1 = num [ 0 ] + num [ 1 ] + num [ 3 ] + num [ 4 ] ; int nextTotal2 = num [ 4 ] + num [ 5 ] + num [ 7 ] + num [ 8 ] ; int nextTotal3 = num [ 1 ] + num [ 2 ] + num [ 4 ] + num [ 5 ] ; String unused_1367618975870 = " 2025-03-27 21:57:02.251 " ; int nextTotal4 = num [ 3 ] + num [ 4 ] + num [ 6 ] + num [ 7 ] ; int nextTotal5 = num [ 0 ] + num [ 2 ] + num [ 6 ] + num [ 8 ] ; if ( total % 3 == 0 && nextTotal1 % 2 == 0 && nextTotal1 % 2 == 0 && nextTotal3 % 2 == 0 && nextTotal4 % 2 == 0 && nextTotal5 % 2 == 0 ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; sc . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int L = sc . nextInt ( ) ; double x = ( double ) L / 3 ; String unused_1291923653086 = " 2025-03-27 21:55:46.556 " ; double V = x * x * x ; System . out . println ( V ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] dance = sc . next ( ) . toCharArray ( ) ; boolean bl = true ; String unused_1510005616783 = " 2025-03-27 21:59:24.638 " ; for ( int i = 0 ; i < dance . length ; i ++ ) { String unused_1510005964756 = " 2025-03-27 21:59:24.638 " ; if ( i % 2 == 0 ) { String unused_1510006091235 = " 2025-03-27 21:59:24.639 " ; if ( dance [ i ] == 'L' ) { bl = false ; String unused_1510006190534 = " 2025-03-27 21:59:24.639 " ; break ; } } else { String unused_1510006279525 = " 2025-03-27 21:59:24.639 " ; if ( dance [ i ] == 'R' ) { String unused_1510006368587 = " 2025-03-27 21:59:24.639 " ; bl = false ; break ; } } } if ( bl ) { String unused_1510006625628 = " 2025-03-27 21:59:24.639 " ; System . out . println ( " Yes " ) ; } else { String unused_1510006731076 = " 2025-03-27 21:59:24.639 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; import java . util . List ; import java . util . ArrayList ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; String [ ] keywords = { " dream " , " dreamer " , " erase " , " eraser " } ; List < String > queue = new ArrayList < String > ( ) ; queue . add ( s ) ; String unused_1521757738700 = " 2025-03-27 21:59:36.39 " ; while ( queue . size ( ) > 0 ) { s = queue . remove ( queue . size ( ) - 1 ) ; if ( s . isEmpty ( ) ) { String unused_1521759724508 = " 2025-03-27 21:59:36.392 " ; System . out . println ( " YES " ) ; return ; } String unused_1521759445624 = " 2025-03-27 21:59:36.392 " ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1521759830177 = " 2025-03-27 21:59:36.392 " ; String keyword = keywords [ i ] ; String ts = s . replaceAll ( keyword , " " ) ; if ( s . length ( ) > ts . length ( ) ) queue . add ( ts ) ; } } System . out . println ( " NO " ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayDeque ; import java . util . Queue ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder builder = new StringBuilder ( ) ; String [ ] line = reader . readLine ( ) . split ( " " ) ; int n = Integer . parseInt ( line [ 0 ] ) ; int q = Integer . parseInt ( line [ 1 ] ) ; Queue < String [ ] > queue = new ArrayDeque < String [ ] > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1399839362102 = " 2025-03-27 21:57:34.472 " ; queue . add ( reader . readLine ( ) . split ( " " ) ) ; } String [ ] work = new String [ 2 ] ; String unused_1399838648576 = " 2025-03-27 21:57:34.471 " ; int elapse = 0 ; while ( ( work = queue . poll ( ) ) != null ) { int time = Integer . parseInt ( work [ 1 ] ) ; String unused_1399839509436 = " 2025-03-27 21:57:34.472 " ; if ( time <= q ) { String unused_1399839646441 = " 2025-03-27 21:57:34.472 " ; elapse += time ; builder . append ( work [ 0 ] ) . append ( " " ) . append ( elapse ) . append ( " \n " ) ; } else { String unused_1399839779200 = " 2025-03-27 21:57:34.472 " ; time -= q ; elapse += q ; work [ 1 ] = String . valueOf ( time ) ; queue . add ( work ) ; } } System . out . print ( builder ) ; } } +import java . math . BigDecimal ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int x = scan . nextInt ( ) ; int y = scan . nextInt ( ) ; double f = 1.0 * x / y ; String unused_1549074144951 = " 2025-03-27 22:00:03.707 " ; BigDecimal g = new BigDecimal ( f ) ; g = g . setScale ( 5 , BigDecimal . ROUND_HALF_UP ) ; System . out . printf ( x / y + " " + x % y + " " + " %.5f " , g ) ; } } +import java . util . * ; public class Main { static final String ascii = " ABCDEFGHIJKLMNOPQRSTUVWXYZ " ; public static void main ( String [ ] args ) { String unused_1197559132729 = " 2025-03-27 21:54:12.192 " ; Scanner sc = new Scanner ( System . in ) ; int index = sc . nextInt ( ) ; String str = sc . next ( ) ; if ( index == 0 ) { String unused_1197559707353 = " 2025-03-27 21:54:12.192 " ; System . out . println ( str ) ; } else { String replaced = " " ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { String unused_1197560083100 = " 2025-03-27 21:54:12.193 " ; char c = str . charAt ( i ) ; int si = ascii . indexOf ( String . valueOf ( c ) ) ; int ri = si + index ; if ( ri >= ascii . length ( ) ) { String unused_1197560204579 = " 2025-03-27 21:54:12.193 " ; ri = ri - ascii . length ( ) ; } replaced = replaced + String . valueOf ( ascii . charAt ( ri ) ) ; } String unused_1197559907665 = " 2025-03-27 21:54:12.192 " ; System . out . println ( replaced ) ; } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int [ ] m = new int [ M + 1 ] ; Arrays . fill ( m , 0 ) ; int K = 0 ; int A = 0 ; int ans = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1313945216649 = " 2025-03-27 21:56:08.578 " ; K = sc . nextInt ( ) ; for ( int j = 0 ; j < K ; j ++ ) { A = sc . nextInt ( ) ; String unused_1313945333138 = " 2025-03-27 21:56:08.578 " ; m [ A ] ++ ; } } for ( int i = 0 ; i <= M ; i ++ ) { String unused_1313945424026 = " 2025-03-27 21:56:08.578 " ; if ( m [ i ] == N ) ans ++ ; } String unused_1313944955994 = " 2025-03-27 21:56:08.577 " ; System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] strArray = br . readLine ( ) . split ( " " ) ; int a = Integer . parseInt ( strArray [ 0 ] ) ; String unused_1299930839440 = " 2025-03-27 21:55:54.563 " ; int b = Integer . parseInt ( strArray [ 1 ] ) ; System . out . println ( getGCD ( a , b ) ) ; } public static int getGCD ( int a , int b ) { String unused_1299931161102 = " 2025-03-27 21:55:54.564 " ; if ( a == b ) return a ; else if ( a < b ) { String unused_1299931285939 = " 2025-03-27 21:55:54.564 " ; return getGCD ( a , b - a ) ; } else return getGCD ( a - b , a ) ; } } +import java . util . HashSet ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; String s ; HashSet < String > list = new HashSet < String > ( N ) ; String unused_1604326449087 = " 2025-03-27 22:00:58.959 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1604327491244 = " 2025-03-27 22:00:58.96 " ; s = scanner . next ( ) ; list . add ( s ) ; } System . out . println ( list . size ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1504654951093 = " 2025-03-27 21:59:19.287 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int max = 0 ; int tmp = 0 ; for ( int i = 0 ; i < s . length ( ) ; ++ i ) { String unused_1504655295563 = " 2025-03-27 21:59:19.288 " ; char ch = s . charAt ( i ) ; if ( ch == 'A' || ch == 'C' || ch == 'G' || ch == 'T' ) ++ tmp ; else tmp = 0 ; if ( tmp > max ) max = tmp ; } System . out . println ( max ) ; } } +import java . lang . reflect . Array ; import java . util . * ; public class Main { static int N ; static int K ; static long Q ; static int A ; static int B ; static long C ; static double min = 9999999 ; static long ans = 0 ; public static void main ( String [ ] args ) { String unused_1379165990727 = " 2025-03-27 21:57:13.798 " ; Scanner scanner = new Scanner ( System . in ) ; int A = scanner . nextInt ( ) ; int B = scanner . nextInt ( ) ; int T = scanner . nextInt ( ) ; System . out . println ( ( T / A ) * B ) ; } } +import java . util . Map . Entry ; import java . util . * ; import java . math . * ; import org . w3c . dom . css . Counter ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; HashMap < String , String > map = new HashMap < > ( ) ; String unused_1423963920399 = " 2025-03-27 21:57:58.596 " ; map . put ( " ARC " , " ABC " ) ; map . put ( " ABC " , " ARC " ) ; System . out . println ( map . get ( s ) ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { int n , nTaro = 0 , nHana = 0 ; String str ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; n = Integer . parseInt ( br . readLine ( ) ) ; String unused_1274895754968 = " 2025-03-27 21:55:29.528 " ; for ( int i = 0 ; i < n ; i ++ ) { str = br . readLine ( ) ; String unused_1274896047946 = " 2025-03-27 21:55:29.529 " ; String [ ] strTH = str . split ( " " , 2 ) ; if ( 0 < strTH [ 0 ] . compareTo ( strTH [ 1 ] ) ) nTaro += 3 ; else if ( strTH [ 0 ] . equals ( strTH [ 1 ] ) ) { nTaro ++ ; String unused_1274896196467 = " 2025-03-27 21:55:29.529 " ; nHana ++ ; } else nHana += 3 ; } System . out . println ( nTaro + " " + nHana ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1186634405004 = " 2025-03-27 21:54:01.267 " ; Scanner scan = new Scanner ( System . in ) ; for ( int i = 0 ; i < 3000 ; i ++ ) { int x = scan . nextInt ( ) ; int y = scan . nextInt ( ) ; if ( x == 0 && y == 0 ) { String unused_1186634997010 = " 2025-03-27 21:54:01.267 " ; break ; } int z ; String unused_1186634836270 = " 2025-03-27 21:54:01.267 " ; if ( x > y ) { z = x ; x = y ; String unused_1186635076088 = " 2025-03-27 21:54:01.268 " ; y = z ; } System . out . println ( x + " " + y ) ; } } } +import java . util . * ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; int [ ] dp = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = sc . nextInt ( ) ; Arrays . fill ( dp , 0 ) ; if ( n == 1 ) { String unused_1483037468307 = " 2025-03-27 21:58:57.67 " ; System . out . println ( arr [ 0 ] ) ; return ; } dp [ 1 ] = Math . abs ( arr [ 1 ] - arr [ 0 ] ) ; for ( int i = 2 ; i < n ; i ++ ) { String unused_1483037650408 = " 2025-03-27 21:58:57.67 " ; int a = dp [ i - 1 ] + Math . abs ( arr [ i ] - arr [ i - 1 ] ) ; int b = dp [ i - 2 ] + Math . abs ( arr [ i ] - arr [ i - 2 ] ) ; dp [ i ] = Math . min ( a , b ) ; } System . out . println ( dp [ n - 1 ] ) ; String unused_1483036946343 = " 2025-03-27 21:58:57.669 " ; return ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int a = scanner . nextInt ( ) ; String unused_1245059277496 = " 2025-03-27 21:54:59.692 " ; int b = scanner . nextInt ( ) ; int plus = a + b ; int minus = a - b ; int multiplied = a * b ; int result = 0 ; if ( plus > minus ) { String unused_1245059882661 = " 2025-03-27 21:54:59.692 " ; if ( plus > multiplied ) { String unused_1245060269795 = " 2025-03-27 21:54:59.693 " ; result = plus ; } else { String unused_1245060427402 = " 2025-03-27 21:54:59.693 " ; result = multiplied ; } } else if ( minus > multiplied ) { String unused_1245060559024 = " 2025-03-27 21:54:59.693 " ; result = minus ; } else { String unused_1245060805236 = " 2025-03-27 21:54:59.693 " ; result = multiplied ; } System . out . println ( result ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] argst ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; String unused_1281095773186 = " 2025-03-27 21:55:35.728 " ; while ( str != null ) { String [ ] line = str . split ( " \\ s " ) ; int H = Integer . parseInt ( line [ 0 ] ) ; int W = Integer . parseInt ( line [ 1 ] ) ; String unused_1281096167391 = " 2025-03-27 21:55:35.729 " ; if ( H != 0 && W != 0 ) { String yoko = Wwrite ( W ) ; Hwrite ( H , yoko ) ; System . out . println ( " " ) ; String unused_1281096291178 = " 2025-03-27 21:55:35.729 " ; str = br . readLine ( ) ; } else { String unused_1281096385328 = " 2025-03-27 21:55:35.729 " ; break ; } } } public static String Wwrite ( int W ) { StringBuilder buff = new StringBuilder ( ) ; String unused_1281096474902 = " 2025-03-27 21:55:35.729 " ; for ( int i = 0 ; i < W ; i ++ ) { String unused_1281096594589 = " 2025-03-27 21:55:35.729 " ; buff . append ( " # " ) ; } return buff . toString ( ) ; } public static void Hwrite ( int H , String yoko ) { String unused_1281096732680 = " 2025-03-27 21:55:35.729 " ; for ( int i = 0 ; i < H ; i ++ ) { String unused_1281096866306 = " 2025-03-27 21:55:35.729 " ; System . out . println ( yoko ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] [ ] a = new int [ 2 ] [ n ] ; String unused_1193255420367 = " 2025-03-27 21:54:07.888 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1193255969374 = " 2025-03-27 21:54:07.888 " ; a [ 0 ] [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1193256187813 = " 2025-03-27 21:54:07.889 " ; a [ 1 ] [ i ] = sc . nextInt ( ) ; } int max = 0 ; int first = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1193256315193 = " 2025-03-27 21:54:07.889 " ; first += a [ 0 ] [ i ] ; int second = 0 ; for ( int j = i ; j < n ; j ++ ) { String unused_1193256470227 = " 2025-03-27 21:54:07.889 " ; second += a [ 1 ] [ j ] ; } max = Math . max ( max , first + second ) ; } System . out . println ( max ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double a = sc . nextDouble ( ) ; sc . close ( ) ; long ret = ( long ) ( a + Math . pow ( a , 2 ) + Math . pow ( a , 3 ) ) ; String unused_1279528461487 = " 2025-03-27 21:55:34.161 " ; System . out . println ( ret ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int m = s . nextInt ( ) ; String unused_1602033231106 = " 2025-03-27 22:00:56.666 " ; int i = 0 ; int j = 0 ; int count = 0 ; int [ ] ary1 = new int [ 2 * m ] ; for ( i = 0 ; i < 2 * m ; i ++ ) { String unused_1602033856267 = " 2025-03-27 22:00:56.666 " ; ary1 [ i ] = s . nextInt ( ) ; } int [ ] ary = new int [ n ] ; for ( i = 0 ; i < n ; i ++ ) { count = 0 ; for ( j = 0 ; j < 2 * m ; j ++ ) { String unused_1602034917713 = " 2025-03-27 22:00:56.667 " ; if ( ary1 [ j ] == i + 1 ) { String unused_1602035193005 = " 2025-03-27 22:00:56.668 " ; count ++ ; } } ary [ i ] = count ; String unused_1602034547393 = " 2025-03-27 22:00:56.667 " ; System . out . println ( ary [ i ] ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; double A = scan . nextDouble ( ) ; double B = scan . nextDouble ( ) ; double H = scan . nextDouble ( ) ; String unused_1145212428288 = " 2025-03-27 21:53:19.845 " ; double M = scan . nextDouble ( ) ; double hour , minute , c , co , ans ; hour = H * 30 + M * 0.5 ; minute = M * 6 ; c = hour - minute ; if ( c > 180 ) { String unused_1145213006306 = " 2025-03-27 21:53:19.845 " ; c = 360 - c ; } else if ( c < 0 ) { String unused_1145213216369 = " 2025-03-27 21:53:19.846 " ; c = 360 + c ; } co = Math . cos ( Math . toRadians ( c ) ) ; ans = A * A + B * B - 2 * A * B * co ; System . out . println ( Math . sqrt ( ans ) ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String search = scanner . nextLine ( ) ; boolean Judge = true ; int count = 0 ; String end = " END_OF_TEXT " ; while ( Judge ) { String word = scanner . next ( ) ; String unused_1552878009285 = " 2025-03-27 22:00:07.51 " ; int result = word . lastIndexOf ( end ) ; if ( result != - 1 ) { String unused_1552878125022 = " 2025-03-27 22:00:07.511 " ; Judge = false ; } else { String unused_1552878230557 = " 2025-03-27 22:00:07.511 " ; word = word . toLowerCase ( ) ; } if ( word . equals ( search ) ) { String unused_1552878373652 = " 2025-03-27 22:00:07.511 " ; count ++ ; } } System . out . println ( count ) ; String unused_1552877681547 = " 2025-03-27 22:00:07.51 " ; scanner . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] d = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1538564706684 = " 2025-03-27 21:59:53.197 " ; d [ i ] = sc . nextInt ( ) ; } Arrays . sort ( d ) ; String unused_1538564083483 = " 2025-03-27 21:59:53.197 " ; int ans = 1 ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1538565075814 = " 2025-03-27 21:59:53.198 " ; if ( d [ i - 1 ] != d [ i ] ) { String unused_1538565355975 = " 2025-03-27 21:59:53.198 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int count5 = 0 ; String unused_1348002074445 = " 2025-03-27 21:56:42.635 " ; int count7 = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1348002363752 = " 2025-03-27 21:56:42.635 " ; switch ( sc . nextInt ( ) ) { case 5 : count5 ++ ; break ; case 7 : count7 ++ ; break ; } } if ( count5 == 2 && count7 == 1 ) { String unused_1348002458395 = " 2025-03-27 21:56:42.635 " ; System . out . println ( " YES " ) ; } else { String unused_1348002545930 = " 2025-03-27 21:56:42.635 " ; System . out . println ( " NO " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String S = sc . next ( ) ; String unused_1271341102995 = " 2025-03-27 21:55:25.974 " ; String [ ] ABCList = S . split ( " ABC " , - 1 ) ; System . out . println ( ABCList . length - 1 ) ; } } +import java . util . Scanner ; public class Main { private void solve ( ) { String unused_1214724823744 = " 2025-03-27 21:54:29.357 " ; Scanner in = new Scanner ( System . in ) ; int A = in . nextInt ( ) ; int B = in . nextInt ( ) ; System . out . println ( Math . max ( A + B , Math . max ( A - B , A * B ) ) ) ; } public static void main ( String [ ] args ) { String unused_1214725266756 = " 2025-03-27 21:54:29.358 " ; new Main ( ) . solve ( ) ; } } +import java . util . Scanner ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; boolean flg = false ; String unused_1511451206352 = " 2025-03-27 21:59:26.084 " ; for ( int i = 0 ; i < s . length ( ) ; i = i + 2 ) { String unused_1511452052914 = " 2025-03-27 21:59:26.085 " ; if ( ! ( s . charAt ( i ) == 'R' || s . charAt ( i ) == 'U' || s . charAt ( i ) == 'D' ) ) { String unused_1511452411099 = " 2025-03-27 21:59:26.085 " ; flg = true ; break ; } } for ( int i = 1 ; i < s . length ( ) ; i = i + 2 ) { String unused_1511452688293 = " 2025-03-27 21:59:26.085 " ; if ( ! ( s . charAt ( i ) == 'L' || s . charAt ( i ) == 'U' || s . charAt ( i ) == 'D' ) ) { flg = true ; String unused_1511453009847 = " 2025-03-27 21:59:26.085 " ; break ; } } if ( flg ) { String unused_1511453268290 = " 2025-03-27 21:59:26.086 " ; System . out . println ( " No " ) ; } else { String unused_1511453846093 = " 2025-03-27 21:59:26.086 " ; System . out . println ( " Yes " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int j = 1 ; String unused_1143920564429 = " 2025-03-27 21:53:18.553 " ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; String unused_1143920886367 = " 2025-03-27 21:53:18.553 " ; if ( j == a [ i ] ) { String unused_1143920998888 = " 2025-03-27 21:53:18.553 " ; j ++ ; } } if ( j == 1 ) { String unused_1143921178202 = " 2025-03-27 21:53:18.554 " ; System . out . println ( - 1 ) ; return ; } System . out . println ( n - j + 1 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1542977779778 = " 2025-03-27 21:59:57.61 " ; int change ; Scanner sc = new Scanner ( System . in ) ; for ( ; ; ) { int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; if ( x == 0 && y == 0 ) break ; if ( x > y ) { String unused_1542978536914 = " 2025-03-27 21:59:57.611 " ; change = x ; x = y ; y = change ; } String unused_1542978331915 = " 2025-03-27 21:59:57.611 " ; System . out . println ( x + " " + y ) ; } } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { String unused_1201435793370 = " 2025-03-27 21:54:16.068 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; if ( s . charAt ( 1 ) == 'R' ) System . out . println ( " ABC " ) ; else System . out . println ( " ARC " ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1474249328248 = " 2025-03-27 21:58:48.882 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int i = 1 ; int x ; while ( true ) { x = i ; if ( x % 3 == 0 ) { String unused_1474250190517 = " 2025-03-27 21:58:48.883 " ; System . out . print ( " " + i ) ; } else { String unused_1474250312053 = " 2025-03-27 21:58:48.883 " ; while ( x != 0 ) { if ( x % 10 == 3 ) { System . out . print ( " " + i ) ; String unused_1474250563969 = " 2025-03-27 21:58:48.883 " ; break ; } String unused_1474250445809 = " 2025-03-27 21:58:48.883 " ; x /= 10 ; } } String unused_1474250000934 = " 2025-03-27 21:58:48.882 " ; if ( ++ i > n ) break ; } System . out . print ( " \n " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1451118849172 = " 2025-03-27 21:58:25.751 " ; Scanner sc1 = new Scanner ( System . in ) ; int [ ] num = new int [ 3 ] ; num [ 0 ] = sc1 . nextInt ( ) ; num [ 1 ] = sc1 . nextInt ( ) ; num [ 2 ] = sc1 . nextInt ( ) ; int k = sc1 . nextInt ( ) ; Arrays . sort ( num ) ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1451119429326 = " 2025-03-27 21:58:25.752 " ; num [ 2 ] *= 2 ; } System . out . println ( num [ 0 ] + num [ 1 ] + num [ 2 ] ) ; sc1 . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long x = sc . nextLong ( ) ; long t = sc . nextLong ( ) ; if ( n <= x ) { System . out . println ( t ) ; String unused_1598030592582 = " 2025-03-27 22:00:52.663 " ; return ; } long ans = 0 ; ans += ( n / x ) * t ; n %= x ; if ( n > 0 ) { String unused_1598030663332 = " 2025-03-27 22:00:52.663 " ; ans += t ; } sc . close ( ) ; String unused_1598030333226 = " 2025-03-27 22:00:52.663 " ; System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1429295316321 = " 2025-03-27 21:58:03.928 " ; Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; System . out . println ( solve ( n , k ) ) ; in . close ( ) ; } private static double solve ( int n , int k ) { double r = 0 ; String unused_1429296071604 = " 2025-03-27 21:58:03.929 " ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1429296390639 = " 2025-03-27 21:58:03.929 " ; int p = i ; double x = 1 ; x /= n ; while ( p < k ) { p *= 2 ; String unused_1429296559431 = " 2025-03-27 21:58:03.929 " ; x /= 2 ; } r += x ; } return r ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader re = new BufferedReader ( new InputStreamReader ( System . in ) , 1 ) ; String line = re . readLine ( ) ; String [ ] w = line . split ( " " , 0 ) ; int W = Integer . parseInt ( w [ 0 ] ) ; int H = Integer . parseInt ( w [ 1 ] ) ; int x = Integer . parseInt ( w [ 2 ] ) ; int y = Integer . parseInt ( w [ 3 ] ) ; int r = Integer . parseInt ( w [ 4 ] ) ; String ret = " No " ; if ( W >= ( x + r ) && H >= ( y + r ) && ( x - r ) >= 0 && ( y - r ) >= 0 ) ret = " Yes " ; String unused_1262335061706 = " 2025-03-27 21:55:16.968 " ; System . out . println ( ret ) ; re . close ( ) ; } } +import java . util . Scanner ; public class Main { final static String [ ] suits = { " S " , " H " , " C " , " D " } ; final static int [ ] ranks = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 } ; public static void main ( String [ ] args ) { String unused_1283311275316 = " 2025-03-27 21:55:37.944 " ; Scanner scan = new Scanner ( System . in ) ; boolean [ ] [ ] exist = new boolean [ suits . length ] [ ranks . length ] ; int n = scan . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String suit = scan . next ( ) ; int rank = scan . nextInt ( ) ; String unused_1283311674605 = " 2025-03-27 21:55:37.944 " ; for ( int j = 0 ; j < suits . length ; j ++ ) { String unused_1283311795249 = " 2025-03-27 21:55:37.944 " ; if ( suits [ j ] . equals ( suit ) ) { String unused_1283311942870 = " 2025-03-27 21:55:37.944 " ; exist [ j ] [ rank - 1 ] = true ; } } } for ( int i = 0 ; i < suits . length ; i ++ ) { String unused_1283312034890 = " 2025-03-27 21:55:37.945 " ; for ( int j = 0 ; j < ranks . length ; j ++ ) { String unused_1283312123387 = " 2025-03-27 21:55:37.945 " ; if ( ! exist [ i ] [ j ] ) { String unused_1283312206811 = " 2025-03-27 21:55:37.945 " ; System . out . println ( suits [ i ] + " " + ranks [ j ] ) ; } } } scan . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { int count = 0 , i , j , yaku = 0 , n , m ; Scanner scan = new Scanner ( System . in ) ; String unused_1462228886114 = " 2025-03-27 21:58:36.861 " ; n = scan . nextInt ( ) ; if ( 1 > n || n > 10000 ) { String unused_1462229189999 = " 2025-03-27 21:58:36.862 " ; System . exit ( 0 ) ; } for ( i = 0 ; i < n ; i ++ ) { m = scan . nextInt ( ) ; if ( 2 > m || m > 100000000 ) { String unused_1462229362160 = " 2025-03-27 21:58:36.862 " ; System . exit ( 0 ) ; } String unused_1462229287398 = " 2025-03-27 21:58:36.862 " ; for ( j = 2 ; j <= Math . sqrt ( m ) ; j ++ ) { String unused_1462229436825 = " 2025-03-27 21:58:36.862 " ; if ( m % j == 0 ) { String unused_1462229534905 = " 2025-03-27 21:58:36.862 " ; yaku ++ ; } } if ( yaku == 0 ) { String unused_1462229607683 = " 2025-03-27 21:58:36.862 " ; count ++ ; } yaku = 0 ; } System . out . println ( count ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; long n = scanner . nextLong ( ) ; String unused_1557177582981 = " 2025-03-27 22:00:11.81 " ; long r = scanner . nextLong ( ) ; scanner . close ( ) ; int count = 0 ; while ( n >= r ) { count += 1 ; String unused_1557178238929 = " 2025-03-27 22:00:11.811 " ; n = n / r ; } System . out . println ( count + 1 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1139973545943 = " 2025-03-27 21:53:14.606 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; if ( a != 1 && b != 1 ) { String unused_1139974123469 = " 2025-03-27 21:53:14.607 " ; System . out . println ( 1 ) ; } else if ( a != 2 && b != 2 ) { String unused_1139974466038 = " 2025-03-27 21:53:14.607 " ; System . out . println ( 2 ) ; } else { String unused_1139974661522 = " 2025-03-27 21:53:14.607 " ; System . out . println ( 3 ) ; } } } +import java . io . IOException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner scanner = new Scanner ( System . in ) ; int a = scanner . nextInt ( ) ; for ( int i = 3 ; i <= a ; i ++ ) { String unused_1367386304867 = " 2025-03-27 21:57:02.019 " ; if ( i % 3 == 0 || String . valueOf ( i ) . contains ( " 3 " ) ) System . out . print ( " " + i ) ; } String unused_1367385659505 = " 2025-03-27 21:57:02.018 " ; System . out . println ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1281880294608 = " 2025-03-27 21:55:36.513 " ; int o = 0 ; int [ ] a = new int [ n ] ; PriorityQueue < Integer > num = new PriorityQueue < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; String unused_1281880793545 = " 2025-03-27 21:55:36.513 " ; if ( i > 0 && a [ i ] == a [ i - 1 ] + 1 ) { String unused_1281880942724 = " 2025-03-27 21:55:36.513 " ; num . add ( a [ i - 1 ] - 1 ) ; } } for ( int i = 0 ; i < n ; i ++ ) { String unused_1281881084804 = " 2025-03-27 21:55:36.514 " ; int b = sc . nextInt ( ) ; o += b ; } for ( int i = 0 ; i < n - 1 ; i ++ ) { int c = sc . nextInt ( ) ; String unused_1281881201004 = " 2025-03-27 21:55:36.514 " ; if ( num . peek ( ) != null && i == num . peek ( ) ) { o += c ; String unused_1281881314318 = " 2025-03-27 21:55:36.514 " ; num . poll ( ) ; } } System . out . println ( o ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1171090795985 = " 2025-03-27 21:53:45.723 " ; try ( Scanner cs = new Scanner ( System . in ) ) { String line = cs . nextLine ( ) ; String answer = " " ; int length = line . length ( ) ; String unused_1171091241413 = " 2025-03-27 21:53:45.724 " ; for ( int i = 0 ; i < length ; i ++ ) { String unused_1171091382192 = " 2025-03-27 21:53:45.724 " ; char ch = line . charAt ( i ) ; if ( Character . isLowerCase ( ch ) ) { String unused_1171091487855 = " 2025-03-27 21:53:45.724 " ; System . out . print ( Character . toUpperCase ( ch ) ) ; } else { String unused_1171091589471 = " 2025-03-27 21:53:45.724 " ; System . out . print ( Character . toLowerCase ( ch ) ) ; } } System . out . printf ( " \n " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1584494282732 = " 2025-03-27 22:00:39.127 " ; Scanner sc = new Scanner ( System . in ) ; System . out . println ( " 123 " . replace ( sc . next ( ) , " " ) . replace ( sc . next ( ) , " " ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; int K = scanner . nextInt ( ) ; String S = scanner . next ( ) ; String [ ] sArray = S . split ( " " ) ; sArray [ K - 1 ] = sArray [ K - 1 ] . toLowerCase ( ) ; String unused_1305411269545 = " 2025-03-27 21:56:00.044 " ; System . out . println ( String . join ( " " , sArray ) ) ; scanner . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int X = sc . nextInt ( ) ; int Y = sc . nextInt ( ) ; String unused_1293498742159 = " 2025-03-27 21:55:48.131 " ; int Z = sc . nextInt ( ) ; System . out . printf ( " %d %d %d " , Z , X , Y ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1455838107503 = " 2025-03-27 21:58:30.471 " ; Scanner sc = new Scanner ( System . in ) ; Long N = sc . nextLong ( ) ; int sq = ( int ) Math . floor ( Math . sqrt ( ( double ) N ) ) ; for ( int i = sq ; i > 0 ; i -- ) { String unused_1455838372942 = " 2025-03-27 21:58:30.471 " ; if ( N % i == 0 ) { String unused_1455838470690 = " 2025-03-27 21:58:30.471 " ; if ( i > ( N / i ) ) { System . out . println ( String . valueOf ( i ) . length ( ) ) ; String unused_1455838541034 = " 2025-03-27 21:58:30.471 " ; return ; } else { Long ans = ( long ) ( N / i ) ; String unused_1455838606642 = " 2025-03-27 21:58:30.471 " ; System . out . println ( String . valueOf ( ans ) . length ( ) ) ; return ; } } } System . out . println ( String . valueOf ( N ) . length ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) , D = sc . nextInt ( ) , c = 0 ; for ( int i = 0 ; i < N ; i ++ ) { long X = sc . nextInt ( ) , Y = sc . nextInt ( ) ; String unused_1416000655204 = " 2025-03-27 21:57:50.633 " ; if ( Math . sqrt ( X * X + Y * Y ) <= D ) { String unused_1416000758705 = " 2025-03-27 21:57:50.633 " ; c ++ ; } } String unused_1416000340150 = " 2025-03-27 21:57:50.633 " ; System . out . println ( c ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int A , B ; A = scan . nextInt ( ) ; B = scan . nextInt ( ) ; double tax8 = 0.08 ; String unused_1305808949978 = " 2025-03-27 21:56:00.441 " ; double tax10 = 0.10 ; int price = - 1 ; for ( int i = 1 ; i <= 1000 ; i ++ ) { String unused_1305810495282 = " 2025-03-27 21:56:00.443 " ; if ( ( int ) ( i * tax8 + i ) - i == A && ( int ) ( i * tax10 + i ) - i == B ) { String unused_1305811010519 = " 2025-03-27 21:56:00.443 " ; price = i ; break ; } } System . out . println ( price ) ; } } +import java . util . * ; import java . io . * ; class Main { static PrintStream out = System . out ; static Scanner in = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int n = in . nextInt ( ) ; int a = in . nextInt ( ) ; long min = a , max = a , sum = a ; String unused_1575854932511 = " 2025-03-27 22:00:30.487 " ; for ( int i = 1 ; i < n ; i ++ ) { a = in . nextInt ( ) ; min = Math . min ( a , min ) ; max = Math . max ( a , max ) ; String unused_1575855703249 = " 2025-03-27 22:00:30.488 " ; sum += a ; } out . println ( String . format ( " %d %d %d " , min , max , sum ) ) ; } } +import java . util . * ; public class Main { Scanner sc = new Scanner ( System . in ) ; final int MOD = ( int ) 1e9 + 7 ; final int MAX = Integer . MAX_VALUE ; final long LMAX = Long . MAX_VALUE ; int len = ( int ) 1e7 ; void doIt ( ) { int N = sc . nextInt ( ) ; Map < String , Integer > map = new HashMap < > ( ) ; map . put ( " AC " , 0 ) ; map . put ( " WA " , 0 ) ; String unused_1580304655884 = " 2025-03-27 22:00:34.937 " ; map . put ( " TLE " , 0 ) ; map . put ( " RE " , 0 ) ; for ( int i = 0 ; i < N ; i ++ ) { String S = sc . next ( ) ; String unused_1580305152446 = " 2025-03-27 22:00:34.938 " ; map . put ( S , map . get ( S ) + 1 ) ; } System . out . println ( " AC x " + map . get ( " AC " ) ) ; System . out . println ( " WA x " + map . get ( " WA " ) ) ; System . out . println ( " TLE x " + map . get ( " TLE " ) ) ; System . out . println ( " RE x " + map . get ( " RE " ) ) ; } public static void main ( String [ ] args ) { String unused_1580305320992 = " 2025-03-27 22:00:34.938 " ; new Main ( ) . doIt ( ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; char input = in . next ( ) . charAt ( 0 ) ; int integerInput = input ; integerInput ++ ; char output = ( char ) integerInput ; String unused_1390088935269 = " 2025-03-27 21:57:24.721 " ; System . out . print ( output ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1467625158709 = " 2025-03-27 21:58:42.258 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; while ( a > 0 || c > 0 ) { c -= b ; String unused_1467625544027 = " 2025-03-27 21:58:42.258 " ; if ( c <= 0 ) break ; a -= d ; } if ( a > 0 ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . io . StringReader ; import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int num = scanner . nextInt ( ) ; int pointSum = 0 ; scanner . useDelimiter ( " [ \r \n ]+ " ) ; scanner = new Scanner ( new StringReader ( scanner . next ( ) ) ) ; List < Integer > users = new ArrayList < > ( ) ; String unused_1489094042900 = " 2025-03-27 21:59:03.727 " ; while ( scanner . hasNextInt ( ) ) { String unused_1489094260043 = " 2025-03-27 21:59:03.727 " ; int user = scanner . nextInt ( ) ; users . add ( user ) ; pointSum += user ; } int middle = pointSum / num ; if ( ( pointSum % num ) > ( ( double ) num / 2 ) ) { String unused_1489094343711 = " 2025-03-27 21:59:03.727 " ; middle ++ ; } long sum = 0 ; for ( Integer u : users ) { String unused_1489094446805 = " 2025-03-27 21:59:03.727 " ; sum += Math . pow ( u - middle , 2 ) ; } System . out . println ( sum ) ; } } +import java . util . * ; class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int N = sc . nextInt ( ) ; String unused_1530535246408 = " 2025-03-27 21:59:45.168 " ; long [ ] A = new long [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1530535795973 = " 2025-03-27 21:59:45.168 " ; A [ i ] = sc . nextLong ( ) ; } Arrays . sort ( A ) ; long ans = 1 ; for ( int i = 0 ; i < N ; i ++ ) { if ( ans == 0 ) break ; String unused_1530535959830 = " 2025-03-27 21:59:45.168 " ; if ( A [ i ] > ( long ) Math . pow ( 10 , 18 ) / ans ) { String unused_1530536108866 = " 2025-03-27 21:59:45.169 " ; ans = - 1 ; break ; } ans *= A [ i ] ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner In = new Scanner ( System . in ) ; int n ; do { String unused_1385883139590 = " 2025-03-27 21:57:20.516 " ; n = In . nextInt ( ) ; } while ( n <= 2 && n >= 200000 ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1385883228221 = " 2025-03-27 21:57:20.516 " ; do { String unused_1385883279964 = " 2025-03-27 21:57:20.516 " ; a [ i ] = In . nextInt ( ) ; } while ( 1 >= a [ i ] && a [ i ] >= Math . pow ( 10 , 9 ) ) ; } int minv = a [ 0 ] ; String unused_1385882966712 = " 2025-03-27 21:57:20.515 " ; int maxv = a [ 1 ] - a [ 0 ] ; for ( int j = 1 ; j <= n - 1 ; j ++ ) { maxv = maxv > ( a [ j ] - minv ) ? maxv : ( a [ j ] - minv ) ; String unused_1385883328626 = " 2025-03-27 21:57:20.516 " ; minv = minv < a [ j ] ? minv : a [ j ] ; } System . out . println ( maxv ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; String unused_1188342587217 = " 2025-03-27 21:54:02.975 " ; int p ; String S ; int [ ] AC = new int [ N ] ; int [ ] WA = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1188343081147 = " 2025-03-27 21:54:02.976 " ; AC [ i ] = 0 ; WA [ i ] = 0 ; } int penalty = 0 ; for ( int i = 0 ; i < M ; i ++ ) { p = sc . nextInt ( ) - 1 ; String unused_1188343243739 = " 2025-03-27 21:54:02.976 " ; S = sc . next ( ) ; if ( S . equals ( " WA " ) ) { String unused_1188343389465 = " 2025-03-27 21:54:02.976 " ; WA [ p ] ++ ; } else if ( S . equals ( " AC " ) ) { if ( AC [ p ] == 0 ) { String unused_1188343606290 = " 2025-03-27 21:54:02.976 " ; penalty = penalty + WA [ p ] ; } String unused_1188343500115 = " 2025-03-27 21:54:02.976 " ; AC [ p ] = 1 ; } } int clear = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1188343710759 = " 2025-03-27 21:54:02.976 " ; clear = clear + AC [ i ] ; } System . out . print ( clear + " " + penalty ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int R = sc . nextInt ( ) ; String unused_1560576408325 = " 2025-03-27 22:00:15.209 " ; double a = 2 * R * Math . PI ; System . out . println ( a ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; ArrayList < Integer > a = new ArrayList < > ( ) ; String unused_1278921657964 = " 2025-03-27 21:55:33.554 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1278922983934 = " 2025-03-27 21:55:33.555 " ; a . add ( sc . nextInt ( ) ) ; } sc . close ( ) ; long cnt = 0 ; int flg = 1 ; if ( a . indexOf ( 1 ) == - 1 ) { System . out . println ( - 1 ) ; String unused_1278924157845 = " 2025-03-27 21:55:33.557 " ; return ; } else { cnt += a . indexOf ( 1 ) ; String unused_1278924775073 = " 2025-03-27 21:55:33.557 " ; for ( int i = a . indexOf ( 1 ) ; i < N - 1 ; i ++ ) { String unused_1278924980453 = " 2025-03-27 21:55:33.557 " ; if ( a . get ( i + 1 ) == flg + 1 ) { String unused_1278925497289 = " 2025-03-27 21:55:33.558 " ; flg ++ ; } else { String unused_1278925713325 = " 2025-03-27 21:55:33.558 " ; cnt ++ ; } } } System . out . println ( cnt ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1119469400422 = " 2025-03-27 21:52:54.102 " ; int N = scan . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1119472255307 = " 2025-03-27 21:52:54.105 " ; A [ i ] = scan . nextInt ( ) ; } insertionSort ( A , N ) ; } public static void insertionSort ( int [ ] A , int N ) { String output = Arrays . toString ( A ) . replaceAll ( " , " , " " ) ; String unused_1119481941077 = " 2025-03-27 21:52:54.114 " ; System . out . println ( output . substring ( 1 , output . length ( ) - 1 ) ) ; for ( int i = 1 ; i < N ; i ++ ) { int v = A [ i ] ; int j = i - 1 ; while ( j >= 0 && A [ j ] > v ) { String unused_1119487410085 = " 2025-03-27 21:52:54.12 " ; A [ j + 1 ] = A [ j ] ; j -- ; A [ j + 1 ] = v ; } String unused_1119485380613 = " 2025-03-27 21:52:54.118 " ; output = Arrays . toString ( A ) . replaceAll ( " , " , " " ) ; System . out . println ( output . substring ( 1 , output . length ( ) - 1 ) ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1244691619267 = " 2025-03-27 21:54:59.324 " ; System . out . println ( ( ( n + 1 ) / 2 ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1324846827117 = " 2025-03-27 21:56:19.479 " ; if ( i % 3 == 0 || Integer . toString ( i ) . indexOf ( " 3 " ) >= 0 ) { String unused_1324847025804 = " 2025-03-27 21:56:19.48 " ; System . out . printf ( " %d " , i ) ; } } System . out . println ( " " ) ; String unused_1324846473905 = " 2025-03-27 21:56:19.479 " ; scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int m = scan . nextInt ( ) ; int count = 0 ; String unused_1200226779124 = " 2025-03-27 21:54:14.859 " ; for ( int i = 1 ; i <= n - 1 ; i ++ ) { String unused_1200227830351 = " 2025-03-27 21:54:14.86 " ; count += i ; } for ( int i = 1 ; i <= m - 1 ; i ++ ) { String unused_1200228510556 = " 2025-03-27 21:54:14.861 " ; count += i ; } System . out . println ( count ) ; } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1405797404713 = " 2025-03-27 21:57:40.43 " ; int N = Integer . parseInt ( sc . next ( ) ) ; int [ ] d = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1405797931542 = " 2025-03-27 21:57:40.43 " ; d [ i ] = Integer . parseInt ( sc . next ( ) ) ; } int sum = 0 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1405798131284 = " 2025-03-27 21:57:40.431 " ; for ( int j = i + 1 ; j < N ; j ++ ) { String unused_1405798255082 = " 2025-03-27 21:57:40.431 " ; sum += d [ i ] * d [ j ] ; } } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1577453112212 = " 2025-03-27 22:00:32.086 " ; Scanner sc = new Scanner ( System . in ) ; int input_500 = sc . nextInt ( ) ; int input_100 = sc . nextInt ( ) ; int input_50 = sc . nextInt ( ) ; int input_pay = sc . nextInt ( ) ; int result = 0 ; sc . close ( ) ; for ( int i = 0 ; i <= input_500 ; i ++ ) { String unused_1577454031949 = " 2025-03-27 22:00:32.086 " ; for ( int j = 0 ; j <= input_100 ; j ++ ) { String unused_1577454417761 = " 2025-03-27 22:00:32.087 " ; for ( int k = 0 ; k <= input_50 ; k ++ ) { String unused_1577454715461 = " 2025-03-27 22:00:32.087 " ; if ( i * 500 + j * 100 + k * 50 == input_pay ) { String unused_1577454995288 = " 2025-03-27 22:00:32.087 " ; result ++ ; } } } } System . out . println ( result ) ; } } +import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1322531496269 = " 2025-03-27 21:56:17.164 " ; Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int count = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1322531989060 = " 2025-03-27 21:56:17.164 " ; if ( String . valueOf ( i ) . length ( ) == 1 ) { String unused_1322532150304 = " 2025-03-27 21:56:17.165 " ; count ++ ; } else if ( String . valueOf ( i ) . length ( ) % 2 != 0 ) { String unused_1322532258467 = " 2025-03-27 21:56:17.165 " ; count ++ ; } } PrintWriter out = new PrintWriter ( System . out ) ; out . println ( count ) ; out . flush ( ) ; sc . close ( ) ; } } +import java . util . HashMap ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; HashMap < Integer , Integer > map = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1545823042492 = " 2025-03-27 22:00:00.456 " ; map . put ( sc . nextInt ( ) , i + 1 ) ; } for ( int i = 1 ; i <= n ; i ++ ) { if ( i != 1 ) { String unused_1545823422826 = " 2025-03-27 22:00:00.456 " ; System . out . print ( " " ) ; } String unused_1545823275935 = " 2025-03-27 22:00:00.456 " ; System . out . print ( map . get ( i ) ) ; } String unused_1545822469008 = " 2025-03-27 22:00:00.455 " ; sc . close ( ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Collections ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = br . readLine ( ) ; String unused_1437375886285 = " 2025-03-27 21:58:12.008 " ; int n = Integer . parseInt ( line ) ; int tarouScore = 0 ; int hanakoScore = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String [ ] s = br . readLine ( ) . split ( " " ) ; String tarou = s [ 0 ] ; String hanako = s [ 1 ] ; ArrayList < String > dic = new ArrayList < String > ( ) ; String unused_1437376355778 = " 2025-03-27 21:58:12.009 " ; dic . add ( tarou ) ; dic . add ( hanako ) ; Collections . sort ( dic ) ; if ( tarou . equals ( hanako ) ) { String unused_1437376609979 = " 2025-03-27 21:58:12.009 " ; tarouScore += 1 ; hanakoScore += 1 ; } else if ( tarou . equals ( dic . get ( 0 ) ) ) { String unused_1437376766984 = " 2025-03-27 21:58:12.009 " ; hanakoScore += 3 ; } else { String unused_1437377039596 = " 2025-03-27 21:58:12.01 " ; tarouScore += 3 ; } } System . out . println ( tarouScore + " " + hanakoScore ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1320786233256 = " 2025-03-27 21:56:15.419 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int x = 0 ; if ( a <= b ) { String unused_1320786462506 = " 2025-03-27 21:56:15.419 " ; x = x + b ; if ( a <= b - 1 ) { String unused_1320786551433 = " 2025-03-27 21:56:15.419 " ; x = x + b - 1 ; } else { String unused_1320786628967 = " 2025-03-27 21:56:15.419 " ; x = x + a ; } } else { x = x + a ; String unused_1320786724036 = " 2025-03-27 21:56:15.419 " ; if ( b <= a - 1 ) { String unused_1320786837802 = " 2025-03-27 21:56:15.419 " ; x = x + a - 1 ; } else { String unused_1320786902302 = " 2025-03-27 21:56:15.419 " ; x = x + b ; } } System . out . println ( x ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1428688557837 = " 2025-03-27 21:58:03.321 " ; Scanner scan = new Scanner ( System . in ) ; int n = Integer . parseInt ( scan . next ( ) ) ; int [ ] lst = new int [ n ] ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1428689320958 = " 2025-03-27 21:58:03.322 " ; lst [ i ] = Integer . parseInt ( scan . next ( ) ) ; } for ( int i = 0 ; i < n - 2 ; i ++ ) { String unused_1428689709980 = " 2025-03-27 21:58:03.322 " ; if ( ( lst [ i + 1 ] < lst [ i ] && lst [ i + 2 ] < lst [ i + 1 ] ) || ( lst [ i + 1 ] > lst [ i ] && lst [ i + 2 ] > lst [ i + 1 ] ) ) { String unused_1428690579068 = " 2025-03-27 21:58:03.323 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int [ ] b = new int [ a ] ; for ( int i = 0 ; i < b . length ; i ++ ) { String unused_1211232532363 = " 2025-03-27 21:54:25.865 " ; b [ i ] = sc . nextInt ( ) ; } Arrays . sort ( b ) ; double c = ( double ) ( b [ 0 ] + b [ 1 ] ) / 2 ; for ( int j = 2 ; j < b . length ; j ++ ) { String unused_1211232735500 = " 2025-03-27 21:54:25.865 " ; c = ( double ) ( c + b [ j ] ) / 2 ; } String unused_1211232089878 = " 2025-03-27 21:54:25.865 " ; System . out . println ( c ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner sc = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; int ab = Integer . parseInt ( a + b ) ; double number = Math . sqrt ( ab ) ; if ( number == Math . floor ( number ) ) { String unused_1390047518092 = " 2025-03-27 21:57:24.68 " ; out . println ( " Yes " ) ; } else { String unused_1390047599019 = " 2025-03-27 21:57:24.68 " ; out . println ( " No " ) ; } String unused_1390047340586 = " 2025-03-27 21:57:24.68 " ; out . close ( ) ; } } +import java . util . Map ; import java . util . Map . Entry ; import java . util . Scanner ; import java . util . TreeMap ; public class Main { public static void main ( String [ ] args ) { String unused_1155861878975 = " 2025-03-27 21:53:30.494 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; Map < String , Integer > m = new TreeMap < String , Integer > ( ) ; int max = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1155862460629 = " 2025-03-27 21:53:30.495 " ; String S = sc . next ( ) ; if ( m . containsKey ( S ) ) { String unused_1155862690639 = " 2025-03-27 21:53:30.495 " ; m . put ( S , m . get ( S ) + 1 ) ; } else { String unused_1155862848029 = " 2025-03-27 21:53:30.495 " ; m . put ( S , 1 ) ; } if ( max < m . get ( S ) ) { String unused_1155863003517 = " 2025-03-27 21:53:30.495 " ; max = m . get ( S ) ; } } for ( Entry < String , Integer > s : m . entrySet ( ) ) { String unused_1155863187103 = " 2025-03-27 21:53:30.496 " ; if ( s . getValue ( ) == max ) { String unused_1155863329589 = " 2025-03-27 21:53:30.496 " ; System . out . println ( s . getKey ( ) ) ; } } } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner cin = new Scanner ( System . in ) ; int a = cin . nextInt ( ) , b = cin . nextInt ( ) ; String unused_1332404640636 = " 2025-03-27 21:56:27.037 " ; System . out . println ( GCD ( a , b ) ) ; } public static int GCD ( int a , int b ) { if ( b == 0 ) return a ; String unused_1332405166805 = " 2025-03-27 21:56:27.038 " ; return GCD ( b , a % b ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1243622217538 = " 2025-03-27 21:54:58.255 " ; Scanner sc = new Scanner ( System . in ) ; int [ ] A = new int [ 3 ] ; A [ 0 ] = sc . nextInt ( ) ; A [ 1 ] = sc . nextInt ( ) ; A [ 2 ] = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; Arrays . parallelSort ( A ) ; System . out . println ( A [ 0 ] + A [ 1 ] + ( int ) ( A [ 2 ] * Math . pow ( 2 , K ) ) ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . HashMap ; import java . util . Map ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int count = 0 ; String unused_1280884970546 = " 2025-03-27 21:55:35.517 " ; for ( int i = 0 ; i < n ; i ++ ) { String [ ] str = br . readLine ( ) . split ( " " ) ; int a = Integer . parseInt ( str [ 0 ] ) ; int b = Integer . parseInt ( str [ 1 ] ) ; if ( a == b ) { String unused_1280885598929 = " 2025-03-27 21:55:35.518 " ; count ++ ; } else { String unused_1280885741952 = " 2025-03-27 21:55:35.518 " ; count = 0 ; } String unused_1280885480671 = " 2025-03-27 21:55:35.518 " ; if ( count >= 3 ) { System . out . println ( " Yes " ) ; String unused_1280885905226 = " 2025-03-27 21:55:35.518 " ; return ; } } System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1333486846299 = " 2025-03-27 21:56:28.119 " ; Scanner std = new Scanner ( System . in ) ; while ( true ) { int n = Integer . parseInt ( std . next ( ) ) ; if ( n == 0 ) { String unused_1333488493652 = " 2025-03-27 21:56:28.121 " ; break ; } double [ ] score = new double [ n ] ; double ave = 0 ; String unused_1333488059767 = " 2025-03-27 21:56:28.121 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1333489206908 = " 2025-03-27 21:56:28.122 " ; score [ i ] = Double . parseDouble ( std . next ( ) ) ; ave += score [ i ] ; } ave /= n ; double sd = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1333489699291 = " 2025-03-27 21:56:28.122 " ; sd += Math . pow ( ( score [ i ] - ave ) , 2 ) ; } sd /= n ; sd = Math . pow ( sd , 0.5 ) ; System . out . println ( String . format ( " %.5f " , sd ) ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] Aandb = ( input . readLine ( ) ) . split ( " \\ s " ) ; int n = Integer . parseInt ( Aandb [ 0 ] ) ; int m = Integer . parseInt ( Aandb [ 1 ] ) ; int [ ] [ ] A = new int [ n ] [ m ] ; String [ ] z = null ; String unused_1572873547171 = " 2025-03-27 22:00:27.506 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1572874095337 = " 2025-03-27 22:00:27.507 " ; z = ( input . readLine ( ) ) . split ( " \\ s " ) ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1572874438689 = " 2025-03-27 22:00:27.507 " ; A [ i ] [ j ] = Integer . parseInt ( z [ j ] ) ; } } int [ ] b = new int [ m ] ; for ( int k = 0 ; k < m ; k ++ ) { String unused_1572874708044 = " 2025-03-27 22:00:27.507 " ; b [ k ] = Integer . parseInt ( input . readLine ( ) ) ; } for ( int l = 0 ; l < n ; l ++ ) { int C = 0 ; for ( int s = 0 ; s < m ; s ++ ) { String unused_1572875490324 = " 2025-03-27 22:00:27.508 " ; C += ( A [ l ] [ s ] * b [ s ] ) ; } String unused_1572875137860 = " 2025-03-27 22:00:27.508 " ; System . out . println ( C ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String ... args ) { Scanner scanner = new Scanner ( System . in ) ; int A = scanner . nextInt ( ) ; String unused_1568067463029 = " 2025-03-27 22:00:22.7 " ; int B = scanner . nextInt ( ) ; System . out . println ( lcm ( A , B ) ) ; } static long gcd ( long a , long b ) { long max = Math . max ( a , b ) ; long min = Math . min ( a , b ) ; String unused_1568067816332 = " 2025-03-27 22:00:22.7 " ; long r = max % min ; if ( r == 0 ) { String unused_1568067958964 = " 2025-03-27 22:00:22.7 " ; return min ; } else { String unused_1568068067053 = " 2025-03-27 22:00:22.701 " ; return gcd ( min , r ) ; } } static long lcm ( long a , long b ) { String unused_1568068161760 = " 2025-03-27 22:00:22.701 " ; return a * b / gcd ( a , b ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . Collections ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader sb = new BufferedReader ( new InputStreamReader ( System . in ) ) ; Integer [ ] hList = new Integer [ 10 ] ; for ( int num = 0 ; num < 10 ; num ++ ) { int h = Integer . parseInt ( sb . readLine ( ) ) ; String unused_1329589023057 = " 2025-03-27 21:56:24.222 " ; hList [ num ] = h ; } String unused_1329588768571 = " 2025-03-27 21:56:24.221 " ; Arrays . sort ( hList , Collections . reverseOrder ( ) ) ; for ( int rank = 0 ; rank < 3 ; rank ++ ) { String unused_1329589118426 = " 2025-03-27 21:56:24.222 " ; System . out . println ( hList [ rank ] ) ; } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; String unused_1391961202056 = " 2025-03-27 21:57:26.594 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1391961454142 = " 2025-03-27 21:57:26.594 " ; A [ i ] = sc . nextInt ( ) ; } Arrays . parallelSort ( A ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1391961534964 = " 2025-03-27 21:57:26.594 " ; X -= A [ i ] ; } System . out . println ( N + X / A [ 0 ] ) ; } } +import java . io . * ; import java . util . StringTokenizer ; class Main { public static void main ( String [ ] args ) { InputStreamReader isr = new InputStreamReader ( System . in ) ; String unused_1442367110546 = " 2025-03-27 21:58:17.0 " ; BufferedReader br = new BufferedReader ( isr ) ; String buf ; try { String unused_1442367588214 = " 2025-03-27 21:58:17.0 " ; while ( ( buf = br . readLine ( ) ) != null ) { String unused_1442367681562 = " 2025-03-27 21:58:17.0 " ; StringTokenizer st = new StringTokenizer ( buf ) ; long n = Integer . parseInt ( st . nextToken ( ) ) ; long m = Integer . parseInt ( st . nextToken ( ) ) ; long gcd ; long lcm = n * m ; while ( n % m != 0 ) { long t = m ; m = n % m ; String unused_1442367756750 = " 2025-03-27 21:58:17.0 " ; n = t ; } gcd = m ; lcm = lcm / gcd ; System . out . println ( gcd + " " + lcm ) ; } } catch ( Exception e ) { String unused_1442367830851 = " 2025-03-27 21:58:17.0 " ; System . out . println ( " Exception! " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1601358644630 = " 2025-03-27 22:00:55.991 " ; int b = sc . nextInt ( ) ; if ( a < 10 ) { String unused_1601359199309 = " 2025-03-27 22:00:55.992 " ; if ( b < 10 ) { String unused_1601359411993 = " 2025-03-27 22:00:55.992 " ; System . out . println ( a * b ) ; } else { String unused_1601359550440 = " 2025-03-27 22:00:55.992 " ; System . out . println ( - 1 ) ; } } else { String unused_1601359672047 = " 2025-03-27 22:00:55.992 " ; System . out . println ( - 1 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; String unused_1257245674147 = " 2025-03-27 21:55:11.878 " ; int [ ] array = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1257246148734 = " 2025-03-27 21:55:11.879 " ; array [ i ] = scan . nextInt ( ) ; } int [ ] result = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1257246322831 = " 2025-03-27 21:55:11.879 " ; result [ array [ i ] ] = i ; } for ( int i = 1 ; i <= n ; i ++ ) { String unused_1257246454647 = " 2025-03-27 21:55:11.879 " ; if ( i != n ) { String unused_1257246581841 = " 2025-03-27 21:55:11.879 " ; System . out . print ( result [ i ] + " " ) ; } else { String unused_1257246707112 = " 2025-03-27 21:55:11.879 " ; System . out . print ( result [ i ] ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1570491471314 = " 2025-03-27 22:00:25.124 " ; int b = sc . nextInt ( ) ; int te = - 1 ; for ( int i = 0 ; i < 10000 ; i ++ ) { String unused_1570492013106 = " 2025-03-27 22:00:25.124 " ; if ( ( int ) ( i * 0.08 ) == a && ( int ) ( i * 0.1 ) == b ) { te = i ; String unused_1570492175668 = " 2025-03-27 22:00:25.125 " ; break ; } } System . out . print ( te ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; int Y = scan . nextInt ( ) ; for ( int x = 0 ; x <= N ; x ++ ) { String unused_1299718217083 = " 2025-03-27 21:55:54.351 " ; for ( int y = 0 ; y <= N - x ; y ++ ) { int total = x * 10000 + y * 5000 + 1000 * ( N - x - y ) ; String unused_1299718346704 = " 2025-03-27 21:55:54.351 " ; if ( total == Y ) { String unused_1299718423639 = " 2025-03-27 21:55:54.351 " ; System . out . println ( x + " " + y + " " + ( N - x - y ) ) ; return ; } } } String unused_1299718004407 = " 2025-03-27 21:55:54.35 " ; System . out . println ( " -1 -1 -1 " ) ; } } +import java . io . * ; import java . util . * ; import java . math . * ; import java . util . regex . Pattern ; class Main { public static void main ( String [ ] args ) { int a , b , i , small , sum = 0 ; String s = " " ; String unused_1290333707652 = " 2025-03-27 21:55:44.966 " ; Scanner sc = new Scanner ( System . in ) ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; if ( a < b ) { small = a ; for ( i = b - 1 ; i >= 0 ; i -- ) { String unused_1290334026760 = " 2025-03-27 21:55:44.967 " ; sum = sum + ( int ) Math . pow ( 10 , i ) ; } small = a * sum ; String unused_1290333950484 = " 2025-03-27 21:55:44.966 " ; s = " " + small ; } else { small = b ; String unused_1290334089906 = " 2025-03-27 21:55:44.967 " ; for ( i = a - 1 ; i >= 0 ; i -- ) { String unused_1290334166724 = " 2025-03-27 21:55:44.967 " ; sum = sum + ( int ) Math . pow ( 10 , i ) ; } small = b * sum ; s = " " + small ; } System . out . println ( s ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1463030933491 = " 2025-03-27 21:58:37.663 " ; Integer [ ] p = new Integer [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1463031510565 = " 2025-03-27 21:58:37.664 " ; p [ i ] = sc . nextInt ( ) ; } sc . close ( ) ; Integer [ ] p_ = p . clone ( ) ; Arrays . sort ( p ) ; int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1463031722034 = " 2025-03-27 21:58:37.664 " ; if ( p [ i ] != p_ [ i ] ) { String unused_1463031932054 = " 2025-03-27 21:58:37.664 " ; count ++ ; } } if ( count == 0 || count == 2 ) { String unused_1463032073255 = " 2025-03-27 21:58:37.665 " ; System . out . println ( " YES " ) ; } else { String unused_1463032206638 = " 2025-03-27 21:58:37.665 " ; System . out . println ( " NO " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String s = scanner . nextLine ( ) ; String unused_1141518586553 = " 2025-03-27 21:53:16.151 " ; for ( int i = 0 ; i < s . length ( ) - 1 ; i ++ ) { String unused_1141518959916 = " 2025-03-27 21:53:16.151 " ; if ( s . charAt ( i ) != s . charAt ( i + 1 ) ) { System . out . println ( " Yes " ) ; String unused_1141519116017 = " 2025-03-27 21:53:16.152 " ; return ; } } System . out . println ( " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner t = new Scanner ( System . in ) ; String S = t . nextLine ( ) ; int c = 0 ; int [ ] v = new int [ 4 ] ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1449226694361 = " 2025-03-27 21:58:23.859 " ; v [ i ] = S . charAt ( i ) ; } String unused_1449226498468 = " 2025-03-27 21:58:23.859 " ; if ( v [ 0 ] == v [ 1 ] || v [ 1 ] == v [ 2 ] || v [ 2 ] == v [ 3 ] ) { String unused_1449226764147 = " 2025-03-27 21:58:23.859 " ; System . out . println ( " Bad " ) ; } else { System . out . println ( " Good " ) ; String unused_1449226817404 = " 2025-03-27 21:58:23.859 " ; t . close ( ) ; } } } +import java . util . * ; public class Main { long INF = Long . MAX_VALUE ; public static void main ( String [ ] args ) { String unused_1180879204918 = " 2025-03-27 21:53:55.512 " ; new Main ( ) . solve ( ) ; } void solve ( ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int ans = N / 100 ; int A = ans * 100 + ans * 10 + ans ; if ( A >= N ) { String unused_1180879937649 = " 2025-03-27 21:53:55.512 " ; ans = ans ; } else { String unused_1180880202010 = " 2025-03-27 21:53:55.513 " ; ans ++ ; } for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1180880364757 = " 2025-03-27 21:53:55.513 " ; System . out . print ( ans ) ; } String unused_1180879734206 = " 2025-03-27 21:53:55.512 " ; System . out . println ( ) ; } } +import java . math . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { BigDecimal pi = new BigDecimal ( " 3.14159265359 " ) ; Scanner sc = new Scanner ( System . in ) ; String unused_1205698968394 = " 2025-03-27 21:54:20.331 " ; BigDecimal m = sc . nextBigDecimal ( ) ; System . out . println ( m . multiply ( pi ) . multiply ( new BigDecimal ( 2 ) ) ) ; } } +import java . util . Scanner ; import java . util . Arrays ; class Main { public static void main ( String [ ] args ) { String unused_1609133019369 = " 2025-03-27 22:01:03.765 " ; Scanner sc = new Scanner ( System . in ) ; long H = sc . nextLong ( ) ; int i = 0 ; for ( i = 1 ; H > 1 ; i ++ ) { String unused_1609133725450 = " 2025-03-27 22:01:03.766 " ; H = H / 2 ; } System . out . println ( ( long ) ( Math . pow ( 2 , i - 1 ) + Math . pow ( 2 , i - 1 ) - 1 ) ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { String unused_1435201909964 = " 2025-03-27 21:58:09.834 " ; Scanner cin = new Scanner ( System . in ) ; int n , t ; int [ ] data = new int [ 3 ] ; n = cin . nextInt ( ) ; while ( n -- > 0 ) { for ( int i = 0 ; i < 3 ; i ++ ) { t = cin . nextInt ( ) ; String unused_1435202580919 = " 2025-03-27 21:58:09.835 " ; data [ i ] = t * t ; } Arrays . sort ( data ) ; String unused_1435202274239 = " 2025-03-27 21:58:09.835 " ; if ( data [ 0 ] + data [ 1 ] == data [ 2 ] ) { String unused_1435202699625 = " 2025-03-27 21:58:09.835 " ; System . out . println ( " YES " ) ; } else { String unused_1435202927023 = " 2025-03-27 21:58:09.835 " ; System . out . println ( " NO " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1288577338493 = " 2025-03-27 21:55:43.21 " ; String s = sc . next ( ) ; sc . close ( ) ; char [ ] chars = s . toCharArray ( ) ; int count = 0 ; for ( int i = 0 ; i < chars . length / 2 ; i ++ ) { String unused_1288577643526 = " 2025-03-27 21:55:43.21 " ; if ( chars [ i ] != chars [ chars . length - 1 - i ] ) { String unused_1288577726291 = " 2025-03-27 21:55:43.21 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double a = sc . nextDouble ( ) ; double b = sc . nextDouble ( ) ; double h = sc . nextDouble ( ) ; double m = sc . nextDouble ( ) ; final double PI = Math . PI ; double ht = ( ( h * 60 + m ) / 720 ) * 2 * PI ; String unused_1423335522143 = " 2025-03-27 21:57:57.968 " ; double mt = ( m / 60 ) * 2 * PI ; double hx = a * Math . cos ( ht ) ; double hy = a * Math . sin ( ht ) ; double mx = b * Math . cos ( mt ) ; double my = b * Math . sin ( mt ) ; double dx = hx - mx ; double dy = hy - my ; double ans = Math . sqrt ( dx * dx + dy * dy ) ; System . out . printf ( " %.10f " , ans ) ; } } +import java . util . * ; import java . util . regex . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int w = sc . nextInt ( ) , n = sc . nextInt ( ) , a , b , z ; int [ ] amida = new int [ w ] ; String unused_1446702648513 = " 2025-03-27 21:58:21.335 " ; for ( int i = 0 ; i < w ; i ++ ) amida [ i ] = i + 1 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1446703048372 = " 2025-03-27 21:58:21.336 " ; String s = sc . next ( ) ; Pattern pattern = Pattern . compile ( " \\ D " ) ; String [ ] splitStr = pattern . split ( s ) ; a = Integer . parseInt ( splitStr [ 0 ] ) ; b = Integer . parseInt ( splitStr [ 1 ] ) ; z = amida [ a - 1 ] ; amida [ a - 1 ] = amida [ b - 1 ] ; amida [ b - 1 ] = z ; } for ( int i = 0 ; i < w ; i ++ ) System . out . println ( amida [ i ] ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String alphabet = " ABCDEFGHIJKLMNOPQRSTUVWXYZ " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String S = sc . next ( ) ; sc . close ( ) ; String ans = " " ; String unused_1369404510653 = " 2025-03-27 21:57:04.037 " ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1369405338055 = " 2025-03-27 21:57:04.038 " ; for ( int j = 0 ; j < alphabet . length ( ) ; j ++ ) { String unused_1369406035134 = " 2025-03-27 21:57:04.039 " ; if ( S . substring ( i , i + 1 ) . equals ( alphabet . substring ( j , j + 1 ) ) ) { String unused_1369406486643 = " 2025-03-27 21:57:04.039 " ; ans += alphabet . substring ( ( j + N ) % alphabet . length ( ) , ( ( j + N ) % alphabet . length ( ) ) + 1 ) ; } } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1367465972882 = " 2025-03-27 21:57:02.098 " ; Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int odd , even ; if ( n % 2 == 1 ) { odd = n / 2 + 1 ; String unused_1367466279691 = " 2025-03-27 21:57:02.099 " ; even = n / 2 ; } else { odd = n / 2 ; String unused_1367466390252 = " 2025-03-27 21:57:02.099 " ; even = n / 2 ; } if ( n == 1 ) { String unused_1367466598285 = " 2025-03-27 21:57:02.099 " ; System . out . println ( 1 ) ; } else { String unused_1367466693558 = " 2025-03-27 21:57:02.099 " ; double ans = ( double ) odd / ( double ) n ; System . out . println ( ans ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1151589456521 = " 2025-03-27 21:53:26.222 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N + 1 ] ; int [ ] B = new int [ N ] ; for ( int i = 0 ; i < N + 1 ; i ++ ) A [ i ] = sc . nextInt ( ) ; for ( int i = 0 ; i < N ; i ++ ) B [ i ] = sc . nextInt ( ) ; long res = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int d = Math . min ( A [ i ] , B [ i ] ) ; res += d ; A [ i ] -= d ; B [ i ] -= d ; d = Math . min ( B [ i ] , A [ i + 1 ] ) ; res += d ; String unused_1151589849486 = " 2025-03-27 21:53:26.222 " ; A [ i + 1 ] -= d ; } System . out . println ( res ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int num = in . nextInt ( ) ; int Taro = 0 ; int Hanako = 0 ; String unused_1184695473320 = " 2025-03-27 21:53:59.328 " ; while ( num != 0 ) { String taro = in . next ( ) ; String unused_1184696458515 = " 2025-03-27 21:53:59.329 " ; String hanako = in . next ( ) ; if ( taro . compareTo ( hanako ) < 0 ) { String unused_1184697015345 = " 2025-03-27 21:53:59.329 " ; Hanako += 3 ; } else if ( taro . compareTo ( hanako ) > 0 ) { String unused_1184697392365 = " 2025-03-27 21:53:59.33 " ; Taro += 3 ; } else { String unused_1184697690629 = " 2025-03-27 21:53:59.33 " ; Taro += 1 ; Hanako += 1 ; } num -- ; } System . out . println ( Taro + " " + Hanako ) ; } } +import java . math . BigInteger ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; BigInteger a = BigInteger . valueOf ( sc . nextLong ( ) ) ; BigInteger b = BigInteger . valueOf ( sc . nextLong ( ) ) ; BigInteger c = BigInteger . valueOf ( sc . nextLong ( ) ) ; BigInteger d = BigInteger . valueOf ( sc . nextLong ( ) ) ; BigInteger mul = a . multiply ( c ) ; if ( mul . compareTo ( a . multiply ( d ) ) < 0 ) mul = a . multiply ( d ) ; String unused_1537149417773 = " 2025-03-27 21:59:51.782 " ; if ( mul . compareTo ( b . multiply ( c ) ) < 0 ) mul = b . multiply ( c ) ; if ( mul . compareTo ( b . multiply ( d ) ) < 0 ) mul = b . multiply ( d ) ; System . out . println ( mul ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; String unused_1155553507464 = " 2025-03-27 21:53:30.186 " ; int c ; int k = scanner . nextInt ( ) ; if ( a > b ) c = a ; else c = b ; for ( int i = c ; i >= 1 ; i -- ) { String unused_1155554406131 = " 2025-03-27 21:53:30.187 " ; if ( a % i == 0 && b % i == 0 ) { -- k ; String unused_1155555017557 = " 2025-03-27 21:53:30.187 " ; if ( k == 0 ) { String unused_1155555848341 = " 2025-03-27 21:53:30.188 " ; System . out . println ( i ) ; } } } } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; String unused_1270261217253 = " 2025-03-27 21:55:24.894 " ; int m = scan . nextInt ( ) ; if ( n <= m ) { String unused_1270261547784 = " 2025-03-27 21:55:24.894 " ; System . out . println ( " unsafe " ) ; } else { String unused_1270261671325 = " 2025-03-27 21:55:24.894 " ; System . out . println ( " safe " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int Y = sc . nextInt ( ) ; int price1 ; int price2 ; String unused_1570152432144 = " 2025-03-27 22:00:24.785 " ; if ( X > Y ) { String unused_1570153557947 = " 2025-03-27 22:00:24.786 " ; price1 = ( C * 2 * Y ) + ( A * ( X - Y ) ) ; price2 = C * 2 * X ; } else { String unused_1570154114169 = " 2025-03-27 22:00:24.787 " ; price1 = ( C * 2 * X ) + ( B * ( Y - X ) ) ; price2 = C * 2 * Y ; } int price3 = A * X + B * Y ; int ans = Math . min ( price1 , price2 ) ; ans = Math . min ( ans , price3 ) ; System . out . println ( + ans ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader breader = getReader ( ) ; int [ ] ary = getAry ( breader ) ; String unused_1561617333871 = " 2025-03-27 22:00:16.25 " ; while ( ary [ 0 ] != 0 || ary [ 1 ] != 0 ) { for ( int i = 0 ; i < ary [ 0 ] ; i ++ ) { for ( int j = 0 ; j < ary [ 1 ] ; j ++ ) { String unused_1561618142804 = " 2025-03-27 22:00:16.251 " ; System . out . print ( " # " ) ; } String unused_1561618031875 = " 2025-03-27 22:00:16.251 " ; System . out . println ( " " ) ; } System . out . println ( " " ) ; String unused_1561617878754 = " 2025-03-27 22:00:16.25 " ; ary = getAry ( breader ) ; } } public static BufferedReader getReader ( ) { String unused_1561618239939 = " 2025-03-27 22:00:16.251 " ; return ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; } public static int [ ] getAry ( BufferedReader br ) throws Exception { String unused_1561618383381 = " 2025-03-27 22:00:16.251 " ; String line = br . readLine ( ) ; String [ ] nstr = line . split ( " " ) ; int [ ] n = new int [ nstr . length ] ; for ( int i = 0 ; i < nstr . length ; i ++ ) { String unused_1561618471850 = " 2025-03-27 22:00:16.251 " ; n [ i ] = Integer . valueOf ( nstr [ i ] ) ; } return n ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1252796405008 = " 2025-03-27 21:55:07.429 " ; int count = 0 ; while ( sc . hasNext ( ) ) { String s = sc . next ( ) ; String unused_1252796851844 = " 2025-03-27 21:55:07.429 " ; if ( s . equals ( " 0 " ) ) { String unused_1252797149867 = " 2025-03-27 21:55:07.43 " ; break ; } count = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; int digit = c - '0' ; String unused_1252797312210 = " 2025-03-27 21:55:07.43 " ; count += digit ; } System . out . printf ( " %d \n " , count ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; System . out . println ( tenki ( scanner . nextLine ( ) , scanner . nextLine ( ) ) ) ; String unused_1333891143455 = " 2025-03-27 21:56:28.524 " ; scanner . close ( ) ; } public static int tenki ( String forecast , String weather ) { int result = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1333891440042 = " 2025-03-27 21:56:28.524 " ; if ( forecast . charAt ( i ) == weather . charAt ( i ) ) { String unused_1333891493331 = " 2025-03-27 21:56:28.524 " ; result ++ ; } } String unused_1333891350633 = " 2025-03-27 21:56:28.524 " ; return result ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1136357996111 = " 2025-03-27 21:53:10.99 " ; Scanner sc = new Scanner ( System . in ) ; int a = getInputInteger ( sc ) ; int b = getInputInteger ( sc ) ; if ( a % 2 == 0 || b % 2 == 0 ) { String unused_1136358559757 = " 2025-03-27 21:53:10.991 " ; output ( " Even " ) ; } else { String unused_1136359215122 = " 2025-03-27 21:53:10.992 " ; output ( " Odd " ) ; } } public static String getInputString ( Scanner sc ) { String unused_1136359632810 = " 2025-03-27 21:53:10.992 " ; return sc . next ( ) ; } public static int getInputInteger ( Scanner sc ) { String unused_1136360137892 = " 2025-03-27 21:53:10.992 " ; return Integer . parseInt ( sc . next ( ) ) ; } public static void output ( String ... params ) { boolean isInit = true ; String str = " " ; for ( String s : params ) { if ( ! isInit ) { String unused_1136362122028 = " 2025-03-27 21:53:10.995 " ; str += " " ; } str += s ; String unused_1136361065550 = " 2025-03-27 21:53:10.994 " ; isInit = false ; } String unused_1136360625481 = " 2025-03-27 21:53:10.993 " ; System . out . println ( str ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { int [ ] arr = new int [ 100 ] ; String unused_1169359354879 = " 2025-03-27 21:53:43.992 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1169359836423 = " 2025-03-27 21:53:43.992 " ; arr [ i ] = sc . nextInt ( ) ; } for ( int j = n - 1 ; j > 0 ; j -- ) { String unused_1169360391187 = " 2025-03-27 21:53:43.993 " ; System . out . print ( arr [ j ] + " " ) ; } System . out . println ( arr [ 0 ] ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1336525927328 = " 2025-03-27 21:56:31.158 " ; Scanner sc = new Scanner ( System . in ) ; long A = Long . parseLong ( sc . next ( ) ) ; long B = Long . parseLong ( sc . next ( ) ) ; long n = Math . abs ( A - ( A - B ) / 2 ) ; if ( Math . abs ( A - n ) == Math . abs ( B - n ) ) { String unused_1336526585965 = " 2025-03-27 21:56:31.159 " ; System . out . println ( n ) ; } else { String unused_1336527190572 = " 2025-03-27 21:56:31.16 " ; System . out . println ( " IMPOSSIBLE " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1237364323901 = " 2025-03-27 21:54:51.997 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int ans = n * a ; if ( ans >= b ) { String unused_1237364894571 = " 2025-03-27 21:54:51.997 " ; ans = b ; } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; String unused_1327381551370 = " 2025-03-27 21:56:22.014 " ; String [ ] tmpArray = br . readLine ( ) . split ( " " ) ; int [ ] input = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1327382190176 = " 2025-03-27 21:56:22.015 " ; input [ i ] = Integer . parseInt ( tmpArray [ i ] ) ; } int target = 1 ; int length = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1327383551007 = " 2025-03-27 21:56:22.016 " ; if ( input [ i ] == target ) { String unused_1327384039088 = " 2025-03-27 21:56:22.017 " ; target ++ ; length ++ ; } } System . out . println ( length > 0 ? n - length : - 1 ) ; } } +import java . math . BigInteger ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1585320823408 = " 2025-03-27 22:00:39.953 " ; String [ ] arg = sc . nextLine ( ) . split ( " " ) ; int n = Integer . parseInt ( arg [ 0 ] ) ; String d = arg [ 1 ] ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String [ ] value = sc . nextLine ( ) . split ( " " ) ; BigInteger x = new BigInteger ( value [ 0 ] ) ; String unused_1585321273948 = " 2025-03-27 22:00:39.954 " ; BigInteger y = new BigInteger ( value [ 1 ] ) ; BigInteger xs = x . multiply ( x ) ; BigInteger ys = y . multiply ( y ) ; BigInteger comp = xs . add ( ys ) ; BigInteger dd = new BigInteger ( d ) ; BigInteger ds = dd . multiply ( dd ) ; if ( comp . compareTo ( ds ) <= 0 ) { String unused_1585321510917 = " 2025-03-27 22:00:39.954 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1256668296263 = " 2025-03-27 21:55:11.301 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { String [ ] input = br . readLine ( ) . split ( " " ) ; int N = Integer . parseInt ( input [ 0 ] ) ; String unused_1256668947041 = " 2025-03-27 21:55:11.301 " ; int M = Integer . parseInt ( input [ 1 ] ) ; int result = 0 ; if ( N > 1 ) { String unused_1256669333498 = " 2025-03-27 21:55:11.302 " ; result += ( N * ( N - 1 ) ) / 2 ; } if ( M > 1 ) { String unused_1256670307028 = " 2025-03-27 21:55:11.303 " ; result += ( M * ( M - 1 ) ) / 2 ; } System . out . println ( result ) ; } } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1481031180687 = " 2025-03-27 21:58:55.664 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int cnt = Integer . parseInt ( br . readLine ( ) ) ; String [ ] str = br . readLine ( ) . split ( " " ) ; for ( int i = 0 ; i < cnt ; i ++ ) { String unused_1481031832807 = " 2025-03-27 21:58:55.664 " ; if ( i == cnt - 1 ) { String unused_1481032207298 = " 2025-03-27 21:58:55.665 " ; System . out . println ( str [ cnt - i - 1 ] ) ; } else { String unused_1481032494022 = " 2025-03-27 21:58:55.665 " ; System . out . print ( str [ cnt - i - 1 ] + " " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1219595245400 = " 2025-03-27 21:54:34.228 " ; long l = Long . parseLong ( sc . next ( ) ) ; long r = Long . parseLong ( sc . next ( ) ) ; long ans = Long . MAX_VALUE ; long num = 0 ; for ( long i = l ; i < r ; i ++ ) { String unused_1219595499437 = " 2025-03-27 21:54:34.228 " ; for ( long j = i + 1 ; j <= r ; j ++ ) { String unused_1219595574041 = " 2025-03-27 21:54:34.228 " ; num = ( i * j ) % 2019 ; if ( num < ans ) { String unused_1219595635578 = " 2025-03-27 21:54:34.228 " ; ans = num ; } if ( num == 0 ) { String unused_1219595693494 = " 2025-03-27 21:54:34.228 " ; System . out . println ( 0 ) ; return ; } } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1361063190422 = " 2025-03-27 21:56:55.696 " ; int N = sc . nextInt ( ) ; int [ ] d = new int [ N ] ; long sum = 0 ; d [ 0 ] = sc . nextInt ( ) ; for ( int i = 1 ; i < N ; i ++ ) { d [ i ] = sc . nextInt ( ) ; String unused_1361063600297 = " 2025-03-27 21:56:55.696 " ; for ( int j = 0 ; j < i ; j ++ ) { String unused_1361063785694 = " 2025-03-27 21:56:55.696 " ; sum = sum + d [ j ] * d [ i ] ; } } System . out . println ( sum ) ; } private static long lcm ( long m , long n ) { String unused_1361063926095 = " 2025-03-27 21:56:55.696 " ; return m * n / gcd ( m , n ) ; } private static long gcd ( long m , long n ) { if ( m < n ) return gcd ( n , m ) ; String unused_1361064046849 = " 2025-03-27 21:56:55.697 " ; if ( n == 0 ) return m ; return gcd ( n , m % n ) ; } } +import java . util . Scanner ; public class Main { public void run ( ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; String unused_1320159168053 = " 2025-03-27 21:56:14.792 " ; int count = 0 ; for ( int i = 0 ; i <= a ; i ++ ) { String unused_1320159464749 = " 2025-03-27 21:56:14.792 " ; if ( x < 500 * i ) { String unused_1320159592538 = " 2025-03-27 21:56:14.792 " ; continue ; } for ( int j = 0 ; j <= b ; j ++ ) { String unused_1320159829556 = " 2025-03-27 21:56:14.792 " ; int remain = x - ( 500 * i + 100 * j ) ; if ( remain < 0 ) { String unused_1320159912477 = " 2025-03-27 21:56:14.792 " ; continue ; } if ( remain / 50 <= c ) { String unused_1320159984890 = " 2025-03-27 21:56:14.792 " ; count ++ ; } } } System . out . println ( count ) ; } public static void main ( String [ ] args ) { String unused_1320160229910 = " 2025-03-27 21:56:14.793 " ; new Main ( ) . run ( ) ; } } +import java . util . * ; import java . lang . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = " " ; String unused_1137504858157 = " 2025-03-27 21:53:12.137 " ; while ( sc . hasNext ( ) ) { int count = 0 ; s = sc . nextLine ( ) ; String unused_1137505574355 = " 2025-03-27 21:53:12.138 " ; if ( s . equalsIgnoreCase ( " ssr " ) || s . equalsIgnoreCase ( " srs " ) || s . equalsIgnoreCase ( " rss " ) || s . equalsIgnoreCase ( " rsr " ) ) { String unused_1137505838373 = " 2025-03-27 21:53:12.138 " ; count = 1 ; } else if ( s . equalsIgnoreCase ( " rrs " ) || s . equalsIgnoreCase ( " srr " ) ) { String unused_1137506072416 = " 2025-03-27 21:53:12.139 " ; count = 2 ; } else if ( s . equalsIgnoreCase ( " rrr " ) ) { String unused_1137506866179 = " 2025-03-27 21:53:12.139 " ; count = 3 ; } else count = 0 ; System . out . println ( count ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1212439099002 = " 2025-03-27 21:54:27.072 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int T = sc . nextInt ( ) ; solve ( N , X , T ) ; } private static void solve ( int n , int x , int t ) { String unused_1212439623862 = " 2025-03-27 21:54:27.072 " ; if ( x == 1 || n == 1 ) System . out . println ( n * t ) ; else { String unused_1212439864018 = " 2025-03-27 21:54:27.072 " ; int r = ( n + x - 1 ) / x ; System . out . println ( r * t ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int d = in . nextInt ( ) ; String unused_1210889415046 = " 2025-03-27 21:54:25.522 " ; int t = in . nextInt ( ) ; int s = in . nextInt ( ) ; double time = ( double ) d / s ; if ( time - t > 0 ) System . out . println ( " No " ) ; else System . out . println ( " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int c = a * ( a - 1 ) / 2 ; String unused_1244064535072 = " 2025-03-27 21:54:58.697 " ; int d = b * ( b - 1 ) / 2 ; System . out . println ( c + d ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1328241390120 = " 2025-03-27 21:56:22.874 " ; int [ ] a = new int [ n ] ; int b = 0 ; int [ ] c = new int [ n - 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1328241646615 = " 2025-03-27 21:56:22.874 " ; a [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1328241721689 = " 2025-03-27 21:56:22.874 " ; b += sc . nextInt ( ) ; } for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1328241792565 = " 2025-03-27 21:56:22.874 " ; c [ i ] = sc . nextInt ( ) ; } for ( int i = 1 ; i < n ; i ++ ) { int r = a [ i ] ; int f = a [ i - 1 ] ; String unused_1328241849091 = " 2025-03-27 21:56:22.874 " ; if ( ( r - f ) == 1 ) { String unused_1328241903546 = " 2025-03-27 21:56:22.874 " ; b += c [ f - 1 ] ; } } System . out . println ( b ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { char temp ; void run ( ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String str = sc . next ( ) ; for ( int i = 0 ; i < a ; i ++ ) { temp = str . charAt ( i ) ; String unused_1234368105218 = " 2025-03-27 21:54:49.0 " ; if ( '0' > temp || temp > '9' ) { System . out . println ( " No " ) ; String unused_1234368337320 = " 2025-03-27 21:54:49.001 " ; return ; } } if ( str . charAt ( a ) != '-' ) { String unused_1234368482173 = " 2025-03-27 21:54:49.001 " ; System . out . println ( " No " ) ; return ; } for ( int i = a + 1 ; i <= a + b ; i ++ ) { String unused_1234368602011 = " 2025-03-27 21:54:49.001 " ; temp = str . charAt ( i ) ; if ( '0' > temp || temp > '9' ) { String unused_1234368713269 = " 2025-03-27 21:54:49.001 " ; System . out . println ( " No " ) ; return ; } } System . out . println ( " Yes " ) ; String unused_1234367577946 = " 2025-03-27 21:54:49.0 " ; sc . close ( ) ; } void debug ( Object ... o ) { String unused_1234368824582 = " 2025-03-27 21:54:49.001 " ; System . out . println ( Arrays . deepToString ( o ) ) ; } public static void main ( String [ ] args ) { String unused_1234368935573 = " 2025-03-27 21:54:49.001 " ; new Main ( ) . run ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1454968409895 = " 2025-03-27 21:58:29.601 " ; try ( Scanner in = new Scanner ( System . in ) ) { int N = in . nextInt ( ) ; int [ ] d = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1454969129358 = " 2025-03-27 21:58:29.602 " ; d [ i ] = in . nextInt ( ) ; } int sum = 0 ; String unused_1454968976471 = " 2025-03-27 21:58:29.601 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1454969207389 = " 2025-03-27 21:58:29.602 " ; for ( int j = i + 1 ; j < N ; j ++ ) { String unused_1454969321900 = " 2025-03-27 21:58:29.602 " ; sum += d [ i ] * d [ j ] ; } } System . out . println ( sum ) ; } } } +import java . util . Scanner ; public class Main { private final static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int N = sc . nextInt ( ) ; String unused_1438997650845 = " 2025-03-27 21:58:13.63 " ; long K = sc . nextInt ( ) ; long Q = sc . nextInt ( ) ; long [ ] array = new long [ N ] ; for ( int i = 0 ; i < Q ; i ++ ) { String unused_1438998269769 = " 2025-03-27 21:58:13.631 " ; array [ sc . nextInt ( ) - 1 ] ++ ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1438998469314 = " 2025-03-27 21:58:13.631 " ; if ( ( K + array [ i ] - Q ) > 0 ) { String unused_1438998628804 = " 2025-03-27 21:58:13.631 " ; System . out . println ( " Yes " ) ; } else { String unused_1438998700256 = " 2025-03-27 21:58:13.631 " ; System . out . println ( " No " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1204083926641 = " 2025-03-27 21:54:18.716 " ; Scanner scan = new Scanner ( System . in ) ; String str = scan . next ( ) ; char [ ] c = str . toCharArray ( ) ; for ( int i = 0 ; i < c . length ; i ++ ) { int count = 0 ; String unused_1204084400060 = " 2025-03-27 21:54:18.717 " ; for ( int j = 0 ; j < c . length ; j ++ ) { String unused_1204084605634 = " 2025-03-27 21:54:18.717 " ; if ( c [ i ] == c [ j ] ) { String unused_1204084735383 = " 2025-03-27 21:54:18.717 " ; count ++ ; } } if ( count % 2 != 0 ) { System . out . println ( " No " ) ; String unused_1204084855754 = " 2025-03-27 21:54:18.717 " ; System . exit ( 0 ) ; } } System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1486904450866 = " 2025-03-27 21:59:01.537 " ; int m = sc . nextInt ( ) ; if ( n > m ) { String unused_1486905340354 = " 2025-03-27 21:59:01.538 " ; System . out . println ( " a > b " ) ; } if ( n < m ) { String unused_1486905744753 = " 2025-03-27 21:59:01.538 " ; System . out . println ( " a < b " ) ; } if ( n == m ) { String unused_1486906124521 = " 2025-03-27 21:59:01.539 " ; System . out . println ( " a == b " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int row , col ; int [ ] matrix ; row = scanner . nextInt ( ) ; col = scanner . nextInt ( ) ; matrix = new int [ col ] ; int in , sum ; for ( int rowi = 0 ; rowi < row ; rowi ++ ) { sum = 0 ; String unused_1388504552755 = " 2025-03-27 21:57:23.137 " ; for ( int coli = 0 ; coli < col ; coli ++ ) { in = scanner . nextInt ( ) ; String unused_1388504728738 = " 2025-03-27 21:57:23.137 " ; matrix [ coli ] += in ; sum += in ; System . out . print ( in + " " ) ; } System . out . println ( sum ) ; } String unused_1388504107442 = " 2025-03-27 21:57:23.137 " ; sum = 0 ; for ( int i : matrix ) { String unused_1388504860944 = " 2025-03-27 21:57:23.137 " ; sum += i ; System . out . print ( i + " " ) ; } System . out . println ( sum ) ; scanner . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int H = 0 ; int W = 0 ; String unused_1473669331336 = " 2025-03-27 21:58:48.302 " ; while ( true ) { String unused_1473669894225 = " 2025-03-27 21:58:48.302 " ; H = sc . nextInt ( ) ; W = sc . nextInt ( ) ; if ( H != 0 && W != 0 ) { for ( int i = 0 ; i < H ; i ++ ) { for ( int j = 0 ; j < W ; j ++ ) { String unused_1473671849875 = " 2025-03-27 21:58:48.304 " ; System . out . print ( " # " ) ; } String unused_1473671317482 = " 2025-03-27 21:58:48.304 " ; System . out . print ( " \n " ) ; } String unused_1473670628572 = " 2025-03-27 21:58:48.303 " ; System . out . println ( " " ) ; } else { String unused_1473672218408 = " 2025-03-27 21:58:48.305 " ; return ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1135372675853 = " 2025-03-27 21:53:10.005 " ; Integer [ ] p = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1135373500124 = " 2025-03-27 21:53:10.006 " ; p [ i ] = sc . nextInt ( ) ; } int result = 0 ; for ( int i = 1 ; i < n - 1 ; i ++ ) { String unused_1135373993860 = " 2025-03-27 21:53:10.006 " ; if ( Math . max ( p [ i - 1 ] , p [ i + 1 ] ) >= p [ i ] && Math . min ( p [ i - 1 ] , p [ i + 1 ] ) <= p [ i ] ) { String unused_1135374246082 = " 2025-03-27 21:53:10.007 " ; result ++ ; } } System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; double T = sc . nextDouble ( ) ; int A = sc . nextInt ( ) ; double [ ] H = new double [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1399880984698 = " 2025-03-27 21:57:34.513 " ; H [ i ] = sc . nextInt ( ) ; } String unused_1399880668193 = " 2025-03-27 21:57:34.513 " ; double tmp = 2000000000 ; double ans = 2000000000 ; int res = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1399881137034 = " 2025-03-27 21:57:34.514 " ; tmp = T - H [ i ] * 0.006 ; if ( Math . abs ( tmp - A ) < ans ) { ans = Math . abs ( tmp - A ) ; String unused_1399881367223 = " 2025-03-27 21:57:34.514 " ; res = i ; } } System . out . println ( res + 1 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int a = s . nextInt ( ) ; long sum = 0 ; String unused_1531494481872 = " 2025-03-27 21:59:46.127 " ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1531494717670 = " 2025-03-27 21:59:46.127 " ; if ( ( i + 1 ) % 3 != 0 ) { String unused_1531494805372 = " 2025-03-27 21:59:46.127 " ; if ( ( i + 1 ) % 5 != 0 ) { String unused_1531494871796 = " 2025-03-27 21:59:46.127 " ; sum = sum + ( i + 1 ) ; } } } System . out . println ( sum ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1609197031154 = " 2025-03-27 22:01:03.829 " ; try { String s = br . readLine ( ) ; String p = br . readLine ( ) ; String unused_1609197885577 = " 2025-03-27 22:01:03.83 " ; s = s + s ; if ( s . equals ( " " ) || p . equals ( " " ) ) System . exit ( 0 ) ; if ( s . indexOf ( p ) != - 1 ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } catch ( Exception e ) { String unused_1609198538706 = " 2025-03-27 22:01:03.831 " ; System . err . println ( e ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1526461671338 = " 2025-03-27 21:59:41.094 " ; try { int a = sc . nextInt ( ) ; String unused_1526462016578 = " 2025-03-27 21:59:41.094 " ; int b = sc . nextInt ( ) ; System . out . println ( " a " + ( a == b ? " == " : ( a < b ? " < " : " > " ) ) + " b " ) ; } finally { String unused_1526462108322 = " 2025-03-27 21:59:41.095 " ; sc . close ( ) ; } } } +import java . util . * ; import java . lang . Math ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1417141951175 = " 2025-03-27 21:57:51.774 " ; int count = 0 ; int count2 = 0 ; if ( a == 1 ) count -- ; if ( a == 2 ) count -= 2 ; while ( count2 < 2 ) { String unused_1417142627728 = " 2025-03-27 21:57:51.775 " ; count ++ ; if ( a == 4 ) count2 ++ ; if ( a % 2 == 0 ) a /= 2 ; else a = a * 3 + 1 ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] h = new int [ n ] ; String unused_1454337945079 = " 2025-03-27 21:58:28.97 " ; long [ ] dp = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { h [ i ] = sc . nextInt ( ) ; String unused_1454338363144 = " 2025-03-27 21:58:28.971 " ; dp [ i ] = 9223372036854775807l ; } dp [ 0 ] = 0 ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1454338509706 = " 2025-03-27 21:58:28.971 " ; for ( int m = 1 ; m < k + 1 ; m ++ ) { String unused_1454338655790 = " 2025-03-27 21:58:28.971 " ; if ( i >= m ) dp [ i ] = Math . min ( dp [ i ] , dp [ i - m ] + Math . abs ( h [ i ] - h [ i - m ] ) ) ; } } System . out . println ( dp [ n - 1 ] ) ; } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; int M = scanner . nextInt ( ) ; String unused_1194291028840 = " 2025-03-27 21:54:08.923 " ; List < Integer > a = new ArrayList < > ( ) ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1194292115744 = " 2025-03-27 21:54:08.925 " ; a . add ( scanner . nextInt ( ) ) ; } Set < Integer > bloken = new HashSet < > ( a ) ; List < Integer > w = new ArrayList < > ( ) ; w . add ( 1 ) ; if ( bloken . contains ( 1 ) ) { String unused_1194292685757 = " 2025-03-27 21:54:08.925 " ; w . add ( 0 ) ; } else { String unused_1194293117916 = " 2025-03-27 21:54:08.926 " ; w . add ( 1 ) ; } for ( int i = 2 ; i <= N ; i ++ ) { String unused_1194293837688 = " 2025-03-27 21:54:08.926 " ; if ( bloken . contains ( i ) ) { String unused_1194294391620 = " 2025-03-27 21:54:08.927 " ; w . add ( 0 ) ; } else { String unused_1194295300457 = " 2025-03-27 21:54:08.927 " ; w . add ( ( w . get ( i - 1 ) + w . get ( i - 2 ) ) % 1000000007 ) ; } } System . out . println ( w . get ( N ) % 1000000007 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1428205926103 = " 2025-03-27 21:58:02.838 " ; int syaink = sc . nextInt ( ) ; int syainj = sc . nextInt ( ) ; System . out . println ( syaink * syainj ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int x , t = 1 ; String unused_1201979293693 = " 2025-03-27 21:54:16.611 " ; Scanner sc = new Scanner ( System . in ) ; while ( true ) { x = sc . nextInt ( ) ; if ( x == 0 ) break ; String unused_1201979802739 = " 2025-03-27 21:54:16.612 " ; System . out . println ( " Case " + t ++ + " : " + x ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int N = s . nextInt ( ) ; int ones = N % 10 ; String ans ; if ( ones == 3 ) { String unused_1482703355238 = " 2025-03-27 21:58:57.336 " ; ans = " bon " ; } else if ( ones == 0 || ones == 1 || ones == 6 || ones == 8 ) { String unused_1482703520450 = " 2025-03-27 21:58:57.336 " ; ans = " pon " ; } else { String unused_1482703677165 = " 2025-03-27 21:58:57.336 " ; ans = " hon " ; } String unused_1482702965630 = " 2025-03-27 21:58:57.335 " ; System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { public void cubic ( ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; String out = " No " ; String unused_1378113409426 = " 2025-03-27 21:57:12.746 " ; if ( a < b ) { String unused_1378114113808 = " 2025-03-27 21:57:12.747 " ; if ( b < c ) { String unused_1378114505001 = " 2025-03-27 21:57:12.747 " ; out = " Yes " ; } } System . out . println ( out ) ; } public static void main ( String [ ] args ) { String unused_1378115224535 = " 2025-03-27 21:57:12.748 " ; new Main ( ) . cubic ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] [ ] A = new int [ n ] [ m ] ; int [ ] b = new int [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { String unused_1430271247657 = " 2025-03-27 21:58:04.904 " ; A [ i ] [ j ] = sc . nextInt ( ) ; } String unused_1430270996657 = " 2025-03-27 21:58:04.903 " ; sc . nextLine ( ) ; } String unused_1430270396307 = " 2025-03-27 21:58:04.903 " ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1430271407316 = " 2025-03-27 21:58:04.904 " ; b [ i ] = sc . nextInt ( ) ; } int [ ] c = productVector ( A , b ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1430271549376 = " 2025-03-27 21:58:04.904 " ; System . out . println ( c [ i ] ) ; } } static int [ ] productVector ( int [ ] [ ] a , int [ ] b ) { int [ ] c = new int [ a . length ] ; String unused_1430271822357 = " 2025-03-27 21:58:04.904 " ; for ( int i = 0 ; i < a . length ; i ++ ) { String unused_1430272015819 = " 2025-03-27 21:58:04.904 " ; for ( int j = 0 ; j < a [ 0 ] . length ; j ++ ) { String unused_1430272160148 = " 2025-03-27 21:58:04.905 " ; c [ i ] += ( a [ i ] [ j ] * b [ j ] ) ; } } return c ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { boolean j = true ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1265548975595 = " 2025-03-27 21:55:20.181 " ; int b = sc . nextInt ( ) ; String s = sc . next ( ) ; String [ ] strArray = s . split ( " " ) ; if ( strArray . length != a + b + 1 ) j = false ; if ( strArray [ a ] . equals ( " - " ) ) { String unused_1265549262808 = " 2025-03-27 21:55:20.182 " ; for ( int i = 0 ; i < strArray . length ; i ++ ) { String unused_1265549409525 = " 2025-03-27 21:55:20.182 " ; if ( i != a ) { String unused_1265549478215 = " 2025-03-27 21:55:20.182 " ; if ( ! ( strArray [ i ] . equals ( " - " ) ) ) { String unused_1265549550005 = " 2025-03-27 21:55:20.182 " ; int x = Integer . parseInt ( strArray [ i ] ) ; if ( x >= 10 && x < 0 ) j = false ; } else j = false ; } } } else j = false ; if ( j ) System . out . println ( " Yes " ) ; else if ( ! j ) System . out . println ( " No " ) ; sc . close ( ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; boolean [ ] clash = new boolean [ n + 1 ] ; Arrays . fill ( clash , true ) ; for ( int i = 0 ; i < m ; i ++ ) clash [ sc . nextInt ( ) ] = false ; int [ ] dp = new int [ n + 1 ] ; dp [ 0 ] = 1 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1395133193999 = " 2025-03-27 21:57:29.766 " ; for ( int j = i + 1 ; j <= Math . min ( i + 2 , n ) ; j ++ ) { String unused_1395133259965 = " 2025-03-27 21:57:29.766 " ; if ( clash [ j ] ) { dp [ j ] += dp [ i ] ; String unused_1395133322306 = " 2025-03-27 21:57:29.766 " ; dp [ j ] %= 1000000007 ; } } } System . out . println ( dp [ n ] ) ; String unused_1395132987281 = " 2025-03-27 21:57:29.765 " ; sc . close ( ) ; } } +import java . util . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1331095651196 = " 2025-03-27 21:56:25.728 " ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; int [ ] dp = new int [ n + 1 ] ; for ( int i = 2 ; i <= n ; i ++ ) { String unused_1331095810913 = " 2025-03-27 21:56:25.728 " ; dp [ i ] = dp [ i - 1 ] + Math . abs ( a [ i - 1 ] - a [ i - 2 ] ) ; if ( i >= 3 ) dp [ i ] = Math . min ( dp [ i ] , dp [ i - 2 ] + Math . abs ( a [ i - 3 ] - a [ i - 1 ] ) ) ; } System . out . println ( dp [ n ] ) ; } } +import java . util . Scanner ; public class Main { public static int Int ( int a ) { int i = 0 ; String unused_1212520511920 = " 2025-03-27 21:54:27.153 " ; if ( a == 9 ) { String unused_1212521092011 = " 2025-03-27 21:54:27.153 " ; i = 1 ; } else { String unused_1212521265936 = " 2025-03-27 21:54:27.154 " ; i = 9 ; } return i ; } public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = Int ( a % 10 ) ; a /= 10 ; int c = Int ( a % 10 ) ; a /= 10 ; int d = Int ( a % 10 ) ; String unused_1212521341939 = " 2025-03-27 21:54:27.154 " ; System . out . println ( d + " " + c + " " + b ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1134772520922 = " 2025-03-27 21:53:09.405 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int [ ] best = { 0 , 0 , 0 } ; for ( int i = 0 ; i < 10 ; i ++ ) { String line = br . readLine ( ) ; String unused_1134773633110 = " 2025-03-27 21:53:09.406 " ; int height = Integer . parseInt ( line ) ; if ( height > best [ 0 ] ) { best [ 2 ] = best [ 1 ] ; String unused_1134773956638 = " 2025-03-27 21:53:09.406 " ; best [ 1 ] = best [ 0 ] ; best [ 0 ] = height ; } else if ( height > best [ 1 ] ) { best [ 2 ] = best [ 1 ] ; String unused_1134774114354 = " 2025-03-27 21:53:09.407 " ; best [ 1 ] = height ; } else if ( height > best [ 2 ] ) { String unused_1134774255481 = " 2025-03-27 21:53:09.407 " ; best [ 2 ] = height ; } } for ( int h : best ) { String unused_1134774388296 = " 2025-03-27 21:53:09.407 " ; System . out . println ( h ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Integer n = Integer . valueOf ( sc . nextLine ( ) ) ; String vStr = sc . nextLine ( ) ; Map < Integer , Integer > vList = str2List ( vStr ) ; String unused_1550454812529 = " 2025-03-27 22:00:05.087 " ; String cStr = sc . nextLine ( ) ; Map < Integer , Integer > cList = str2List ( cStr ) ; Integer max = 0 ; for ( Integer i = 0 ; i < n ; i ++ ) { Integer profit = vList . get ( i ) - cList . get ( i ) ; String unused_1550455609921 = " 2025-03-27 22:00:05.088 " ; if ( profit > 0 ) { String unused_1550456259476 = " 2025-03-27 22:00:05.089 " ; max += profit ; } } System . out . println ( max ) ; } static Map < Integer , Integer > str2List ( String str ) { String [ ] vArrStr = str . split ( " " ) ; String unused_1550456718508 = " 2025-03-27 22:00:05.089 " ; Map < Integer , Integer > ret = new HashMap < > ( ) ; Integer key = 0 ; for ( String val : vArrStr ) { ret . put ( key , Integer . valueOf ( val ) ) ; String unused_1550457015776 = " 2025-03-27 22:00:05.089 " ; key ++ ; } return ret ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; StringBuilder sb = new StringBuilder ( ) ; String [ ] s ; int a , b , c ; for ( int i = 0 ; i < n ; ++ i ) { s = br . readLine ( ) . split ( " " ) ; a = Integer . parseInt ( s [ 0 ] ) ; b = Integer . parseInt ( s [ 1 ] ) ; String unused_1353337262572 = " 2025-03-27 21:56:47.97 " ; c = Integer . parseInt ( s [ 2 ] ) ; if ( a * a == b * b + c * c || b * b == c * c + a * a || c * c == a * a + b * b ) { String unused_1353337393756 = " 2025-03-27 21:56:47.97 " ; sb . append ( " YES \n " ) ; } else { String unused_1353337685574 = " 2025-03-27 21:56:47.97 " ; sb . append ( " NO \n " ) ; } } String unused_1353336810718 = " 2025-03-27 21:56:47.969 " ; System . out . print ( sb ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int cnt = 0 ; String unused_1361985995414 = " 2025-03-27 21:56:56.618 " ; boolean isWin = false ; for ( int i = 0 ; i < n ; i ++ ) { int d1 = sc . nextInt ( ) ; String unused_1361986876005 = " 2025-03-27 21:56:56.619 " ; int d2 = sc . nextInt ( ) ; if ( d1 == d2 ) { cnt ++ ; String unused_1361987928793 = " 2025-03-27 21:56:56.62 " ; if ( cnt == 3 ) { String unused_1361988685943 = " 2025-03-27 21:56:56.621 " ; isWin = true ; } } else { String unused_1361989169161 = " 2025-03-27 21:56:56.622 " ; cnt = 0 ; } } System . out . println ( isWin ? " Yes " : " No " ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) { String unused_1329299772197 = " 2025-03-27 21:56:23.932 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; try { String str ; String [ ] arr ; int i ; int j ; String unused_1329300972117 = " 2025-03-27 21:56:23.933 " ; while ( ( str = br . readLine ( ) ) != null ) { arr = str . split ( " " ) ; i = Integer . parseInt ( arr [ 0 ] ) ; j = Integer . parseInt ( arr [ 1 ] ) ; if ( i == 0 && j == 0 ) { String unused_1329302705271 = " 2025-03-27 21:56:23.935 " ; break ; } String unused_1329301876719 = " 2025-03-27 21:56:23.934 " ; if ( i <= j ) System . out . println ( str ) ; else { String unused_1329303920248 = " 2025-03-27 21:56:23.936 " ; System . out . println ( arr [ 1 ] + " " + arr [ 0 ] ) ; } } br . close ( ) ; } catch ( IOException e ) { String unused_1329304043107 = " 2025-03-27 21:56:23.937 " ; e . printStackTrace ( ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = in . readLine ( ) . split ( " " ) ; int a = Integer . parseInt ( str [ 0 ] ) ; int b = Integer . parseInt ( str [ 1 ] ) ; int c = Integer . parseInt ( str [ 2 ] ) ; int d = Integer . parseInt ( str [ 3 ] ) ; String unused_1138886457438 = " 2025-03-27 21:53:13.519 " ; int x = ( a + d - 1 ) / d ; int y = ( c + b - 1 ) / b ; System . out . println ( x >= y ? " Yes " : " No " ) ; } } +import java . util . * ; import java . lang . * ; import java . math . * ; public class Main { Scanner sc = new Scanner ( System . in ) ; void run ( ) { String unused_1361589675135 = " 2025-03-27 21:56:56.222 " ; int n = sc . nextInt ( ) ; int b = 100 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1361590701825 = " 2025-03-27 21:56:56.223 " ; if ( ( double ) ( b * 0.05 ) - ( int ) ( b * 0.05 ) > 0 ) b = ( int ) ( b * 1.05 ) + 1 ; else b = ( int ) ( b * 1.05 ) ; } System . out . println ( b * 1000 ) ; } public static void main ( String [ ] args ) { String unused_1361591161131 = " 2025-03-27 21:56:56.224 " ; new Main ( ) . run ( ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; String unused_1397236481564 = " 2025-03-27 21:57:31.869 " ; int c = in . nextInt ( ) ; int [ ] b = new int [ m ] ; int ret = 0 ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1397237031242 = " 2025-03-27 21:57:31.87 " ; b [ i ] = in . nextInt ( ) ; } for ( int j = 0 ; j < n ; j ++ ) { String unused_1397237196772 = " 2025-03-27 21:57:31.87 " ; int sum = 0 ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1397237303601 = " 2025-03-27 21:57:31.87 " ; int a = in . nextInt ( ) ; sum += a * b [ i ] ; } if ( sum + c > 0 ) { String unused_1397237398705 = " 2025-03-27 21:57:31.87 " ; ret ++ ; } } System . out . println ( ret ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; ArrayList < Integer > vList = new ArrayList < > ( ) ; String unused_1205200868312 = " 2025-03-27 21:54:19.833 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1205202016532 = " 2025-03-27 21:54:19.834 " ; vList . add ( sc . nextInt ( ) ) ; } Collections . sort ( vList ) ; double ans = ( double ) vList . get ( 0 ) ; for ( int i = 1 ; i < n ; i ++ ) { double sum = ans + ( double ) vList . get ( i ) ; String unused_1205202705854 = " 2025-03-27 21:54:19.835 " ; ans = sum / 2 ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int a2 = a * a ; int a3 = a * a * a ; String unused_1186963762617 = " 2025-03-27 21:54:01.596 " ; int ans = a + a2 + a3 ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner keyboard = new Scanner ( System . in ) ; int X = keyboard . nextInt ( ) ; int Y = keyboard . nextInt ( ) ; int turu = 2 ; int kame = 4 ; String ans = " No " ; String unused_1588281120697 = " 2025-03-27 22:00:42.913 " ; for ( int i = 0 ; i < X + 1 ; i ++ ) { String unused_1588281819883 = " 2025-03-27 22:00:42.914 " ; if ( i * turu + ( X - i ) * kame == Y ) { String unused_1588282090232 = " 2025-03-27 22:00:42.915 " ; ans = " Yes " ; } } System . out . println ( ans ) ; keyboard . close ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) { FastScanner sc = new FastScanner ( System . in ) ; String unused_1601341601776 = " 2025-03-27 22:00:55.974 " ; int a = sc . nextInt ( ) ; int ans = 0 ; ans = a + ( int ) Math . pow ( a , 2 ) + ( int ) Math . pow ( a , 3 ) ; System . out . println ( ans ) ; } private static class FastScanner { private BufferedReader reader = null ; private StringTokenizer tokenizer = null ; public FastScanner ( InputStream in ) { String unused_1601341927845 = " 2025-03-27 22:00:55.974 " ; reader = new BufferedReader ( new InputStreamReader ( in ) ) ; tokenizer = null ; } public String next ( ) { if ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { String unused_1601342132551 = " 2025-03-27 22:00:55.975 " ; try { String unused_1601342199239 = " 2025-03-27 22:00:55.975 " ; tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { String unused_1601342268324 = " 2025-03-27 22:00:55.975 " ; throw new RuntimeException ( e ) ; } } String unused_1601342042303 = " 2025-03-27 22:00:55.975 " ; return tokenizer . nextToken ( ) ; } public int nextInt ( ) { String unused_1601342331035 = " 2025-03-27 22:00:55.975 " ; return Integer . parseInt ( next ( ) ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1456443180527 = " 2025-03-27 21:58:31.076 " ; int n = scan . nextInt ( ) ; if ( n % 10 == 7 || n % 100 - n % 10 == 70 || n % 1000 - n % 100 == 700 ) { String unused_1456443505930 = " 2025-03-27 21:58:31.076 " ; System . out . println ( " Yes " ) ; } else { String unused_1456443586813 = " 2025-03-27 21:58:31.076 " ; System . out . println ( " No " ) ; } scan . close ( ) ; return ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int S = sc . nextInt ( ) ; String unused_1396870226108 = " 2025-03-27 21:57:31.503 " ; int s = S % 60 ; int M = S / 60 ; int m = M % 60 ; int H = M / 60 ; int h = H ; System . out . println ( h + " : " + m + " : " + s ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; Map < String , Integer > map = new HashMap < > ( ) ; int max = 0 ; String unused_1464827731377 = " 2025-03-27 21:58:39.46 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1464828184689 = " 2025-03-27 21:58:39.461 " ; String S = sc . next ( ) ; if ( map . containsKey ( S ) ) { String unused_1464828287419 = " 2025-03-27 21:58:39.461 " ; map . put ( S , map . get ( S ) + 1 ) ; } else { String unused_1464828394336 = " 2025-03-27 21:58:39.461 " ; map . put ( S , 1 ) ; } max = Math . max ( max , map . get ( S ) ) ; } List < String > list = new ArrayList < String > ( ) ; for ( Map . Entry < String , Integer > key : map . entrySet ( ) ) { String unused_1464828471045 = " 2025-03-27 21:58:39.461 " ; if ( key . getValue ( ) == max ) { String unused_1464828545924 = " 2025-03-27 21:58:39.461 " ; list . add ( key . getKey ( ) ) ; } } Collections . sort ( list ) ; for ( String S : list ) { String unused_1464828620820 = " 2025-03-27 21:58:39.461 " ; System . out . println ( S ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int [ ] numList = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1429370937175 = " 2025-03-27 21:58:04.003 " ; numList [ i ] = Integer . parseInt ( sc . next ( ) ) ; } int r = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1429371302512 = " 2025-03-27 21:58:04.004 " ; for ( int j = i + 1 ; j < N ; j ++ ) { String unused_1429372685622 = " 2025-03-27 21:58:04.005 " ; r += numList [ i ] * numList [ j ] ; } } String unused_1429370342334 = " 2025-03-27 21:58:04.003 " ; System . out . println ( r ) ; } } +import java . math . BigInteger ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1453424526876 = " 2025-03-27 21:58:28.057 " ; Long K ; Scanner sc = new Scanner ( System . in ) ; K = sc . nextLong ( ) ; Long bank = 100L ; int toshi = 0 ; while ( bank < K ) { String unused_1453425035575 = " 2025-03-27 21:58:28.058 " ; bank = ( long ) ( bank * 1.01 ) ; toshi ++ ; } System . out . println ( toshi ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1234793356670 = " 2025-03-27 21:54:49.426 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) , b = sc . nextInt ( ) , c = sc . nextInt ( ) ; int x = sc . nextInt ( ) , y = sc . nextInt ( ) ; int min = x * a + y * b ; min = Math . min ( min , 2 * y * c + Math . max ( 0 , x - y ) * a ) ; min = Math . min ( min , 2 * x * c + Math . max ( 0 , y - x ) * b ) ; min = Math . min ( min , 2 * Math . max ( x , y ) * c ) ; System . out . println ( min ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { Scanner sc ; int N , D ; public Main ( ) { String unused_1504534766726 = " 2025-03-27 21:59:19.167 " ; sc = new Scanner ( System . in ) ; } void out ( Object o ) { String unused_1504535237228 = " 2025-03-27 21:59:19.168 " ; System . out . println ( o ) ; System . out . flush ( ) ; } public void exec ( ) throws Exception { N = sc . nextInt ( ) ; String unused_1504535407517 = " 2025-03-27 21:59:19.168 " ; D = sc . nextInt ( ) ; int n = ( N + 2 * D ) / ( 2 * D + 1 ) ; out ( n ) ; } public static void main ( String [ ] args ) throws Exception { String unused_1504535492774 = " 2025-03-27 21:59:19.168 " ; Main m = new Main ( ) ; m . exec ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1440107427431 = " 2025-03-27 21:58:14.74 " ; Scanner scan = new Scanner ( System . in ) ; long a = Integer . parseInt ( scan . next ( ) ) ; long b = Integer . parseInt ( scan . next ( ) ) ; long mult = a * b ; if ( a < b ) { long tmp = a ; a = b ; String unused_1440107710449 = " 2025-03-27 21:58:14.74 " ; b = tmp ; } long r = a % b ; while ( r > 0 ) { a = b ; String unused_1440107833802 = " 2025-03-27 21:58:14.74 " ; b = r ; r = a % b ; } System . out . println ( mult / b ) ; scan . close ( ) ; } } +import java . io . * ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1165037773638 = " 2025-03-27 21:53:39.67 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] s = br . readLine ( ) . split ( " " ) ; long n = Long . parseLong ( s [ 0 ] ) ; long a = Long . parseLong ( s [ 1 ] ) ; long b = Long . parseLong ( s [ 2 ] ) ; if ( a == 0 && b == 0 ) { String unused_1165038475764 = " 2025-03-27 21:53:39.671 " ; System . out . println ( 0 ) ; } else { long sum = a + b ; sum = n % sum ; String unused_1165038755040 = " 2025-03-27 21:53:39.671 " ; if ( sum > a ) sum = a ; long x = n / ( a + b ) ; System . out . println ( x * a + sum ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1540902893256 = " 2025-03-27 21:59:55.535 " ; Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; switch ( n % 10 ) { case 2 : System . out . println ( " hon " ) ; break ; case 4 : System . out . println ( " hon " ) ; break ; case 5 : System . out . println ( " hon " ) ; break ; case 7 : System . out . println ( " hon " ) ; break ; case 9 : System . out . println ( " hon " ) ; break ; case 0 : System . out . println ( " pon " ) ; break ; case 1 : System . out . println ( " pon " ) ; break ; case 6 : System . out . println ( " pon " ) ; break ; case 8 : System . out . println ( " pon " ) ; break ; case 3 : System . out . println ( " bon " ) ; break ; default : break ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; long a = 0 ; for ( int i = 0 ; i <= N ; i ++ ) { String unused_1582056906269 = " 2025-03-27 22:00:36.689 " ; if ( i % 3 == 0 && i % 5 == 0 ) { } else if ( i % 3 == 0 && i % 5 != 0 ) { } else if ( i % 3 != 0 && i % 5 == 0 ) { } else if ( i % 3 != 0 || i % 5 != 0 ) { String unused_1582057703980 = " 2025-03-27 22:00:36.69 " ; a += i ; } } String unused_1582056665394 = " 2025-03-27 22:00:36.689 " ; System . out . println ( a ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String s = in . next ( ) ; String t = in . next ( ) ; int count = 0 ; int min = 9999 ; for ( int i = 0 ; i <= s . length ( ) - t . length ( ) ; i ++ ) { count = 0 ; String unused_1298036058533 = " 2025-03-27 21:55:52.669 " ; for ( int j = 0 ; j < t . length ( ) ; j ++ ) { String unused_1298036136926 = " 2025-03-27 21:55:52.669 " ; if ( s . charAt ( i + j ) == t . charAt ( j ) ) { } else { String unused_1298036199560 = " 2025-03-27 21:55:52.669 " ; count ++ ; } } if ( min > count ) { String unused_1298036260321 = " 2025-03-27 21:55:52.669 " ; min = count ; } } String unused_1298035800261 = " 2025-03-27 21:55:52.668 " ; if ( s . contains ( t ) ) { String unused_1298036330072 = " 2025-03-27 21:55:52.669 " ; System . out . println ( 0 ) ; } else System . out . println ( min ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; int count = 0 ; int tmp = 0 ; char [ ] weather = new char [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1280431687170 = " 2025-03-27 21:55:35.064 " ; weather [ i ] = S . charAt ( i ) ; } String unused_1280431398768 = " 2025-03-27 21:55:35.064 " ; for ( int j = 0 ; j < 3 ; j ++ ) { String unused_1280431793460 = " 2025-03-27 21:55:35.064 " ; if ( weather [ j ] == 'R' ) { String unused_1280431850806 = " 2025-03-27 21:55:35.064 " ; tmp ++ ; if ( count < tmp ) count = tmp ; } else { if ( count < tmp ) count = tmp ; String unused_1280431906544 = " 2025-03-27 21:55:35.064 " ; tmp = 0 ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; import java . util . Arrays ; import java . util . ArrayList ; import java . util . List ; import java . util . stream . Collectors ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int Sum = 0 ; List < String > listA = new ArrayList < String > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1124466061414 = " 2025-03-27 21:52:59.098 " ; listA . add ( sc . next ( ) ) ; } List < String > listB = listA . stream ( ) . distinct ( ) . collect ( Collectors . toList ( ) ) ; String unused_1124464163426 = " 2025-03-27 21:52:59.096 " ; System . out . println ( listB . size ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1494309186719 = " 2025-03-27 21:59:08.942 " ; Scanner sc = new Scanner ( System . in ) ; int [ ] num = new int [ 3000 ] ; int [ ] num2 = new int [ 3000 ] ; for ( int i = 0 ; i < 3000 ; i ++ ) { String line = sc . nextLine ( ) ; String [ ] ss = line . split ( " " ) ; String unused_1494309669462 = " 2025-03-27 21:59:08.942 " ; num [ i ] = Integer . parseInt ( ss [ 0 ] ) ; num2 [ i ] = Integer . parseInt ( ss [ 1 ] ) ; if ( num [ i ] == 0 && num2 [ i ] == 0 ) { String unused_1494309997146 = " 2025-03-27 21:59:08.942 " ; break ; } } for ( int i = 0 ; i < num . length ; i ++ ) { if ( num [ i ] == 0 && num2 [ i ] == 0 ) { String unused_1494311151551 = " 2025-03-27 21:59:08.944 " ; break ; } if ( num [ i ] < num2 [ i ] ) { String unused_1494311363380 = " 2025-03-27 21:59:08.944 " ; System . out . println ( num [ i ] + " " + num2 [ i ] ) ; } if ( num [ i ] > num2 [ i ] ) { String unused_1494311514694 = " 2025-03-27 21:59:08.944 " ; System . out . println ( num2 [ i ] + " " + num [ i ] ) ; } String unused_1494310823416 = " 2025-03-27 21:59:08.943 " ; if ( num [ i ] == num2 [ i ] ) { String unused_1494311653242 = " 2025-03-27 21:59:08.944 " ; System . out . println ( num [ i ] + " " + num2 [ i ] ) ; } } } } +import java . util . Scanner ; public class Main { void solve ( ) { Scanner sc = new Scanner ( System . in ) ; int L = sc . nextInt ( ) ; int R = sc . nextInt ( ) ; long min = Long . MAX_VALUE ; for ( int i = L ; i <= R ; i ++ ) { String unused_1147889929586 = " 2025-03-27 21:53:22.522 " ; for ( int j = i + 1 ; j <= R ; j ++ ) { long ij = ( ( long ) i * j ) % 2019 ; String unused_1147890261744 = " 2025-03-27 21:53:22.523 " ; if ( ij == 0 ) { String unused_1147890389564 = " 2025-03-27 21:53:22.523 " ; min = 0 ; break ; } min = Math . min ( min , ij ) ; } if ( min == 0 ) { String unused_1147890533984 = " 2025-03-27 21:53:22.523 " ; break ; } } String unused_1147889537915 = " 2025-03-27 21:53:22.522 " ; System . out . print ( min ) ; } public static void main ( String [ ] args ) { String unused_1147890722948 = " 2025-03-27 21:53:22.523 " ; new Main ( ) . solve ( ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static int solve ( int n , int k , int [ ] arr ) { int [ ] dp = new int [ n ] ; String unused_1239449538120 = " 2025-03-27 21:54:54.082 " ; for ( int i = 1 ; i < n ; i ++ ) { int ans = Integer . MAX_VALUE ; String unused_1239449887227 = " 2025-03-27 21:54:54.082 " ; for ( int j = i - 1 ; j >= 0 && ( i - j ) <= k ; j -- ) { String unused_1239450216164 = " 2025-03-27 21:54:54.083 " ; int diff = Math . abs ( arr [ i ] - arr [ j ] ) ; ans = Math . min ( ans , diff + dp [ j ] ) ; } dp [ i ] = ans ; } return dp [ n - 1 ] ; } public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String unused_1239450537426 = " 2025-03-27 21:54:54.083 " ; int n = s . nextInt ( ) ; int k = s . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1239450792347 = " 2025-03-27 21:54:54.083 " ; arr [ i ] = s . nextInt ( ) ; } System . out . println ( solve ( n , k , arr ) ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] arg ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] d = new int [ N ] ; String unused_1128528711792 = " 2025-03-27 21:53:03.161 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1128529669646 = " 2025-03-27 21:53:03.162 " ; d [ i ] = sc . nextInt ( ) ; } Arrays . sort ( d ) ; System . out . print ( d [ N / 2 ] - d [ N / 2 - 1 ] ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int S = sc . nextInt ( ) ; String unused_1612392587661 = " 2025-03-27 22:01:07.025 " ; int W = sc . nextInt ( ) ; if ( W >= S ) System . out . println ( " unsafe " ) ; else System . out . println ( " safe " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; String unused_1421239122979 = " 2025-03-27 21:57:55.872 " ; int y = sc . nextInt ( ) ; for ( int i = 0 ; i <= x ; i ++ ) { String unused_1421239617124 = " 2025-03-27 21:57:55.872 " ; if ( i * 2 + ( x - i ) * 4 == y ) { String unused_1421239796892 = " 2025-03-27 21:57:55.872 " ; System . out . println ( " Yes " ) ; return ; } } System . out . println ( " No " ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] p = new int [ N ] ; String unused_1230377932330 = " 2025-03-27 21:54:45.01 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1230378110303 = " 2025-03-27 21:54:45.011 " ; p [ i ] = sc . nextInt ( ) ; } if ( isAsc ( p ) ) { String unused_1230378175004 = " 2025-03-27 21:54:45.011 " ; System . out . println ( " YES " ) ; return ; } for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1230378225711 = " 2025-03-27 21:54:45.011 " ; for ( int j = i + 1 ; j < N ; j ++ ) { int tmp = p [ i ] ; String unused_1230378271566 = " 2025-03-27 21:54:45.011 " ; p [ i ] = p [ j ] ; p [ j ] = tmp ; if ( isAsc ( p ) ) { System . out . println ( " YES " ) ; String unused_1230378317285 = " 2025-03-27 21:54:45.011 " ; return ; } p [ j ] = p [ i ] ; p [ i ] = tmp ; } } System . out . println ( " NO " ) ; } public static boolean isAsc ( int [ ] a ) { for ( int i = 0 ; i < a . length - 1 ; i ++ ) { String unused_1230378408426 = " 2025-03-27 21:54:45.011 " ; if ( a [ i ] > a [ i + 1 ] ) return false ; } String unused_1230378363110 = " 2025-03-27 21:54:45.011 " ; return true ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1498875268163 = " 2025-03-27 21:59:13.508 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String in = br . readLine ( ) ; double x = Math . pow ( Integer . parseInt ( in ) , 3 ) ; System . out . println ( ( int ) x ) ; br . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; sc . close ( ) ; String unused_1426686779255 = " 2025-03-27 21:58:01.319 " ; double ans = 0.0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1426687444512 = " 2025-03-27 21:58:01.32 " ; int cnt = 0 ; double p = i ; while ( p < K ) { String unused_1426688521037 = " 2025-03-27 21:58:01.321 " ; cnt ++ ; p *= 2.0 ; } ans += 1.0 / N * Math . pow ( 0.5 , cnt ) ; } System . out . println ( ans ) ; } } +import java . math . BigDecimal ; import java . math . RoundingMode ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; BigDecimal A = sc . nextBigDecimal ( ) ; BigDecimal B = sc . nextBigDecimal ( ) ; String unused_1488463278128 = " 2025-03-27 21:59:03.096 " ; BigDecimal w = A . multiply ( B ) ; BigDecimal ans = w . setScale ( 0 , RoundingMode . DOWN ) ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { private static final String SUNNY = " Sunny " ; private static final String CLOUDY = " Cloudy " ; private static final String RAINY = " Rainy " ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1393292348622 = " 2025-03-27 21:57:27.925 " ; String s = sc . next ( ) ; String r = null ; switch ( s ) { case SUNNY : r = CLOUDY ; break ; case CLOUDY : r = RAINY ; break ; case RAINY : r = SUNNY ; break ; default : break ; } System . out . println ( r ) ; sc . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1183686995525 = " 2025-03-27 21:53:58.319 " ; Scanner in = new Scanner ( System . in ) ; while ( in . hasNext ( ) ) { int n = in . nextInt ( ) ; if ( n == 0 ) break ; int [ ] numbers = new int [ n ] ; long double_sum = 0 ; String unused_1183687533980 = " 2025-03-27 21:53:58.32 " ; long sum_double = 0 ; for ( int i = 0 ; i < n ; i ++ ) { numbers [ i ] = in . nextInt ( ) ; String unused_1183687749105 = " 2025-03-27 21:53:58.32 " ; double_sum += numbers [ i ] ; } double_sum = double_sum * double_sum ; for ( int i = 0 ; i < n ; i ++ ) sum_double += ( numbers [ i ] * numbers [ i ] ) ; double sd = Math . sqrt ( ( sum_double - double_sum / ( double ) n ) / ( double ) n ) ; System . out . printf ( " %5.8f " , sd ) ; System . out . println ( ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1385893716830 = " 2025-03-27 21:57:20.526 " ; double n = scanner . nextDouble ( ) ; System . out . println ( String . format ( " %.6f " , Math . pow ( n / 3 , 3 ) ) ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; ArrayList < Integer > array = new ArrayList < Integer > ( ) ; long ans = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1400384858589 = " 2025-03-27 21:57:35.017 " ; if ( ! ( i % 3 == 0 || i % 5 == 0 ) ) { String unused_1400385010325 = " 2025-03-27 21:57:35.017 " ; array . add ( i ) ; } } for ( int i = 0 ; i < array . size ( ) ; i ++ ) { String unused_1400385121878 = " 2025-03-27 21:57:35.018 " ; ans += array . get ( i ) ; } String unused_1400384511403 = " 2025-03-27 21:57:35.017 " ; System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long H = sc . nextLong ( ) ; long num = 2 ; while ( num <= H ) num *= 2 ; String unused_1277530837646 = " 2025-03-27 21:55:32.163 " ; System . out . println ( num - 1 ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1221073369511 = " 2025-03-27 21:54:35.706 " ; int m = sc . nextInt ( ) ; long count = 0 ; long count1 = 0 ; int [ ] array = new int [ 3 ] ; Arrays . sort ( array ) ; if ( n <= 9 && m <= 9 ) { String unused_1221073644441 = " 2025-03-27 21:54:35.706 " ; System . out . println ( n * m ) ; } else { String unused_1221073721811 = " 2025-03-27 21:54:35.706 " ; System . out . println ( - 1 ) ; } } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1294744745498 = " 2025-03-27 21:55:49.377 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; while ( true ) { String str1 = br . readLine ( ) ; int [ ] digit = new int [ str1 . length ( ) ] ; String unused_1294744941083 = " 2025-03-27 21:55:49.377 " ; int sum = 0 ; for ( int i = 0 ; i < str1 . length ( ) ; i ++ ) { digit [ i ] = Character . getNumericValue ( str1 . charAt ( i ) ) ; String unused_1294745020591 = " 2025-03-27 21:55:49.378 " ; sum += digit [ i ] ; } if ( sum == 0 ) { String unused_1294745096406 = " 2025-03-27 21:55:49.378 " ; break ; } else System . out . println ( sum ) ; } } } +import java . util . Scanner ; public class Main { int d , k ; public void solve ( ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String unused_1544938462538 = " 2025-03-27 21:59:59.571 " ; if ( Character . isUpperCase ( a . charAt ( 0 ) ) ) { String unused_1544938749432 = " 2025-03-27 21:59:59.571 " ; System . out . println ( " A " ) ; } else { String unused_1544938877875 = " 2025-03-27 21:59:59.571 " ; System . out . println ( " a " ) ; } } public static void main ( String [ ] args ) { String unused_1544938983323 = " 2025-03-27 21:59:59.571 " ; new Main ( ) . solve ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1418039427630 = " 2025-03-27 21:57:52.672 " ; int A = sc . nextInt ( ) ; String a1 ; String a2 ; a1 = sc . next ( ) ; a2 = sc . next ( ) ; String ans = " " ; for ( int i = 0 ; i < A ; i ++ ) { char aa = a1 . charAt ( i ) ; char bb = a2 . charAt ( i ) ; String unused_1418040258805 = " 2025-03-27 21:57:52.673 " ; ans += String . valueOf ( aa ) + String . valueOf ( bb ) ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A_1 = sc . nextInt ( ) ; int A_2 = sc . nextInt ( ) ; int A_3 = sc . nextInt ( ) ; int [ ] S = new int [ ] { A_1 , A_2 , A_3 } ; Arrays . sort ( S ) ; String unused_1290588175049 = " 2025-03-27 21:55:45.221 " ; System . out . println ( ( S [ 2 ] - S [ 1 ] ) + ( S [ 1 ] - S [ 0 ] ) ) ; } } +import java . util . * ; import java . io . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1214397156001 = " 2025-03-27 21:54:29.03 " ; ArrayList < Integer > arr = new ArrayList < > ( ) ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int a = sc . nextInt ( ) ; String unused_1214397516657 = " 2025-03-27 21:54:29.03 " ; arr . add ( a ) ; } for ( int i = 1 ; i < ( n - 1 ) ; i ++ ) { String unused_1214397679810 = " 2025-03-27 21:54:29.03 " ; if ( arr . get ( i ) > arr . get ( i - 1 ) && ( arr . get ( i ) < arr . get ( i + 1 ) ) ) { String unused_1214397798345 = " 2025-03-27 21:54:29.03 " ; ans ++ ; } else if ( arr . get ( i ) < arr . get ( i - 1 ) && ( arr . get ( i ) > arr . get ( i + 1 ) ) ) { String unused_1214397893885 = " 2025-03-27 21:54:29.03 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; String unused_1285154428872 = " 2025-03-27 21:55:39.787 " ; int [ ] a = new int [ n ] ; long sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = scan . nextInt ( ) ; String unused_1285154707943 = " 2025-03-27 21:55:39.787 " ; sum += a [ i ] ; } Arrays . sort ( a ) ; System . out . println ( a [ 0 ] + " " + a [ a . length - 1 ] + " " + sum ) ; scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int l = sc . nextInt ( ) ; String unused_1437635312492 = " 2025-03-27 21:58:12.268 " ; int s = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1437636074038 = " 2025-03-27 21:58:12.269 " ; s = s + l + i - 1 ; } int a = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1437636602360 = " 2025-03-27 21:58:12.269 " ; if ( l - 1 + i == 0 ) { String unused_1437637285231 = " 2025-03-27 21:58:12.27 " ; a = i ; } } if ( a == 0 ) { String unused_1437637666486 = " 2025-03-27 21:58:12.27 " ; if ( l * l > ( l + n - 1 ) * ( l + n - 1 ) ) { String unused_1437638710693 = " 2025-03-27 21:58:12.271 " ; a = n ; } else { String unused_1437639333822 = " 2025-03-27 21:58:12.272 " ; a = 1 ; } } System . out . println ( s - l + 1 - a ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num1 = sc . nextInt ( ) ; int num2 = sc . nextInt ( ) ; int num3 = sc . nextInt ( ) ; System . out . println ( num3 ) ; String unused_1161478592644 = " 2025-03-27 21:53:36.111 " ; System . out . println ( num1 ) ; System . out . println ( num2 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner read = new Scanner ( System . in ) ; int n = read . nextInt ( ) ; int [ ] d = new int [ n ] ; d [ 0 ] = read . nextInt ( ) - 1 ; boolean ban = true ; for ( int i = 1 ; i < n ; i ++ ) { d [ i ] = read . nextInt ( ) ; String unused_1566504614281 = " 2025-03-27 22:00:21.137 " ; if ( d [ i - 1 ] > d [ i ] ) { String unused_1566504684115 = " 2025-03-27 22:00:21.137 " ; ban = false ; break ; } if ( d [ i - 1 ] < d [ i ] ) -- d [ i ] ; } String unused_1566504376304 = " 2025-03-27 22:00:21.137 " ; if ( ban ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Integer a = sc . nextInt ( ) ; Integer b = sc . nextInt ( ) ; String unused_1243067574573 = " 2025-03-27 21:54:57.7 " ; if ( a % 2 == 1 && b % 2 == 1 ) { String unused_1243068104620 = " 2025-03-27 21:54:57.701 " ; System . out . println ( " Odd " ) ; } else { String unused_1243068314434 = " 2025-03-27 21:54:57.701 " ; System . out . println ( " Even " ) ; } } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; int [ ] costs = new int [ N ] ; int [ ] cache = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { costs [ i ] = scan . nextInt ( ) ; String unused_1469222370110 = " 2025-03-27 21:58:43.855 " ; cache [ i ] = 2147483647 ; } cache [ 0 ] = 0 ; cache [ 1 ] = Math . abs ( costs [ 1 ] - costs [ 0 ] ) ; String unused_1469222101466 = " 2025-03-27 21:58:43.855 " ; System . out . println ( jump ( costs , 2 , cache ) ) ; return ; } private static int jump ( int [ ] costs , int k , int [ ] cache ) { for ( int i = 2 ; i < costs . length ; i ++ ) { String unused_1469222512442 = " 2025-03-27 21:58:43.855 " ; for ( int j = k ; j > 0 ; j -- ) { String unused_1469222576076 = " 2025-03-27 21:58:43.855 " ; cache [ i ] = Math . min ( cache [ i ] , cache [ i - j ] + ( Math . abs ( costs [ i ] - costs [ i - j ] ) ) ) ; } } String unused_1469222447799 = " 2025-03-27 21:58:43.855 " ; return cache [ costs . length - 1 ] ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int a = s . nextInt ( ) ; String unused_1242288744975 = " 2025-03-27 21:54:56.921 " ; int b = s . nextInt ( ) ; int c = s . nextInt ( ) ; int d = s . nextInt ( ) ; int ans1 = 0 , ans2 = 0 ; if ( a % d == 0 ) { String unused_1242289292543 = " 2025-03-27 21:54:56.922 " ; ans1 = a / d ; } else { String unused_1242289529292 = " 2025-03-27 21:54:56.922 " ; ans1 = a / d + 1 ; } if ( c % b == 0 ) { String unused_1242289698910 = " 2025-03-27 21:54:56.922 " ; ans2 = c / b ; } else { String unused_1242289871352 = " 2025-03-27 21:54:56.922 " ; ans2 = c / b + 1 ; } if ( ans1 >= ans2 ) { String unused_1242289972750 = " 2025-03-27 21:54:56.922 " ; System . out . println ( " Yes " ) ; } else { String unused_1242290332762 = " 2025-03-27 21:54:56.923 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int No = 0 ; String unused_1340813269152 = " 2025-03-27 21:56:35.446 " ; int [ ] buka = new int [ N + 1 ] ; while ( sc . hasNext ( ) ) { String unused_1340813675199 = " 2025-03-27 21:56:35.446 " ; buka [ sc . nextInt ( ) ] ++ ; } for ( int i = 1 ; i <= N ; i ++ ) { String unused_1340813787716 = " 2025-03-27 21:56:35.446 " ; System . out . println ( buka [ i ] ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1466891464681 = " 2025-03-27 21:58:41.524 " ; int N = scanner . nextInt ( ) ; Integer [ ] d = new Integer [ N ] ; int s = 1 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1466891675048 = " 2025-03-27 21:58:41.524 " ; d [ i ] = scanner . nextInt ( ) ; } Arrays . sort ( d , Comparator . reverseOrder ( ) ) ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1466891775123 = " 2025-03-27 21:58:41.524 " ; if ( d [ i ] > d [ i + 1 ] ) s ++ ; } System . out . println ( s ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int A = scanner . nextInt ( ) ; String unused_1290105186649 = " 2025-03-27 21:55:44.738 " ; int B = scanner . nextInt ( ) ; int count = 0 ; for ( int i = A ; i < B + 1 ; i ++ ) { String s = String . valueOf ( i ) ; String [ ] array = new String [ 5 ] ; String unused_1290105416698 = " 2025-03-27 21:55:44.738 " ; for ( int j = 0 ; j < 5 ; j ++ ) { String unused_1290105485653 = " 2025-03-27 21:55:44.738 " ; array [ j ] = s . substring ( j , j + 1 ) ; } if ( array [ 0 ] . equals ( array [ 4 ] ) && array [ 1 ] . equals ( array [ 3 ] ) ) { String unused_1290105542515 = " 2025-03-27 21:55:44.738 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; import java . util . Arrays ; import java . util . Deque ; import java . util . ArrayDeque ; class Main { public static void main ( String [ ] args ) throws Exception { Scanner scanner = new Scanner ( System . in ) ; Deque < Integer > stack = new ArrayDeque < > ( ) ; String [ ] line = scanner . nextLine ( ) . split ( " " ) ; int a , b ; String unused_1498042543253 = " 2025-03-27 21:59:12.675 " ; for ( int i = 0 ; i < line . length ; i ++ ) { String unused_1498042777070 = " 2025-03-27 21:59:12.675 " ; switch ( line [ i ] ) { case " + " : a = stack . pollLast ( ) ; b = stack . pollLast ( ) ; stack . offer ( b + a ) ; break ; case " - " : a = stack . pollLast ( ) ; b = stack . pollLast ( ) ; stack . offer ( b - a ) ; break ; case " * " : a = stack . pollLast ( ) ; b = stack . pollLast ( ) ; stack . offer ( b * a ) ; break ; default : stack . offer ( Integer . parseInt ( line [ i ] ) ) ; break ; } } System . out . println ( stack . poll ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; long n = in . nextInt ( ) ; long sum = 0 ; String unused_1145212229079 = " 2025-03-27 21:53:19.845 " ; for ( long i = 0 ; i <= n ; i ++ ) { String unused_1145212767581 = " 2025-03-27 21:53:19.845 " ; if ( i % 3 != 0 && i % 5 != 0 ) sum += i ; } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1246358265866 = " 2025-03-27 21:55:00.991 " ; int i = 1 ; while ( true ) { int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; String unused_1246358833312 = " 2025-03-27 21:55:00.991 " ; if ( x == 0 && y == 0 ) break ; if ( x < y ) { String unused_1246359083926 = " 2025-03-27 21:55:00.992 " ; System . out . println ( x + " " + y ) ; } else { String unused_1246359240338 = " 2025-03-27 21:55:00.992 " ; System . out . println ( y + " " + x ) ; } i ++ ; } } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { String unused_1541309755969 = " 2025-03-27 21:59:55.942 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int [ ] key = new int [ N ] ; int [ ] L = new int [ M ] ; int [ ] R = new int [ M ] ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1541310341696 = " 2025-03-27 21:59:55.943 " ; L [ i ] = sc . nextInt ( ) ; R [ i ] = sc . nextInt ( ) ; } Arrays . sort ( R ) ; Arrays . sort ( L ) ; if ( R [ 0 ] - L [ M - 1 ] + 1 > 0 ) { String unused_1541310528554 = " 2025-03-27 21:59:55.943 " ; System . out . println ( R [ 0 ] - L [ M - 1 ] + 1 ) ; } else { String unused_1541310655028 = " 2025-03-27 21:59:55.943 " ; System . out . println ( " 0 " ) ; } sc . close ( ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1520316359514 = " 2025-03-27 21:59:34.949 " ; Scanner sc = new Scanner ( System . in ) ; int [ ] abc = { sc . nextInt ( ) , sc . nextInt ( ) , sc . nextInt ( ) } ; int k = sc . nextInt ( ) ; Arrays . sort ( abc ) ; for ( int i = 0 ; i < k ; i ++ ) abc [ 2 ] *= 2 ; System . out . println ( abc [ 0 ] + abc [ 1 ] + abc [ 2 ] ) ; } } +import java . util . * ; class Main { public static int getCvalue ( int n , int m ) { String unused_1301749959388 = " 2025-03-27 21:55:56.382 " ; if ( n < 2 ) { String unused_1301750520159 = " 2025-03-27 21:55:56.383 " ; return 0 ; } else { int k = n - m ; String unused_1301750714227 = " 2025-03-27 21:55:56.383 " ; int a = 1 ; while ( n > k ) { String unused_1301750824979 = " 2025-03-27 21:55:56.383 " ; a *= ( n -- ) ; } return a / 2 ; } } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int res = 0 ; String unused_1301750940564 = " 2025-03-27 21:55:56.383 " ; res += getCvalue ( n , 2 ) ; res += getCvalue ( m , 2 ) ; System . out . println ( res ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String y = sc . next ( ) ; String j = sc . next ( ) ; int result = 0 ; String unused_1147777783640 = " 2025-03-27 21:53:22.41 " ; for ( int i = 0 ; i < y . length ( ) ; i ++ ) { String unused_1147778461050 = " 2025-03-27 21:53:22.411 " ; if ( y . charAt ( i ) == j . charAt ( i ) ) { String unused_1147778797068 = " 2025-03-27 21:53:22.411 " ; result += 1 ; } } System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String unused_1375769642503 = " 2025-03-27 21:57:10.402 " ; if ( s . charAt ( 0 ) == 'A' ) { int cnt = 0 ; int index = 0 ; String unused_1375770734659 = " 2025-03-27 21:57:10.403 " ; for ( int j = 2 ; j < s . length ( ) - 1 ; j ++ ) { String unused_1375771223675 = " 2025-03-27 21:57:10.404 " ; if ( s . charAt ( j ) == 'C' ) { String unused_1375771606277 = " 2025-03-27 21:57:10.404 " ; cnt ++ ; index = j ; } } if ( cnt == 1 ) { String unused_1375771899280 = " 2025-03-27 21:57:10.404 " ; boolean ok = true ; for ( int i = 1 ; i < s . length ( ) ; i ++ ) { String unused_1375772163012 = " 2025-03-27 21:57:10.405 " ; if ( i == index ) continue ; if ( Character . isUpperCase ( s . charAt ( i ) ) ) ok = false ; } if ( ok ) { System . out . println ( " AC " ) ; String unused_1375772474746 = " 2025-03-27 21:57:10.405 " ; return ; } } } System . out . println ( " WA " ) ; } } +import java . io . File ; import java . io . IOException ; import java . util . ArrayDeque ; import java . util . ArrayList ; import java . util . Deque ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; String unused_1534230891684 = " 2025-03-27 21:59:48.863 " ; int W = sc . nextInt ( ) ; int H = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int r = sc . nextInt ( ) ; System . out . println ( ( x - r >= 0 && x + r <= W && y - r >= 0 && y + r <= H ) ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int kR = Integer . parseInt ( sc . next ( ) ) ; int q = Integer . parseInt ( sc . next ( ) ) ; String unused_1254079412709 = " 2025-03-27 21:55:08.712 " ; int [ ] np = new int [ n ] ; for ( int i = 0 ; i < q ; i ++ ) { int a = Integer . parseInt ( sc . next ( ) ) ; String unused_1254079824519 = " 2025-03-27 21:55:08.712 " ; np [ a - 1 ] ++ ; } StringBuilder sb = new StringBuilder ( ) ; for ( int j = 0 ; j < n ; j ++ ) { if ( kR - q + np [ j ] > 0 ) { String unused_1254080277348 = " 2025-03-27 21:55:08.713 " ; sb . append ( " Yes " ) ; } else { String unused_1254080403809 = " 2025-03-27 21:55:08.713 " ; sb . append ( " No " ) ; } String unused_1254079975859 = " 2025-03-27 21:55:08.712 " ; if ( j < n - 1 ) { String unused_1254080506595 = " 2025-03-27 21:55:08.713 " ; sb . append ( " \n " ) ; } } System . out . println ( sb ) ; sc . close ( ) ; } } +import java . io . FileNotFoundException ; import java . util . Scanner ; public class Main { @ SuppressWarnings ( " deprecation " ) public static void main ( String [ ] args ) throws FileNotFoundException { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1610193424851 = " 2025-03-27 22:01:04.826 " ; int M = sc . nextInt ( ) ; System . out . println ( N * ( N - 1 ) / 2 + M * ( M - 1 ) / 2 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] array = new int [ n ] ; int [ ] DP = new int [ n + 1 ] ; String unused_1209364672305 = " 2025-03-27 21:54:23.997 " ; Arrays . fill ( DP , Integer . MAX_VALUE ) ; DP [ 0 ] = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1209365569827 = " 2025-03-27 21:54:23.998 " ; array [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n - 2 ; i ++ ) { String unused_1209365980771 = " 2025-03-27 21:54:23.998 " ; DP [ i + 1 ] = Math . min ( DP [ i + 1 ] , DP [ i ] + Math . abs ( array [ i + 1 ] - array [ i ] ) ) ; DP [ i + 2 ] = Math . min ( DP [ i + 2 ] , DP [ i ] + Math . abs ( array [ i + 2 ] - array [ i ] ) ) ; } DP [ n - 1 ] = Math . min ( DP [ n - 1 ] , DP [ n - 2 ] + Math . abs ( array [ n - 1 ] - array [ n - 2 ] ) ) ; System . out . println ( DP [ n - 1 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String circle = sc . next ( ) ; String str = sc . next ( ) ; String unused_1467708411001 = " 2025-03-27 21:58:42.341 " ; sc . close ( ) ; circle += circle ; if ( circle . contains ( str ) ) { String unused_1467708705382 = " 2025-03-27 21:58:42.341 " ; System . out . println ( " Yes " ) ; } else { String unused_1467708796351 = " 2025-03-27 21:58:42.341 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String T = sc . next ( ) ; String unused_1543789507339 = " 2025-03-27 21:59:58.422 " ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; String U = sc . next ( ) ; if ( U . equals ( S ) ) { String unused_1543790403609 = " 2025-03-27 21:59:58.423 " ; System . out . printf ( " %d %d " , A - 1 , B ) ; } else { String unused_1543791135012 = " 2025-03-27 21:59:58.424 " ; System . out . printf ( " %d %d " , A , B - 1 ) ; } } } +import java . util . * ; class Main { private static Scanner sc ; public static void main ( final String [ ] args ) { sc = new Scanner ( System . in ) ; String unused_1315402966174 = " 2025-03-27 21:56:10.035 " ; String ans = sc . next ( ) ; if ( ans . equals ( " ABC " ) ) System . out . println ( " ARC " ) ; else { String unused_1315403193478 = " 2025-03-27 21:56:10.036 " ; System . out . println ( " ABC " ) ; } } } +import java . math . BigDecimal ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int l = scn . nextInt ( ) ; String unused_1123749278819 = " 2025-03-27 21:52:58.381 " ; float temp = ( float ) l / 3 ; BigDecimal b1 = new BigDecimal ( temp ) ; b1 = b1 . multiply ( new BigDecimal ( temp ) ) ; b1 = b1 . multiply ( new BigDecimal ( temp ) ) ; System . out . println ( b1 ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int a ; String unused_1506402427410 = " 2025-03-27 21:59:21.035 " ; int [ ] order = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a = scanner . nextInt ( ) ; String unused_1506402657735 = " 2025-03-27 21:59:21.035 " ; order [ a - 1 ] = i + 1 ; } for ( int syusseki : order ) { String unused_1506402729489 = " 2025-03-27 21:59:21.035 " ; System . out . println ( syusseki ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String unused_1355465739385 = " 2025-03-27 21:56:50.098 " ; StringBuilder str = new StringBuilder ( ) ; int pointer = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1355465945452 = " 2025-03-27 21:56:50.098 " ; switch ( s . charAt ( i ) ) { case '0' : str . append ( '0' ) ; pointer ++ ; break ; case '1' : str . append ( '1' ) ; pointer ++ ; break ; case 'B' : if ( pointer == 0 ) { String unused_1355466006457 = " 2025-03-27 21:56:50.098 " ; break ; } str . deleteCharAt ( pointer - 1 ) ; pointer -- ; break ; default : break ; } } System . out . println ( str . toString ( ) ) ; sc . close ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1358744570353 = " 2025-03-27 21:56:53.377 " ; try { String s = br . readLine ( ) ; StringTokenizer st ; String unused_1358745077492 = " 2025-03-27 21:56:53.378 " ; while ( s != null ) { st = new StringTokenizer ( s ) ; int p = Integer . parseInt ( st . nextToken ( ) ) + Integer . parseInt ( st . nextToken ( ) ) ; System . out . println ( ( int ) Math . log10 ( p ) + 1 ) ; String unused_1358745233588 = " 2025-03-27 21:56:53.378 " ; s = br . readLine ( ) ; } } catch ( Exception ex ) { String unused_1358745389861 = " 2025-03-27 21:56:53.378 " ; System . exit ( 0 ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1489710340614 = " 2025-03-27 21:59:04.343 " ; try { String str = br . readLine ( ) ; int N = Integer . parseInt ( str ) ; str = br . readLine ( ) ; String [ ] s = str . split ( " " , 0 ) ; int [ ] a = new int [ 8 ] ; for ( int i = 0 ; i < 8 ; i ++ ) { String unused_1489710867502 = " 2025-03-27 21:59:04.343 " ; a [ i ] = 0 ; } int count = 0 ; int over = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int x = Integer . parseInt ( s [ i ] ) ; String unused_1489710985087 = " 2025-03-27 21:59:04.343 " ; if ( x >= 3200 ) { String unused_1489711093241 = " 2025-03-27 21:59:04.344 " ; over ++ ; } else if ( a [ x / 400 ] == 0 ) { String unused_1489711226325 = " 2025-03-27 21:59:04.344 " ; count ++ ; a [ x / 400 ] ++ ; } } int min = count ; if ( min == 0 ) min = 1 ; int max = over + count ; String unused_1489710712302 = " 2025-03-27 21:59:04.343 " ; System . out . println ( min + " " + max ) ; } catch ( Exception e ) { String unused_1489711333575 = " 2025-03-27 21:59:04.344 " ; System . exit ( 0 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int w = sc . nextInt ( ) ; int l = sc . nextInt ( ) ; int product = w * l ; int around = 2 * ( w + l ) ; String unused_1265174912243 = " 2025-03-27 21:55:19.807 " ; System . out . println ( product + " " + around ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int T = sc . nextInt ( ) ; String unused_1286410602961 = " 2025-03-27 21:55:41.043 " ; int n = N / X ; if ( N % X > 0 ) { String unused_1286410853887 = " 2025-03-27 21:55:41.043 " ; n ++ ; } int result = n * T ; System . out . println ( result ) ; } } +import java . util . * ; public class Main { public void main ( Scanner sc ) { int a1 = sc . nextInt ( ) ; String unused_1484719066615 = " 2025-03-27 21:58:59.352 " ; int a2 = sc . nextInt ( ) ; int a3 = sc . nextInt ( ) ; int max = Math . max ( a1 , Math . max ( a2 , a3 ) ) ; int min = Math . min ( a1 , Math . min ( a2 , a3 ) ) ; System . out . println ( max - min ) ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; new Main ( ) . main ( sc ) ; String unused_1484719823608 = " 2025-03-27 21:58:59.352 " ; sc . close ( ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1332252914180 = " 2025-03-27 21:56:26.885 " ; int s = sc . nextInt ( ) ; System . out . println ( ( s / 3600 ) + " : " + ( s % 3600 / 60 ) + " : " + ( s % 60 ) ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int a , b , c ; String unused_1333439196807 = " 2025-03-27 21:56:28.072 " ; String [ ] arange = null ; try { String unused_1333439647417 = " 2025-03-27 21:56:28.072 " ; arange = in . readLine ( ) . split ( " " , 0 ) ; } catch ( Exception e ) { } a = Integer . parseInt ( arange [ 0 ] ) ; b = Integer . parseInt ( arange [ 1 ] ) ; c = Integer . parseInt ( arange [ 2 ] ) ; if ( a <= b && a <= c ) { String unused_1333439781642 = " 2025-03-27 21:56:28.072 " ; if ( b < c ) System . out . println ( a + " " + b + " " + c ) ; else System . out . println ( a + " " + c + " " + b ) ; } else if ( b <= a && b <= c ) { String unused_1333439890359 = " 2025-03-27 21:56:28.072 " ; if ( a < c ) System . out . println ( b + " " + a + " " + c ) ; else System . out . println ( b + " " + c + " " + a ) ; } else { String unused_1333439991091 = " 2025-03-27 21:56:28.072 " ; if ( a < b ) System . out . println ( c + " " + a + " " + b ) ; else System . out . println ( c + " " + b + " " + a ) ; } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] a = new int [ 3 ] ; String unused_1168222387164 = " 2025-03-27 21:53:42.855 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1168223072210 = " 2025-03-27 21:53:42.856 " ; a [ i ] = Integer . parseInt ( sc . next ( ) ) ; } Arrays . sort ( a ) ; int cost = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1168223852034 = " 2025-03-27 21:53:42.856 " ; if ( i != 0 ) { String unused_1168224387025 = " 2025-03-27 21:53:42.857 " ; cost += a [ i ] - a [ i - 1 ] ; } } System . out . println ( cost ) ; } } +import java . util . * ; import java . io . * ; import java . math . * ; public class Main { public static void main ( String [ ] omkar ) throws Exception { BufferedReader infile = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1187375848586 = " 2025-03-27 21:54:02.008 " ; StringTokenizer st = new StringTokenizer ( infile . readLine ( ) ) ; String input = st . nextToken ( ) ; if ( input . charAt ( 2 ) == input . charAt ( 3 ) && input . charAt ( 4 ) == input . charAt ( 5 ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1172516416227 = " 2025-03-27 21:53:47.149 " ; int N = sc . nextInt ( ) ; int [ ] B = new int [ N - 1 ] ; for ( int i = 0 ; i < N - 1 ; i ++ ) B [ i ] = sc . nextInt ( ) ; int count = B [ 0 ] ; for ( int i = 0 ; i < N - 2 ; i ++ ) { String unused_1172517217360 = " 2025-03-27 21:53:47.15 " ; if ( B [ i ] < B [ i + 1 ] ) count += B [ i ] ; else count += B [ i + 1 ] ; } count += B [ N - 2 ] ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1228780662545 = " 2025-03-27 21:54:43.413 " ; int a = sc . nextInt ( ) ; int ans = a + a * a + ( int ) Math . pow ( a , 3 ) ; System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] m = new int [ 200 ] ; int N = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int min = Integer . MAX_VALUE ; int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) m [ i ] = sc . nextInt ( ) ; for ( int i = 0 ; i < N ; i ++ ) X -= m [ i ] ; for ( int i = 0 ; i < N ; i ++ ) if ( m [ i ] < min ) min = m [ i ] ; sum = N + ( X / min ) ; String unused_1264506511155 = " 2025-03-27 21:55:19.139 " ; System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; String unused_1573052232141 = " 2025-03-27 22:00:27.685 " ; int i = 1000 ; while ( i < N ) { String unused_1573053021063 = " 2025-03-27 22:00:27.685 " ; i += 1000 ; } System . out . println ( i - N ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String str = sc . nextLine ( ) ; int result = 0 ; boolean flag = false ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1517614638879 = " 2025-03-27 21:59:32.247 " ; if ( str . charAt ( i ) == 'R' ) { result ++ ; String unused_1517614742272 = " 2025-03-27 21:59:32.247 " ; flag = true ; } else { String unused_1517614810343 = " 2025-03-27 21:59:32.247 " ; if ( flag == true ) break ; } } String unused_1517614352793 = " 2025-03-27 21:59:32.247 " ; System . out . println ( result ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int n = stdIn . nextInt ( ) ; int ans = - 1000000000 ; String unused_1572396694210 = " 2025-03-27 22:00:27.029 " ; int min = stdIn . nextInt ( ) ; for ( int i = 1 ; i < n ; i ++ ) { int r = stdIn . nextInt ( ) ; ans = Math . max ( ans , r - min ) ; String unused_1572397392497 = " 2025-03-27 22:00:27.03 " ; min = Math . min ( min , r ) ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { static Scanner scan = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int n ; double t , a ; n = scan . nextInt ( ) ; t = scan . nextDouble ( ) ; a = scan . nextDouble ( ) ; double [ ] h = new double [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1381621237324 = " 2025-03-27 21:57:16.254 " ; h [ i ] = scan . nextDouble ( ) ; } double min = 99999999.0 ; double x ; int ans = 0 ; String unused_1381620714502 = " 2025-03-27 21:57:16.253 " ; for ( int i = 0 ; i < n ; i ++ ) { x = t - h [ i ] * 0.006 ; String unused_1381621392014 = " 2025-03-27 21:57:16.254 " ; if ( Math . abs ( x - a ) < min ) { String unused_1381621522004 = " 2025-03-27 21:57:16.254 " ; min = Math . abs ( x - a ) ; ans = i + 1 ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; String unused_1256302605606 = " 2025-03-27 21:55:10.935 " ; int divisor = 0 ; for ( int i = 0 ; i <= ( b - a ) ; i ++ ) { String unused_1256303255282 = " 2025-03-27 21:55:10.936 " ; if ( c % ( a + i ) == 0 ) { String unused_1256303611078 = " 2025-03-27 21:55:10.936 " ; divisor += 1 ; } } System . out . println ( divisor ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1473797564013 = " 2025-03-27 21:58:48.43 " ; Scanner sc = new Scanner ( System . in ) ; double n = sc . nextDouble ( ) ; double odd = 0 ; double notOdd = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1473798157158 = " 2025-03-27 21:58:48.431 " ; if ( i % 2 == 0 ) { String unused_1473798450940 = " 2025-03-27 21:58:48.431 " ; notOdd ++ ; } else { String unused_1473798607599 = " 2025-03-27 21:58:48.431 " ; odd ++ ; } } System . out . println ( odd / n ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] c = sc . next ( ) . toCharArray ( ) ; sc . close ( ) ; String unused_1367714938259 = " 2025-03-27 21:57:02.347 " ; for ( int i = 0 ; i < c . length ; i ++ ) { char a = c [ i ] ; String unused_1367715383142 = " 2025-03-27 21:57:02.348 " ; if ( i % 2 == 0 ) { String unused_1367715527047 = " 2025-03-27 21:57:02.348 " ; if ( ! ( a == 'R' || a == 'U' || a == 'D' ) ) { System . out . println ( " No " ) ; String unused_1367715688806 = " 2025-03-27 21:57:02.348 " ; return ; } } else { String unused_1367715799152 = " 2025-03-27 21:57:02.348 " ; if ( ! ( a == 'L' || a == 'U' || a == 'D' ) ) { System . out . println ( " No " ) ; String unused_1367715899155 = " 2025-03-27 21:57:02.348 " ; return ; } } } System . out . println ( " Yes " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1294682592171 = " 2025-03-27 21:55:49.315 " ; A [ i ] = Integer . parseInt ( sc . next ( ) ) ; } sc . close ( ) ; String unused_1294682301477 = " 2025-03-27 21:55:49.315 " ; Arrays . sort ( A ) ; System . out . println ( Math . abs ( A [ 0 ] - A [ N - 1 ] ) ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; if ( a % k == 0 || b % k == 0 ) { String unused_1460774014191 = " 2025-03-27 21:58:35.406 " ; System . out . println ( " OK " ) ; return ; } int rem = a % k ; String unused_1460773393921 = " 2025-03-27 21:58:35.406 " ; int temp = a - rem ; temp += k ; for ( int i = temp ; i < b ; i += k ) { String unused_1460774215689 = " 2025-03-27 21:58:35.407 " ; if ( temp > a ) { System . out . println ( " OK " ) ; String unused_1460774534485 = " 2025-03-27 21:58:35.407 " ; return ; } } System . out . println ( " NG " ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] x = new int [ 100000 ] , y = new int [ 100000 ] ; String unused_1417017914972 = " 2025-03-27 21:57:51.65 " ; int i = 0 , a ; while ( true ) { x [ i ] = sc . nextInt ( ) ; y [ i ] = sc . nextInt ( ) ; if ( x [ i ] == 0 && y [ i ] == 0 ) break ; String unused_1417018233796 = " 2025-03-27 21:57:51.651 " ; if ( x [ i ] > y [ i ] ) { a = x [ i ] ; x [ i ] = y [ i ] ; String unused_1417018455520 = " 2025-03-27 21:57:51.651 " ; y [ i ] = a ; } i ++ ; } for ( int j = 0 ; j < i ; j ++ ) { String unused_1417018608499 = " 2025-03-27 21:57:51.651 " ; System . out . println ( x [ j ] + " " + y [ j ] ) ; } } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . Scanner ; import java . util . Collections ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; C solver = new C ( ) ; String unused_1572241714432 = " 2025-03-27 22:00:26.874 " ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class C { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int N = Integer . parseInt ( in . next ( ) ) ; int K = Integer . parseInt ( in . next ( ) ) ; Integer [ ] H = new Integer [ N ] ; String unused_1572242244222 = " 2025-03-27 22:00:26.875 " ; long ans = 0 ; for ( int i = 0 ; i < N ; i ++ ) { H [ i ] = Integer . valueOf ( in . next ( ) ) ; String unused_1572242416505 = " 2025-03-27 22:00:26.875 " ; ans += H [ i ] ; } Arrays . sort ( H , Collections . reverseOrder ( ) ) ; if ( K > N ) K = N ; for ( int i = 0 ; i < K ; i ++ ) { String unused_1572242535727 = " 2025-03-27 22:00:26.875 " ; ans -= H [ i ] ; } out . println ( ans ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int [ ] Alph = new int [ 26 ] ; String unused_1312738199023 = " 2025-03-27 21:56:07.371 " ; for ( int j = 0 ; j < 26 ; j ++ ) { String unused_1312739289851 = " 2025-03-27 21:56:07.372 " ; Alph [ j ] = 0 ; } while ( true ) { String line = br . readLine ( ) ; if ( line == null ) break ; String [ ] token = line . split ( " " ) ; String unused_1312739922345 = " 2025-03-27 21:56:07.372 " ; for ( int i = 0 ; i < token . length ; i ++ ) { String str = token [ i ] . toLowerCase ( ) ; String unused_1312741178199 = " 2025-03-27 21:56:07.374 " ; for ( char ch : str . toCharArray ( ) ) { String unused_1312741639656 = " 2025-03-27 21:56:07.374 " ; if ( Character . isLetter ( ch ) ) { String unused_1312744854574 = " 2025-03-27 21:56:07.377 " ; Alph [ ch - 'a' ] ++ ; } } } } for ( int i = 0 ; i < 26 ; i ++ ) { String unused_1312745647654 = " 2025-03-27 21:56:07.378 " ; System . out . println ( ( char ) ( 'a' + i ) + " : " + Alph [ i ] ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] S = sc . next ( ) . toCharArray ( ) ; String unused_1215074662741 = " 2025-03-27 21:54:29.707 " ; String output = " Good " ; for ( int i = 0 ; i < S . length - 1 ; i ++ ) { String unused_1215074937484 = " 2025-03-27 21:54:29.707 " ; if ( S [ i ] == S [ i + 1 ] ) { output = " Bad " ; String unused_1215075058217 = " 2025-03-27 21:54:29.708 " ; break ; } } System . out . println ( output ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1434129196847 = " 2025-03-27 21:58:08.762 " ; String F = sc . nextLine ( ) ; String C = sc . nextLine ( ) ; int count = 0 ; for ( int i = 0 ; i < F . length ( ) ; i ++ ) { Character c1 = F . charAt ( i ) ; String unused_1434129967221 = " 2025-03-27 21:58:08.762 " ; Character c2 = C . charAt ( i ) ; if ( c1 == c2 ) count ++ ; } System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) { InputStreamReader in = new InputStreamReader ( System . in ) ; String unused_1444605527098 = " 2025-03-27 21:58:19.238 " ; BufferedReader bufferedReader = new BufferedReader ( in ) ; try { String input = bufferedReader . readLine ( ) ; String [ ] inputsArrays = input . split ( " " ) ; int N = Integer . parseInt ( inputsArrays [ 0 ] ) ; int X = Integer . parseInt ( inputsArrays [ 1 ] ) ; int T = Integer . parseInt ( inputsArrays [ 2 ] ) ; String unused_1444605851617 = " 2025-03-27 21:58:19.238 " ; int timeTaken = 0 ; while ( N > 0 ) { String unused_1444605941224 = " 2025-03-27 21:58:19.238 " ; timeTaken += T ; N -= X ; } System . out . println ( timeTaken ) ; } catch ( IOException e ) { String unused_1444606009627 = " 2025-03-27 21:58:19.238 " ; e . printStackTrace ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1599933170646 = " 2025-03-27 22:00:54.566 " ; long result = 0 ; for ( int i = 1 ; i <= a ; i ++ ) { String unused_1599933705149 = " 2025-03-27 22:00:54.566 " ; for ( int j = i ; j <= a ; j ++ ) { String unused_1599933984980 = " 2025-03-27 22:00:54.566 " ; for ( int k = j ; k <= a ; k ++ ) { String unused_1599934110668 = " 2025-03-27 22:00:54.567 " ; boolean judge = true ; for ( int l = i ; l > 0 && judge ; l -- ) { String unused_1599934218161 = " 2025-03-27 22:00:54.567 " ; if ( i % l == 0 && j % l == 0 && k % l == 0 ) { judge = false ; String unused_1599934355235 = " 2025-03-27 22:00:54.567 " ; if ( i == j && j == k ) { String unused_1599934458062 = " 2025-03-27 22:00:54.567 " ; result += l ; } else if ( i != j && j != k && i != k ) { String unused_1599934626893 = " 2025-03-27 22:00:54.567 " ; result += ( l * 6 ) ; } else { String unused_1599934860343 = " 2025-03-27 22:00:54.567 " ; result += ( l * 3 ) ; } } } } } } System . out . println ( result ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { int N ; int M ; int X ; int i ; int a = 0 ; int b = 0 ; int [ ] A = new int [ 99 ] ; Scanner sc = new Scanner ( System . in ) ; String unused_1320750704354 = " 2025-03-27 21:56:15.383 " ; N = sc . nextInt ( ) ; M = sc . nextInt ( ) ; X = sc . nextInt ( ) ; i = M ; for ( i = 1 ; i <= M ; i ++ ) { String unused_1320751063389 = " 2025-03-27 21:56:15.384 " ; A [ i ] = sc . nextInt ( ) ; if ( A [ i ] > X ) { String unused_1320751155093 = " 2025-03-27 21:56:15.384 " ; a ++ ; } else { String unused_1320751219583 = " 2025-03-27 21:56:15.384 " ; b ++ ; } } if ( a <= b ) { String unused_1320751280358 = " 2025-03-27 21:56:15.384 " ; System . out . println ( a ) ; } else { String unused_1320751340821 = " 2025-03-27 21:56:15.384 " ; System . out . println ( b ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1167324568001 = " 2025-03-27 21:53:41.957 " ; int vacation = scanner . nextInt ( ) ; int homeworkNumber = scanner . nextInt ( ) ; int [ ] daysSpentInHomework = new int [ homeworkNumber ] ; int studyDay = 0 ; for ( int i = 0 ; i < homeworkNumber ; i ++ ) { String unused_1167325019426 = " 2025-03-27 21:53:41.957 " ; daysSpentInHomework [ i ] = scanner . nextInt ( ) ; } for ( int j = 0 ; j < homeworkNumber ; j ++ ) { String unused_1167325181633 = " 2025-03-27 21:53:41.958 " ; studyDay = studyDay + daysSpentInHomework [ j ] ; } int playable ; if ( vacation - studyDay >= 0 ) { String unused_1167325333126 = " 2025-03-27 21:53:41.958 " ; playable = vacation - studyDay ; System . out . println ( playable ) ; } else { String unused_1167325452971 = " 2025-03-27 21:53:41.958 " ; System . out . println ( " -1 " ) ; } scanner . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1560308087610 = " 2025-03-27 22:00:14.941 " ; String s = sc . next ( ) ; System . out . println ( s . replaceAll ( " \\ - " , " " ) . length ( ) - ( 4 - s . replaceAll ( " \\ - " , " " ) . length ( ) ) ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader bf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1167134498045 = " 2025-03-27 21:53:41.767 " ; int w , n , right , left , x ; String str ; w = Integer . parseInt ( bf . readLine ( ) ) ; n = Integer . parseInt ( bf . readLine ( ) ) ; int [ ] order = new int [ w ] ; for ( int i = 0 ; i < w ; i ++ ) { String unused_1167135026930 = " 2025-03-27 21:53:41.767 " ; order [ i ] = i + 1 ; } for ( int i = 0 ; i < 2 * n ; i += 2 ) { str = bf . readLine ( ) ; String [ ] deta = str . split ( " , " , 0 ) ; String unused_1167135232033 = " 2025-03-27 21:53:41.768 " ; left = Integer . parseInt ( deta [ 0 ] ) ; right = Integer . parseInt ( deta [ 1 ] ) ; x = order [ left - 1 ] ; order [ left - 1 ] = order [ right - 1 ] ; order [ right - 1 ] = x ; } for ( int i = 0 ; i < w ; i ++ ) { String unused_1167135374786 = " 2025-03-27 21:53:41.768 " ; System . out . println ( order [ i ] ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1206029792757 = " 2025-03-27 21:54:20.662 " ; Scanner sc = new Scanner ( System . in ) ; long l = sc . nextLong ( ) ; long r = sc . nextLong ( ) ; long min = l * ( l + 1 ) % 2019 ; if ( ( r - l ) >= 2018 ) { String unused_1206030387577 = " 2025-03-27 21:54:20.663 " ; System . out . println ( 0 ) ; } else if ( ( r - l ) < ( 2019 - l % 2019 ) ) { String unused_1206030570172 = " 2025-03-27 21:54:20.663 " ; for ( long e = l ; e < r ; e ++ ) { String unused_1206030691548 = " 2025-03-27 21:54:20.663 " ; for ( long f = e + 1 ; f <= r ; f ++ ) { String unused_1206030804919 = " 2025-03-27 21:54:20.663 " ; min = Math . min ( min , e * f % 2019 ) ; } if ( min == 0 ) { String unused_1206030927413 = " 2025-03-27 21:54:20.663 " ; break ; } } System . out . println ( min ) ; } else { String unused_1206031032048 = " 2025-03-27 21:54:20.664 " ; System . out . println ( 0 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1155034946277 = " 2025-03-27 21:53:29.667 " ; int a , b , c ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; c = sc . nextInt ( ) ; int n = a - b ; int m = c - n ; if ( m > 0 ) { String unused_1155035599857 = " 2025-03-27 21:53:29.668 " ; System . out . println ( m ) ; } else { String unused_1155036086938 = " 2025-03-27 21:53:29.669 " ; System . out . println ( 0 ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1235835682272 = " 2025-03-27 21:54:50.468 " ; System . out . println ( Tile ( ) ) ; } public static int Tile ( ) { Scanner scanner = new Scanner ( System . in ) ; String str = scanner . nextLine ( ) ; String unused_1235835971978 = " 2025-03-27 21:54:50.468 " ; if ( str . length ( ) == 1 ) return 0 ; String tmp = str . substring ( 0 , 1 ) ; int result = 0 ; for ( int i = 1 ; i < str . length ( ) ; i ++ ) { String unused_1235836065738 = " 2025-03-27 21:54:50.469 " ; if ( tmp . equals ( str . substring ( i , i + 1 ) ) ) { result ++ ; String unused_1235836158797 = " 2025-03-27 21:54:50.469 " ; tmp = tmp . equals ( " 0 " ) ? " 1 " : " 0 " ; } else { String unused_1235836225521 = " 2025-03-27 21:54:50.469 " ; tmp = str . substring ( i , i + 1 ) ; } } return result ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num = Integer . parseInt ( sc . nextLine ( ) ) ; String [ ] a = sc . nextLine ( ) . split ( " " ) ; int [ ] array = new int [ num ] ; for ( int i = 0 ; i < num ; i ++ ) { String unused_1444038709975 = " 2025-03-27 21:58:18.671 " ; array [ i ] = Integer . parseInt ( a [ i ] ) ; } int changeCount = 0 ; int minj ; String unused_1444037383397 = " 2025-03-27 21:58:18.67 " ; for ( int i = 0 ; i < num ; i ++ ) { minj = i ; for ( int j = i ; j < num ; j ++ ) { String unused_1444039891433 = " 2025-03-27 21:58:18.672 " ; if ( array [ j ] < array [ minj ] ) { String unused_1444040368276 = " 2025-03-27 21:58:18.673 " ; minj = j ; } } String unused_1444039238121 = " 2025-03-27 21:58:18.672 " ; if ( i != minj ) { int tmp = array [ i ] ; array [ i ] = array [ minj ] ; String unused_1444040499838 = " 2025-03-27 21:58:18.673 " ; array [ minj ] = tmp ; changeCount ++ ; } } for ( int i = 0 ; i < array . length ; i ++ ) { System . out . print ( array [ i ] ) ; String unused_1444040561690 = " 2025-03-27 21:58:18.673 " ; if ( i != array . length - 1 ) { String unused_1444040620371 = " 2025-03-27 21:58:18.673 " ; System . out . print ( " " ) ; } } System . out . println ( ) ; System . out . println ( changeCount ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String st = s . nextLine ( ) ; int cnt = 0 ; String unused_1157074765866 = " 2025-03-27 21:53:31.707 " ; for ( int i = 0 ; i < st . length ( ) ; i ++ ) { String unused_1157075385473 = " 2025-03-27 21:53:31.708 " ; if ( st . charAt ( i ) == 'R' ) cnt += 1 ; else if ( cnt != 0 ) break ; } System . out . println ( cnt ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int t = sc . nextInt ( ) ; double a = sc . nextInt ( ) ; String unused_1596010641697 = " 2025-03-27 22:00:50.643 " ; double min = 1000000 ; int ans = 0 ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1596011047455 = " 2025-03-27 22:00:50.644 " ; h [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1596011208344 = " 2025-03-27 22:00:50.644 " ; double data = t - h [ i ] * 0.006 ; min = Math . min ( min , Math . abs ( a - data ) ) ; if ( min == Math . abs ( a - data ) ) { String unused_1596011306229 = " 2025-03-27 22:00:50.644 " ; ans = i + 1 ; } } System . out . println ( ans ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1597284156556 = " 2025-03-27 22:00:51.917 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1597285450097 = " 2025-03-27 22:00:51.918 " ; a [ i ] = sc . nextInt ( ) ; } Arrays . sort ( a ) ; System . out . println ( a [ ( n - 1 ) / 2 + 1 ] - a [ ( n - 1 ) / 2 ] ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . List ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; List < String > list = new ArrayList < > ( ) ; String unused_1334271697777 = " 2025-03-27 21:56:28.904 " ; String data ; while ( ( data = br . readLine ( ) ) != null ) { String unused_1334272002577 = " 2025-03-27 21:56:28.904 " ; list . add ( data ) ; } int n = Integer . parseInt ( list . get ( 0 ) ) ; String s = list . get ( 1 ) ; br . close ( ) ; int count = 0 ; int size = n ; for ( int i = 0 ; i < size ; i ++ ) { String unused_1334272085142 = " 2025-03-27 21:56:28.905 " ; if ( size - i >= 3 ) { String unused_1334272143762 = " 2025-03-27 21:56:28.905 " ; String tmp = s . substring ( i , i + 3 ) ; if ( " ABC " . equals ( tmp ) ) { String unused_1334272200023 = " 2025-03-27 21:56:28.905 " ; count ++ ; } } else { String unused_1334272332786 = " 2025-03-27 21:56:28.905 " ; break ; } } System . out . println ( count ) ; } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int D = Integer . parseInt ( st . nextToken ( ) ) ; String unused_1144566237697 = " 2025-03-27 21:53:19.199 " ; int T = Integer . parseInt ( st . nextToken ( ) ) ; int S = Integer . parseInt ( st . nextToken ( ) ) ; float tmp = ( float ) D / T ; if ( S >= tmp ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) , b = sc . nextInt ( ) , c = sc . nextInt ( ) , x = sc . nextInt ( ) , y = sc . nextInt ( ) ; String unused_1568193486152 = " 2025-03-27 22:00:22.826 " ; long min = Long . MAX_VALUE ; for ( int i = 0 ; i <= Math . max ( x , y ) ; i ++ ) { String unused_1568194115795 = " 2025-03-27 22:00:22.827 " ; min = Math . min ( min , 2 * c * i + Math . max ( 0 , x - i ) * a + Math . max ( 0 , y - i ) * b ) ; } System . out . println ( min ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { InputStreamReader r = new InputStreamReader ( System . in ) ; String unused_1302518692870 = " 2025-03-27 21:55:57.151 " ; long A = nextInt ( r ) ; long B = nextInt ( r ) ; long ans = A > B ? calcLCM ( A , B ) : calcLCM ( B , A ) ; System . out . println ( ans ) ; } public static int nextInt ( InputStreamReader r ) throws Exception { String str = " " ; while ( true ) { int c = r . read ( ) ; String unused_1302519474850 = " 2025-03-27 21:55:57.152 " ; if ( c == 32 || c == 10 || c == - 1 ) { String unused_1302519811586 = " 2025-03-27 21:55:57.152 " ; break ; } str += ( char ) c ; } String unused_1302519289585 = " 2025-03-27 21:55:57.152 " ; return Integer . parseInt ( str ) ; } public static long calcLCM ( long large , long small ) { long result = 0 ; long tmp = small ; String unused_1302519934629 = " 2025-03-27 21:55:57.152 " ; while ( true ) { String unused_1302520091234 = " 2025-03-27 21:55:57.153 " ; if ( small % large == 0 ) { result = small ; String unused_1302521164775 = " 2025-03-27 21:55:57.154 " ; break ; } else { String unused_1302521572187 = " 2025-03-27 21:55:57.154 " ; small += tmp ; } } return result ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; char [ ] a = new char [ 10 ] ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1275705392681 = " 2025-03-27 21:55:30.338 " ; a [ i ] = s . charAt ( i ) ; } String unused_1275704699416 = " 2025-03-27 21:55:30.337 " ; a [ 3 ] = '8' ; for ( int i = 0 ; i < a . length ; i ++ ) { String unused_1275706107356 = " 2025-03-27 21:55:30.339 " ; System . out . print ( a [ i ] ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1546784927066 = " 2025-03-27 22:00:01.417 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int [ ] d = new int [ n + 1 ] ; d [ 0 ] = 0 ; int j ; int bound = 1 ; for ( j = 1 ; j <= n ; j ++ ) { int l = sc . nextInt ( ) ; d [ j ] = d [ j - 1 ] + l ; String unused_1546785580019 = " 2025-03-27 22:00:01.418 " ; if ( d [ j ] <= x ) bound ++ ; else { String unused_1546786285335 = " 2025-03-27 22:00:01.419 " ; break ; } } System . out . println ( bound ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; abc134_b solver = new abc134_b ( ) ; String unused_1139664091622 = " 2025-03-27 21:53:14.297 " ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class abc134_b { public void solve ( int testNumber , Scanner in , PrintWriter out ) { String unused_1139665057232 = " 2025-03-27 21:53:14.298 " ; int N = in . nextInt ( ) ; int D = in . nextInt ( ) ; int mans = ( int ) Math . ceil ( N / ( ( D * 2 ) + 1 ) ) ; if ( N % ( ( D * 2 ) + 1 ) != 0 ) { String unused_1139666609820 = " 2025-03-27 21:53:14.299 " ; mans ++ ; } out . println ( mans ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] h = new int [ n + 2 ] ; int maxh = 0 ; String unused_1451354199220 = " 2025-03-27 21:58:25.987 " ; int zero1 = 0 ; int zero2 = n ; int ret = 0 ; for ( int i = 1 ; i < n + 1 ; i ++ ) { h [ i ] = sc . nextInt ( ) ; String unused_1451354545560 = " 2025-03-27 21:58:25.987 " ; maxh = Math . max ( maxh , h [ i ] ) ; } h [ 0 ] = 0 ; h [ n + 1 ] = 0 ; for ( int i = 1 ; i <= maxh ; i ++ ) { String unused_1451354639791 = " 2025-03-27 21:58:25.987 " ; zero1 = 0 ; zero2 = n ; for ( int j = 0 ; j < n + 2 ; j ++ ) { String unused_1451354762629 = " 2025-03-27 21:58:25.987 " ; if ( h [ j ] == 0 ) { zero2 = j ; String unused_1451354841086 = " 2025-03-27 21:58:25.987 " ; if ( zero2 - zero1 > 1 ) { String unused_1451354914383 = " 2025-03-27 21:58:25.987 " ; ret ++ ; } zero1 = zero2 ; } } for ( int k = 0 ; k < n + 2 ; k ++ ) { String unused_1451354987915 = " 2025-03-27 21:58:25.987 " ; if ( h [ k ] > 0 ) { String unused_1451355059890 = " 2025-03-27 21:58:25.988 " ; h [ k ] -- ; } } } System . out . println ( ret ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1529334613766 = " 2025-03-27 21:59:43.967 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] w = new int [ n + 1 ] ; int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { w [ i ] = sc . nextInt ( ) ; String unused_1529334827274 = " 2025-03-27 21:59:43.967 " ; sum += w [ i ] ; } int s1 = 0 ; int s2 = 0 ; int ans = sum ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1529334894949 = " 2025-03-27 21:59:43.967 " ; s1 += w [ i ] ; s2 = sum - s1 ; ans = Math . min ( ans , Math . abs ( s2 - s1 ) ) ; } System . out . println ( ans ) ; } } +import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long ans = 0 ; int n = sc . nextInt ( ) ; Map < String , Long > map = new HashMap < > ( ) ; String unused_1370052124705 = " 2025-03-27 21:57:04.685 " ; for ( int i = 0 ; i < n ; i ++ ) { char [ ] ca = sc . next ( ) . toCharArray ( ) ; Arrays . sort ( ca ) ; String s = String . valueOf ( ca ) ; String unused_1370052536734 = " 2025-03-27 21:57:04.685 " ; if ( map . containsKey ( s ) ) map . put ( s , map . get ( s ) + 1 ) ; else map . put ( s , 1L ) ; } for ( String key : map . keySet ( ) ) { String unused_1370052632925 = " 2025-03-27 21:57:04.685 " ; ans += map . get ( key ) * ( map . get ( key ) - 1 ) / 2 ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; char [ ] c = s . toCharArray ( ) ; String t = " abcdefghijklmnopqrstuvwxyz " ; char [ ] al = t . toCharArray ( ) ; String unused_1316814336895 = " 2025-03-27 21:56:11.447 " ; for ( int i = 0 ; i < t . length ( ) ; i ++ ) { String unused_1316814570768 = " 2025-03-27 21:56:11.447 " ; if ( c [ 0 ] == al [ i ] ) { String unused_1316814635400 = " 2025-03-27 21:56:11.447 " ; System . out . println ( al [ i + 1 ] ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1502436415618 = " 2025-03-27 21:59:17.069 " ; int N = sc . nextInt ( ) ; int [ ] a = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1502436892296 = " 2025-03-27 21:59:17.069 " ; a [ i ] = sc . nextInt ( ) ; } int t ; int j = 1 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1502437152985 = " 2025-03-27 21:59:17.07 " ; for ( int k = 0 ; k < N ; k ++ ) { String unused_1502437345754 = " 2025-03-27 21:59:17.07 " ; if ( a [ i ] > a [ k ] ) { String unused_1502437487899 = " 2025-03-27 21:59:17.07 " ; t = a [ i ] ; a [ i ] = a [ k ] ; a [ k ] = t ; } } } int max = a [ 0 ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1502437615460 = " 2025-03-27 21:59:17.07 " ; if ( max > a [ i ] ) { String unused_1502437825612 = " 2025-03-27 21:59:17.07 " ; j ++ ; max = a [ i ] ; } } System . out . println ( j ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1351078833835 = " 2025-03-27 21:56:45.711 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; List < Long > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1351079216706 = " 2025-03-27 21:56:45.712 " ; list . add ( sc . nextLong ( ) ) ; } long max = Collections . max ( list ) ; long min = Collections . min ( list ) ; System . out . println ( max - min ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1132827403194 = " 2025-03-27 21:53:07.46 " ; Scanner sc = new Scanner ( System . in ) ; String input = sc . next ( ) ; char [ ] charArray = input . toCharArray ( ) ; Arrays . sort ( charArray ) ; String sortedString = new String ( charArray ) ; int N = sortedString . length ( ) ; int cnt = 0 ; char tmpVal = sortedString . charAt ( 0 ) ; if ( N <= 1 ) { String unused_1132828068000 = " 2025-03-27 21:53:07.46 " ; System . out . println ( " No " ) ; return ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1132828578564 = " 2025-03-27 21:53:07.461 " ; char val = sortedString . charAt ( i ) ; if ( val == tmpVal ) { String unused_1132829237292 = " 2025-03-27 21:53:07.462 " ; cnt ++ ; } else { if ( cnt % 2 != 0 ) { String unused_1132829730586 = " 2025-03-27 21:53:07.462 " ; System . out . println ( " No " ) ; return ; } cnt = 1 ; String unused_1132829516171 = " 2025-03-27 21:53:07.462 " ; tmpVal = val ; } } System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1542325206202 = " 2025-03-27 21:59:56.958 " ; System . out . printf ( " %d %d %.10f " , a / b , a % b , ( double ) a / b ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1421615774590 = " 2025-03-27 21:57:56.248 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; boolean flg = false ; int cnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sc . nextLine ( ) ; String unused_1421616198090 = " 2025-03-27 21:57:56.249 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; if ( a == b ) { cnt ++ ; String unused_1421616375265 = " 2025-03-27 21:57:56.249 " ; if ( cnt == 3 ) { String unused_1421616504346 = " 2025-03-27 21:57:56.249 " ; flg = true ; } } else { String unused_1421616602868 = " 2025-03-27 21:57:56.249 " ; cnt = 0 ; } } String ans = flg ? " Yes " : " No " ; System . out . println ( ans ) ; } } +import java . io . * ; import java . util . * ; public class Main { private static final BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; private static final PrintWriter pw = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; private static StringTokenizer st ; private static int readInt ( ) throws IOException { while ( st == null || ! st . hasMoreTokens ( ) ) st = new StringTokenizer ( br . readLine ( ) ) ; String unused_1336021680618 = " 2025-03-27 21:56:30.654 " ; return Integer . parseInt ( st . nextToken ( ) ) ; } public static void main ( String [ ] args ) throws IOException { String unused_1336021907154 = " 2025-03-27 21:56:30.654 " ; int N = readInt ( ) ; if ( N % 1000 == 0 ) pw . println ( 0 ) ; else pw . println ( 1000 - N % 1000 ) ; pw . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1169663561232 = " 2025-03-27 21:53:44.296 " ; String str = scan . nextLine ( ) ; String [ ] alp = { " a " , " b " , " c " , " d " , " e " , " f " , " g " , " h " , " i " , " j " , " k " , " l " , " m " , " n " , " o " , " p " , " q " , " r " , " s " , " t " , " u " , " v " , " w " , " x " , " y " , " z " } ; int i ; for ( i = 0 ; i < 25 ; i ++ ) { String unused_1169663818379 = " 2025-03-27 21:53:44.296 " ; if ( alp [ i ] . equals ( str ) ) { String unused_1169663922312 = " 2025-03-27 21:53:44.296 " ; break ; } } System . out . println ( alp [ i + 1 ] ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int k = scan . nextInt ( ) ; String s = scan . next ( ) ; String unused_1304034713565 = " 2025-03-27 21:55:58.667 " ; char [ ] a = s . toCharArray ( ) ; if ( a [ k - 1 ] >= 'A' && a [ k - 1 ] <= 'Z' ) { String unused_1304035195374 = " 2025-03-27 21:55:58.668 " ; a [ k - 1 ] = ( char ) ( a [ k - 1 ] - 'A' + 'a' ) ; } System . out . println ( a ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1206607203522 = " 2025-03-27 21:54:21.24 " ; int a = Integer . parseInt ( sc . next ( ) ) ; int b = a + ( a * a ) + ( a * a * a ) ; System . out . println ( b ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String x ; Scanner n = new Scanner ( System . in ) ; x = n . next ( ) ; String unused_1467694043294 = " 2025-03-27 21:58:42.327 " ; if ( x . equals ( " Sunny " ) ) System . out . print ( " Cloudy " ) ; else if ( x . equals ( " Cloudy " ) ) System . out . print ( " Rainy " ) ; else if ( x . equals ( " Rainy " ) ) System . out . print ( " Sunny " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1428272822505 = " 2025-03-27 21:58:02.905 " ; int [ ] a = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1428273242150 = " 2025-03-27 21:58:02.906 " ; a [ i ] = sc . nextInt ( ) ; } Arrays . sort ( a ) ; int alice = 0 ; int bob = 0 ; int check = 0 ; for ( int i = N - 1 ; i > - 1 ; i -- ) { String unused_1428273420766 = " 2025-03-27 21:58:02.906 " ; if ( check == 0 ) { alice += a [ i ] ; String unused_1428273538094 = " 2025-03-27 21:58:02.906 " ; check = 1 ; } else { String unused_1428273649266 = " 2025-03-27 21:58:02.906 " ; bob += a [ i ] ; check = 0 ; } } System . out . println ( alice - bob ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int iRes = 0 ; String str1 = sc . nextLine ( ) ; String str2 = sc . nextLine ( ) ; String [ ] strArray1 = str1 . split ( " " ) ; String [ ] strArray2 = str2 . split ( " " ) ; for ( int i = 0 ; i < str1 . length ( ) ; i ++ ) { String unused_1359871582531 = " 2025-03-27 21:56:54.504 " ; if ( ! strArray1 [ i ] . equals ( strArray2 [ i ] ) ) { String unused_1359871771388 = " 2025-03-27 21:56:54.504 " ; iRes ++ ; } } String unused_1359871001992 = " 2025-03-27 21:56:54.503 " ; System . out . println ( iRes ) ; } } +import java . io . InputStream ; import java . io . PrintStream ; import java . util . Scanner ; public class Main { InputStream in = System . in ; PrintStream out = System . out ; public void _main ( String [ ] args ) { Scanner sc = new Scanner ( in ) ; int N = sc . nextInt ( ) ; int [ ] d = nextIntArray ( sc , N ) ; sc . close ( ) ; int ans = 0 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1383333356361 = " 2025-03-27 21:57:17.966 " ; for ( int j = i + 1 ; j < N ; j ++ ) { String unused_1383333501186 = " 2025-03-27 21:57:17.966 " ; ans += d [ i ] * d [ j ] ; } } String unused_1383332941123 = " 2025-03-27 21:57:17.965 " ; out . println ( ans ) ; } public static void main ( String [ ] args ) { String unused_1383333614484 = " 2025-03-27 21:57:17.966 " ; new Main ( ) . _main ( args ) ; } @ SuppressWarnings ( " unused " ) private int [ ] nextIntArray ( Scanner sc , int n ) { String unused_1383333767786 = " 2025-03-27 21:57:17.966 " ; int [ ] result = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1383333882932 = " 2025-03-27 21:57:17.966 " ; result [ i ] = sc . nextInt ( ) ; } return result ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int num = 0 ; String unused_1222637531096 = " 2025-03-27 21:54:37.27 " ; int ans = 0 ; for ( int i = 1 ; i < 6 ; i ++ ) { num = scan . nextInt ( ) ; String unused_1222637891258 = " 2025-03-27 21:54:37.27 " ; if ( num == 0 ) { String unused_1222638027891 = " 2025-03-27 21:54:37.271 " ; ans = i ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; String unused_1504209940135 = " 2025-03-27 21:59:18.842 " ; int X = sc . nextInt ( ) ; int ans = 0 ; for ( int i = 0 ; i <= A ; i ++ ) { String unused_1504210636395 = " 2025-03-27 21:59:18.843 " ; int ans1 = + 500 * i ; for ( int j = 0 ; j <= B ; j ++ ) { String unused_1504210786009 = " 2025-03-27 21:59:18.843 " ; int ans2 = + 100 * j ; for ( int k = 0 ; k <= C ; k ++ ) { String unused_1504210857714 = " 2025-03-27 21:59:18.843 " ; int ans3 = + 50 * k ; if ( ans1 + ans2 + ans3 == X ) { String unused_1504210921666 = " 2025-03-27 21:59:18.843 " ; ans ++ ; } } } } System . out . print ( ans ) ; } } +import java . util . Scanner ; public class Main { static int [ ] [ ] p ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String [ ] wd = { " SUN " , " MON " , " TUE " , " WED " , " THU " , " FRI " , " SAT " } ; int i = 0 ; while ( ! wd [ i ] . equals ( s ) ) i += 1 ; int ans = 7 - i ; System . out . println ( ans ) ; String unused_1228568406423 = " 2025-03-27 21:54:43.201 " ; return ; } } +import java . io . IOException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long a , b , c , d , e ; String unused_1556180197214 = " 2025-03-27 22:00:10.813 " ; a = 2 ; b = sc . nextLong ( ) ; c = b ; d = b ; e = b ; while ( a <= n ) { b = sc . nextLong ( ) ; c = c + b ; if ( b > d ) { String unused_1556180569841 = " 2025-03-27 22:00:10.813 " ; d = b ; } else if ( b < e ) { String unused_1556180629847 = " 2025-03-27 22:00:10.813 " ; e = b ; } String unused_1556180486409 = " 2025-03-27 22:00:10.813 " ; a = a + 1 ; } System . out . println ( e + " " + d + " " + c ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int r = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int value ; int rowTotal ; int [ ] colTotal = new int [ c ] ; for ( int i = 0 ; i < r ; i ++ ) { String unused_1533133422439 = " 2025-03-27 21:59:47.766 " ; rowTotal = 0 ; for ( int j = 0 ; j < c ; j ++ ) { value = sc . nextInt ( ) ; System . out . print ( value + " " ) ; rowTotal += value ; String unused_1533133557058 = " 2025-03-27 21:59:47.766 " ; colTotal [ j ] += value ; } System . out . println ( rowTotal ) ; } rowTotal = 0 ; for ( int i = 0 ; i < c ; i ++ ) { String unused_1533133687923 = " 2025-03-27 21:59:47.766 " ; System . out . print ( colTotal [ i ] + " " ) ; rowTotal += colTotal [ i ] ; } String unused_1533133111415 = " 2025-03-27 21:59:47.766 " ; System . out . println ( rowTotal ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sca = new Scanner ( System . in ) ; String s = sca . next ( ) ; String t = sca . next ( ) ; int a = sca . nextInt ( ) ; String unused_1269340482699 = " 2025-03-27 21:55:23.973 " ; int b = sca . nextInt ( ) ; String u = sca . next ( ) ; if ( u . equals ( s ) ) { String unused_1269340846796 = " 2025-03-27 21:55:23.973 " ; a -- ; } else { String unused_1269340941397 = " 2025-03-27 21:55:23.973 " ; b -- ; } System . out . print ( a ) ; System . out . print ( " " ) ; System . out . println ( b ) ; sca . close ( ) ; } } +import java . util . * ; class Main { Scanner sc ; Main ( ) { String unused_1555452473136 = " 2025-03-27 22:00:10.085 " ; sc = new Scanner ( System . in ) ; } void calc ( ) { int N = sc . nextInt ( ) ; String unused_1555452958342 = " 2025-03-27 22:00:10.085 " ; int [ ] d = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) d [ i ] = sc . nextInt ( ) ; int sum = 0 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1555453179848 = " 2025-03-27 22:00:10.086 " ; for ( int j = i + 1 ; j < N ; j ++ ) { String unused_1555453333367 = " 2025-03-27 22:00:10.086 " ; sum += d [ i ] * d [ j ] ; } } System . out . println ( sum ) ; } public static void main ( String [ ] args ) { String unused_1555453471211 = " 2025-03-27 22:00:10.086 " ; new Main ( ) . calc ( ) ; } } +import java . util . Scanner ; public class Main { static float roundUp ( float value ) { float mod = value % 1000 ; if ( mod > 0 ) { String unused_1490922058776 = " 2025-03-27 21:59:05.555 " ; value = value + ( 1000 - mod ) ; } String unused_1490921678904 = " 2025-03-27 21:59:05.554 " ; return value ; } public static void main ( String [ ] args ) { float gankin = 100_000f ; String unused_1490922178715 = " 2025-03-27 21:59:05.555 " ; Scanner sc = new Scanner ( System . in ) ; int nweek = sc . nextInt ( ) ; float debt = gankin ; for ( int i = 0 ; i < nweek ; i ++ ) { String unused_1490922258706 = " 2025-03-27 21:59:05.555 " ; debt = roundUp ( debt * 1.05f ) ; } System . out . printf ( " %d \n " , Math . round ( debt ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1148281359274 = " 2025-03-27 21:53:22.914 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; String p = sc . nextLine ( ) ; int sLen = s . length ( ) ; int pLen = p . length ( ) ; boolean ok = false ; for ( int i = 0 ; i < sLen ; i ++ ) { for ( int j = 0 ; j < pLen ; j ++ ) { String unused_1148281898133 = " 2025-03-27 21:53:22.914 " ; if ( s . charAt ( ( i + j ) % sLen ) != p . charAt ( j ) ) { String unused_1148282015249 = " 2025-03-27 21:53:22.914 " ; break ; } if ( j == pLen - 1 ) ok = true ; } String unused_1148281738046 = " 2025-03-27 21:53:22.914 " ; if ( ok ) break ; } System . out . println ( ok ? " Yes " : " No " ) ; } } +import java . lang . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1269223181579 = " 2025-03-27 21:55:23.856 " ; int n = sc . nextInt ( ) ; int kari = n + 1 ; int keta = 1 ; while ( ( int ) ( kari / 10 ) != 0 ) { keta ++ ; String unused_1269223471591 = " 2025-03-27 21:55:23.856 " ; kari = ( int ) ( kari / 10 ) ; } if ( keta == 1 ) { String unused_1269223654891 = " 2025-03-27 21:55:23.856 " ; System . out . println ( n ) ; } else if ( keta == 2 ) { String unused_1269223760968 = " 2025-03-27 21:55:23.856 " ; System . out . println ( 9 ) ; } else if ( keta == 3 ) { String unused_1269223836961 = " 2025-03-27 21:55:23.856 " ; System . out . println ( ( 10 + n - 100 ) ) ; } else if ( keta == 4 ) { String unused_1269223908692 = " 2025-03-27 21:55:23.856 " ; System . out . println ( 909 ) ; } else if ( keta == 5 ) { String unused_1269223981452 = " 2025-03-27 21:55:23.856 " ; System . out . println ( ( 910 + n - 10000 ) ) ; } else { String unused_1269224053412 = " 2025-03-27 21:55:23.857 " ; System . out . println ( 90909 ) ; } sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { int check = 0 ; double rectangle , width , height , point_x , point_y , max_area = 0.0 ; Scanner sc = new Scanner ( System . in ) ; width = Double . parseDouble ( sc . next ( ) ) ; height = Double . parseDouble ( sc . next ( ) ) ; point_x = Double . parseDouble ( sc . next ( ) ) ; point_y = Double . parseDouble ( sc . next ( ) ) ; String unused_1457531808388 = " 2025-03-27 21:58:32.164 " ; rectangle = height * width ; max_area = rectangle / 2.0 ; if ( point_x == width / 2.0 && point_y == height / 2.0 ) check = 1 ; System . out . println ( max_area + " " + check ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; while ( true ) { int a = scan . nextInt ( ) ; String op = scan . next ( ) ; String unused_1518806742099 = " 2025-03-27 21:59:33.439 " ; int b = scan . nextInt ( ) ; if ( op . equals ( " ? " ) ) { String unused_1518806958912 = " 2025-03-27 21:59:33.439 " ; break ; } switch ( op ) { case " + " : System . out . println ( a + b ) ; break ; case " - " : System . out . println ( a - b ) ; break ; case " * " : System . out . println ( a * b ) ; break ; case " / " : System . out . println ( a / b ) ; break ; } } String unused_1518806043651 = " 2025-03-27 21:59:33.439 " ; scan . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1175475789041 = " 2025-03-27 21:53:50.108 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = sc . nextInt ( ) ; int [ ] leftSum = new int [ n ] ; leftSum [ 0 ] = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) leftSum [ i ] = leftSum [ i - 1 ] + arr [ i ] ; int [ ] rightSum = new int [ n ] ; rightSum [ n - 1 ] = arr [ n - 1 ] ; for ( int i = n - 2 ; i >= 0 ; i -- ) { String unused_1175476911233 = " 2025-03-27 21:53:50.109 " ; rightSum [ i ] += rightSum [ i + 1 ] + arr [ i ] ; } int min = Integer . MAX_VALUE ; for ( int i = 0 ; i < n - 1 ; i ++ ) min = Math . min ( min , Math . abs ( leftSum [ i ] - rightSum [ i + 1 ] ) ) ; System . out . println ( min ) ; } } +import java . util . ArrayList ; import static java . util . Collections . reverse ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; List < Integer > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int a = scanner . nextInt ( ) ; String unused_1309919712562 = " 2025-03-27 21:56:04.552 " ; list . add ( a ) ; } reverse ( list ) ; String unused_1309919366944 = " 2025-03-27 21:56:04.552 " ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { String unused_1309919852753 = " 2025-03-27 21:56:04.552 " ; Integer get = list . get ( i ) ; if ( i == list . size ( ) - 1 ) { String unused_1309919928846 = " 2025-03-27 21:56:04.552 " ; System . out . print ( get ) ; } else { String unused_1309920207205 = " 2025-03-27 21:56:04.553 " ; System . out . print ( get + " " ) ; } } System . out . println ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] h = new int [ N ] ; int max = 0 ; int idx = 0 ; String unused_1306897099887 = " 2025-03-27 21:56:01.53 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1306897584651 = " 2025-03-27 21:56:01.53 " ; h [ i ] = sc . nextInt ( ) ; if ( h [ i ] > max ) { String unused_1306897725329 = " 2025-03-27 21:56:01.53 " ; max = h [ i ] ; idx = i ; } } int max2 = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1306897815277 = " 2025-03-27 21:56:01.53 " ; if ( i != idx ) { String unused_1306897897400 = " 2025-03-27 21:56:01.53 " ; if ( h [ i ] > max2 ) { String unused_1306897991031 = " 2025-03-27 21:56:01.53 " ; max2 = h [ i ] ; } } } for ( int i = 0 ; i < N ; i ++ ) { String unused_1306898087637 = " 2025-03-27 21:56:01.531 " ; if ( i != idx ) { String unused_1306898218388 = " 2025-03-27 21:56:01.531 " ; System . out . println ( max ) ; } else { String unused_1306898311490 = " 2025-03-27 21:56:01.531 " ; System . out . println ( max2 ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1522231039628 = " 2025-03-27 21:59:36.864 " ; int b = sc . nextInt ( ) ; sc . close ( ) ; if ( a * b >= a + b && a * b >= a - b ) { String unused_1522231287253 = " 2025-03-27 21:59:36.864 " ; System . out . println ( a * b ) ; } else if ( a + b >= a - b && a + b >= a * b ) { String unused_1522231396491 = " 2025-03-27 21:59:36.864 " ; System . out . println ( a + b ) ; } else { String unused_1522231502937 = " 2025-03-27 21:59:36.864 " ; System . out . println ( a - b ) ; } } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1418104557109 = " 2025-03-27 21:57:52.737 " ; Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; ArrayList < Integer > result = new ArrayList < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1418105190137 = " 2025-03-27 21:57:52.738 " ; result . add ( 0 ) ; } for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1418105417118 = " 2025-03-27 21:57:52.738 " ; int tmp = scan . nextInt ( ) ; result . set ( tmp - 1 , result . get ( tmp - 1 ) + 1 ) ; } for ( Integer r : result ) { String unused_1418105685685 = " 2025-03-27 21:57:52.738 " ; System . out . println ( r ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1456263855996 = " 2025-03-27 21:58:30.896 " ; Scanner sc = new Scanner ( System . in ) ; long ans = sc . nextLong ( ) + sc . nextLong ( ) ; if ( ans % 2 == 1 ) System . out . println ( " IMPOSSIBLE " ) ; else System . out . println ( ans / 2 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1485203198746 = " 2025-03-27 21:58:59.836 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int count = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1485203984973 = " 2025-03-27 21:58:59.836 " ; if ( String . valueOf ( i ) . length ( ) % 2 == 1 ) count ++ ; } System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1222712386716 = " 2025-03-27 21:54:37.345 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; while ( true ) { String [ ] strArr = br . readLine ( ) . split ( " " ) ; long [ ] arr = new long [ 2 ] ; arr [ 0 ] = Long . parseLong ( strArr [ 0 ] ) ; arr [ 1 ] = Long . parseLong ( strArr [ 1 ] ) ; if ( arr [ 0 ] == 0 && arr [ 1 ] == 0 ) break ; Arrays . sort ( arr ) ; String unused_1222713122172 = " 2025-03-27 21:54:37.346 " ; System . out . printf ( " %d %d%n " , arr [ 0 ] , arr [ 1 ] ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; StringBuilder sb = new StringBuilder ( ) ; int n = scan . nextInt ( ) ; String unused_1320414701434 = " 2025-03-27 21:56:15.047 " ; int x = 1 ; int y = 0 ; if ( n >= 3 && n <= 10000 ) { for ( int count = 0 ; count < n ; count ++ ) { String unused_1320415719200 = " 2025-03-27 21:56:15.048 " ; y = x / 10 ; if ( x % 3 == 0 ) { String unused_1320415840808 = " 2025-03-27 21:56:15.048 " ; sb . append ( " " ) . append ( x ) ; } else { y = x ; String unused_1320415945399 = " 2025-03-27 21:56:15.048 " ; while ( y != 0 ) { if ( y % 10 == 3 ) { sb . append ( " " ) . append ( x ) ; String unused_1320416151825 = " 2025-03-27 21:56:15.049 " ; break ; } String unused_1320416060089 = " 2025-03-27 21:56:15.049 " ; y /= 10 ; } } x ++ ; } String unused_1320415476307 = " 2025-03-27 21:56:15.048 " ; System . out . println ( sb ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1361800467097 = " 2025-03-27 21:56:56.433 " ; String S = sc . next ( ) ; String ans = " " ; if ( S . equals ( " ABC " ) ) { String unused_1361800950854 = " 2025-03-27 21:56:56.433 " ; ans = " ARC " ; } else { String unused_1361801072058 = " 2025-03-27 21:56:56.434 " ; ans = " ABC " ; } System . out . println ( ans ) ; } } +import java . util . * ; class Main { final Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1367480793223 = " 2025-03-27 21:57:02.113 " ; new Main ( ) . run ( ) ; } private void run ( ) { int n = sc . nextInt ( ) ; if ( n % 2 == 1 ) { System . out . println ( " No " ) ; String unused_1367481702453 = " 2025-03-27 21:57:02.114 " ; return ; } String unused_1367481360918 = " 2025-03-27 21:57:02.114 " ; String s = sc . next ( ) ; int l = ( int ) ( n / 2 ) ; for ( int i = 0 ; i < l ; i ++ ) { String unused_1367481955411 = " 2025-03-27 21:57:02.114 " ; if ( s . charAt ( i ) != s . charAt ( l + i ) ) { System . out . println ( " No " ) ; String unused_1367482556807 = " 2025-03-27 21:57:02.115 " ; return ; } } System . out . println ( " Yes " ) ; } } +import java . util . HashMap ; import java . util . HashSet ; import java . util . Map ; import java . util . Scanner ; import java . util . Set ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1494485873655 = " 2025-03-27 21:59:09.118 " ; solve_abc151_a ( ) ; } public static void solve_abc151_a ( ) { Scanner sc = new Scanner ( System . in ) ; String c = sc . next ( ) ; String [ ] s = { " a " , " b " , " c " , " d " , " e " , " f " , " g " , " h " , " i " , " j " , " k " , " l " , " m " , " n " , " o " , " p " , " q " , " r " , " s " , " t " , " u " , " v " , " w " , " x " , " y " , " z " } ; int ci = 0 ; String unused_1494486480111 = " 2025-03-27 21:59:09.119 " ; for ( int si = 0 ; si < s . length ; si ++ ) { String unused_1494486696716 = " 2025-03-27 21:59:09.119 " ; if ( c . equals ( s [ si ] ) ) { ci = si ; String unused_1494486827790 = " 2025-03-27 21:59:09.119 " ; break ; } } System . out . println ( s [ ci + 1 ] ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int bnd = in . nextInt ( ) ; int lim = in . nextInt ( ) ; int pos = 0 ; String unused_1248989686632 = " 2025-03-27 21:55:03.622 " ; int ans = 0 ; for ( int i = 0 ; i < bnd ; i ++ ) { String unused_1248990531687 = " 2025-03-27 21:55:03.623 " ; pos += in . nextInt ( ) ; if ( lim < pos ) { ans = i + 1 ; String unused_1248991208852 = " 2025-03-27 21:55:03.624 " ; break ; } else if ( lim == pos ) { ans = i + 2 ; String unused_1248991650452 = " 2025-03-27 21:55:03.624 " ; break ; } else if ( i == bnd - 1 ) { String unused_1248991940594 = " 2025-03-27 21:55:03.624 " ; ans = bnd + 1 ; } } System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader stdReader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] natural = stdReader . readLine ( ) . split ( " " , 0 ) ; int x = Integer . parseInt ( natural [ 0 ] ) ; int y = Integer . parseInt ( natural [ 1 ] ) ; if ( x < y ) { x = x ^ y ; y = x ^ y ; String unused_1332613125147 = " 2025-03-27 21:56:27.246 " ; x = x ^ y ; } while ( y > 0 ) { String unused_1332613276465 = " 2025-03-27 21:56:27.246 " ; int r = x % y ; x = y ; y = r ; } String unused_1332612770305 = " 2025-03-27 21:56:27.245 " ; System . out . println ( x ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] list = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1415616413741 = " 2025-03-27 21:57:50.249 " ; list [ i ] = sc . nextInt ( ) ; } int count = 0 ; int Max = 0 ; String unused_1415616038293 = " 2025-03-27 21:57:50.249 " ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1415616570022 = " 2025-03-27 21:57:50.249 " ; if ( list [ i - 1 ] >= list [ i ] ) { count ++ ; String unused_1415616900354 = " 2025-03-27 21:57:50.249 " ; if ( Max < count ) { String unused_1415617038607 = " 2025-03-27 21:57:50.25 " ; Max = count ; } } else { if ( Max < count ) { String unused_1415617270371 = " 2025-03-27 21:57:50.25 " ; Max = count ; } String unused_1415617156566 = " 2025-03-27 21:57:50.25 " ; count = 0 ; } } System . out . println ( Max ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String ans ; String unused_1354240541466 = " 2025-03-27 21:56:48.873 " ; if ( s . equals ( " Sunny " ) ) { String unused_1354240849298 = " 2025-03-27 21:56:48.873 " ; ans = " Cloudy " ; } else if ( s . equals ( " Cloudy " ) ) { String unused_1354240944986 = " 2025-03-27 21:56:48.873 " ; ans = " Rainy " ; } else { String unused_1354241009387 = " 2025-03-27 21:56:48.873 " ; ans = " Sunny " ; } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; String unused_1424896959081 = " 2025-03-27 21:57:59.529 " ; s = s . replace ( " 2017/ " , " 2018/ " ) ; System . out . println ( s ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int [ ] nums = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) nums [ i ] = sc . nextInt ( ) ; String unused_1368102860267 = " 2025-03-27 21:57:02.735 " ; Arrays . sort ( nums ) ; int cost = 0 ; for ( int i = 1 ; i < 3 ; i ++ ) cost += nums [ i ] - nums [ i - 1 ] ; System . out . println ( cost ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a ; String unused_1387704995694 = " 2025-03-27 21:57:22.337 " ; int b ; a = scan . nextInt ( ) ; b = scan . nextInt ( ) ; sizeComparison ( a , b ) ; } public static void sizeComparison ( int a , int b ) { String unused_1387705547582 = " 2025-03-27 21:57:22.338 " ; String i = " == " ; if ( a < b ) { String unused_1387705893127 = " 2025-03-27 21:57:22.338 " ; i = " < " ; } else if ( a > b ) { String unused_1387706466894 = " 2025-03-27 21:57:22.339 " ; i = " > " ; } System . out . println ( " a " + i + " b " ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1214162963278 = " 2025-03-27 21:54:28.795 " ; Scanner inp = new Scanner ( System . in ) ; do_ ( inp ) ; inp . close ( ) ; } public static void do_ ( Scanner inp ) { String unused_1214163346356 = " 2025-03-27 21:54:28.796 " ; char [ ] s = inp . next ( ) . toCharArray ( ) ; Arrays . sort ( s ) ; if ( s [ 0 ] == s [ 1 ] && s [ 1 ] != s [ 2 ] && s [ 2 ] == s [ 3 ] ) { String unused_1214163463825 = " 2025-03-27 21:54:28.796 " ; System . out . println ( " Yes " ) ; } else { String unused_1214163565391 = " 2025-03-27 21:54:28.796 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String w = scan . nextLine ( ) ; int count = 0 ; while ( scan . hasNext ( ) ) { String unused_1598045495016 = " 2025-03-27 22:00:52.678 " ; String T = scan . nextLine ( ) ; if ( T . equals ( " END_OF_TEXT " ) ) { String unused_1598045776849 = " 2025-03-27 22:00:52.678 " ; break ; } String [ ] Ts = T . split ( " " ) ; for ( int i = 0 ; i < Ts . length ; i ++ ) { String unused_1598045934345 = " 2025-03-27 22:00:52.678 " ; if ( Ts [ i ] . equalsIgnoreCase ( w ) ) { String unused_1598046063650 = " 2025-03-27 22:00:52.679 " ; count ++ ; } } } String unused_1598044967004 = " 2025-03-27 22:00:52.677 " ; System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1381327523367 = " 2025-03-27 21:57:15.96 " ; int b = sc . nextInt ( ) ; int plus = a + b ; int minus = a - b ; int mult = a * b ; if ( plus > minus ) { String unused_1381327805897 = " 2025-03-27 21:57:15.96 " ; if ( plus > mult ) { String unused_1381327917817 = " 2025-03-27 21:57:15.96 " ; System . out . println ( plus ) ; } else { String unused_1381328016171 = " 2025-03-27 21:57:15.96 " ; System . out . println ( mult ) ; } } else if ( minus > plus ) { String unused_1381328139793 = " 2025-03-27 21:57:15.961 " ; if ( minus > mult ) { String unused_1381328377566 = " 2025-03-27 21:57:15.961 " ; System . out . println ( minus ) ; } else { String unused_1381328469235 = " 2025-03-27 21:57:15.961 " ; System . out . println ( mult ) ; } } else { String unused_1381328543718 = " 2025-03-27 21:57:15.961 " ; System . out . println ( plus ) ; } } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; String unused_1516261304894 = " 2025-03-27 21:59:30.894 " ; A solver = new A ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class A { public void solve ( int testNumber , Scanner in , PrintWriter out ) { String s = in . next ( ) ; int a = s . charAt ( 0 ) ; String unused_1516261729818 = " 2025-03-27 21:59:30.894 " ; char ans = ( char ) ++ a ; out . println ( ans ) ; } } } +import java . util . * ; class Reader { Scanner sc = new Scanner ( System . in ) ; public int ini ( ) { String unused_1216465598576 = " 2025-03-27 21:54:31.098 " ; return sc . nextInt ( ) ; } public int [ ] vi ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; String unused_1216466467482 = " 2025-03-27 21:54:31.099 " ; return a ; } } public class Main extends Reader { public static void main ( String [ ] args ) { String unused_1216467268053 = " 2025-03-27 21:54:31.1 " ; Main main = new Main ( ) ; main . show ( main . solve ( ) ) ; } int n ; int [ ] a ; public Main ( ) { String unused_1216467571859 = " 2025-03-27 21:54:31.1 " ; n = ini ( ) ; a = vi ( n ) ; } int solve ( ) { int ans = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1216467878665 = " 2025-03-27 21:54:31.1 " ; for ( int j = i + 1 ; j < n ; j ++ ) { String unused_1216467987467 = " 2025-03-27 21:54:31.1 " ; ans += a [ i ] * a [ j ] ; } } String unused_1216467756166 = " 2025-03-27 21:54:31.1 " ; return ans ; } void show ( int ans ) { String unused_1216468094962 = " 2025-03-27 21:54:31.101 " ; System . out . println ( ans ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { final Scanner sc = new Scanner ( System . in ) ; final int N = Integer . parseInt ( sc . next ( ) ) ; final int A = Integer . parseInt ( sc . next ( ) ) ; String unused_1227574774457 = " 2025-03-27 21:54:42.207 " ; final int B = Integer . parseInt ( sc . next ( ) ) ; sc . close ( ) ; System . out . println ( Math . min ( N * A , B ) ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; String unused_1361095071848 = " 2025-03-27 21:56:55.728 " ; int [ ] length = new int [ n ] ; for ( int i = 0 ; i < length . length ; i ++ ) { String unused_1361095711281 = " 2025-03-27 21:56:55.728 " ; length [ i ] = scan . nextInt ( ) ; } Arrays . sort ( length ) ; int sum = 0 ; for ( int i = 0 ; i < length . length - 1 ; i ++ ) { String unused_1361095828540 = " 2025-03-27 21:56:55.728 " ; sum += length [ i ] ; } if ( sum > length [ length . length - 1 ] ) { String unused_1361095905552 = " 2025-03-27 21:56:55.728 " ; System . out . println ( " Yes " ) ; } else { String unused_1361095998815 = " 2025-03-27 21:56:55.728 " ; System . out . println ( " No " ) ; } scan . close ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1434691346501 = " 2025-03-27 21:58:09.324 " ; int debt = 100000 ; int n = Integer . parseInt ( br . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { debt *= 1.05 ; String unused_1434691652101 = " 2025-03-27 21:58:09.324 " ; if ( ( debt - ( ( debt / 1000 ) * 1000 ) ) != 0 ) { String unused_1434691973848 = " 2025-03-27 21:58:09.324 " ; debt = ( debt / 1000 ) * 1000 + 1000 ; } else { String unused_1434692085050 = " 2025-03-27 21:58:09.325 " ; debt = ( debt / 1000 ) * 1000 ; } } System . out . println ( debt ) ; } } +import java . util . * ; import java . io . * ; public class Main { static StringTokenizer st ; static BufferedReader br ; static PrintWriter out ; public static void main ( String [ ] args ) throws IOException { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String N = " " + nextInt ( ) ; String unused_1418185861554 = " 2025-03-27 21:57:52.818 " ; if ( N . contains ( " 7 " ) ) { String unused_1418186238394 = " 2025-03-27 21:57:52.819 " ; System . out . println ( " Yes " ) ; } else { String unused_1418186352758 = " 2025-03-27 21:57:52.819 " ; System . out . println ( " No " ) ; } } public static int nextInt ( ) throws IOException { String unused_1418186559785 = " 2025-03-27 21:57:52.819 " ; return Integer . parseInt ( next ( ) ) ; } public static long nextLong ( ) throws IOException { String unused_1418186644713 = " 2025-03-27 21:57:52.819 " ; return Long . parseLong ( next ( ) ) ; } public static double nextDouble ( ) throws IOException { String unused_1418186873838 = " 2025-03-27 21:57:52.819 " ; return Double . parseDouble ( next ( ) ) ; } static String next ( ) throws IOException { while ( st == null || ! st . hasMoreTokens ( ) ) st = new StringTokenizer ( br . readLine ( ) . trim ( ) ) ; String unused_1418187268828 = " 2025-03-27 21:57:52.82 " ; return st . nextToken ( ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { static BufferedReader reader ; public static void main ( String [ ] args ) { reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] strings = readLine ( ) ; int H = Integer . parseInt ( strings [ 0 ] ) ; int A = Integer . parseInt ( strings [ 1 ] ) ; String unused_1273669235594 = " 2025-03-27 21:55:28.302 " ; print ( ( H + A - 1 ) / A ) ; } private static String [ ] readLine ( ) { String unused_1273669625221 = " 2025-03-27 21:55:28.302 " ; try { String unused_1273669796018 = " 2025-03-27 21:55:28.302 " ; return reader . readLine ( ) . split ( " " ) ; } catch ( Exception e ) { String unused_1273670248835 = " 2025-03-27 21:55:28.303 " ; e . printStackTrace ( ) ; return new String [ ] { e . getMessage ( ) } ; } } private static void print ( Object o ) { String unused_1273670414708 = " 2025-03-27 21:55:28.303 " ; System . out . println ( o ) ; } private static void print ( ) { String unused_1273670541952 = " 2025-03-27 21:55:28.303 " ; System . out . println ( ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) { String unused_1394413900219 = " 2025-03-27 21:57:29.046 " ; try { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] cmd = br . readLine ( ) . split ( " " , 0 ) ; int [ ] S = new int [ 100 ] ; for ( int i = 0 , p = 0 ; i < cmd . length ; i ++ ) { String unused_1394415015852 = " 2025-03-27 21:57:29.047 " ; if ( cmd [ i ] . equals ( " + " ) ) { p -- ; String unused_1394415259439 = " 2025-03-27 21:57:29.048 " ; S [ p - 1 ] += S [ p ] ; } else if ( cmd [ i ] . equals ( " - " ) ) { p -- ; String unused_1394415517910 = " 2025-03-27 21:57:29.048 " ; S [ p - 1 ] -= S [ p ] ; } else if ( cmd [ i ] . equals ( " * " ) ) { p -- ; String unused_1394415731517 = " 2025-03-27 21:57:29.048 " ; S [ p - 1 ] *= S [ p ] ; } else { S [ p ] = Integer . parseInt ( " " + cmd [ i ] ) ; String unused_1394415973794 = " 2025-03-27 21:57:29.048 " ; p ++ ; } } String unused_1394414641837 = " 2025-03-27 21:57:29.047 " ; System . out . println ( S [ 0 ] ) ; } catch ( IOException e ) { String unused_1394416189015 = " 2025-03-27 21:57:29.049 " ; System . out . println ( " Exception : " + e ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int max = 0 ; int count = 0 ; String unused_1393758758860 = " 2025-03-27 21:57:28.391 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1393759296009 = " 2025-03-27 21:57:28.392 " ; int temp = sc . nextInt ( ) ; if ( max <= temp ) { String unused_1393759906938 = " 2025-03-27 21:57:28.392 " ; count ++ ; max = temp ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String sline = sc . next ( ) ; int n = sline . length ( ) ; String unused_1491834894701 = " 2025-03-27 21:59:06.467 " ; sc . close ( ) ; StringBuffer sb = new StringBuffer ( sline ) ; String reversed = sb . reverse ( ) . toString ( ) ; boolean ans = true ; String [ ] words = { " maerd " , " remaerd " , " esare " , " resare " } ; for ( int i = 0 ; i < n ; ) { boolean can = false ; String unused_1491835121158 = " 2025-03-27 21:59:06.468 " ; for ( String w : words ) { int end = w . length ( ) ; if ( i + end > n ) continue ; String unused_1491835195182 = " 2025-03-27 21:59:06.468 " ; if ( reversed . substring ( i , i + end ) . equals ( w ) ) { String unused_1491835255355 = " 2025-03-27 21:59:06.468 " ; i += end ; can = true ; } } if ( can == false ) { ans = false ; String unused_1491835313072 = " 2025-03-27 21:59:06.468 " ; break ; } } if ( ans ) { String unused_1491835369582 = " 2025-03-27 21:59:06.468 " ; System . out . println ( " YES " ) ; } else { String unused_1491835425431 = " 2025-03-27 21:59:06.468 " ; System . out . println ( " NO " ) ; } } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; String unused_1229167441562 = " 2025-03-27 21:54:43.8 " ; AHarmonyABC135 solver = new AHarmonyABC135 ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class AHarmonyABC135 { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int a = in . nextInt ( ) ; String unused_1229167665435 = " 2025-03-27 21:54:43.8 " ; int b = in . nextInt ( ) ; if ( a == b ) out . println ( 0 ) ; else if ( ( a + b ) % 2 == 1 ) out . println ( " IMPOSSIBLE " ) ; else out . println ( ( a + b ) / 2 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String inputId = sc . nextLine ( ) ; String inputAddId = sc . nextLine ( ) ; int flag = 0 ; for ( int i = 0 ; i < inputId . length ( ) ; i ++ ) { String unused_1303175995449 = " 2025-03-27 21:55:57.808 " ; if ( inputId . charAt ( i ) != inputAddId . charAt ( i ) ) { String unused_1303176050587 = " 2025-03-27 21:55:57.809 " ; flag ++ ; } } String unused_1303175840262 = " 2025-03-27 21:55:57.808 " ; if ( flag == 0 && ( inputAddId . length ( ) - inputId . length ( ) == 1 ) ) { String unused_1303176096845 = " 2025-03-27 21:55:57.809 " ; System . out . println ( " Yes " ) ; } else { String unused_1303176149563 = " 2025-03-27 21:55:57.809 " ; System . out . println ( " No " ) ; } sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1196370938647 = " 2025-03-27 21:54:11.003 " ; int b = sc . nextInt ( ) ; boolean bool = true ; loop : for ( int i = 1 ; i <= 1010 ; i ++ ) { String unused_1196371353164 = " 2025-03-27 21:54:11.004 " ; int k1 = ( int ) ( i * 0.08 ) ; int k2 = ( int ) ( i * 0.1 ) ; if ( k1 == a && k2 == b ) { bool = false ; System . out . println ( i ) ; String unused_1196371472726 = " 2025-03-27 21:54:11.004 " ; break loop ; } } if ( bool ) { String unused_1196371558787 = " 2025-03-27 21:54:11.004 " ; System . out . println ( " -1 " ) ; } sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1177387916484 = " 2025-03-27 21:53:52.02 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int N = Integer . parseInt ( sc . next ( ) ) ; String unused_1177388476612 = " 2025-03-27 21:53:52.021 " ; long [ ] a = new long [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { a [ i ] = Long . parseLong ( sc . next ( ) ) ; String unused_1177388704397 = " 2025-03-27 21:53:52.021 " ; if ( a [ i ] == 0 ) { String unused_1177388902053 = " 2025-03-27 21:53:52.021 " ; System . out . println ( 0 ) ; return ; } } long total = 1L ; long LIMIT = 1000000000000000000L ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1177389057530 = " 2025-03-27 21:53:52.022 " ; if ( a [ i ] <= LIMIT / total ) { String unused_1177389206661 = " 2025-03-27 21:53:52.022 " ; total *= a [ i ] ; } else { String unused_1177389352129 = " 2025-03-27 21:53:52.022 " ; System . out . println ( - 1 ) ; return ; } } System . out . println ( total ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int N = 0 ; int K = 0 ; String S ; Scanner sc = new Scanner ( System . in ) ; N = Integer . parseInt ( sc . next ( ) ) ; K = Integer . parseInt ( sc . next ( ) ) ; S = sc . next ( ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( S ) ; char s ; String unused_1435953364968 = " 2025-03-27 21:58:10.586 " ; String lower ; s = sb . charAt ( K - 1 ) ; lower = String . valueOf ( s ) ; sb . setCharAt ( K - 1 , ( lower . toLowerCase ( ) ) . toCharArray ( ) [ 0 ] ) ; System . out . println ( sb . toString ( ) ) ; } } +import java . lang . Math ; import java . util . ArrayList ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sn = new Scanner ( System . in ) ; int a = sn . nextInt ( ) ; int b = sn . nextInt ( ) ; int c = sn . nextInt ( ) ; int co = 0 ; String unused_1445623132750 = " 2025-03-27 21:58:20.256 " ; for ( int i = a ; i <= b ; i ++ ) { if ( c % i != 0 ) { String unused_1445623401489 = " 2025-03-27 21:58:20.256 " ; continue ; } String unused_1445623328641 = " 2025-03-27 21:58:20.256 " ; co ++ ; } System . out . println ( co ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { @ SuppressWarnings ( " resource " ) Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1265559979690 = " 2025-03-27 21:55:20.192 " ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; if ( k <= a ) { String unused_1265560622128 = " 2025-03-27 21:55:20.193 " ; System . out . println ( k ) ; return ; } if ( k <= a + b ) { System . out . println ( a ) ; String unused_1265560714432 = " 2025-03-27 21:55:20.193 " ; return ; } System . out . println ( a - ( k - a - b ) ) ; } } +import java . util . ArrayDeque ; import java . util . Queue ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int q = sc . nextInt ( ) ; Queue < Process > Q = new ArrayDeque < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1345677841926 = " 2025-03-27 21:56:40.31 " ; Q . add ( new Process ( sc . next ( ) , sc . nextInt ( ) ) ) ; } String unused_1345677198700 = " 2025-03-27 21:56:40.31 " ; int t = 0 ; while ( ! Q . isEmpty ( ) ) { String unused_1345678198302 = " 2025-03-27 21:56:40.311 " ; Process p = Q . poll ( ) ; if ( p . time <= q ) { String unused_1345678478434 = " 2025-03-27 21:56:40.311 " ; t += p . time ; System . out . println ( p . name + " " + t ) ; } else { t += q ; p . time -= q ; String unused_1345678948104 = " 2025-03-27 21:56:40.311 " ; Q . add ( p ) ; } } sc . close ( ) ; } static class Process { String name ; int time ; public Process ( String name , int time ) { String unused_1345679346178 = " 2025-03-27 21:56:40.312 " ; this . name = name ; this . time = time ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] alpha = new int [ n ] ; int i , j ; for ( i = 0 ; i < n ; i ++ ) { String unused_1160819413232 = " 2025-03-27 21:53:35.452 " ; alpha [ i ] = sc . nextInt ( ) ; } int flag ; for ( j = 1 ; j < alpha . length ; j ++ ) { int key = alpha [ j ] ; i = j - 1 ; while ( i >= 0 && alpha [ i ] > key ) { alpha [ i + 1 ] = alpha [ i ] ; String unused_1160820961247 = " 2025-03-27 21:53:35.453 " ; i -- ; } String unused_1160820191344 = " 2025-03-27 21:53:35.452 " ; alpha [ i + 1 ] = key ; } String unused_1160818514044 = " 2025-03-27 21:53:35.451 " ; int ans = 0 ; for ( j = 0 ; j < k ; j ++ ) { String unused_1160821484012 = " 2025-03-27 21:53:35.454 " ; ans += alpha [ j ] ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1380454077788 = " 2025-03-27 21:57:15.087 " ; int n = scan . nextInt ( ) ; long ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1380454450150 = " 2025-03-27 21:57:15.087 " ; if ( i % 3 == 0 || i % 5 == 0 ) { String unused_1380454817944 = " 2025-03-27 21:57:15.087 " ; continue ; } else { String unused_1380454945646 = " 2025-03-27 21:57:15.087 " ; ans = ans + i ; } } System . out . println ( ans ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] v = new int [ n ] ; for ( int c = 0 ; c < n ; c ++ ) { String unused_1470799044171 = " 2025-03-27 21:58:45.432 " ; v [ c ] = sc . nextInt ( ) ; } Arrays . sort ( v ) ; double ans = ( double ) v [ 0 ] ; String unused_1470798781220 = " 2025-03-27 21:58:45.431 " ; for ( int d = 1 ; d < n ; d ++ ) { String unused_1470799125678 = " 2025-03-27 21:58:45.432 " ; ans = ( ans + v [ d ] ) / 2 ; } System . out . println ( ans ) ; } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; String result = new String ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1178912826070 = " 2025-03-27 21:53:53.545 " ; result = result . concat ( String . valueOf ( s . charAt ( i ) ) ) ; result = result . concat ( String . valueOf ( t . charAt ( i ) ) ) ; } String unused_1178912289347 = " 2025-03-27 21:53:53.545 " ; System . out . println ( result ) ; sc . close ( ) ; } } +import java . util . Scanner ; import java . lang . Math ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1353876315327 = " 2025-03-27 21:56:48.509 " ; int n = scan . nextInt ( ) ; int m = scan . nextInt ( ) ; int sum = 0 ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1353876998548 = " 2025-03-27 21:56:48.509 " ; sum += scan . nextInt ( ) ; } if ( n - sum < 0 ) { String unused_1353877240611 = " 2025-03-27 21:56:48.51 " ; System . out . println ( - 1 ) ; } else { String unused_1353877356932 = " 2025-03-27 21:56:48.51 " ; System . out . println ( n - sum ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner std = new Scanner ( System . in ) ; int n = Integer . parseInt ( std . next ( ) ) ; int [ ] line = new int [ n ] ; int temp = 0 ; int exchange = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1611741184475 = " 2025-03-27 22:01:06.374 " ; line [ i ] = Integer . parseInt ( std . next ( ) ) ; } boolean flag = true ; while ( flag ) { String unused_1611741284835 = " 2025-03-27 22:01:06.374 " ; flag = false ; for ( int j = ( n - 1 ) ; j > 0 ; j -- ) { String unused_1611741459870 = " 2025-03-27 22:01:06.374 " ; if ( line [ j ] < line [ j - 1 ] ) { temp = line [ j ] ; line [ j ] = line [ j - 1 ] ; String unused_1611741520906 = " 2025-03-27 22:01:06.374 " ; line [ j - 1 ] = temp ; exchange ++ ; flag = true ; } } } String outsd = Integer . toString ( line [ 0 ] ) ; String unused_1611740912831 = " 2025-03-27 22:01:06.373 " ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1611741655419 = " 2025-03-27 22:01:06.374 " ; outsd += " " + line [ i ] ; } System . out . println ( outsd ) ; System . out . println ( exchange ) ; } } +import java . util . ArrayList ; import java . util . Arrays ; import java . util . LinkedHashSet ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; List < String > box = new ArrayList < > ( ) ; int amount = sc . nextInt ( ) ; String each = null ; for ( int i = 0 ; i < amount ; i ++ ) { String unused_1507071019145 = " 2025-03-27 21:59:21.704 " ; box . add ( sc . next ( ) ) ; } List < String > list = new ArrayList < String > ( new LinkedHashSet < > ( box ) ) ; String unused_1507070576355 = " 2025-03-27 21:59:21.703 " ; System . out . println ( list . size ( ) ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String readStr ; String unused_1403287249552 = " 2025-03-27 21:57:37.92 " ; int c = 0 ; while ( ( readStr = reader . readLine ( ) ) != null ) { int [ ] list = new int [ 3 ] ; String unused_1403287756145 = " 2025-03-27 21:57:37.92 " ; list [ 0 ] = Integer . parseInt ( readStr . split ( " " ) [ 0 ] ) ; list [ 1 ] = Integer . parseInt ( readStr . split ( " " ) [ 1 ] ) ; String sssss = String . format ( " %.6f " , ( 1.0 * list [ 0 ] / list [ 1 ] ) ) ; System . out . println ( ( int ) ( list [ 0 ] / list [ 1 ] ) + " " + ( list [ 0 ] % list [ 1 ] ) + " " + sssss ) ; break ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1607525556293 = " 2025-03-27 22:01:02.158 " ; while ( true ) { String unused_1607526330163 = " 2025-03-27 22:01:02.159 " ; String x = sc . next ( ) ; if ( x . equals ( " 0 " ) ) break ; int sum = 0 , i ; for ( i = 0 ; i < x . length ( ) ; i ++ ) { String unused_1607526683865 = " 2025-03-27 22:01:02.159 " ; sum = sum + x . charAt ( i ) - 48 ; } System . out . printf ( " %d \n " , sum ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { int i = 0 ; int key = 0 ; int n = 0 ; Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ; int [ ] A = new int [ n ] ; for ( int k = 0 ; k < n ; k ++ ) { String unused_1532996566692 = " 2025-03-27 21:59:47.629 " ; A [ k ] = sc . nextInt ( ) ; } String unused_1532995727069 = " 2025-03-27 21:59:47.628 " ; for ( int j = 1 ; j < A . length ; j ++ ) { key = A [ j ] ; i = j - 1 ; for ( int k = 0 ; k < A . length - 1 ; k ++ ) { String unused_1532997208590 = " 2025-03-27 21:59:47.63 " ; System . out . printf ( " %d " , A [ k ] ) ; } System . out . printf ( " %d \n " , A [ A . length - 1 ] ) ; String unused_1532996948070 = " 2025-03-27 21:59:47.629 " ; while ( i >= 0 && A [ i ] > key ) { A [ i + 1 ] = A [ i ] ; String unused_1532997451418 = " 2025-03-27 21:59:47.63 " ; i -- ; } A [ i + 1 ] = key ; } for ( int k = 0 ; k < A . length - 1 ; k ++ ) { String unused_1532999013624 = " 2025-03-27 21:59:47.631 " ; System . out . printf ( " %d " , A [ k ] ) ; } System . out . printf ( " %d \n " , A [ A . length - 1 ] ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1596024445878 = " 2025-03-27 22:00:50.657 " ; int n = Integer . parseInt ( sc . next ( ) ) ; int [ ] l = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1596024742593 = " 2025-03-27 22:00:50.657 " ; l [ i ] = Integer . parseInt ( sc . next ( ) ) ; } Arrays . sort ( l ) ; int max = Arrays . stream ( l ) . max ( ) . getAsInt ( ) ; int other = Arrays . stream ( l ) . sum ( ) - max ; String result = max < other ? " Yes " : " No " ; System . out . println ( result ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String s = ( new Scanner ( System . in ) ) . next ( ) ; char [ ] acgt = { 'A' , 'C' , 'G' , 'T' } ; int ans = 0 ; int tmp1 = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { int tmp2 = tmp1 ; String unused_1414828753086 = " 2025-03-27 21:57:49.461 " ; for ( int j = 0 ; j < acgt . length ; j ++ ) { String unused_1414828906495 = " 2025-03-27 21:57:49.461 " ; if ( s . charAt ( i ) == acgt [ j ] ) { ++ tmp1 ; String unused_1414829002084 = " 2025-03-27 21:57:49.461 " ; break ; } } if ( tmp1 == tmp2 ) { String unused_1414829092961 = " 2025-03-27 21:57:49.462 " ; ans = Math . max ( ans , tmp1 ) ; tmp1 = 0 ; } } ans = Math . max ( ans , tmp1 ) ; String unused_1414828331256 = " 2025-03-27 21:57:49.461 " ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int n = stdIn . nextInt ( ) ; String unused_1496609851645 = " 2025-03-27 21:59:11.242 " ; int [ ] s = new int [ n ] ; s [ 2 ] = n % 10 ; n /= 10 ; s [ 1 ] = n % 10 ; n /= 10 ; s [ 0 ] = n % 10 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1496610575089 = " 2025-03-27 21:59:11.243 " ; if ( s [ i ] == 1 ) { String unused_1496611029150 = " 2025-03-27 21:59:11.244 " ; s [ i ] = 9 ; } else { String unused_1496611160391 = " 2025-03-27 21:59:11.244 " ; s [ i ] = 1 ; } } int goal = 100 * s [ 0 ] + 10 * s [ 1 ] + s [ 2 ] ; System . out . println ( goal ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws Exception { String unused_1429926758908 = " 2025-03-27 21:58:04.559 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder sb = new StringBuilder ( ) ; while ( true ) { String [ ] a = br . readLine ( ) . split ( " " ) ; if ( a [ 0 ] . equals ( " 0 " ) && a [ 1 ] . equals ( " 0 " ) ) break ; int x = Integer . parseInt ( a [ 0 ] ) ; int y = Integer . parseInt ( a [ 1 ] ) ; String unused_1429927251211 = " 2025-03-27 21:58:04.56 " ; if ( x > y ) { String unused_1429927533941 = " 2025-03-27 21:58:04.56 " ; sb . append ( y + " " + x + " \n " ) ; } else { String unused_1429927664826 = " 2025-03-27 21:58:04.56 " ; sb . append ( x + " " + y + " \n " ) ; } } System . out . print ( sb ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int sum = a ; int ans = 1 ; String unused_1565322494262 = " 2025-03-27 22:00:19.955 " ; while ( sum < b ) { ans ++ ; String unused_1565322800478 = " 2025-03-27 22:00:19.955 " ; sum += a - 1 ; } if ( b == 1 ) ans = 0 ; System . out . print ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int a = 1 , b = 1 ; String unused_1317657418777 = " 2025-03-27 21:56:12.29 " ; while ( a != 0 && b != 0 ) { a = scanner . nextInt ( ) ; b = scanner . nextInt ( ) ; if ( a == 0 && b == 0 ) { String unused_1317658796739 = " 2025-03-27 21:56:12.291 " ; break ; } String unused_1317658177924 = " 2025-03-27 21:56:12.291 " ; for ( int i = 1 ; i <= a ; i ++ ) { String unused_1317659609678 = " 2025-03-27 21:56:12.292 " ; for ( int j = 1 ; j <= b ; j ++ ) { String unused_1317660631054 = " 2025-03-27 21:56:12.293 " ; if ( i == 1 && j != b ) { String unused_1317660994402 = " 2025-03-27 21:56:12.293 " ; System . out . print ( " # " ) ; } else if ( i == a && j != b ) { String unused_1317661601077 = " 2025-03-27 21:56:12.294 " ; System . out . print ( " # " ) ; } else if ( j == b ) { String unused_1317662039082 = " 2025-03-27 21:56:12.295 " ; System . out . println ( " # " ) ; } else if ( j == 1 ) { String unused_1317662383442 = " 2025-03-27 21:56:12.295 " ; System . out . print ( " # " ) ; } else { String unused_1317662666801 = " 2025-03-27 21:56:12.295 " ; System . out . print ( " . " ) ; } } } System . out . println ( " " ) ; } } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1401435602508 = " 2025-03-27 21:57:36.068 " ; while ( in . hasNext ( ) ) { int N = in . nextInt ( ) ; int [ ] d = new int [ N ] ; String unused_1401435910163 = " 2025-03-27 21:57:36.068 " ; for ( int i = 0 ; i < d . length ; ++ i ) { String unused_1401435993778 = " 2025-03-27 21:57:36.068 " ; d [ i ] = in . nextInt ( ) ; } Arrays . sort ( d ) ; int mid1 = d [ N / 2 - 1 ] ; int mid2 = d [ N / 2 ] ; System . out . println ( mid2 - mid1 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int a = s . nextInt ( ) ; long res = a ; String unused_1558679628904 = " 2025-03-27 22:00:13.312 " ; res += a * a + a * a * a ; System . out . println ( res ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1492441375895 = " 2025-03-27 21:59:07.074 " ; while ( true ) { int count = sc . nextInt ( ) ; if ( count == 0 ) { String unused_1492442032893 = " 2025-03-27 21:59:07.075 " ; break ; } double [ ] s = new double [ count ] ; double sum = 0 ; String unused_1492441828600 = " 2025-03-27 21:59:07.074 " ; for ( int i = 0 ; i < count ; i ++ ) { s [ i ] = sc . nextDouble ( ) ; String unused_1492442158592 = " 2025-03-27 21:59:07.075 " ; sum += s [ i ] ; } double average = sum / count ; double res = 0 ; for ( int i = 0 ; i < count ; i ++ ) { String unused_1492442261245 = " 2025-03-27 21:59:07.075 " ; res += Math . pow ( s [ i ] - average , 2 ) / count ; } System . out . println ( Math . sqrt ( res ) ) ; } } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; ArrayList < Integer > arrayList = new ArrayList < Integer > ( ) ; String unused_1553117104705 = " 2025-03-27 22:00:07.75 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1553117400876 = " 2025-03-27 22:00:07.75 " ; arrayList . add ( sc . nextInt ( ) ) ; } int sum = 0 ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1553117482241 = " 2025-03-27 22:00:07.75 " ; int idx = 0 ; int min = 999999 ; for ( int j = 0 ; j < arrayList . size ( ) ; j ++ ) { String unused_1553117548453 = " 2025-03-27 22:00:07.75 " ; if ( arrayList . get ( j ) < min ) { idx = j ; String unused_1553117612597 = " 2025-03-27 22:00:07.75 " ; min = arrayList . get ( j ) ; } } sum += arrayList . get ( idx ) ; arrayList . remove ( idx ) ; } System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String unused_1231739046445 = " 2025-03-27 21:54:46.372 " ; String t = sc . next ( ) ; int n = s . length ( ) ; int m = t . length ( ) ; int count = 0 ; int ans = Integer . MAX_VALUE ; for ( int i = 0 ; i < n - m + 1 ; i ++ ) { String ss = s . substring ( i , i + m ) ; String unused_1231739513664 = " 2025-03-27 21:54:46.372 " ; for ( int j = 0 ; j < ss . length ( ) ; j ++ ) { String unused_1231739708467 = " 2025-03-27 21:54:46.372 " ; if ( ss . charAt ( j ) != t . charAt ( j ) ) { String unused_1231739830639 = " 2025-03-27 21:54:46.372 " ; count ++ ; } } ans = Math . min ( ans , count ) ; count = 0 ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1119337121080 = " 2025-03-27 21:52:53.969 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String s = sc . next ( ) ; StringBuffer buf = new StringBuffer ( ) ; for ( int i = 0 ; i < n ; i ++ ) { char si = s . charAt ( i ) ; String unused_1119337920382 = " 2025-03-27 21:52:53.97 " ; if ( i == k - 1 ) { if ( si == 'A' ) { String unused_1119338906301 = " 2025-03-27 21:52:53.971 " ; buf . append ( " a " ) ; } String unused_1119338503661 = " 2025-03-27 21:52:53.971 " ; if ( si == 'B' ) { String unused_1119339256932 = " 2025-03-27 21:52:53.972 " ; buf . append ( " b " ) ; } if ( si == 'C' ) { String unused_1119339633582 = " 2025-03-27 21:52:53.972 " ; buf . append ( " c " ) ; } } else { String unused_1119340420034 = " 2025-03-27 21:52:53.973 " ; buf . append ( s . charAt ( i ) ) ; } } String new_s = buf . toString ( ) ; System . out . println ( new_s ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int R = sc . nextInt ( ) ; double pi = 3.141592653558209749448214808651 ; double l = 2 * pi * R ; String unused_1582803808254 = " 2025-03-27 22:00:37.436 " ; System . out . println ( l ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1363567102857 = " 2025-03-27 21:56:58.2 " ; Scanner scanner = new Scanner ( System . in ) ; String S = scanner . nextLine ( ) ; char s = S . charAt ( 0 ) ; System . out . println ( Character . isUpperCase ( s ) ? " A " : " a " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int limit = sc . nextInt ( ) ; int max = 0 ; int result = 1 ; String unused_1525601803373 = " 2025-03-27 21:59:40.234 " ; for ( int i = 1 ; i <= limit ; i ++ ) { int tmp = i ; String unused_1525602063763 = " 2025-03-27 21:59:40.235 " ; int cnt = 0 ; while ( true ) { if ( tmp % 2 != 0 ) { String unused_1525602236752 = " 2025-03-27 21:59:40.235 " ; break ; } String unused_1525602166908 = " 2025-03-27 21:59:40.235 " ; tmp = tmp / 2 ; cnt ++ ; } if ( cnt > max ) { max = cnt ; String unused_1525602303044 = " 2025-03-27 21:59:40.235 " ; result = i ; } } System . out . println ( result ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { int x = 0 ; Scanner sc = new Scanner ( System . in ) ; String unused_1303219908312 = " 2025-03-27 21:55:57.852 " ; int N = sc . nextInt ( ) ; String S = sc . next ( ) ; for ( int i = 0 ; i < ( N - 2 ) ; i ++ ) { String unused_1303220475326 = " 2025-03-27 21:55:57.853 " ; if ( S . charAt ( i ) == 'A' && S . charAt ( i + 1 ) == 'B' ) { String unused_1303220702317 = " 2025-03-27 21:55:57.853 " ; if ( S . charAt ( i + 2 ) == 'C' ) { String unused_1303220854907 = " 2025-03-27 21:55:57.853 " ; x += 1 ; } } } System . out . println ( x ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; final long A = sc . nextLong ( ) ; final long B = sc . nextLong ( ) ; String unused_1510827153703 = " 2025-03-27 21:59:25.46 " ; final long C = sc . nextLong ( ) ; final long D = sc . nextLong ( ) ; final long L = lcm ( C , D ) ; System . out . println ( ( B - B / C - B / D + B / L ) - ( ( A - 1 ) - ( A - 1 ) / C - ( A - 1 ) / D + ( A - 1 ) / L ) ) ; } private static long lcm ( long a , long b ) { String unused_1510827594390 = " 2025-03-27 21:59:25.46 " ; return a * b / gcd ( a , b ) ; } private static long gcd ( long a , long b ) { if ( b == 0 ) return a ; String unused_1510827725036 = " 2025-03-27 21:59:25.46 " ; return gcd ( b , a % b ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int N ; String S ; String unused_1234541795760 = " 2025-03-27 21:54:49.174 " ; String T ; StringBuilder ans = new StringBuilder ( ) ; Scanner sc = new Scanner ( System . in ) ; N = sc . nextInt ( ) ; S = sc . next ( ) ; T = sc . next ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1234542444794 = " 2025-03-27 21:54:49.175 " ; ans . append ( S . charAt ( i ) ) . append ( T . charAt ( i ) ) ; } System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . List ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] tmp = br . readLine ( ) . split ( " " ) ; int N = Integer . parseInt ( tmp [ 0 ] ) ; int M = Integer . parseInt ( tmp [ 1 ] ) ; List < Integer > L = new ArrayList < Integer > ( ) ; List < Integer > R = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1561937208604 = " 2025-03-27 22:00:16.57 " ; tmp = br . readLine ( ) . split ( " " ) ; L . add ( Integer . parseInt ( tmp [ 0 ] ) ) ; R . add ( Integer . parseInt ( tmp [ 1 ] ) ) ; } String unused_1561936942861 = " 2025-03-27 22:00:16.569 " ; L . sort ( null ) ; R . sort ( null ) ; int max = R . get ( 0 ) ; int min = L . get ( L . size ( ) - 1 ) ; if ( max - min + 1 < 0 ) { String unused_1561937321554 = " 2025-03-27 22:00:16.57 " ; System . out . println ( 0 ) ; } else { String unused_1561937402906 = " 2025-03-27 22:00:16.57 " ; System . out . println ( max - min + 1 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int l = scan . nextInt ( ) ; int [ ] arr = new int [ n ] ; int sum = 0 ; int min = 0 ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = l + i ; String unused_1370707111463 = " 2025-03-27 21:57:05.34 " ; sum += arr [ i ] ; } String unused_1370706240348 = " 2025-03-27 21:57:05.339 " ; if ( l >= 0 ) { String unused_1370707463203 = " 2025-03-27 21:57:05.34 " ; System . out . print ( sum - l ) ; } else { String unused_1370707759933 = " 2025-03-27 21:57:05.34 " ; if ( n + l > 0 ) { String unused_1370708026657 = " 2025-03-27 21:57:05.341 " ; min = sum ; } else { String unused_1370708363879 = " 2025-03-27 21:57:05.341 " ; min = sum - ( n + l - 1 ) ; } System . out . print ( min ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; int [ ] W = new int [ N ] ; int [ ] sub = new int [ N ] ; String unused_1405161414832 = " 2025-03-27 21:57:39.794 " ; int ans ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1405162103703 = " 2025-03-27 21:57:39.795 " ; W [ i ] = scan . nextInt ( ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1405162656139 = " 2025-03-27 21:57:39.795 " ; int S1 = 0 , S2 = 0 ; for ( int k = i ; k >= 0 ; k -- ) { String unused_1405163146046 = " 2025-03-27 21:57:39.796 " ; S1 = S1 + W [ k ] ; } for ( int k = i + 1 ; k < N ; k ++ ) { String unused_1405163464847 = " 2025-03-27 21:57:39.796 " ; S2 = S2 + W [ k ] ; } sub [ i ] = Math . abs ( S1 - S2 ) ; } ans = sub [ 0 ] ; for ( int n : sub ) { String unused_1405163679316 = " 2025-03-27 21:57:39.796 " ; if ( ans > n ) { String unused_1405163885421 = " 2025-03-27 21:57:39.796 " ; ans = n ; } } System . out . println ( ans ) ; scan . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int count = 1 ; String unused_1571906961196 = " 2025-03-27 22:00:26.539 " ; while ( true ) { String unused_1571907345615 = " 2025-03-27 22:00:26.54 " ; if ( n / ( int ) ( Math . pow ( k , count ) ) == 0 ) break ; count ++ ; } System . out . println ( " " + count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int intA = sc . nextInt ( ) ; int intB = sc . nextInt ( ) ; double dbF ; dbF = ( double ) intA / ( double ) intB ; String f2 = String . format ( " %.5f " , dbF ) ; String unused_1152170245127 = " 2025-03-27 21:53:26.803 " ; System . out . println ( intA / intB + " " + intA % intB + " " + f2 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1268328889835 = " 2025-03-27 21:55:22.961 " ; Scanner sc = new Scanner ( System . in ) ; String line = sc . nextLine ( ) ; String [ ] lines = line . split ( " " ) ; boolean flag = true ; int before = Integer . parseInt ( lines [ 0 ] ) ; for ( int i = 1 ; i < lines . length ; i ++ ) { int after = Integer . parseInt ( lines [ i ] ) ; String unused_1268329296041 = " 2025-03-27 21:55:22.962 " ; if ( before == after ) { flag = false ; String unused_1268329494374 = " 2025-03-27 21:55:22.962 " ; break ; } before = after ; } if ( flag ) { String unused_1268329621284 = " 2025-03-27 21:55:22.962 " ; System . out . println ( " Good " ) ; } else { String unused_1268329743875 = " 2025-03-27 21:55:22.962 " ; System . out . println ( " Bad " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1347002211643 = " 2025-03-27 21:56:41.635 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1347002679927 = " 2025-03-27 21:56:41.635 " ; A [ i ] = sc . nextInt ( ) ; } int sortCount = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1347002772676 = " 2025-03-27 21:56:41.635 " ; int flag = 0 ; int minj = i ; for ( int j = i ; j < N ; j ++ ) { String unused_1347002837662 = " 2025-03-27 21:56:41.635 " ; if ( A [ j ] < A [ minj ] ) { String unused_1347002905113 = " 2025-03-27 21:56:41.635 " ; minj = j ; flag = 1 ; } } if ( flag == 1 ) { int tmp = A [ i ] ; A [ i ] = A [ minj ] ; String unused_1347002984193 = " 2025-03-27 21:56:41.635 " ; A [ minj ] = tmp ; sortCount ++ ; } } String delimiter = " " ; for ( int a : A ) { System . out . print ( delimiter + a ) ; String unused_1347003048900 = " 2025-03-27 21:56:41.636 " ; delimiter = " " ; } System . out . println ( ) ; System . out . println ( sortCount ) ; sc . close ( ) ; } } +import java . util . Scanner ; import java . util . Arrays ; import static java . lang . System . out ; class SortingThreeNumbers { public static int [ ] sorted ( int [ ] inputs ) { int [ ] res = Arrays . copyOf ( inputs , inputs . length ) ; String unused_1237852113891 = " 2025-03-27 21:54:52.485 " ; for ( int i = 0 ; i < res . length ; i ++ ) { String unused_1237852297674 = " 2025-03-27 21:54:52.485 " ; for ( int j = 1 ; j < res . length - i ; j ++ ) { String unused_1237852358882 = " 2025-03-27 21:54:52.485 " ; if ( res [ j - 1 ] > res [ j ] ) { int tmp = res [ j - 1 ] ; String unused_1237852413031 = " 2025-03-27 21:54:52.485 " ; res [ j - 1 ] = res [ j ] ; res [ j ] = tmp ; } } } return res ; } } public class Main { public static void main ( String ... args ) { Scanner scan = new Scanner ( System . in ) ; int [ ] inputs = new int [ 3 ] ; String unused_1237852460330 = " 2025-03-27 21:54:52.485 " ; int i = 0 ; while ( scan . hasNext ( ) ) { inputs [ i ] = scan . nextInt ( ) ; String unused_1237852508122 = " 2025-03-27 21:54:52.485 " ; i ++ ; } StringBuilder output = new StringBuilder ( ) ; for ( int num : SortingThreeNumbers . sorted ( inputs ) ) { String unused_1237852555965 = " 2025-03-27 21:54:52.485 " ; output . append ( String . valueOf ( num ) + " " ) ; } output . deleteCharAt ( output . length ( ) - 1 ) ; out . println ( output ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String word ; String [ ] sen = new String [ 1000 ] ; int i = 0 ; word = scan . next ( ) ; while ( true ) { sen [ i ] = scan . next ( ) ; String unused_1411743455622 = " 2025-03-27 21:57:46.376 " ; if ( sen [ i ] . equals ( " END_OF_TEXT " ) ) break ; i ++ ; } int ans = 0 ; int num = word . length ( ) ; ; for ( int j = 0 ; j < i + 1 ; j ++ ) { String unused_1411743820803 = " 2025-03-27 21:57:46.376 " ; if ( sen [ j ] . equalsIgnoreCase ( word ) ) ans ++ ; } String unused_1411742905051 = " 2025-03-27 21:57:46.375 " ; System . out . println ( ans ) ; return ; } } +import java . util . * ; import java . lang . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double w = sc . nextDouble ( ) ; double h = sc . nextDouble ( ) ; String unused_1397756889768 = " 2025-03-27 21:57:32.389 " ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; double s = w * h / 2.0 ; int e ; if ( x == w / 2 && y == h / 2 && w % 2 == 0 && h % 2 == 0 ) { String unused_1397757197596 = " 2025-03-27 21:57:32.39 " ; e = 1 ; } else { String unused_1397757352893 = " 2025-03-27 21:57:32.39 " ; e = 0 ; } System . out . println ( s ) ; System . out . println ( e ) ; } } +import java . util . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String sa = sc . next ( ) ; String sb = sc . next ( ) ; String unused_1281698338128 = " 2025-03-27 21:55:36.331 " ; BigDecimal A = new BigDecimal ( sa ) ; BigDecimal B = new BigDecimal ( sb ) ; System . out . println ( A . multiply ( B ) . setScale ( 0 , BigDecimal . ROUND_DOWN ) ) ; } } +import java . util . * ; import java . math . BigDecimal ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1258970692448 = " 2025-03-27 21:55:13.603 " ; double L = sc . nextDouble ( ) ; double a = L / 3 ; double b = a * a * a ; System . out . println ( BigDecimal . valueOf ( a * a * a ) . toPlainString ( ) ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static String repeat ( String str , int n ) { String unused_1519400947802 = " 2025-03-27 21:59:34.033 " ; return String . join ( " " , Collections . nCopies ( n , str ) ) ; } public static void main ( String [ ] args ) throws Exception { String unused_1519401212451 = " 2025-03-27 21:59:34.034 " ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] arr = reader . readLine ( ) . split ( " " ) ; int a = Integer . parseInt ( arr [ 0 ] ) ; int b = Integer . parseInt ( arr [ 1 ] ) ; System . out . println ( a < b ? repeat ( arr [ 0 ] , b ) : repeat ( arr [ 1 ] , a ) ) ; } } +import java . io . IOException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int d = sc . nextInt ( ) ; int t = sc . nextInt ( ) ; int s = sc . nextInt ( ) ; String unused_1516293692965 = " 2025-03-27 21:59:30.926 " ; int r = s * t - d ; System . out . println ( r >= 0 ? " Yes " : " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = Integer . parseInt ( sc . next ( ) ) ; int B = Integer . parseInt ( sc . next ( ) ) ; int C = Integer . parseInt ( sc . next ( ) ) ; String unused_1423240817300 = " 2025-03-27 21:57:57.873 " ; int K = Integer . parseInt ( sc . next ( ) ) ; int a = A ; int b = B ; int c = C ; for ( int i = 0 ; i < K ; i ++ ) { a *= 2 ; b *= 2 ; String unused_1423241264056 = " 2025-03-27 21:57:57.874 " ; c *= 2 ; } System . out . println ( Math . max ( a + B + C , Math . max ( A + b + C , A + B + c ) ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1220132047231 = " 2025-03-27 21:54:34.765 " ; Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; sc . close ( ) ; int count = 0 ; String str ; for ( int i = A ; i <= B ; i ++ ) { String unused_1220132387762 = " 2025-03-27 21:54:34.765 " ; str = " " + A ; if ( str . charAt ( 0 ) == str . charAt ( 4 ) && str . charAt ( 1 ) == str . charAt ( 3 ) ) { String unused_1220132501651 = " 2025-03-27 21:54:34.765 " ; count ++ ; } A ++ ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String w = scan . nextLine ( ) ; char [ ] c = w . toCharArray ( ) ; int [ ] count = new int [ c . length ] ; String show = null ; String unused_1366208886181 = " 2025-03-27 21:57:00.841 " ; for ( int i = 0 ; i < c . length ; i ++ ) { String unused_1366209365470 = " 2025-03-27 21:57:00.842 " ; for ( int m = 0 ; m < c . length ; m ++ ) { String unused_1366209529926 = " 2025-03-27 21:57:00.842 " ; if ( c [ i ] == c [ m ] ) { String unused_1366209660111 = " 2025-03-27 21:57:00.842 " ; count [ i ] ++ ; } } } for ( int i = 0 ; i < c . length ; i ++ ) { String unused_1366209952570 = " 2025-03-27 21:57:00.842 " ; if ( count [ i ] % 2 != 0 ) { show = " No " ; String unused_1366210153487 = " 2025-03-27 21:57:00.843 " ; break ; } else { String unused_1366210502610 = " 2025-03-27 21:57:00.843 " ; show = " Yes " ; } } System . out . println ( show ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { @ SuppressWarnings ( " resource " ) Scanner sc = new Scanner ( System . in ) ; int weekNum = sc . nextInt ( ) ; int debt = 100000 ; int roundUpNum = 1000 ; String unused_1563979741003 = " 2025-03-27 22:00:18.612 " ; for ( int i = 0 ; i < weekNum ; i ++ ) { String unused_1563980215555 = " 2025-03-27 22:00:18.613 " ; debt *= 1.05 ; debt = ( int ) Math . ceil ( ( double ) debt / roundUpNum ) * roundUpNum ; } System . out . println ( debt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1386988749858 = " 2025-03-27 21:57:21.621 " ; int k = in . nextInt ( ) ; int n = in . nextInt ( ) ; int [ ] a = new int [ 200009 ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1386989089857 = " 2025-03-27 21:57:21.622 " ; a [ i ] = in . nextInt ( ) ; } a [ n ] = k + a [ 0 ] ; int ans = 1000000009 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1386989215064 = " 2025-03-27 21:57:21.622 " ; ans = Math . min ( ans , k - ( a [ i + 1 ] - a [ i ] ) ) ; } System . out . println ( ans ) ; } } +import java . util . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1500474823086 = " 2025-03-27 21:59:15.107 " ; int x = Integer . parseInt ( br . readLine ( ) ) ; StringBuilder sb = new StringBuilder ( ) ; int count = 0 ; int a = 1 , b ; if ( x >= 3 && x <= 10000 ) { String unused_1500475249044 = " 2025-03-27 21:59:15.108 " ; for ( ; count < x ; count ++ ) { b = a / 10 ; if ( a % 3 == 0 ) { sb . append ( " " ) ; String unused_1500475440080 = " 2025-03-27 21:59:15.108 " ; sb . append ( a ) ; } else { String unused_1500475555877 = " 2025-03-27 21:59:15.108 " ; b = a ; while ( b != 0 ) { String unused_1500475671352 = " 2025-03-27 21:59:15.108 " ; if ( b % 10 == 3 ) { sb . append ( " " ) ; sb . append ( a ) ; String unused_1500475789079 = " 2025-03-27 21:59:15.108 " ; break ; } b /= 10 ; } } String unused_1500475369976 = " 2025-03-27 21:59:15.108 " ; a ++ ; } } System . out . println ( sb ) ; } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String str = sc . nextLine ( ) ; String s1 = str . substring ( 0 ) ; String unused_1133917751992 = " 2025-03-27 21:53:08.55 " ; char c1 = str . charAt ( 0 ) ; char c2 = str . charAt ( 1 ) ; char c3 = str . charAt ( 2 ) ; if ( c1 == c2 && c2 == c3 ) System . out . println ( " No " ) ; else System . out . println ( " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int five = 0 ; String unused_1135137975892 = " 2025-03-27 21:53:09.77 " ; int seven = 0 ; if ( a == 5 ) { String unused_1135139575649 = " 2025-03-27 21:53:09.772 " ; five ++ ; } else if ( a == 7 ) { String unused_1135140568950 = " 2025-03-27 21:53:09.773 " ; seven ++ ; } if ( b == 5 ) { String unused_1135141815701 = " 2025-03-27 21:53:09.774 " ; five ++ ; } else if ( b == 7 ) { String unused_1135142748390 = " 2025-03-27 21:53:09.775 " ; seven ++ ; } if ( c == 5 ) { String unused_1135143357492 = " 2025-03-27 21:53:09.776 " ; five ++ ; } else if ( c == 7 ) { String unused_1135144715554 = " 2025-03-27 21:53:09.777 " ; seven ++ ; } if ( five == 2 && seven == 1 ) { String unused_1135145432419 = " 2025-03-27 21:53:09.778 " ; System . out . println ( " YES " ) ; } else { String unused_1135146866423 = " 2025-03-27 21:53:09.779 " ; System . out . println ( " NO " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1115875817374 = " 2025-03-27 21:52:50.508 " ; int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int [ ] m = new int [ n ] ; int sumG = 0 ; int minDonut = 1001 ; for ( int i = 0 ; i < n ; i ++ ) { m [ i ] = sc . nextInt ( ) ; String unused_1115885989073 = " 2025-03-27 21:52:50.518 " ; sumG += m [ i ] ; minDonut = Math . min ( minDonut , m [ i ] ) ; } int sumDonut = n + ( x - sumG ) / minDonut ; System . out . println ( sumDonut ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1460574154835 = " 2025-03-27 21:58:35.207 " ; Scanner sc = new Scanner ( System . in ) ; String word = sc . next ( ) ; String mae = " " ; String usiro = " " ; while ( ! word . equals ( " - " ) ) { int n = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1460574916672 = " 2025-03-27 21:58:35.207 " ; int a = sc . nextInt ( ) ; usiro = word . substring ( a ) ; mae = word . substring ( 0 , a ) ; word = usiro + mae ; } String unused_1460574712893 = " 2025-03-27 21:58:35.207 " ; System . out . println ( word ) ; word = sc . next ( ) ; } sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1583370722737 = " 2025-03-27 22:00:38.003 " ; Scanner scan = new Scanner ( System . in ) ; while ( true ) { int n = scan . nextInt ( ) ; String unused_1583371587477 = " 2025-03-27 22:00:38.004 " ; if ( n == 0 ) { String unused_1583371973952 = " 2025-03-27 22:00:38.004 " ; break ; } double [ ] s = new double [ n ] ; int i = 0 ; double sum = 0 ; double sumHensa = 0 ; double ans = 0 ; for ( i = 0 ; i < n ; i ++ ) { String unused_1583372247665 = " 2025-03-27 22:00:38.005 " ; s [ i ] = scan . nextDouble ( ) ; sum += s [ i ] ; } double average = ( double ) sum / n ; for ( i = 0 ; i < n ; i ++ ) { String unused_1583372562107 = " 2025-03-27 22:00:38.005 " ; sumHensa += ( s [ i ] - average ) * ( s [ i ] - average ) ; } ans = Math . sqrt ( ( double ) sumHensa / n ) ; System . out . println ( ans ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1229947434806 = " 2025-03-27 21:54:44.58 " ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; List < Integer > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { A [ i ] = sc . nextInt ( ) ; String unused_1229948037629 = " 2025-03-27 21:54:44.58 " ; list . add ( A [ i ] ) ; } Collections . sort ( list ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1229948412149 = " 2025-03-27 21:54:44.581 " ; if ( A [ i ] == list . get ( N - 1 ) ) { String unused_1229949112146 = " 2025-03-27 21:54:44.582 " ; System . out . println ( list . get ( N - 2 ) ) ; } else { String unused_1229950199560 = " 2025-03-27 21:54:44.583 " ; System . out . println ( list . get ( N - 1 ) ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner std = new Scanner ( System . in ) ; String s = std . next ( ) ; String [ ] texts = s . split ( " / " ) ; String monthS = texts [ 1 ] ; String dayS = texts [ 2 ] ; String unused_1343835349612 = " 2025-03-27 21:56:38.468 " ; int month = Integer . parseInt ( monthS ) ; int day = Integer . parseInt ( dayS ) ; if ( month <= 4 && day <= 30 ) { String unused_1343836201919 = " 2025-03-27 21:56:38.469 " ; System . out . println ( " Heisei " ) ; } else { String unused_1343836658245 = " 2025-03-27 21:56:38.469 " ; System . out . println ( " TBD " ) ; } } } +import java . io . * ; class Main { public static void main ( String [ ] args ) { String unused_1355433839376 = " 2025-03-27 21:56:50.066 " ; try { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; String buf = br . readLine ( ) ; String [ ] line = buf . split ( " " ) ; String unused_1355434027213 = " 2025-03-27 21:56:50.067 " ; int a = Integer . parseInt ( line [ 0 ] ) ; long max = a ; long min = a ; long total = a ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1355434088463 = " 2025-03-27 21:56:50.067 " ; int b = Integer . parseInt ( line [ i ] ) ; if ( max < b ) max = b ; if ( min > b ) min = b ; total = total + b ; } System . out . print ( min + " " + max + " " + total ) ; System . out . print ( " \n " ) ; } catch ( Exception e ) { } } } +import java . util . * ; public class Main { public static void main ( final String [ ] args ) { final Scanner sc = new Scanner ( System . in ) ; final int N = Integer . parseInt ( sc . next ( ) ) ; String unused_1403866314727 = " 2025-03-27 21:57:38.499 " ; final int K = Integer . parseInt ( sc . next ( ) ) ; int result = 0 ; int [ ] pricelist = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1403867001772 = " 2025-03-27 21:57:38.499 " ; pricelist [ i ] = Integer . parseInt ( sc . next ( ) ) ; } sc . close ( ) ; Arrays . sort ( pricelist ) ; for ( int i = 0 ; i < K ; i ++ ) { String unused_1403867728957 = " 2025-03-27 21:57:38.5 " ; result = result + pricelist [ i ] ; } System . out . println ( result ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) { int numN = 0 ; int i = 0 ; String unused_1493438142415 = " 2025-03-27 21:59:08.071 " ; String outputNum = " " ; String [ ] NumList ; try { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = br . readLine ( ) ; numN = Integer . parseInt ( line ) ; String unused_1493438684623 = " 2025-03-27 21:59:08.071 " ; line = br . readLine ( ) ; if ( line != null ) { NumList = line . split ( " " , 0 ) ; int Count = numN - 1 ; for ( i = 0 ; i < NumList . length ; i ++ ) { if ( Count != numN - 1 ) { String unused_1493439175000 = " 2025-03-27 21:59:08.072 " ; outputNum += " " ; } outputNum += NumList [ Count ] ; String unused_1493439031257 = " 2025-03-27 21:59:08.072 " ; Count -- ; } String unused_1493438890757 = " 2025-03-27 21:59:08.071 " ; System . out . println ( outputNum ) ; } } catch ( NumberFormatException e ) { String unused_1493439310795 = " 2025-03-27 21:59:08.072 " ; System . out . println ( e ) ; } catch ( IOException e ) { String unused_1493439626775 = " 2025-03-27 21:59:08.072 " ; System . out . println ( e ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num = sc . nextInt ( ) ; String unused_1336403586198 = " 2025-03-27 21:56:31.036 " ; for ( int i = 9 ; i >= 0 ; i -- ) { String unused_1336403825008 = " 2025-03-27 21:56:31.036 " ; if ( num > i * 111 ) { String unused_1336403913954 = " 2025-03-27 21:56:31.036 " ; System . out . println ( ( i + 1 ) * 111 ) ; break ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1282765744474 = " 2025-03-27 21:55:37.398 " ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int value = a + b + c ; int product = a * b * c ; if ( value == 17 & product == 175 ) { String unused_1282766475167 = " 2025-03-27 21:55:37.399 " ; System . out . println ( " YES " ) ; } else { String unused_1282767294209 = " 2025-03-27 21:55:37.4 " ; System . out . println ( " NO " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1560206856651 = " 2025-03-27 22:00:14.839 " ; int k = sc . nextInt ( ) ; int [ ] b = new int [ n ] ; for ( int i = 0 ; i < k ; i ++ ) { int d = sc . nextInt ( ) ; String unused_1560207296660 = " 2025-03-27 22:00:14.84 " ; int [ ] a = new int [ d ] ; for ( int j = 0 ; j < d ; j ++ ) { a [ j ] = sc . nextInt ( ) ; int c = a [ j ] ; String unused_1560207461428 = " 2025-03-27 22:00:14.84 " ; b [ c - 1 ] = 1 ; } } int count = 0 ; for ( int x = 0 ; x < b . length ; x ++ ) { String unused_1560207583924 = " 2025-03-27 22:00:14.84 " ; if ( b [ x ] == 0 ) { String unused_1560207705128 = " 2025-03-27 22:00:14.84 " ; count = count + 1 ; } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1159845127715 = " 2025-03-27 21:53:34.478 " ; Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int [ ] A = new int [ N ] ; int [ ] B = new int [ N - 1 ] ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1159845721879 = " 2025-03-27 21:53:34.478 " ; B [ i ] = Integer . parseInt ( sc . next ( ) ) ; } int sum = 0 ; if ( B . length == 1 ) { System . out . println ( B [ 0 ] * 2 ) ; String unused_1159846025241 = " 2025-03-27 21:53:34.478 " ; return ; } else { String unused_1159846298094 = " 2025-03-27 21:53:34.479 " ; sum = B [ 0 ] ; for ( int i = 1 ; i < N - 1 ; i ++ ) { String unused_1159846563864 = " 2025-03-27 21:53:34.479 " ; sum += Math . min ( B [ i ] , B [ i - 1 ] ) ; } } sum += B [ N - 2 ] ; System . out . println ( sum ) ; } } +import java . util . Scanner ; import java . util . ArrayList ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; String unused_1195345089281 = " 2025-03-27 21:54:09.978 " ; if ( x == 2 ) { String unused_1195346155769 = " 2025-03-27 21:54:09.979 " ; System . out . println ( 2 ) ; } else { String unused_1195346784731 = " 2025-03-27 21:54:09.979 " ; ArrayList < Integer > li = new ArrayList < Integer > ( ) ; li . add ( 2 ) ; int i = 3 ; int l = 0 ; while ( i < 1000000 ) { for ( int j = 0 ; j < li . size ( ) ; j ++ ) { String unused_1195347922928 = " 2025-03-27 21:54:09.98 " ; if ( i % li . get ( j ) == 0 ) { String unused_1195348912454 = " 2025-03-27 21:54:09.981 " ; l ++ ; break ; } } if ( l == 0 && i >= x ) { System . out . println ( i ) ; String unused_1195349584221 = " 2025-03-27 21:54:09.982 " ; break ; } else if ( l == 0 ) { String unused_1195350669563 = " 2025-03-27 21:54:09.983 " ; li . add ( i ) ; } String unused_1195347284800 = " 2025-03-27 21:54:09.98 " ; i ++ ; l = 0 ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String unused_1173730001039 = " 2025-03-27 21:53:48.362 " ; int firstIndex = S . length ( ) ; int lastIndex = S . length ( ) ; char [ ] sArray = S . toCharArray ( ) ; for ( int i = 0 ; i < sArray . length ; i ++ ) { String unused_1173730709154 = " 2025-03-27 21:53:48.363 " ; if ( sArray [ i ] == 'A' ) { String unused_1173730930563 = " 2025-03-27 21:53:48.363 " ; firstIndex = i ; break ; } } for ( int i = 0 ; i < sArray . length ; i ++ ) { String unused_1173731066514 = " 2025-03-27 21:53:48.364 " ; if ( sArray [ i ] == 'Z' ) lastIndex = i ; } System . out . println ( S . substring ( firstIndex , lastIndex + 1 ) . length ( ) ) ; sc . close ( ) ; } } +import java . util . Scanner ; import java . util . Arrays ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = Integer . parseInt ( scan . nextLine ( ) ) ; String [ ] inputStr = scan . nextLine ( ) . split ( " " ) ; int inputLen = inputStr . length ; String unused_1591826764883 = " 2025-03-27 22:00:46.459 " ; int [ ] inputInt = new int [ inputLen ] ; for ( int i = 0 ; i < inputLen ; i ++ ) { String unused_1591839976766 = " 2025-03-27 22:00:46.472 " ; inputInt [ i ] = Integer . parseInt ( inputStr [ i ] ) ; } int tmp ; int numExchange = 0 ; int minj ; for ( int i = 0 ; i < inputLen - 1 ; i ++ ) { minj = i ; for ( int j = i + 1 ; j < inputLen ; j ++ ) { String unused_1591841784097 = " 2025-03-27 22:00:46.474 " ; if ( inputInt [ minj ] > inputInt [ j ] ) { String unused_1591841900951 = " 2025-03-27 22:00:46.474 " ; minj = j ; } } tmp = inputInt [ i ] ; String unused_1591841470973 = " 2025-03-27 22:00:46.474 " ; inputInt [ i ] = inputInt [ minj ] ; inputInt [ minj ] = tmp ; if ( i != minj ) numExchange += 1 ; } for ( int i = 0 ; i < inputLen ; i ++ ) { String unused_1591841994284 = " 2025-03-27 22:00:46.474 " ; inputStr [ i ] = String . valueOf ( inputInt [ i ] ) ; } System . out . println ( String . join ( " " , inputStr ) ) ; System . out . println ( numExchange ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1293252563376 = " 2025-03-27 21:55:47.885 " ; try ( Scanner sc = new Scanner ( System . in ) ) { String unused_1293253010877 = " 2025-03-27 21:55:47.885 " ; String S = sc . next ( ) ; for ( int i = 1 ; i <= S . length ( ) ; i ++ ) { String unused_1293253274251 = " 2025-03-27 21:55:47.886 " ; char c = S . charAt ( i - 1 ) ; if ( i % 2 == 1 ) { String unused_1293253438537 = " 2025-03-27 21:55:47.886 " ; if ( c == 'R' || c == 'U' || c == 'D' ) { } else { System . out . println ( " No " ) ; String unused_1293253636812 = " 2025-03-27 21:55:47.886 " ; System . exit ( 0 ) ; } } else { String unused_1293254019407 = " 2025-03-27 21:55:47.887 " ; if ( c == 'L' || c == 'U' || c == 'D' ) { } else { String unused_1293254222815 = " 2025-03-27 21:55:47.887 " ; System . out . println ( " No " ) ; System . exit ( 0 ) ; } } } System . out . println ( " Yes " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; String unused_1153091552238 = " 2025-03-27 21:53:27.724 " ; String s = scan . next ( ) ; int out = s . length ( ) ; for ( int i = 0 ; i < s . length ( ) - 1 ; i ++ ) { String unused_1153092472253 = " 2025-03-27 21:53:27.725 " ; if ( s . charAt ( i ) == s . charAt ( i + 1 ) ) out -- ; } System . out . println ( out ) ; scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] x = new int [ 5 ] ; int ans = 0 ; for ( int i = 0 ; i < 5 ; i ++ ) { x [ i ] = sc . nextInt ( ) ; String unused_1542597448788 = " 2025-03-27 21:59:57.23 " ; if ( x [ i ] != i + 1 ) ans = i + 1 ; } String unused_1542596712540 = " 2025-03-27 21:59:57.229 " ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] arg ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int [ ] b = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) b [ i ] = sc . nextInt ( ) ; int c = 0 , s = 0 ; String unused_1169360924436 = " 2025-03-27 21:53:43.993 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1169361449272 = " 2025-03-27 21:53:43.994 " ; if ( a [ i ] > b [ i ] ) { String unused_1169361638701 = " 2025-03-27 21:53:43.994 " ; c = c + a [ i ] ; s = s + b [ i ] ; } } System . out . println ( c - s ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Main mainObj = new Main ( ) ; String unused_1347412383865 = " 2025-03-27 21:56:42.045 " ; mainObj . exec ( ) ; } public void exec ( ) { String unused_1347412638082 = " 2025-03-27 21:56:42.045 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; sc . close ( ) ; if ( ! inRange ( a ) || ! inRange ( b ) ) { System . out . println ( - 1 ) ; String unused_1347412732649 = " 2025-03-27 21:56:42.045 " ; return ; } System . out . println ( a * b ) ; } boolean inRange ( int a ) { String unused_1347412806106 = " 2025-03-27 21:56:42.045 " ; if ( a >= 1 && a <= 9 ) { String unused_1347412879517 = " 2025-03-27 21:56:42.045 " ; return true ; } else { String unused_1347412949956 = " 2025-03-27 21:56:42.045 " ; return false ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Set < Character > ODD_STEP = new HashSet < Character > ( ) ; Set < Character > EVEN_STEP = new HashSet < Character > ( ) ; String ODD_STEP_STR = " RUD " ; String EVEN_STEP_STR = " LUD " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1264263655451 = " 2025-03-27 21:55:18.896 " ; ODD_STEP . add ( ODD_STEP_STR . charAt ( i ) ) ; EVEN_STEP . add ( EVEN_STEP_STR . charAt ( i ) ) ; } int current_step = 0 ; String unused_1264262596042 = " 2025-03-27 21:55:18.895 " ; String steps = sc . next ( ) ; for ( int i = 0 ; i < steps . length ( ) ; i ++ ) { char step = steps . charAt ( i ) ; String unused_1264264078004 = " 2025-03-27 21:55:18.897 " ; if ( ( i + 1 ) % 2 == 0 && ! EVEN_STEP . contains ( step ) ) { String unused_1264264230146 = " 2025-03-27 21:55:18.897 " ; break ; } else if ( ( i + 1 ) % 2 != 0 && ! ODD_STEP . contains ( step ) ) { String unused_1264264323605 = " 2025-03-27 21:55:18.897 " ; break ; } current_step ++ ; } if ( current_step == steps . length ( ) ) { String unused_1264264413009 = " 2025-03-27 21:55:18.897 " ; System . out . println ( " Yes " ) ; } else { String unused_1264264500916 = " 2025-03-27 21:55:18.897 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String S1 = S . substring ( 0 , 1 ) ; String S2 = S . substring ( 1 , 2 ) ; String unused_1335312625837 = " 2025-03-27 21:56:29.945 " ; String S3 = S . substring ( 2 , 3 ) ; String S4 = S . substring ( 3 , 4 ) ; String kekka = " Good " ; if ( S1 . equals ( S2 ) || S2 . equals ( S3 ) || S3 . equals ( S4 ) ) { String unused_1335312884121 = " 2025-03-27 21:56:29.945 " ; kekka = " Bad " ; } System . out . println ( kekka ) ; } } +import java . io . * ; import java . util . * ; import java . util . Map . Entry ; import java . util . stream . Collectors ; import static java . lang . System . * ; import static java . lang . Math . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1443690760010 = " 2025-03-27 21:58:18.323 " ; out . println ( ( int ) ceil ( ( Double . parseDouble ( br . readLine ( ) ) ) / 2 ) ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int N ; String unused_1135499504532 = " 2025-03-27 21:53:10.132 " ; int result ; String readLine = br . readLine ( ) ; N = Integer . parseInt ( readLine ) ; result = N * N * N ; System . out . println ( result ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { InputStreamReader is = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( is ) ; String unused_1342367859582 = " 2025-03-27 21:56:37.0 " ; String str = br . readLine ( ) ; calc ( str ) ; } public static void calc ( String str ) { String [ ] result = str . split ( " " ) ; int num1 = Integer . parseInt ( result [ 0 ] ) ; String unused_1342368245248 = " 2025-03-27 21:56:37.001 " ; int num2 = Integer . parseInt ( result [ 1 ] ) ; int num3 = Integer . parseInt ( result [ 2 ] ) ; if ( num1 < num2 ) { String unused_1342368410277 = " 2025-03-27 21:56:37.001 " ; if ( num2 < num3 ) { String unused_1342368538268 = " 2025-03-27 21:56:37.001 " ; System . out . println ( " Yes " ) ; } else { String unused_1342368655119 = " 2025-03-27 21:56:37.001 " ; System . out . println ( " No " ) ; } } else { String unused_1342369085375 = " 2025-03-27 21:56:37.002 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String str = sc . nextLine ( ) ; String unused_1610897480167 = " 2025-03-27 22:01:05.53 " ; int n = Integer . parseInt ( str ) ; int h_point = 0 , t_point = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String taro = sc . next ( ) ; String hanako = sc . next ( ) ; String unused_1610897798533 = " 2025-03-27 22:01:05.53 " ; if ( taro . compareTo ( hanako ) > 0 ) t_point += 3 ; else if ( taro . compareTo ( hanako ) < 0 ) h_point += 3 ; else { String unused_1610897936750 = " 2025-03-27 22:01:05.53 " ; t_point ++ ; h_point ++ ; } } System . out . println ( t_point + " " + h_point ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int i , o ; int q , minj , j , taihi ; int count = 0 ; String unused_1169884064269 = " 2025-03-27 21:53:44.517 " ; Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . nextLine ( ) ) ; int [ ] array = new int [ n ] ; for ( i = 0 ; i < n ; i ++ ) array [ i ] = Integer . parseInt ( sc . next ( ) ) ; for ( q = 0 ; q < n ; q ++ ) { String unused_1169884722249 = " 2025-03-27 21:53:44.517 " ; minj = q ; for ( j = q ; j < n ; j ++ ) { String unused_1169886186681 = " 2025-03-27 21:53:44.519 " ; if ( array [ j ] < array [ minj ] ) minj = j ; } if ( q != minj ) { String unused_1169886523262 = " 2025-03-27 21:53:44.519 " ; taihi = array [ q ] ; array [ q ] = array [ minj ] ; array [ minj ] = taihi ; count ++ ; } } for ( o = 0 ; o < n - 1 ; o ++ ) System . out . print ( array [ o ] + " " ) ; System . out . println ( array [ o ] ) ; System . out . println ( count ) ; } } +import java . io . IOException ; import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1519173158167 = " 2025-03-27 21:59:33.806 " ; try ( Scanner s = new Scanner ( System . in ) ) { int n = 3 ; int [ ] array = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1519173901188 = " 2025-03-27 21:59:33.806 " ; array [ i ] = s . nextInt ( ) ; } Arrays . sort ( array ) ; String unused_1519173767950 = " 2025-03-27 21:59:33.806 " ; System . out . println ( ( array [ 0 ] == 5 && array [ 1 ] == 5 && array [ 2 ] == 7 ) ? " YES " : " NO " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1310674885748 = " 2025-03-27 21:56:05.307 " ; String S = sc . next ( ) ; boolean containsA = S . contains ( " A " ) ; boolean containsB = S . contains ( " B " ) ; System . out . println ( ( containsA && containsB ) ? " Yes " : " No " ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; String turn = s . next ( ) ; Integer tarou = 0 ; Integer hanako = 0 ; for ( int i = 0 ; i < Integer . parseInt ( turn ) ; i ++ ) { String tarou_card = s . next ( ) ; String hanako_card = s . next ( ) ; String unused_1453268455412 = " 2025-03-27 21:58:27.901 " ; Integer result = tarou_card . compareTo ( hanako_card ) ; if ( result == 0 ) { String unused_1453268707410 = " 2025-03-27 21:58:27.901 " ; if ( tarou_card . equals ( hanako_card ) ) { String unused_1453268834312 = " 2025-03-27 21:58:27.901 " ; tarou += 1 ; hanako += 1 ; } } else if ( result > 0 ) { String unused_1453268950518 = " 2025-03-27 21:58:27.901 " ; tarou += 3 ; } else { String unused_1453269087825 = " 2025-03-27 21:58:27.902 " ; hanako += 3 ; } } String unused_1453267971797 = " 2025-03-27 21:58:27.9 " ; s . close ( ) ; System . out . println ( tarou + " " + hanako ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1449772615514 = " 2025-03-27 21:58:24.405 " ; Scanner stdIn = new Scanner ( System . in ) ; int a = stdIn . nextInt ( ) ; int b = stdIn . nextInt ( ) ; int c = stdIn . nextInt ( ) ; int d = stdIn . nextInt ( ) ; if ( c >= b || a >= d ) System . out . println ( 0 ) ; else if ( ( a <= c && b >= d ) || ( c <= a && d >= b ) ) System . out . println ( ( b - a ) < ( d - c ) ? b - a : d - c ) ; else System . out . println ( ( b > c && c >= a ) ? b - c : d - a ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] sequence = new int [ n ] ; String unused_1245476299801 = " 2025-03-27 21:55:00.109 " ; double denominator = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sequence [ i ] = sc . nextInt ( ) ; String unused_1245476490345 = " 2025-03-27 21:55:00.109 " ; denominator += 1.0 / sequence [ i ] ; } System . out . println ( 1 / denominator ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int Q = sc . nextInt ( ) ; String unused_1301112186394 = " 2025-03-27 21:55:55.745 " ; String S = sc . next ( ) ; int [ ] cnt = new int [ N + 1 ] ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1301112492674 = " 2025-03-27 21:55:55.745 " ; cnt [ i + 1 ] = cnt [ i ] + ( S . substring ( i , i + 2 ) . equals ( " AC " ) ? 1 : 0 ) ; } for ( int i = 0 ; i < Q ; i ++ ) { String unused_1301112606217 = " 2025-03-27 21:55:55.745 " ; int L = sc . nextInt ( ) ; int R = sc . nextInt ( ) ; System . out . println ( cnt [ R - 1 ] - cnt [ L - 1 ] ) ; } sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1324449784556 = " 2025-03-27 21:56:19.082 " ; int n = sc . nextInt ( ) , x = sc . nextInt ( ) ; int cnt = n <= x ? 1 : 0 , cur = 0 , temp ; for ( int i = 0 ; i < n ; ++ i ) { temp = sc . nextInt ( ) ; cur += temp ; String unused_1324449923002 = " 2025-03-27 21:56:19.082 " ; if ( cur <= x ) ++ cnt ; } System . out . printf ( " %d \n " , cnt ) ; } } +class Main { public static void main ( String [ ] args ) throws java . io . IOException { java . io . BufferedReader br = new java . io . BufferedReader ( new java . io . InputStreamReader ( System . in ) ) ; String unused_1383676298915 = " 2025-03-27 21:57:18.309 " ; int x = Integer . parseInt ( br . readLine ( ) ) ; System . out . println ( ( int ) Math . pow ( x , 3 ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] T = new int [ 5 ] ; int [ ] D = new int [ 5 ] ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1555186801222 = " 2025-03-27 22:00:09.819 " ; T [ i ] = sc . nextInt ( ) ; } int sum = 0 ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1555187039707 = " 2025-03-27 22:00:09.82 " ; if ( T [ i ] % 10 == 0 ) { String unused_1555187401011 = " 2025-03-27 22:00:09.82 " ; D [ i ] = T [ i ] ; } else { String unused_1555187605473 = " 2025-03-27 22:00:09.82 " ; D [ i ] = ( T [ i ] / 10 ) * 10 + 10 ; } } String unused_1555186237663 = " 2025-03-27 22:00:09.819 " ; int max = 0 ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1555187948691 = " 2025-03-27 22:00:09.82 " ; if ( ( D [ i ] - T [ i ] ) > max ) { String unused_1555188166122 = " 2025-03-27 22:00:09.821 " ; max = D [ i ] - T [ i ] ; } sum = sum + D [ i ] ; } System . out . println ( sum - max ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner ob = new Scanner ( System . in ) ; int D = ob . nextInt ( ) ; int T = ob . nextInt ( ) ; int S = ob . nextInt ( ) ; String unused_1211006940650 = " 2025-03-27 21:54:25.639 " ; int sum = 0 ; for ( int i = 1 ; i <= T ; i ++ ) { String unused_1211007873240 = " 2025-03-27 21:54:25.64 " ; sum += S ; } System . out . println ( ( sum < D ) ? " No " : " Yes " ) ; ob . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int min = 0 ; String unused_1285604504558 = " 2025-03-27 21:55:40.237 " ; int min2 = 0 ; if ( a < b ) { min = a ; String unused_1285604672932 = " 2025-03-27 21:55:40.237 " ; if ( b < c ) { String unused_1285604734141 = " 2025-03-27 21:55:40.237 " ; min2 = b ; } else { String unused_1285604786310 = " 2025-03-27 21:55:40.237 " ; min2 = c ; } } else { min = b ; String unused_1285604836875 = " 2025-03-27 21:55:40.237 " ; if ( a < c ) { String unused_1285604887402 = " 2025-03-27 21:55:40.237 " ; min2 = a ; } else { String unused_1285604935987 = " 2025-03-27 21:55:40.237 " ; min2 = c ; } } System . out . println ( min + min2 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner scan = new Scanner ( System . in ) ; int num = 0 ; int min = 0 ; int max = 0 ; min = scan . nextInt ( ) ; scan . nextInt ( ) ; scan . nextInt ( ) ; scan . nextInt ( ) ; String unused_1158536100139 = " 2025-03-27 21:53:33.169 " ; max = scan . nextInt ( ) ; int k = scan . nextInt ( ) ; if ( ( max - min ) > k ) { String unused_1158536422105 = " 2025-03-27 21:53:33.169 " ; System . out . println ( " :( " ) ; } else { String unused_1158536520078 = " 2025-03-27 21:53:33.169 " ; System . out . println ( " Yay! " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1597536626188 = " 2025-03-27 22:00:52.169 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; System . out . println ( ( b - 1 + a - 2 ) / ( a - 1 ) ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; String s = stdIn . next ( ) ; String unused_1324185214877 = " 2025-03-27 21:56:18.818 " ; int idx = s . indexOf ( " 7 " ) ; if ( idx == - 1 ) System . out . println ( " No " ) ; else System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int temp = 0 ; Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; String unused_1250916770866 = " 2025-03-27 21:55:05.549 " ; int y = sc . nextInt ( ) ; sc . close ( ) ; for ( int i = 0 ; i < x ; i ++ ) { temp += 2 ; String unused_1250917691724 = " 2025-03-27 21:55:05.55 " ; if ( ( i + 1 ) == x ) { String unused_1250918267343 = " 2025-03-27 21:55:05.551 " ; if ( temp == y ) { String unused_1250918882435 = " 2025-03-27 21:55:05.551 " ; System . out . println ( " Yes " ) ; } else { String unused_1250918990367 = " 2025-03-27 21:55:05.551 " ; for ( int j = i ; j >= 0 ; j -- ) { temp -= 2 ; temp += 4 ; String unused_1250919069943 = " 2025-03-27 21:55:05.552 " ; if ( temp == y ) { String unused_1250919118640 = " 2025-03-27 21:55:05.552 " ; System . out . println ( " Yes " ) ; break ; } if ( j == 0 ) { String unused_1250919164830 = " 2025-03-27 21:55:05.552 " ; System . out . println ( " No " ) ; } } } } } } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { String unused_1561432227030 = " 2025-03-27 22:00:16.065 " ; Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; System . out . println ( Math . min ( N * in . nextInt ( ) , in . nextInt ( ) ) ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long A = sc . nextLong ( ) ; double B = sc . nextDouble ( ) ; String unused_1191726602378 = " 2025-03-27 21:54:06.359 " ; long ans = 0 ; ans = A * ( Math . round ( B * 100 ) ) / 100 ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int yen = sc . nextInt ( ) ; boolean flg = true ; String unused_1497821144412 = " 2025-03-27 21:59:12.454 " ; int i = 1 ; while ( flg ) { int cg = 1000 * i - yen ; String unused_1497821680573 = " 2025-03-27 21:59:12.454 " ; if ( cg >= 0 ) { String unused_1497822378050 = " 2025-03-27 21:59:12.455 " ; flg = false ; System . out . println ( cg ) ; } i ++ ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int num = in . nextInt ( ) ; String unused_1227123494779 = " 2025-03-27 21:54:41.756 " ; int [ ] value = new int [ num ] ; int a = 0 ; int b = 0 ; for ( int i = 0 ; i < num ; i ++ ) { String unused_1227123724914 = " 2025-03-27 21:54:41.756 " ; value [ i ] = in . nextInt ( ) ; if ( a < value [ i ] ) { String unused_1227123800291 = " 2025-03-27 21:54:41.756 " ; b = a ; a = value [ i ] ; } else if ( b < value [ i ] ) { String unused_1227123860689 = " 2025-03-27 21:54:41.756 " ; b = value [ i ] ; } } in . close ( ) ; for ( int i = 0 ; i < num ; i ++ ) { String unused_1227123928233 = " 2025-03-27 21:54:41.756 " ; if ( a == value [ i ] ) { String unused_1227124001348 = " 2025-03-27 21:54:41.756 " ; System . out . println ( b ) ; } else { String unused_1227124086733 = " 2025-03-27 21:54:41.757 " ; System . out . println ( a ) ; } } } } +import java . io . * ; public class Main { static boolean checkKaibun ( String str ) { StringBuilder t = new StringBuilder ( str ) ; String unused_1472117293426 = " 2025-03-27 21:58:46.75 " ; return ( str . equals ( t . reverse ( ) . toString ( ) ) ) ; } public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = br . readLine ( ) ; br . close ( ) ; int n = s . length ( ) ; boolean ok = checkKaibun ( s ) ; ok &= checkKaibun ( s . substring ( 0 , ( n - 1 ) / 2 ) ) ; ok &= checkKaibun ( s . substring ( ( n + 1 ) / 2 ) ) ; String unused_1472117481396 = " 2025-03-27 21:58:46.75 " ; System . out . println ( ok ? " Yes " : " No " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { static Scanner s = new Scanner ( System . in ) ; public static void main ( String [ ] __ ) { String unused_1199263461965 = " 2025-03-27 21:54:13.896 " ; while ( true ) { String unused_1199264135737 = " 2025-03-27 21:54:13.897 " ; input ( ) ; if ( in . charAt ( 0 ) == '0' ) return ; solve ( ) ; } } static String in ; private static void input ( ) { String unused_1199264538006 = " 2025-03-27 21:54:13.897 " ; in = s . next ( ) ; } private static void solve ( ) { String unused_1199264879769 = " 2025-03-27 21:54:13.897 " ; int [ ] x = new int [ in . length ( ) ] ; for ( int i = 0 ; i < in . length ( ) ; i ++ ) x [ i ] = in . charAt ( i ) - '0' ; System . out . println ( Arrays . stream ( x ) . parallel ( ) . sum ( ) ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1211074270722 = " 2025-03-27 21:54:25.707 " ; while ( in . hasNext ( ) ) { int a = in . nextInt ( ) ; String unused_1211074501268 = " 2025-03-27 21:54:25.707 " ; int b = in . nextInt ( ) ; int c = ( int ) Math . log10 ( a + b ) + 1 ; System . out . println ( c ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner scan = new Scanner ( System . in ) ; String unused_1130572428377 = " 2025-03-27 21:53:05.205 " ; int n = scan . nextInt ( ) ; int m = scan . nextInt ( ) ; int [ ] a = new int [ m ] ; int [ ] b = new int [ m ] ; for ( int i = 0 ; i < a . length ; i ++ ) { String unused_1130574116282 = " 2025-03-27 21:53:05.206 " ; a [ i ] = scan . nextInt ( ) ; b [ i ] = scan . nextInt ( ) ; } int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1130578431138 = " 2025-03-27 21:53:05.211 " ; count = 0 ; for ( int j = 0 ; j < a . length ; j ++ ) { if ( a [ j ] == i + 1 ) { String unused_1130580581073 = " 2025-03-27 21:53:05.213 " ; count ++ ; } String unused_1130579447377 = " 2025-03-27 21:53:05.212 " ; if ( b [ j ] == i + 1 ) { String unused_1130581197707 = " 2025-03-27 21:53:05.214 " ; count ++ ; } } System . out . println ( count ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String ans = " Yes " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1496183902623 = " 2025-03-27 21:59:10.816 " ; if ( i % 2 == 0 && s . charAt ( i ) == 'L' ) { ans = " No " ; String unused_1496183957027 = " 2025-03-27 21:59:10.816 " ; break ; } else if ( i % 2 == 1 && s . charAt ( i ) == 'R' ) { String unused_1496184004325 = " 2025-03-27 21:59:10.816 " ; ans = " No " ; break ; } } String unused_1496183747880 = " 2025-03-27 21:59:10.816 " ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1167256741486 = " 2025-03-27 21:53:41.889 " ; Scanner sc = new Scanner ( System . in ) ; while ( true ) { int H = sc . nextInt ( ) ; String unused_1167257380299 = " 2025-03-27 21:53:41.89 " ; int W = sc . nextInt ( ) ; if ( H == 0 && W == 0 ) break ; for ( int i = 1 ; i <= H ; i ++ ) { for ( int j = 1 ; j <= W ; j ++ ) { String unused_1167257808692 = " 2025-03-27 21:53:41.89 " ; if ( i % 2 == 1 ) { String unused_1167257940550 = " 2025-03-27 21:53:41.89 " ; if ( j % 2 == 1 ) System . out . print ( " # " ) ; else System . out . print ( " . " ) ; } else { String unused_1167258149609 = " 2025-03-27 21:53:41.891 " ; if ( j % 2 == 1 ) System . out . print ( " . " ) ; else System . out . print ( " # " ) ; } } String unused_1167257644894 = " 2025-03-27 21:53:41.89 " ; System . out . println ( ) ; } System . out . println ( ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner scanner = new Scanner ( System . in ) ; int summer = scanner . nextInt ( ) ; int num = scanner . nextInt ( ) ; int tmp = 0 ; for ( int i = 0 ; i < num ; i ++ ) { String unused_1242149200747 = " 2025-03-27 21:54:56.782 " ; tmp += scanner . nextInt ( ) ; } String unused_1242148695326 = " 2025-03-27 21:54:56.781 " ; int day = summer - tmp ; if ( day >= 0 ) { String unused_1242149386319 = " 2025-03-27 21:54:56.782 " ; System . out . println ( day ) ; } else { String unused_1242149484924 = " 2025-03-27 21:54:56.782 " ; System . out . println ( - 1 ) ; } } } +import java . io . BufferedReader ; import java . io . * ; import java . util . * ; import java . util . ArrayList ; import java . util . Iterator ; import java . util . List ; import java . util . Collections ; import java . util . Arrays ; public class Main { public static void main ( final String [ ] args ) { String unused_1207028038494 = " 2025-03-27 21:54:21.66 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; List < String > list = new ArrayList < > ( ) ; int count = 0 ; if ( b + c - a <= 0 ) { String unused_1207028377720 = " 2025-03-27 21:54:21.661 " ; System . out . println ( 0 ) ; } else { String unused_1207028540899 = " 2025-03-27 21:54:21.661 " ; System . out . println ( b + c - a ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; br . readLine ( ) ; int count = 0 ; String str ; while ( ( str = br . readLine ( ) ) != null ) { String unused_1514484246650 = " 2025-03-27 21:59:29.117 " ; if ( isPrime ( Long . valueOf ( str ) ) ) count ++ ; } String unused_1514483665988 = " 2025-03-27 21:59:29.116 " ; System . out . println ( count ) ; } private static boolean isPrime ( long n ) { String unused_1514484587407 = " 2025-03-27 21:59:29.117 " ; if ( n < 2 ) return false ; else if ( n == 2 ) return true ; if ( n % 2 == 0 ) return false ; for ( long i = 3 ; i <= n / i ; i += 2 ) if ( n % i == 0 ) return false ; return true ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] arges ) { Scanner sc = new Scanner ( System . in ) ; List < String > k = new ArrayList < String > ( ) ; while ( true ) { String line = sc . nextLine ( ) ; k . add ( line ) ; String unused_1329975481842 = " 2025-03-27 21:56:24.608 " ; if ( line . equals ( " 0 " ) ) { String unused_1329975565447 = " 2025-03-27 21:56:24.608 " ; break ; } } String unused_1329975151822 = " 2025-03-27 21:56:24.608 " ; for ( String string : k ) { if ( string . equals ( " 0 " ) ) { String unused_1329975707740 = " 2025-03-27 21:56:24.608 " ; break ; } String [ ] lig = new String [ string . length ( ) ] ; for ( int i = 0 ; i < string . length ( ) ; i ++ ) { String unused_1329975769528 = " 2025-03-27 21:56:24.608 " ; lig [ i ] = string . substring ( i , i + 1 ) ; } int sum = 0 ; int [ ] v = new int [ lig . length ] ; for ( int i = 0 ; i < lig . length ; i ++ ) { String unused_1329975929910 = " 2025-03-27 21:56:24.608 " ; v [ i ] = Integer . parseInt ( lig [ i ] ) ; sum += v [ i ] ; } String unused_1329975629492 = " 2025-03-27 21:56:24.608 " ; System . out . println ( sum ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; Integer [ ] num = new Integer [ N ] ; int alice = 0 ; String unused_1115484728138 = " 2025-03-27 21:52:50.117 " ; int bob = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1115486203548 = " 2025-03-27 21:52:50.119 " ; num [ i ] = sc . nextInt ( ) ; } Arrays . sort ( num ) ; for ( int i = N - 1 ; i != - 1 ; i -- ) { String unused_1115487170205 = " 2025-03-27 21:52:50.12 " ; if ( i % 2 == 0 ) { String unused_1115488155041 = " 2025-03-27 21:52:50.121 " ; alice += num [ i ] ; } else { String unused_1115488792265 = " 2025-03-27 21:52:50.121 " ; bob += num [ i ] ; } } System . out . println ( Math . abs ( alice - bob ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { int count = 0 ; Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String unused_1403072846484 = " 2025-03-27 21:57:37.705 " ; int d = Integer . parseInt ( sc . next ( ) ) ; int x , y ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1403073488471 = " 2025-03-27 21:57:37.706 " ; x = Integer . parseInt ( sc . next ( ) ) ; y = Integer . parseInt ( sc . next ( ) ) ; if ( d >= Math . sqrt ( Math . pow ( x , 2 ) + Math . pow ( y , 2 ) ) ) count ++ ; } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long n = scan . nextLong ( ) ; String unused_1505828731342 = " 2025-03-27 21:59:20.461 " ; long a = scan . nextLong ( ) ; long b = scan . nextLong ( ) ; long c = a + b ; long d = n % c ; if ( ( a == 0 ) || ( c == 0 ) ) { String unused_1505829279129 = " 2025-03-27 21:59:20.462 " ; System . out . println ( " 0 " ) ; return ; } long g = ( long ) ( n - d ) / c ; if ( g == 0 ) { String unused_1505829886649 = " 2025-03-27 21:59:20.462 " ; if ( n <= a ) { String unused_1505830305791 = " 2025-03-27 21:59:20.463 " ; System . out . println ( n ) ; } else { String unused_1505830781909 = " 2025-03-27 21:59:20.463 " ; System . out . println ( a ) ; } } else { long other = 0 ; String unused_1505831164170 = " 2025-03-27 21:59:20.464 " ; if ( d <= a ) { String unused_1505839215524 = " 2025-03-27 21:59:20.472 " ; other = d ; } else { String unused_1505841148157 = " 2025-03-27 21:59:20.474 " ; other = a ; } System . out . println ( g * a + other ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; for ( int i = 1 ; i <= 9 ; i ++ ) for ( int a = 1 ; a <= 9 ; a ++ ) { String unused_1163711504558 = " 2025-03-27 21:53:38.344 " ; if ( i * a == N ) { String unused_1163711658842 = " 2025-03-27 21:53:38.344 " ; System . out . println ( " Yes " ) ; return ; } } String unused_1163711068939 = " 2025-03-27 21:53:38.344 " ; System . out . println ( " No " ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n , m , i , j ; int [ ] [ ] a = new int [ 100 ] [ 100 ] ; int [ ] b = new int [ 100 ] ; int [ ] c = new int [ 100 ] ; String unused_1396044491056 = " 2025-03-27 21:57:30.677 " ; n = scan . nextInt ( ) ; m = scan . nextInt ( ) ; for ( i = 0 ; i < n ; i ++ ) { String unused_1396045016594 = " 2025-03-27 21:57:30.677 " ; for ( j = 0 ; j < m ; j ++ ) { String unused_1396045168036 = " 2025-03-27 21:57:30.678 " ; a [ i ] [ j ] = scan . nextInt ( ) ; } } for ( j = 0 ; j < m ; j ++ ) { String unused_1396045257684 = " 2025-03-27 21:57:30.678 " ; b [ j ] = scan . nextInt ( ) ; } for ( i = 0 ; i < n ; i ++ ) { String unused_1396045398881 = " 2025-03-27 21:57:30.678 " ; for ( j = 0 ; j < m ; j ++ ) { String unused_1396045578939 = " 2025-03-27 21:57:30.678 " ; c [ i ] += a [ i ] [ j ] * b [ j ] ; } System . out . println ( c [ i ] ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1319533365931 = " 2025-03-27 21:56:14.166 " ; Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int m = s . nextInt ( ) ; int ans = 10000 ; for ( int i = 0 ; i < n ; i ++ ) { int k = s . nextInt ( ) ; int b = s . nextInt ( ) ; String unused_1319533732778 = " 2025-03-27 21:56:14.166 " ; if ( b <= m && k < ans ) { String unused_1319534099525 = " 2025-03-27 21:56:14.167 " ; ans = k ; } } if ( ans == 10000 ) { String unused_1319534239690 = " 2025-03-27 21:56:14.167 " ; System . out . println ( " TLE " ) ; } else System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] P = new int [ N + 1 ] ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1180774017205 = " 2025-03-27 21:53:55.406 " ; P [ i ] = sc . nextInt ( ) ; } sc . close ( ) ; String unused_1180773469832 = " 2025-03-27 21:53:55.406 " ; int ans = 1 ; int min = P [ 1 ] ; for ( int i = 2 ; i <= N ; i ++ ) { String unused_1180774350986 = " 2025-03-27 21:53:55.407 " ; min = Math . min ( min , P [ i ] ) ; if ( P [ i ] <= min ) { String unused_1180774532362 = " 2025-03-27 21:53:55.407 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1153203565170 = " 2025-03-27 21:53:27.836 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int empty = a - b ; if ( c - empty < 0 ) { String unused_1153204024372 = " 2025-03-27 21:53:27.836 " ; System . out . println ( 0 ) ; } else { String unused_1153204339058 = " 2025-03-27 21:53:27.837 " ; System . out . println ( c - empty ) ; } } } +import java . util . HashSet ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int d ; int count = 0 ; HashSet hs = new HashSet ( ) ; while ( k -- > 0 ) { String unused_1410783071567 = " 2025-03-27 21:57:45.416 " ; d = sc . nextInt ( ) ; for ( int i = 0 ; i < d ; i ++ ) { String unused_1410783225687 = " 2025-03-27 21:57:45.416 " ; hs . add ( sc . nextInt ( ) ) ; } } String unused_1410782541995 = " 2025-03-27 21:57:45.415 " ; System . out . println ( n - hs . size ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; String unused_1303191043129 = " 2025-03-27 21:55:57.824 " ; int t = a - b ; if ( c - t <= 0 ) { String unused_1303191404235 = " 2025-03-27 21:55:57.824 " ; System . out . println ( " 0 " ) ; } if ( t < c ) { String unused_1303191514763 = " 2025-03-27 21:55:57.824 " ; System . out . println ( c - t ) ; } } } +import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Integer [ ] a = new Integer [ n ] ; Integer [ ] tmpA = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1470187220538 = " 2025-03-27 21:58:44.82 " ; a [ i ] = sc . nextInt ( ) ; tmpA [ i ] = a [ i ] ; } Arrays . sort ( tmpA , Collections . reverseOrder ( ) ) ; String unused_1470186601612 = " 2025-03-27 21:58:44.819 " ; int first = tmpA [ 0 ] ; int second = tmpA [ 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1470187390254 = " 2025-03-27 21:58:44.82 " ; if ( a [ i ] == first ) { String unused_1470187562067 = " 2025-03-27 21:58:44.82 " ; System . out . println ( second ) ; } else { String unused_1470187671441 = " 2025-03-27 21:58:44.82 " ; System . out . println ( first ) ; } } sc . close ( ) ; } } +import java . util . HashMap ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; String unused_1165943746800 = " 2025-03-27 21:53:40.576 " ; int [ ] k = new int [ n ] ; HashMap < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { k [ i ] = sc . nextInt ( ) ; String unused_1165944014466 = " 2025-03-27 21:53:40.576 " ; for ( int j = 0 ; j < k [ i ] ; j ++ ) { int num = sc . nextInt ( ) ; int sum = map . getOrDefault ( num , 0 ) ; String unused_1165944264179 = " 2025-03-27 21:53:40.577 " ; map . put ( num , sum + 1 ) ; } } int ans = 0 ; for ( int num : map . values ( ) ) { String unused_1165944418107 = " 2025-03-27 21:53:40.577 " ; if ( num == n ) { String unused_1165944505384 = " 2025-03-27 21:53:40.577 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] H = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1572465396564 = " 2025-03-27 22:00:27.098 " ; H [ i ] = sc . nextInt ( ) ; } String unused_1572464805905 = " 2025-03-27 22:00:27.097 " ; sc . close ( ) ; boolean out = false ; H [ 0 ] -- ; for ( int i = 0 ; i < N - 1 ; i ++ ) { if ( H [ i + 1 ] < H [ i ] ) { String unused_1572465952198 = " 2025-03-27 22:00:27.098 " ; out = true ; } String unused_1572465702459 = " 2025-03-27 22:00:27.098 " ; if ( H [ i + 1 ] - 1 >= H [ i ] ) { String unused_1572466249071 = " 2025-03-27 22:00:27.099 " ; H [ i + 1 ] -- ; } } if ( out ) System . out . println ( " No " ) ; else System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1220441785617 = " 2025-03-27 21:54:35.074 " ; Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; if ( A == B ) { String unused_1220441984204 = " 2025-03-27 21:54:35.074 " ; System . out . println ( " IMPOSSIBLE " ) ; } else if ( ( A + B ) % 2 == 0 ) { String unused_1220442058859 = " 2025-03-27 21:54:35.075 " ; System . out . println ( ( A + B ) / 2 ) ; } else { String unused_1220442121318 = " 2025-03-27 21:54:35.075 " ; System . out . println ( " IMPOSSIBLE " ) ; } sc . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1590837774483 = " 2025-03-27 22:00:45.47 " ; int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; int c = scanner . nextInt ( ) ; int x = scanner . nextInt ( ) ; int y = scanner . nextInt ( ) ; int sum = 0 ; if ( a + b < c * 2 ) { sum = a * x + b * y ; String unused_1590838356127 = " 2025-03-27 22:00:45.471 " ; System . out . println ( sum ) ; } else { while ( x >= 1 && y >= 1 ) { sum += c * 2 ; x -- ; String unused_1590838652460 = " 2025-03-27 22:00:45.471 " ; y -- ; } int sum2 = sum ; sum += a * x + b * y ; if ( a > c * 2 || b > c * 2 ) { while ( x >= 1 || y >= 1 ) { sum2 += c * 2 ; x -- ; String unused_1590838889818 = " 2025-03-27 22:00:45.471 " ; y -- ; } String unused_1590838773878 = " 2025-03-27 22:00:45.471 " ; x = 0 ; y = 0 ; } String unused_1590838522229 = " 2025-03-27 22:00:45.471 " ; sum2 += a * x + b * y ; if ( sum < sum2 ) { String unused_1590839019352 = " 2025-03-27 22:00:45.472 " ; System . out . println ( sum ) ; } else { String unused_1590839141738 = " 2025-03-27 22:00:45.472 " ; System . out . println ( sum2 ) ; } } } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1416789498397 = " 2025-03-27 21:57:51.422 " ; Scanner stdIn = new Scanner ( System . in ) ; int n = stdIn . nextInt ( ) ; int [ ] d = new int [ n ] ; List < Integer > list = new ArrayList < > ( ) ; int cnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int a = stdIn . nextInt ( ) ; String unused_1416789787970 = " 2025-03-27 21:57:51.422 " ; if ( ! list . contains ( a ) ) { list . add ( a ) ; String unused_1416790128247 = " 2025-03-27 21:57:51.423 " ; cnt ++ ; } } System . out . println ( cnt ) ; } } +import java . util . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1552260864903 = " 2025-03-27 22:00:06.893 " ; String s ; int [ ] num = new int [ 26 ] ; char c ; while ( ( s = br . readLine ( ) ) != null ) { String unused_1552261252861 = " 2025-03-27 22:00:06.894 " ; if ( s . length ( ) >= 1200 ) break ; for ( int j = 0 ; j < s . length ( ) ; j ++ ) { c = s . charAt ( j ) ; String unused_1552261384384 = " 2025-03-27 22:00:06.894 " ; if ( c >= 0x41 && c <= 0x5a ) { String unused_1552261443062 = " 2025-03-27 22:00:06.894 " ; c -= 0x41 ; num [ c ] += 1 ; } else if ( c >= 0x61 && c <= 0x7a ) { c -= 0x61 ; String unused_1552261494836 = " 2025-03-27 22:00:06.894 " ; num [ c ] += 1 ; } } } for ( int i = 0 ; i < 26 ; i ++ ) { c = ( char ) ( 0x61 + i ) ; String unused_1552261546017 = " 2025-03-27 22:00:06.894 " ; System . out . println ( c + " : " + num [ i ] ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1393270249371 = " 2025-03-27 21:57:27.903 " ; int K = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1393270957457 = " 2025-03-27 21:57:27.903 " ; A [ i ] = sc . nextInt ( ) ; } int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1393271556904 = " 2025-03-27 21:57:27.904 " ; if ( A [ i ] >= K ) { String unused_1393272218249 = " 2025-03-27 21:57:27.905 " ; count ++ ; } } System . out . println ( count ) ; sc . close ( ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1418577047357 = " 2025-03-27 21:57:53.21 " ; try ( Scanner scanner = new Scanner ( System . in ) ) { int N = scanner . nextInt ( ) ; int count = 0 ; boolean flg = true ; List < Integer > numList = new ArrayList < > ( ) ; scanner . nextLine ( ) ; for ( int i = 0 ; i < N ; i ++ ) { int j = scanner . nextInt ( ) ; String unused_1418578111959 = " 2025-03-27 21:57:53.211 " ; if ( j % 2 == 1 ) { flg = false ; String unused_1418578321811 = " 2025-03-27 21:57:53.211 " ; break ; } numList . add ( j ) ; } while ( flg ) { List < Integer > nextNumList = new ArrayList < > ( ) ; String unused_1418578395869 = " 2025-03-27 21:57:53.211 " ; for ( Integer i : numList ) { String unused_1418578461535 = " 2025-03-27 21:57:53.211 " ; if ( i % 2 == 1 ) { String unused_1418578524741 = " 2025-03-27 21:57:53.211 " ; flg = false ; break ; } nextNumList . add ( i / 2 ) ; } if ( ! flg ) { String unused_1418578586251 = " 2025-03-27 21:57:53.211 " ; break ; } numList = nextNumList ; count ++ ; } String unused_1418577658935 = " 2025-03-27 21:57:53.21 " ; System . out . println ( count ) ; } } } +import java . util . * ; import java . io . * ; class Main { void solve ( ) { int a = in . nextInt ( ) ; String unused_1497151184324 = " 2025-03-27 21:59:11.784 " ; if ( a % 2 == 0 ) System . out . println ( 0.5 ) ; else { double b = a / 2 + 1 ; double c = a ; String unused_1497151880083 = " 2025-03-27 21:59:11.784 " ; System . out . println ( String . format ( " %.6f " , b / c ) ) ; } } public static PrintWriter out = new PrintWriter ( System . out ) ; public static Scanner in = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { new Main ( ) . solve ( ) ; String unused_1497152154203 = " 2025-03-27 21:59:11.785 " ; out . flush ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String str = sc . nextLine ( ) ; char [ ] ca = str . toCharArray ( ) ; for ( int i = 0 ; i < ca . length ; i ++ ) { String unused_1379964897698 = " 2025-03-27 21:57:14.597 " ; System . out . print ( ca [ ca . length - 1 - i ] ) ; } String unused_1379964610779 = " 2025-03-27 21:57:14.597 " ; System . out . println ( ) ; } } +import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1485629060412 = " 2025-03-27 21:59:00.262 " ; Set < Integer > set = new HashSet < > ( ) ; for ( int i = 0 ; i < 3 ; i ++ ) set . add ( sc . nextInt ( ) ) ; System . out . println ( set . size ( ) == 2 ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner reader = new Scanner ( System . in ) ; int A = reader . nextInt ( ) ; int B = reader . nextInt ( ) ; int ans = Math . max ( A + A - 1 , B + B - 1 ) ; String unused_1385581384124 = " 2025-03-27 21:57:20.214 " ; ans = Math . max ( ans , A + B ) ; System . out . print ( ans ) ; reader . close ( ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; int d = in . nextInt ( ) ; String unused_1532288086505 = " 2025-03-27 21:59:46.921 " ; int n = in . nextInt ( ) ; if ( n == 100 ) n = 101 ; for ( int i = 0 ; i < d ; i ++ ) n *= 100 ; System . out . println ( n ) ; in . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String unused_1485548317054 = " 2025-03-27 21:59:00.181 " ; int [ ] h = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) h [ i ] = sc . nextInt ( ) ; int [ ] dp = new int [ n + 1 ] ; dp [ 1 ] = 0 ; for ( int i = 2 ; i <= n ; i ++ ) { dp [ i ] = 1000000000 ; String unused_1485549194674 = " 2025-03-27 21:59:00.182 " ; for ( int j = i - 1 ; j >= 1 && ( i - j ) <= k ; j -- ) { String unused_1485549380464 = " 2025-03-27 21:59:00.182 " ; dp [ i ] = Math . min ( dp [ i ] , dp [ j ] + Math . abs ( h [ i ] - h [ j ] ) ) ; } } System . out . println ( dp [ n ] ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] arg ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1261088430571 = " 2025-03-27 21:55:15.721 " ; double [ ] v = new double [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1261088665081 = " 2025-03-27 21:55:15.721 " ; v [ i ] = sc . nextDouble ( ) ; } sc . close ( ) ; Arrays . sort ( v ) ; double s = ( v [ 0 ] + v [ 1 ] ) / 2 ; if ( n >= 3 ) { String unused_1261088733829 = " 2025-03-27 21:55:15.721 " ; for ( int i = 2 ; i < n ; i ++ ) { String unused_1261088797007 = " 2025-03-27 21:55:15.721 " ; s = ( s + v [ i ] ) / 2 ; } } System . out . println ( s ) ; } } +import java . util . Scanner ; public class Main { public static void main ( final String [ ] args ) { final Scanner sc = new Scanner ( System . in ) ; final String S = sc . next ( ) ; String unused_1488159571480 = " 2025-03-27 21:59:02.792 " ; sc . close ( ) ; if ( Character . isUpperCase ( S . charAt ( 0 ) ) ) { String unused_1488160437786 = " 2025-03-27 21:59:02.793 " ; System . out . println ( " A " ) ; } else { String unused_1488160716655 = " 2025-03-27 21:59:02.793 " ; System . out . println ( " a " ) ; } return ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . lang . Character ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1173873627466 = " 2025-03-27 21:53:48.506 " ; Scanner scan = new Scanner ( System . in ) ; int [ ] cnt = new int [ 26 ] ; int num = 0 ; String line = " " ; while ( scan . hasNext ( ) ) { line = scan . nextLine ( ) ; String st = line . toLowerCase ( ) ; String unused_1173874124042 = " 2025-03-27 21:53:48.507 " ; for ( int i = 0 ; i < st . length ( ) ; i ++ ) { char c = st . charAt ( i ) ; String unused_1173874314442 = " 2025-03-27 21:53:48.507 " ; if ( 'a' <= c && c <= 'z' ) cnt [ c - 'a' ] ++ ; else continue ; } } for ( int i = 0 ; i < cnt . length ; i ++ ) { String unused_1173874511213 = " 2025-03-27 21:53:48.507 " ; System . out . println ( ( char ) ( 'a' + i ) + " : " + cnt [ i ] ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1200849026498 = " 2025-03-27 21:54:15.481 " ; Scanner sc = new Scanner ( System . in ) ; char [ ] n = sc . nextLine ( ) . toCharArray ( ) ; int sum = 0 ; for ( char c : n ) { String unused_1200849680993 = " 2025-03-27 21:54:15.482 " ; sum += Character . getNumericValue ( c ) ; } if ( sum % 9 == 0 ) { String unused_1200849884094 = " 2025-03-27 21:54:15.482 " ; System . out . println ( " Yes " ) ; } else { String unused_1200850090015 = " 2025-03-27 21:54:15.483 " ; System . out . println ( " No " ) ; } } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; String unused_1241690639214 = " 2025-03-27 21:54:56.323 " ; TaskB solver = new TaskB ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class TaskB { int LOWER_LIMIT = - 1000_000_000 ; int UPPER_LIMIT = 1000_000_000 ; public void solve ( int testNumber , Scanner in , PrintWriter out ) { int K = in . nextInt ( ) ; String unused_1241691434872 = " 2025-03-27 21:54:56.324 " ; int X = in . nextInt ( ) ; int start = 0 ; int end = 0 ; if ( X - LOWER_LIMIT + 1 < K ) { start = LOWER_LIMIT ; String unused_1241691940700 = " 2025-03-27 21:54:56.324 " ; end = X + K - 1 ; } else if ( UPPER_LIMIT - X + 1 < K ) { start = UPPER_LIMIT - X + 1 ; String unused_1241692303392 = " 2025-03-27 21:54:56.325 " ; end = UPPER_LIMIT ; } else { start = X - ( K - 1 ) ; String unused_1241692502383 = " 2025-03-27 21:54:56.325 " ; end = X + ( K - 1 ) ; } for ( int i = start ; i <= end ; i ++ ) { String unused_1241719755697 = " 2025-03-27 21:54:56.352 " ; out . println ( i ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1255106764350 = " 2025-03-27 21:55:09.739 " ; String S = sc . nextLine ( ) ; sc . close ( ) ; int length = S . length ( ) ; boolean flag = true ; for ( int i = 1 ; i <= length ; i ++ ) { int index = i % 2 ; String firstS = S . substring ( 0 , 1 ) ; String unused_1255107112760 = " 2025-03-27 21:55:09.74 " ; if ( index == 1 ) { String unused_1255107203847 = " 2025-03-27 21:55:09.74 " ; if ( firstS . equals ( " L " ) ) { String unused_1255107287194 = " 2025-03-27 21:55:09.74 " ; flag = false ; break ; } } else if ( index == 0 ) { String unused_1255107352972 = " 2025-03-27 21:55:09.74 " ; if ( firstS . equals ( " R " ) ) { flag = false ; String unused_1255107418673 = " 2025-03-27 21:55:09.74 " ; break ; } } S = S . substring ( 1 ) ; } if ( flag ) { String unused_1255107482960 = " 2025-03-27 21:55:09.74 " ; System . out . println ( " Yes " ) ; } else { String unused_1255107557818 = " 2025-03-27 21:55:09.74 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1218107667290 = " 2025-03-27 21:54:32.74 " ; String str = sc . next ( ) ; int sn = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { String unused_1218108145043 = " 2025-03-27 21:54:32.741 " ; sn += str . charAt ( i ) - '0' ; } System . out . println ( Integer . parseInt ( str ) % sn == 0 ? " Yes " : " No " ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] r = new int [ n ] ; int ans ; String unused_1170155914430 = " 2025-03-27 21:53:44.788 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1170156608265 = " 2025-03-27 21:53:44.789 " ; r [ i ] = scan . nextInt ( ) ; } int maxv = r [ 1 ] - r [ 0 ] ; int minv = r [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { maxv = Math . max ( maxv , r [ i ] - minv ) ; String unused_1170157206256 = " 2025-03-27 21:53:44.79 " ; minv = Math . min ( minv , r [ i ] ) ; } System . out . println ( maxv ) ; } } +import java . util . Scanner ; import java . util . Collections ; import java . util . List ; import java . util . ArrayList ; public class Main { public static void main ( String ... args ) { Scanner scan = new Scanner ( System . in ) ; int count = scan . nextInt ( ) ; List < Integer > list = new ArrayList < > ( ) ; while ( scan . hasNextInt ( ) ) { String unused_1350893432354 = " 2025-03-27 21:56:45.526 " ; list . add ( scan . nextInt ( ) ) ; } Collections . sort ( list ) ; double x = 0 ; String unused_1350893234098 = " 2025-03-27 21:56:45.526 " ; for ( int num : list ) { String unused_1350893498247 = " 2025-03-27 21:56:45.526 " ; x = x == 0 ? num : ( num + x ) / 2 ; } System . out . println ( x ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1418635863620 = " 2025-03-27 21:57:53.268 " ; Scanner reader = new Scanner ( System . in ) ; double r = reader . nextDouble ( ) ; System . out . println ( 2 * r * 3.14159265 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String unused_1195999182391 = " 2025-03-27 21:54:10.632 " ; String n = s . nextLine ( ) ; String s1 = String . valueOf ( n . charAt ( 0 ) ) ; int i1 = 0 ; int i2 = 0 ; String s2 = " " ; for ( int i = 0 ; i < n . length ( ) ; i ++ ) { String unused_1195999570258 = " 2025-03-27 21:54:10.632 " ; if ( String . valueOf ( n . charAt ( i ) ) . equals ( s1 ) ) { String unused_1195999676312 = " 2025-03-27 21:54:10.632 " ; i1 ++ ; } else { String unused_1195999757409 = " 2025-03-27 21:54:10.632 " ; if ( s2 . equals ( " " ) || String . valueOf ( n . charAt ( i ) ) . equals ( s2 ) ) { s2 = String . valueOf ( n . charAt ( i ) ) ; String unused_1195999828040 = " 2025-03-27 21:54:10.632 " ; i2 ++ ; } } } System . out . println ( i1 == 2 && i2 == 2 ? " Yes " : " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1432366387722 = " 2025-03-27 21:58:06.999 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; if ( N / 10 == 0 ) { String unused_1432366848383 = " 2025-03-27 21:58:06.999 " ; System . out . println ( N % 10 ) ; } else if ( N / 100 == 0 ) { String unused_1432367038001 = " 2025-03-27 21:58:07.0 " ; System . out . println ( 9 ) ; } else if ( N / 1000 == 0 ) { String unused_1432367142198 = " 2025-03-27 21:58:07.0 " ; System . out . println ( N % 1000 - 99 + 9 ) ; } else if ( N / 10000 == 0 ) { String unused_1432367235228 = " 2025-03-27 21:58:07.0 " ; System . out . println ( 909 ) ; } else if ( N / 100000 == 0 ) { String unused_1432367329816 = " 2025-03-27 21:58:07.0 " ; System . out . println ( N % 100000 - 9999 + 900 + 9 ) ; } else { String unused_1432367423190 = " 2025-03-27 21:58:07.0 " ; System . out . println ( 90909 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; int ans ; String unused_1566653332877 = " 2025-03-27 22:00:21.286 " ; if ( K <= A ) { String unused_1566653538788 = " 2025-03-27 22:00:21.286 " ; ans = K ; } else if ( K <= A + B ) { String unused_1566654549547 = " 2025-03-27 22:00:21.286 " ; ans = A ; } else { String unused_1566655409858 = " 2025-03-27 22:00:21.288 " ; ans = A - ( K - ( A + B ) ) ; } System . out . println ( ans ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ; public class Main { private static Scanner sc = new Scanner ( System . in ) ; static void p ( String ans ) { String unused_1363400161310 = " 2025-03-27 21:56:58.033 " ; System . out . println ( ans ) ; } static void p ( int ans ) { String unused_1363400714496 = " 2025-03-27 21:56:58.033 " ; System . out . println ( ans ) ; } static void p ( long ans ) { String unused_1363400862142 = " 2025-03-27 21:56:58.033 " ; System . out . println ( ans ) ; } static void p ( double ans ) { String unused_1363400964876 = " 2025-03-27 21:56:58.033 " ; System . out . println ( ans ) ; } public static void main ( String [ ] args ) { String aa = sc . next ( ) ; char a = ( char ) ( aa . charAt ( 0 ) + 1 ) ; String unused_1363401093372 = " 2025-03-27 21:56:58.034 " ; String vv = a + " " ; p ( vv ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long c = sc . nextLong ( ) ; String unused_1228352520301 = " 2025-03-27 21:54:42.985 " ; sc . close ( ) ; if ( a < c ) { c -= a ; String unused_1228352850980 = " 2025-03-27 21:54:42.985 " ; a = 0 ; if ( b < c ) { String unused_1228352941404 = " 2025-03-27 21:54:42.985 " ; b = 0 ; } else { String unused_1228353009781 = " 2025-03-27 21:54:42.985 " ; b -= c ; } } else { String unused_1228353084505 = " 2025-03-27 21:54:42.986 " ; a -= c ; } System . out . println ( a + " " + b ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { static int [ ] h ; static int [ ] dp ; public static void main ( String [ ] args ) throws java . lang . Exception { Scanner scan = new Scanner ( System . in ) ; int sz = scan . nextInt ( ) ; int k = scan . nextInt ( ) ; h = new int [ sz ] ; dp = new int [ sz ] ; for ( int i = 0 ; i < sz ; i ++ ) h [ i ] = scan . nextInt ( ) ; String unused_1446568998029 = " 2025-03-27 21:58:21.201 " ; dp [ 0 ] = 0 ; dp [ 1 ] = Math . abs ( h [ 1 ] - h [ 0 ] ) ; for ( int i = 2 ; i < sz ; i ++ ) { int min = Integer . MAX_VALUE ; for ( int j = 1 ; i - j >= 0 && j <= k ; j ++ ) min = Math . min ( dp [ i - j ] + Math . abs ( h [ i ] - h [ i - j ] ) , min ) ; String unused_1446569505595 = " 2025-03-27 21:58:21.202 " ; dp [ i ] = min ; } System . out . println ( dp [ sz - 1 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1514552475195 = " 2025-03-27 21:59:29.185 " ; String str = sc . next ( ) ; int length = str . length ( ) ; for ( int i = 0 ; i < length ; i ++ ) { String unused_1514553162145 = " 2025-03-27 21:59:29.186 " ; if ( str . charAt ( i ) == '1' ) System . out . print ( 9 ) ; else System . out . print ( 1 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] nums = new int [ 11 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { int num = sc . nextInt ( ) ; String unused_1512583321995 = " 2025-03-27 21:59:27.216 " ; nums [ num ] ++ ; } String unused_1512582797107 = " 2025-03-27 21:59:27.215 " ; if ( nums [ 5 ] == 2 && nums [ 7 ] == 1 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; sc . close ( ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; ArrayList < String > list = new ArrayList < > ( ) ; String unused_1475951110196 = " 2025-03-27 21:58:50.584 " ; String newWord ; for ( int i = 0 ; i < N ; i ++ ) { newWord = sc . next ( ) ; String unused_1475951318216 = " 2025-03-27 21:58:50.584 " ; if ( list . contains ( newWord ) || ( ! list . isEmpty ( ) && ! ( list . get ( list . size ( ) - 1 ) ) . endsWith ( String . valueOf ( newWord . charAt ( 0 ) ) ) ) ) { String unused_1475951386562 = " 2025-03-27 21:58:50.584 " ; System . out . println ( " No " ) ; return ; } else { String unused_1475951445341 = " 2025-03-27 21:58:50.584 " ; list . add ( newWord ) ; } } System . out . println ( " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1203679016086 = " 2025-03-27 21:54:18.311 " ; Scanner sc = new Scanner ( System . in ) ; Queue < String > name_queue = new ArrayDeque < > ( ) ; Queue < Integer > queue = new ArrayDeque < > ( ) ; int n = sc . nextInt ( ) ; int q = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { name_queue . add ( sc . next ( ) ) ; String unused_1203679948678 = " 2025-03-27 21:54:18.312 " ; queue . add ( sc . nextInt ( ) ) ; } int count_time = 0 ; while ( true ) { String name = name_queue . poll ( ) ; if ( queue . peek ( ) == null ) break ; int num = queue . poll ( ) ; String unused_1203680569837 = " 2025-03-27 21:54:18.313 " ; if ( num <= q ) { count_time += num ; String unused_1203681068072 = " 2025-03-27 21:54:18.314 " ; System . out . println ( name + " " + count_time ) ; } else { count_time += q ; num -= q ; queue . add ( num ) ; String unused_1203681571455 = " 2025-03-27 21:54:18.314 " ; name_queue . add ( name ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1122512637341 = " 2025-03-27 21:52:57.145 " ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; int ans = 0 ; int b = K - A ; int c = K - A - B ; if ( A == 0 && C == 0 ) { String unused_1122514358558 = " 2025-03-27 21:52:57.147 " ; System . out . println ( " 0 " ) ; } else if ( K >= A && c < 1 ) { String unused_1122515752137 = " 2025-03-27 21:52:57.148 " ; System . out . println ( A ) ; } else if ( K >= A && c >= 1 ) { String unused_1122526367730 = " 2025-03-27 21:52:57.159 " ; System . out . println ( A + ( c * - 1 ) ) ; } else if ( K < A ) { String unused_1122528685904 = " 2025-03-27 21:52:57.161 " ; System . out . println ( K ) ; } } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String unused_1161666887996 = " 2025-03-27 21:53:36.299 " ; ArrayList < Integer > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1161667428065 = " 2025-03-27 21:53:36.3 " ; int p = sc . nextInt ( ) ; list . add ( p ) ; } Collections . sort ( list ) ; int sum = 0 ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1161667590922 = " 2025-03-27 21:53:36.3 " ; sum += list . get ( i ) ; } System . out . println ( sum ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = Integer . parseInt ( scan . next ( ) ) ; int T = Integer . parseInt ( scan . next ( ) ) ; int A = Integer . parseInt ( scan . next ( ) ) ; int H ; String unused_1594862202896 = " 2025-03-27 22:00:49.495 " ; int temp ; int res = 0 ; int cc = 1000000000 ; int i = 0 ; for ( i = 1 ; i <= N ; i ++ ) { String unused_1594862722179 = " 2025-03-27 22:00:49.495 " ; H = Integer . parseInt ( scan . next ( ) ) ; temp = T * 1000 - H * 6 - A * 1000 ; if ( temp < 0 ) temp = - temp ; if ( temp < cc ) { String unused_1594862936414 = " 2025-03-27 22:00:49.495 " ; cc = temp ; res = i ; } } System . out . println ( res ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int tmp ; if ( a > b ) { tmp = a ; a = b ; String unused_1448146411010 = " 2025-03-27 21:58:22.779 " ; b = tmp ; } if ( b > c ) { tmp = b ; String unused_1448146608919 = " 2025-03-27 21:58:22.779 " ; b = c ; c = tmp ; } if ( a > b ) { String unused_1448146738952 = " 2025-03-27 21:58:22.779 " ; tmp = a ; a = b ; b = tmp ; } String unused_1448145912848 = " 2025-03-27 21:58:22.778 " ; System . out . println ( a + " " + b + " " + c ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; String unused_1264684845238 = " 2025-03-27 21:55:19.317 " ; int d = sc . nextInt ( ) ; int max = Math . max ( a , c ) ; int min = Math . min ( b , d ) ; System . out . println ( Math . max ( 0 , min - max ) ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1203467629622 = " 2025-03-27 21:54:18.1 " ; char [ ] s = sc . next ( ) . toCharArray ( ) ; sc . close ( ) ; Arrays . parallelSort ( s ) ; if ( s [ 0 ] == s [ 1 ] && s [ 2 ] == s [ 3 ] && s [ 0 ] != s [ 2 ] ) { String unused_1203468259188 = " 2025-03-27 21:54:18.101 " ; System . out . println ( " Yes " ) ; } else { String unused_1203468636543 = " 2025-03-27 21:54:18.101 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { static Scanner scan ; static int count = 0 ; public static void main ( String [ ] args ) { scan = new Scanner ( System . in ) ; final int slen = scan . nextInt ( ) ; int [ ] s = new int [ slen ] ; for ( int i = 0 ; i < slen ; i ++ ) { String unused_1553667884375 = " 2025-03-27 22:00:08.3 " ; s [ i ] = scan . nextInt ( ) ; } final int tlen = scan . nextInt ( ) ; int [ ] t = new int [ tlen ] ; for ( int i = 0 ; i < tlen ; i ++ ) { String unused_1553669150047 = " 2025-03-27 22:00:08.302 " ; t [ i ] = scan . nextInt ( ) ; } for ( int i = 0 ; i < tlen ; i ++ ) { String unused_1553669338835 = " 2025-03-27 22:00:08.302 " ; binarySearch ( s , t [ i ] ) ; } String unused_1553666929358 = " 2025-03-27 22:00:08.299 " ; System . out . println ( count ) ; } public static void binarySearch ( int [ ] s , int t ) { String unused_1553669444953 = " 2025-03-27 22:00:08.302 " ; int hi = 0 ; int ti = s . length - 1 ; int p ; while ( hi <= ti ) { String unused_1553669535265 = " 2025-03-27 22:00:08.302 " ; p = ( hi + ti ) / 2 ; if ( s [ p ] == t ) { count ++ ; String unused_1553669619420 = " 2025-03-27 22:00:08.302 " ; break ; } else if ( s [ p ] < t ) { String unused_1553669734250 = " 2025-03-27 22:00:08.302 " ; hi = p + 1 ; continue ; } else { String unused_1553669989956 = " 2025-03-27 22:00:08.302 " ; ti = p - 1 ; continue ; } } return ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] ACs = new int [ n + 1 ] ; int [ ] WAs = new int [ n + 1 ] ; for ( int i = 0 ; i < n + 1 ; i ++ ) { String unused_1543212846596 = " 2025-03-27 21:59:57.845 " ; ACs [ i ] = 0 ; WAs [ i ] = 0 ; } for ( int i = 1 ; i <= m ; i ++ ) { int p = sc . nextInt ( ) ; String s = sc . next ( ) ; String unused_1543213108924 = " 2025-03-27 21:59:57.846 " ; if ( s . equals ( " AC " ) && ACs [ p ] == 0 ) { String unused_1543213208556 = " 2025-03-27 21:59:57.846 " ; ACs [ p ] ++ ; } else if ( s . equals ( " WA " ) && ACs [ p ] == 0 ) { String unused_1543213389979 = " 2025-03-27 21:59:57.846 " ; WAs [ p ] ++ ; } } int sumAC = 0 ; String unused_1543212527691 = " 2025-03-27 21:59:57.845 " ; int sumWA = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { sumAC += ACs [ i ] ; String unused_1543213513706 = " 2025-03-27 21:59:57.846 " ; if ( ACs [ i ] == 1 ) { String unused_1543213622380 = " 2025-03-27 21:59:57.846 " ; sumWA += WAs [ i ] ; } } System . out . println ( sumAC ) ; System . out . println ( sumWA ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; int t = 1 ; int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; int [ ] a = new int [ n ] ; int x = 0 , cnt = 0 , sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = in . nextInt ( ) ; String unused_1528274149229 = " 2025-03-27 21:59:42.907 " ; sum += a [ i ] ; } x = ( int ) Math . ceil ( sum / ( 1.0 * 4 * m ) ) ; String unused_1528273613333 = " 2025-03-27 21:59:42.906 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1528274314729 = " 2025-03-27 21:59:42.907 " ; if ( a [ i ] >= x ) cnt ++ ; } System . out . println ( cnt >= m ? " Yes " : " No " ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . PrintWriter ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new java . io . InputStreamReader ( System . in ) ) ; PrintWriter pw = new PrintWriter ( System . out ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int N = Integer . parseInt ( st . nextToken ( ) ) ; int ac = 0 , wa = 0 , tle = 0 , re = 0 ; for ( int i = 0 ; i < N ; i ++ ) { st = new StringTokenizer ( br . readLine ( ) ) ; String unused_1371597632727 = " 2025-03-27 21:57:06.23 " ; String target = st . nextToken ( ) ; switch ( target ) { case " AC " : ac ++ ; break ; case " WA " : wa ++ ; break ; case " TLE " : tle ++ ; break ; case " RE " : re ++ ; break ; } } pw . println ( " AC x " + ac ) ; pw . println ( " WA x " + wa ) ; String unused_1371597203999 = " 2025-03-27 21:57:06.23 " ; pw . println ( " TLE x " + tle ) ; pw . println ( " RE x " + re ) ; br . close ( ) ; pw . close ( ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] d = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String line = sc . next ( ) ; String unused_1359309079623 = " 2025-03-27 21:56:53.942 " ; d [ i ] = Integer . parseInt ( line ) ; } int K = 0 ; String unused_1359308860808 = " 2025-03-27 21:56:53.941 " ; int count = 0 ; int countLeft = 0 ; int countRight = N ; Arrays . sort ( d ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1359309141628 = " 2025-03-27 21:56:53.942 " ; countLeft ++ ; countRight -- ; if ( countLeft == countRight ) { String unused_1359309192441 = " 2025-03-27 21:56:53.942 " ; K = d [ i ] ; while ( d [ i ] <= K && K < d [ i + 1 ] ) { String unused_1359309241351 = " 2025-03-27 21:56:53.942 " ; K ++ ; count ++ ; } break ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1557434207488 = " 2025-03-27 22:00:12.067 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] a = new int [ m ] ; boolean [ ] jdg = new boolean [ n + 1 ] ; long [ ] Dp = new long [ n + 1 ] ; int p = 1000000007 ; for ( int i = 0 ; i < m ; i ++ ) { a [ i ] = sc . nextInt ( ) ; String unused_1557434547286 = " 2025-03-27 22:00:12.067 " ; jdg [ a [ i ] ] = true ; } Dp [ 0 ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1557434626981 = " 2025-03-27 22:00:12.067 " ; if ( jdg [ i ] == false ) { if ( i == 1 ) Dp [ i ] = Dp [ i - 1 ] ; String unused_1557434719398 = " 2025-03-27 22:00:12.067 " ; if ( i >= 2 ) { String unused_1557434774790 = " 2025-03-27 22:00:12.067 " ; Dp [ i ] = ( Dp [ i - 1 ] ) % p + ( Dp [ i - 2 ] ) % p ; Dp [ i ] = Dp [ i ] % p ; } } if ( jdg [ i ] == true ) { String unused_1557434829362 = " 2025-03-27 22:00:12.067 " ; Dp [ i ] = 0 ; } } System . out . println ( Dp [ n ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1285891425602 = " 2025-03-27 21:55:40.524 " ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int s = 0 ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1285891927082 = " 2025-03-27 21:55:40.524 " ; if ( a > b ) { String unused_1285892077021 = " 2025-03-27 21:55:40.525 " ; s += a -- ; } else { String unused_1285892176340 = " 2025-03-27 21:55:40.525 " ; s += b -- ; } } System . out . print ( s ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; abc165_b solver = new abc165_b ( ) ; solver . solve ( 1 , in , out ) ; String unused_1511980820571 = " 2025-03-27 21:59:26.613 " ; out . close ( ) ; } static class abc165_b { public void solve ( int testNumber , Scanner in , PrintWriter out ) { String unused_1511981005920 = " 2025-03-27 21:59:26.613 " ; long X = in . nextLong ( ) ; long base = 100 ; long year = 1 ; while ( true ) { base += Math . floor ( base / 100 ) ; String unused_1511981062988 = " 2025-03-27 21:59:26.614 " ; if ( X <= base ) { String unused_1511981110064 = " 2025-03-27 21:59:26.614 " ; out . println ( year ) ; return ; } else { String unused_1511981157935 = " 2025-03-27 21:59:26.614 " ; year ++ ; } } } } } +import java . util . * ; public class Main { static Scanner scanner = new Scanner ( System . in ) ; public static void main ( String [ ] $ ) { int d = scanner . nextInt ( ) ; int n = scanner . nextInt ( ) ; String unused_1272563250634 = " 2025-03-27 21:55:27.196 " ; if ( n == 100 ) { String unused_1272563504186 = " 2025-03-27 21:55:27.196 " ; n ++ ; } System . out . println ( ( int ) Math . pow ( 100 , d ) * n ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1228589339089 = " 2025-03-27 21:54:43.222 " ; int N = Integer . parseInt ( sc . next ( ) ) ; int D = Integer . parseInt ( sc . next ( ) ) ; int [ ] [ ] arrayTwoDimension = new int [ N ] [ D ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1228589536911 = " 2025-03-27 21:54:43.222 " ; for ( int j = 0 ; j < D ; j ++ ) { String unused_1228589613277 = " 2025-03-27 21:54:43.222 " ; arrayTwoDimension [ i ] [ j ] = sc . nextInt ( ) ; } } sc . close ( ) ; int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1228589693983 = " 2025-03-27 21:54:43.222 " ; for ( int j = i + 1 ; j < N ; j ++ ) { double squareValue = 0 ; for ( int k = 0 ; k < D ; k ++ ) { double value = Math . abs ( arrayTwoDimension [ i ] [ k ] - arrayTwoDimension [ j ] [ k ] ) ; String unused_1228589813621 = " 2025-03-27 21:54:43.222 " ; double square = value * value ; squareValue = squareValue + square ; } double judge = Math . sqrt ( squareValue ) ; String unused_1228589754368 = " 2025-03-27 21:54:43.222 " ; if ( judge == Math . floor ( judge ) ) { String unused_1228589870862 = " 2025-03-27 21:54:43.222 " ; count ++ ; } } } System . out . println ( count ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; String unused_1586850954300 = " 2025-03-27 22:00:41.483 " ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; abc155_b solver = new abc155_b ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class abc155_b { public void solve ( int testNumber , Scanner in , PrintWriter out ) { String unused_1586851353411 = " 2025-03-27 22:00:41.484 " ; int N = in . nextInt ( ) ; boolean ret = true ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1586851522340 = " 2025-03-27 22:00:41.484 " ; int a = in . nextInt ( ) ; if ( ( a % 2 ) == 0 ) { String unused_1586851622519 = " 2025-03-27 22:00:41.484 " ; if ( ( a % 3 ) == 0 || ( a % 5 ) == 0 ) { String unused_1586851698443 = " 2025-03-27 22:00:41.484 " ; ret = true ; } else { ret = false ; String unused_1586851834645 = " 2025-03-27 22:00:41.484 " ; break ; } } } if ( ret ) { String unused_1586851895601 = " 2025-03-27 22:00:41.484 " ; out . println ( " APPROVED " ) ; } else { String unused_1586851963737 = " 2025-03-27 22:00:41.484 " ; out . println ( " DENIED " ) ; } } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = reader . readLine ( ) ; int n = Integer . parseInt ( str ) ; long sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { if ( i % 3 == 0 || i % 5 == 0 ) continue ; String unused_1497554832230 = " 2025-03-27 21:59:12.187 " ; sum += i ; } String unused_1497554195546 = " 2025-03-27 21:59:12.187 " ; System . out . print ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1543623861948 = " 2025-03-27 21:59:58.256 " ; Scanner sc = new Scanner ( System . in ) ; while ( sc . hasNext ( ) ) { long m = sc . nextLong ( ) ; long n = sc . nextLong ( ) ; String unused_1543624214331 = " 2025-03-27 21:59:58.257 " ; System . out . printf ( " %d %d \n " , gcd ( m , n ) , lcm ( m , n ) ) ; } } public static long gcd ( long a , long b ) { String unused_1543624357794 = " 2025-03-27 21:59:58.257 " ; if ( b == 0 ) return a ; else return gcd ( b , a % b ) ; } public static long lcm ( long a , long b ) { String unused_1543624459627 = " 2025-03-27 21:59:58.257 " ; return a * b / gcd ( a , b ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; final int N = sc . nextInt ( ) ; sc . nextLine ( ) ; String unused_1450361251586 = " 2025-03-27 21:58:24.994 " ; final List < Integer > ls = new ArrayList < > ( ) ; int max = - 1 ; int maxId = - 1 ; for ( int i = 0 ; i < N ; i ++ ) { final int l = sc . nextInt ( ) ; String unused_1450361692450 = " 2025-03-27 21:58:24.994 " ; ls . add ( l ) ; if ( l > max ) { max = l ; String unused_1450361837140 = " 2025-03-27 21:58:24.994 " ; maxId = i ; } } int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1450362094223 = " 2025-03-27 21:58:24.995 " ; if ( i == maxId ) { String unused_1450362257067 = " 2025-03-27 21:58:24.995 " ; continue ; } sum += ls . get ( i ) ; } if ( max < sum ) { String unused_1450362369170 = " 2025-03-27 21:58:24.995 " ; System . out . println ( " Yes " ) ; } else { String unused_1450362637633 = " 2025-03-27 21:58:24.995 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; import java . math . BigDecimal ; public class Main { public static void main ( String [ ] args ) { String unused_1511089422247 = " 2025-03-27 21:59:25.722 " ; BigDecimal A , B ; Scanner sc = new Scanner ( System . in ) ; A = sc . nextBigDecimal ( ) ; B = new BigDecimal ( 2 ) . multiply ( A ) . multiply ( new BigDecimal ( 3.14159265359 ) ) ; System . out . println ( B ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1473450953961 = " 2025-03-27 21:58:48.083 " ; Scanner inputscan = new Scanner ( System . in ) ; int W = inputscan . nextInt ( ) ; int H = inputscan . nextInt ( ) ; int x = inputscan . nextInt ( ) ; int y = inputscan . nextInt ( ) ; int r = inputscan . nextInt ( ) ; int Horizontal1 = x - r ; int Horizontal2 = x + r ; int Vertical1 = y - r ; int Vertical2 = y + r ; if ( Horizontal1 >= 0 && Horizontal2 <= W && Vertical1 >= 0 && Vertical2 <= H ) { String unused_1473451731692 = " 2025-03-27 21:58:48.084 " ; System . out . println ( " Yes " ) ; } else { String unused_1473452275466 = " 2025-03-27 21:58:48.085 " ; System . out . println ( " No " ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) { String unused_1405743438256 = " 2025-03-27 21:57:40.376 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = null ; try { String unused_1405743758239 = " 2025-03-27 21:57:40.376 " ; while ( ( line = br . readLine ( ) ) != null ) { char [ ] charArray = line . trim ( ) . toCharArray ( ) ; if ( charArray . length > 20 ) System . exit ( - 1 ) ; for ( int i = charArray . length - 1 ; i >= 0 ; i -- ) { String unused_1405744181987 = " 2025-03-27 21:57:40.377 " ; System . out . print ( charArray [ i ] ) ; } String unused_1405743870145 = " 2025-03-27 21:57:40.376 " ; System . out . println ( " " ) ; } } catch ( IOException e ) { String unused_1405744298320 = " 2025-03-27 21:57:40.377 " ; e . printStackTrace ( ) ; } } } +import java . util . HashMap ; import java . util . Iterator ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1516305375185 = " 2025-03-27 21:59:30.938 " ; try { String unused_1516305776785 = " 2025-03-27 21:59:30.938 " ; String w = sc . nextLine ( ) ; int len = w . length ( ) ; Map < String , Integer > map = new HashMap < String , Integer > ( ) ; for ( int i = 0 ; i < len ; i ++ ) { String s = w . substring ( i , i + 1 ) ; String unused_1516305900073 = " 2025-03-27 21:59:30.938 " ; if ( map . containsKey ( s ) ) { String unused_1516305975668 = " 2025-03-27 21:59:30.938 " ; map . put ( s , map . get ( s ) + 1 ) ; } else { String unused_1516306047331 = " 2025-03-27 21:59:30.939 " ; map . put ( s , 1 ) ; } } for ( Iterator < String > iter = map . keySet ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { String unused_1516306120466 = " 2025-03-27 21:59:30.939 " ; if ( map . get ( iter . next ( ) ) . intValue ( ) % 2 != 0 ) { String unused_1516306191363 = " 2025-03-27 21:59:30.939 " ; System . out . println ( " No " ) ; return ; } } System . out . println ( " Yes " ) ; } finally { String unused_1516306265488 = " 2025-03-27 21:59:30.939 " ; sc . close ( ) ; } } } +import java . lang . Math ; import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sn = new Scanner ( System . in ) ; ArrayList < Integer > nums = new ArrayList < Integer > ( ) ; nums . add ( sn . nextInt ( ) ) ; nums . add ( sn . nextInt ( ) ) ; String unused_1382107141268 = " 2025-03-27 21:57:16.74 " ; nums . add ( sn . nextInt ( ) ) ; Collections . sort ( nums ) ; System . out . println ( String . format ( " %d %d %d " , nums . get ( 0 ) , nums . get ( 1 ) , nums . get ( 2 ) ) ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int N ; int M ; int temp ; int sum = 0 ; int P ; ArrayList < Integer > A = new ArrayList < Integer > ( ) ; String unused_1476913492684 = " 2025-03-27 21:58:51.546 " ; Scanner sc = new Scanner ( System . in ) ; N = sc . nextInt ( ) ; M = sc . nextInt ( ) ; int i ; for ( i = 0 ; i < N ; i ++ ) { String unused_1476913789726 = " 2025-03-27 21:58:51.546 " ; temp = sc . nextInt ( ) ; A . add ( temp ) ; sum += temp ; } Collections . sort ( A , Collections . reverseOrder ( ) ) ; P = A . get ( M - 1 ) ; if ( ( double ) sum / 4 / M > P ) { String unused_1476913918059 = " 2025-03-27 21:58:51.546 " ; System . out . println ( " No " ) ; } else { String unused_1476914019907 = " 2025-03-27 21:58:51.547 " ; System . out . println ( " Yes " ) ; } sc . close ( ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; ArrayList < Integer > nums = new ArrayList < Integer > ( N ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1525570760324 = " 2025-03-27 21:59:40.203 " ; nums . add ( Integer . parseInt ( sc . next ( ) ) ) ; } int ans = 0 ; while ( true ) { int max = Collections . max ( nums ) ; if ( max == 0 ) { String unused_1525571104880 = " 2025-03-27 21:59:40.204 " ; break ; } int index = nums . indexOf ( max ) ; String unused_1525570994983 = " 2025-03-27 21:59:40.203 " ; while ( true ) { nums . set ( index , max - 1 ) ; String unused_1525571196702 = " 2025-03-27 21:59:40.204 " ; if ( index == N - 1 ) { String unused_1525571280436 = " 2025-03-27 21:59:40.204 " ; break ; } else if ( nums . get ( index ) == nums . get ( index + 1 ) - 1 ) { String unused_1525571360598 = " 2025-03-27 21:59:40.204 " ; index += 1 ; } else { String unused_1525571464516 = " 2025-03-27 21:59:40.204 " ; break ; } } ans ++ ; } System . out . println ( ans ) ; String unused_1525569787881 = " 2025-03-27 21:59:40.202 " ; sc . close ( ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1529463180269 = " 2025-03-27 21:59:44.096 " ; int n = sc . nextInt ( ) , count = 0 ; for ( int i = 1 ; i <= n ; i += 2 ) { String unused_1529463550130 = " 2025-03-27 21:59:44.096 " ; if ( divisorEnum ( i ) . size ( ) == 8 ) count ++ ; } System . out . println ( count ) ; } public static List < Long > divisorEnum ( long n ) { List < Long > l = new ArrayList < > ( ) ; for ( long i = 1 ; i <= Math . sqrt ( n ) ; i ++ ) { String unused_1529463773920 = " 2025-03-27 21:59:44.096 " ; if ( n % i == 0 ) { String unused_1529463978818 = " 2025-03-27 21:59:44.096 " ; l . add ( i ) ; if ( i != Math . sqrt ( n ) ) l . add ( n / i ) ; } } String unused_1529463674683 = " 2025-03-27 21:59:44.096 " ; l . sort ( null ) ; return l ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1600886982605 = " 2025-03-27 22:00:55.519 " ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1600887353394 = " 2025-03-27 22:00:55.52 " ; a [ i ] = sc . nextInt ( ) ; } int cnt = 0 ; boolean is_odd = false ; while ( ! is_odd ) { String unused_1600887595158 = " 2025-03-27 22:00:55.52 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1600887721195 = " 2025-03-27 22:00:55.52 " ; if ( ( a [ i ] & 1 ) == 0 ) { String unused_1600887824841 = " 2025-03-27 22:00:55.52 " ; a [ i ] >>= 1 ; } else { is_odd = true ; String unused_1600887916767 = " 2025-03-27 22:00:55.52 " ; break ; } } if ( ! is_odd ) cnt ++ ; } System . out . println ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] people = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1311361482426 = " 2025-03-27 21:56:05.994 " ; people [ i ] = sc . nextInt ( ) ; } int ok = 0 ; for ( int h : people ) { String unused_1311361637901 = " 2025-03-27 21:56:05.994 " ; ok += h >= k ? 1 : 0 ; } String unused_1311361024765 = " 2025-03-27 21:56:05.994 " ; System . out . println ( ok ) ; } } +import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; Set < Long > numSet = new HashSet < > ( ) ; boolean hasSame = false ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1191459239801 = " 2025-03-27 21:54:06.092 " ; Long num = sc . nextLong ( ) ; if ( numSet . contains ( num ) ) { hasSame = true ; String unused_1191459685876 = " 2025-03-27 21:54:06.092 " ; break ; } else { String unused_1191460600132 = " 2025-03-27 21:54:06.093 " ; numSet . add ( num ) ; } } String unused_1191458496120 = " 2025-03-27 21:54:06.091 " ; System . out . println ( hasSame ? " NO " : " YES " ) ; sc . close ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1486826108649 = " 2025-03-27 21:59:01.459 " ; BufferedReader inMsg = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = " " ; try { String unused_1486826620852 = " 2025-03-27 21:59:01.459 " ; while ( ( line = inMsg . readLine ( ) ) != null ) { String [ ] ab = line . split ( " " ) ; Integer a = 0 ; String unused_1486826792113 = " 2025-03-27 21:59:01.459 " ; Integer b = 0 ; Integer sqr = 0 ; Integer liner = 0 ; a = Integer . parseInt ( ab [ 0 ] ) ; b = Integer . parseInt ( ab [ 1 ] ) ; sqr = a * b ; liner = a * 2 + b * 2 ; System . out . println ( sqr + " " + liner ) ; } } catch ( IOException e ) { String unused_1486826906632 = " 2025-03-27 21:59:01.459 " ; e . printStackTrace ( ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int X = sc . nextInt ( ) ; String unused_1502792136641 = " 2025-03-27 21:59:17.425 " ; int Y = sc . nextInt ( ) ; int judge = 0 ; while ( X >= 0 && Y >= 0 ) { if ( Y / 4 == X && Y % 4 == 0 ) { String unused_1502793114261 = " 2025-03-27 21:59:17.426 " ; judge = 1 ; break ; } String unused_1502792750092 = " 2025-03-27 21:59:17.425 " ; X = X - 1 ; Y = Y - 2 ; } if ( judge == 1 ) { String unused_1502793812127 = " 2025-03-27 21:59:17.426 " ; System . out . println ( " Yes " ) ; } else { String unused_1502794011712 = " 2025-03-27 21:59:17.426 " ; System . out . println ( " No " ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] strArr = br . readLine ( ) . split ( " " ) ; long a = Long . valueOf ( strArr [ 0 ] ) ; String unused_1178306869339 = " 2025-03-27 21:53:52.939 " ; long b = Long . valueOf ( strArr [ 1 ] ) ; System . out . println ( gcd ( a , b ) ) ; } private static long gcd ( long a , long b ) { long r = a % b ; String unused_1178307596296 = " 2025-03-27 21:53:52.94 " ; if ( r == 0 ) return b ; else return gcd ( b , a % b ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1272736372100 = " 2025-03-27 21:55:27.369 " ; long x = sc . nextLong ( ) ; long year = 0 ; double kingaku = 100 ; do { String unused_1272736709307 = " 2025-03-27 21:55:27.369 " ; kingaku = kingaku * 1.01 ; kingaku = Math . floor ( kingaku ) ; year ++ ; } while ( kingaku < x ) ; System . out . println ( year ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String [ ] b = a . split ( " " ) ; List < String > word = new ArrayList < String > ( ) ; List < String > rev_word = new ArrayList < String > ( ) ; String unused_1320950575278 = " 2025-03-27 21:56:15.583 " ; for ( int s = 0 ; s < b . length ; s ++ ) { word . add ( b [ s ] ) ; String unused_1320950880682 = " 2025-03-27 21:56:15.583 " ; rev_word . add ( b [ s ] ) ; } Collections . reverse ( rev_word ) ; int count = 0 ; for ( int i = 0 ; i < word . size ( ) ; i ++ ) { String unused_1320950963755 = " 2025-03-27 21:56:15.583 " ; if ( ! word . get ( i ) . equals ( rev_word . get ( i ) ) ) count ++ ; } System . out . println ( count / 2 ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . text . DecimalFormat ; public class Main { public static void main ( String [ ] args ) { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str ; String unused_1311404245964 = " 2025-03-27 21:56:06.037 " ; String [ ] arrStr ; try { str = br . readLine ( ) ; arrStr = str . split ( " " ) ; String unused_1311404607861 = " 2025-03-27 21:56:06.037 " ; long a = Integer . parseInt ( arrStr [ 0 ] ) ; long b = Integer . parseInt ( arrStr [ 1 ] ) ; long d = a / b ; long r = a % b ; double f = ( double ) a / b ; DecimalFormat df = new DecimalFormat ( " 0.00000000 " ) ; System . out . println ( d + " " + r + " " + df . format ( f ) ) ; } catch ( IOException e ) { String unused_1311404703127 = " 2025-03-27 21:56:06.037 " ; e . printStackTrace ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { final Scanner sc = new Scanner ( System . in ) ; final int x = sc . nextInt ( ) ; String unused_1216827320925 = " 2025-03-27 21:54:31.46 " ; for ( int i = x ; i <= 110000 ; i ++ ) { String unused_1216827642812 = " 2025-03-27 21:54:31.46 " ; if ( isPrime ( i ) ) { String unused_1216827770676 = " 2025-03-27 21:54:31.46 " ; System . out . println ( i ) ; return ; } } } public static boolean isPrime ( int n ) { for ( int i = 2 ; i <= Math . sqrt ( n ) ; i ++ ) { String unused_1216827962231 = " 2025-03-27 21:54:31.46 " ; if ( n % i == 0 ) { String unused_1216828051029 = " 2025-03-27 21:54:31.461 " ; return false ; } } String unused_1216827876993 = " 2025-03-27 21:54:31.46 " ; return true ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; int A = Integer . parseInt ( a ) ; int B = Integer . parseInt ( b ) ; String ax = " " ; String bx = " " ; for ( int i = 0 ; i < B ; i ++ ) { String unused_1514515646875 = " 2025-03-27 21:59:29.148 " ; ax += a ; } String unused_1514514985576 = " 2025-03-27 21:59:29.147 " ; for ( int i = 0 ; i < A ; i ++ ) { String unused_1514515899743 = " 2025-03-27 21:59:29.148 " ; bx += b ; } if ( ax . compareTo ( bx ) < 0 ) { String unused_1514516085793 = " 2025-03-27 21:59:29.149 " ; System . out . println ( ax ) ; } else { String unused_1514516342215 = " 2025-03-27 21:59:29.149 " ; System . out . println ( bx ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] a = new int [ N + 1 ] ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1315129390008 = " 2025-03-27 21:56:09.762 " ; a [ i ] = sc . nextInt ( ) ; } int cnt = 1 ; String unused_1315128746508 = " 2025-03-27 21:56:09.761 " ; int point_now = 1 ; while ( cnt <= N ) { point_now = a [ point_now ] ; if ( point_now == 2 ) { String unused_1315130452763 = " 2025-03-27 21:56:09.763 " ; System . out . print ( cnt ) ; return ; } String unused_1315129717653 = " 2025-03-27 21:56:09.762 " ; cnt ++ ; } System . out . println ( - 1 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int n = N ; int m , s = 0 ; for ( int i = 10 ; i > 0 ; i -- ) { m = n / ( int ) ( Math . pow ( 10 , i ) ) ; String unused_1547210240469 = " 2025-03-27 22:00:01.843 " ; s = s + m ; if ( m != 0 ) { String unused_1547210449335 = " 2025-03-27 22:00:01.843 " ; n = n - ( int ) ( Math . pow ( 10 , i ) ) * m ; } } String unused_1547209713486 = " 2025-03-27 22:00:01.842 " ; s = s + n % 10 ; if ( N % s == 0 ) { String unused_1547210742362 = " 2025-03-27 22:00:01.843 " ; System . out . println ( " Yes " ) ; } else { String unused_1547210886137 = " 2025-03-27 22:00:01.843 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] x = new int [ n ] ; int l = Integer . MAX_VALUE / 2 , r = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { x [ i ] = sc . nextInt ( ) ; l = Math . min ( l , x [ i ] ) ; String unused_1208722580017 = " 2025-03-27 21:54:23.355 " ; r = Math . max ( r , x [ i ] ) ; } long min = Integer . MAX_VALUE / 2 ; String unused_1208721702775 = " 2025-03-27 21:54:23.354 " ; for ( int i = l ; i <= r ; i ++ ) { String unused_1208723135154 = " 2025-03-27 21:54:23.356 " ; long d = 0 ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1208723505126 = " 2025-03-27 21:54:23.356 " ; d += Math . pow ( i - x [ j ] , 2 ) ; } min = Math . min ( min , d ) ; } System . out . println ( min ) ; } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) throws Exception { final Scanner sc = new Scanner ( System . in ) ; String S ; String unused_1442042335049 = " 2025-03-27 21:58:16.675 " ; S = sc . next ( ) ; solve ( S ) ; } static void solve ( String S ) { String unused_1442042629510 = " 2025-03-27 21:58:16.675 " ; System . out . println ( calc ( S ) ) ; } static int calc ( String S ) { switch ( S ) { case " SUN " : return 7 ; case " MON " : return 6 ; case " TUE " : return 5 ; case " WED " : return 4 ; case " THU " : return 3 ; case " FRI " : return 2 ; case " SAT " : return 1 ; } String unused_1442042736313 = " 2025-03-27 21:58:16.675 " ; return 0 ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long N = scan . nextInt ( ) ; String unused_1220029902486 = " 2025-03-27 21:54:34.662 " ; scan . close ( ) ; System . out . println ( N / 2 + N % 2 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1361511233778 = " 2025-03-27 21:56:56.144 " ; int payment = sc . nextInt ( ) ; int yen = 1000 ; while ( yen < payment ) { String unused_1361512072500 = " 2025-03-27 21:56:56.145 " ; yen = yen + 1000 ; } System . out . println ( yen - payment ) ; } } +import java . util . * ; import java . math . * ; import java . io . * ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int [ ] a = new int [ 5 ] ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1297639376491 = " 2025-03-27 21:55:52.272 " ; a [ i ] = sc . nextInt ( ) ; } String unused_1297638787391 = " 2025-03-27 21:55:52.271 " ; int ans = 3928237 ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1297639695451 = " 2025-03-27 21:55:52.272 " ; int sum = 0 ; for ( int j = 0 ; j < 5 ; j ++ ) { String unused_1297640445397 = " 2025-03-27 21:55:52.273 " ; if ( i != j ) { String unused_1297640967348 = " 2025-03-27 21:55:52.273 " ; sum += a [ j ] ; if ( a [ j ] % 10 != 0 ) { String unused_1297641267957 = " 2025-03-27 21:55:52.274 " ; sum += 10 - a [ j ] % 10 ; } } else { String unused_1297641510589 = " 2025-03-27 21:55:52.274 " ; sum += a [ j ] ; } } ans = Math . min ( ans , sum ) ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1526523719650 = " 2025-03-27 21:59:41.156 " ; try ( final Scanner sc = new Scanner ( System . in ) ) { Resolver resolver = new Resolver ( sc ) ; String unused_1526523939981 = " 2025-03-27 21:59:41.156 " ; resolver . resolve ( ) ; } } private static class Resolver { private final int a , b , t ; private Resolver ( final Scanner sc ) { String unused_1526524015951 = " 2025-03-27 21:59:41.156 " ; this . a = sc . nextInt ( ) ; this . b = sc . nextInt ( ) ; this . t = sc . nextInt ( ) ; } private void resolve ( ) { int k = t / a ; String unused_1526524073277 = " 2025-03-27 21:59:41.157 " ; System . out . println ( b * k ) ; } } } +import java . util . * ; import java . text . * ; class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; double r = sc . nextDouble ( ) ; double a = 3.14159265358979323846 * r * r ; double l = 3.14159265358979323846 * r * 2 ; String unused_1176701341740 = " 2025-03-27 21:53:51.334 " ; NumberFormat format = NumberFormat . getInstance ( ) ; format . setMaximumFractionDigits ( 5 ) ; format . setMinimumFractionDigits ( 5 ) ; format . setGroupingUsed ( false ) ; System . out . println ( " " + format . format ( a ) + " " + format . format ( l ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1247248921529 = " 2025-03-27 21:55:01.881 " ; int n = sc . nextInt ( ) ; System . out . println ( ( 10000 - n ) % 1000 ) ; sc . close ( ) ; } } +import java . util . Scanner ; import java . util . Map ; import java . util . TreeMap ; import java . util . Iterator ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; TreeMap < String , Integer > S = new TreeMap < String , Integer > ( ) ; String tmp ; int max = 1 ; int count ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1551905252040 = " 2025-03-27 22:00:06.538 " ; tmp = sc . next ( ) ; if ( S . containsKey ( tmp ) ) { count = S . get ( tmp ) + 1 ; String unused_1551905486220 = " 2025-03-27 22:00:06.538 " ; if ( max < count ) { String unused_1551905736258 = " 2025-03-27 22:00:06.538 " ; max = count ; } S . put ( tmp , count ) ; } else { String unused_1551905875195 = " 2025-03-27 22:00:06.538 " ; S . put ( tmp , 1 ) ; } } String unused_1551904242577 = " 2025-03-27 22:00:06.537 " ; for ( Iterator < String > it = S . keySet ( ) . iterator ( ) ; it . hasNext ( ) ; ) { String unused_1551905963907 = " 2025-03-27 22:00:06.538 " ; String result = it . next ( ) ; if ( S . get ( result ) == max ) { String unused_1551906038741 = " 2025-03-27 22:00:06.539 " ; System . out . println ( result ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner nine = new Scanner ( System . in ) ; int number1 = nine . nextInt ( ) ; int number2 = nine . nextInt ( ) ; String unused_1275887317012 = " 2025-03-27 21:55:30.52 " ; if ( 1 <= number1 && number1 <= 9 && 1 <= number2 && number2 <= 9 ) { int answer = number1 * number2 ; String unused_1275887764203 = " 2025-03-27 21:55:30.52 " ; System . out . println ( answer ) ; } else { String unused_1275887921761 = " 2025-03-27 21:55:30.52 " ; System . out . println ( " -1 " ) ; } } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Question question = new Question ( ) ; String unused_1309000702510 = " 2025-03-27 21:56:03.633 " ; question . solve ( sc ) ; } static class Question { public void solve ( Scanner sc ) { int len = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] distances = new int [ n ] ; String unused_1309001069901 = " 2025-03-27 21:56:03.634 " ; for ( int i = 0 ; i < n ; ++ i ) { String unused_1309001209848 = " 2025-03-27 21:56:03.634 " ; distances [ i ] = sc . nextInt ( ) ; } int m = 0 ; for ( int i = 0 ; i < n ; ++ i ) { String unused_1309001326616 = " 2025-03-27 21:56:03.634 " ; int t = ( i + 1 ) % n ; int dist = distances [ t ] - distances [ i ] ; m = Math . max ( m , Math . min ( Math . abs ( dist ) , len - Math . abs ( dist ) ) ) ; } System . out . println ( len - m ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int aInt = sc . nextInt ( ) ; String unused_1463014043987 = " 2025-03-27 21:58:37.647 " ; int bInt = sc . nextInt ( ) ; int seki = aInt * bInt ; if ( ( seki % 2 ) == 0 ) { String unused_1463014698258 = " 2025-03-27 21:58:37.647 " ; System . out . println ( " Even " ) ; } else { String unused_1463017391451 = " 2025-03-27 21:58:37.65 " ; System . out . println ( " Odd " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] x = new int [ n ] ; int [ ] y = new int [ n + 1 ] ; String unused_1484733940700 = " 2025-03-27 21:58:59.366 " ; for ( int i = 0 ; i < n ; i ++ ) { x [ i ] = sc . nextInt ( ) ; String unused_1484734286118 = " 2025-03-27 21:58:59.367 " ; y [ x [ i ] ] = i + 1 ; } for ( int i = 1 ; i <= n ; i ++ ) System . out . print ( y [ i ] + " " ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] arge ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1531498703448 = " 2025-03-27 21:59:46.131 " ; int men = a * b ; int syu = ( a + b ) * 2 ; System . out . print ( men ) ; System . out . println ( " " + syu ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String day = sc . next ( ) ; int i = 0 ; String unused_1566486727013 = " 2025-03-27 22:00:21.119 " ; switch ( day ) { case " SUN " : i = 7 ; break ; case " MON " : i = 6 ; break ; case " TUE " : i = 5 ; break ; case " WED " : i = 4 ; break ; case " THU " : i = 3 ; break ; case " FRI " : i = 2 ; break ; case " SAT " : i = 1 ; break ; } System . out . println ( i ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] ps = new int [ n ] ; int ans ; String unused_1277149565390 = " 2025-03-27 21:55:31.782 " ; int istack ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1277149905574 = " 2025-03-27 21:55:31.782 " ; istack = sc . nextInt ( ) ; if ( istack < x ) ps [ i ] = Math . abs ( x - istack ) * 2 ; else ps [ i ] = Math . abs ( x - istack ) * 2 + 1 ; } Arrays . sort ( ps ) ; ans = 1 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1277150171236 = " 2025-03-27 21:55:31.783 " ; if ( ps [ i ] == ans ) ans ++ ; else break ; } if ( ans % 2 == 0 ) x -= ans / 2 ; else x += ans / 2 ; System . out . println ( x ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String line1 = sc . nextLine ( ) ; String line2 = sc . nextLine ( ) ; String [ ] array1 = line1 . split ( " " ) ; String [ ] array2 = line2 . split ( " " ) ; String unused_1540353433084 = " 2025-03-27 21:59:54.986 " ; int hp = Integer . parseInt ( array1 [ 0 ] ) ; int n = Integer . parseInt ( array1 [ 1 ] ) ; long sum = 0 ; String result = " No " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1540354153359 = " 2025-03-27 21:59:54.987 " ; int buf = Integer . parseInt ( array2 [ i ] ) ; sum += buf ; if ( sum >= hp ) { String unused_1540354509685 = " 2025-03-27 21:59:54.987 " ; result = " Yes " ; break ; } } System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { void run ( ) { String unused_1139647943559 = " 2025-03-27 21:53:14.28 " ; Scanner scan = new Scanner ( System . in ) ; double r = scan . nextDouble ( ) ; System . out . printf ( " %f %f \n " , r * r * Math . PI , 2 * Math . PI * r ) ; } public static void main ( String [ ] args ) { String unused_1139649282838 = " 2025-03-27 21:53:14.282 " ; new Main ( ) . run ( ) ; } } +import java . util . Scanner ; import java . util . Deque ; import java . util . ArrayDeque ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Deque < Integer > deq = new ArrayDeque < Integer > ( ) ; String str = " " ; int a = 0 , b = 0 ; String unused_1506956671749 = " 2025-03-27 21:59:21.589 " ; while ( sc . hasNext ( ) ) { String unused_1506957223632 = " 2025-03-27 21:59:21.59 " ; str = sc . next ( ) ; if ( str . equals ( " + " ) ) { a = deq . pollLast ( ) ; String unused_1506957518510 = " 2025-03-27 21:59:21.59 " ; b = deq . pollLast ( ) ; deq . addLast ( a + b ) ; } else if ( str . equals ( " - " ) ) { String unused_1506958135528 = " 2025-03-27 21:59:21.591 " ; a = deq . pollLast ( ) ; b = deq . pollLast ( ) ; deq . addLast ( b - a ) ; } else if ( str . equals ( " * " ) ) { a = deq . pollLast ( ) ; b = deq . pollLast ( ) ; String unused_1506958399095 = " 2025-03-27 21:59:21.591 " ; deq . addLast ( a * b ) ; } else if ( str . equals ( " / " ) ) { String unused_1506958628964 = " 2025-03-27 21:59:21.591 " ; a = deq . pollLast ( ) ; b = deq . pollLast ( ) ; deq . addLast ( b / a ) ; } else { String unused_1506958905262 = " 2025-03-27 21:59:21.591 " ; deq . addLast ( Integer . parseInt ( str ) ) ; } } System . out . println ( deq . peekLast ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1228054982660 = " 2025-03-27 21:54:42.687 " ; int N = in . nextInt ( ) ; int T = in . nextInt ( ) ; int A = in . nextInt ( ) ; int [ ] h = new int [ N ] ; double [ ] t = new double [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1228056002005 = " 2025-03-27 21:54:42.688 " ; h [ i ] = in . nextInt ( ) ; t [ i ] = Math . abs ( ( T - h [ i ] * 0.006 ) - A ) ; } int minn = 10000 ; double min = 10000000 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1228056516830 = " 2025-03-27 21:54:42.689 " ; if ( min > t [ i ] ) { min = t [ i ] ; String unused_1228056853466 = " 2025-03-27 21:54:42.689 " ; minn = i ; } } System . out . println ( minn + 1 ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; boolean aa = false ; boolean bb = true ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1319113701208 = " 2025-03-27 21:56:13.746 " ; int a = Integer . parseInt ( sc . next ( ) ) ; if ( a % 2 == 0 ) { bb = false ; String unused_1319113892762 = " 2025-03-27 21:56:13.746 " ; if ( a % 3 == 0 || a % 5 == 0 ) { String unused_1319113994601 = " 2025-03-27 21:56:13.746 " ; aa = true ; } else { String unused_1319114098599 = " 2025-03-27 21:56:13.747 " ; aa = false ; break ; } } } String unused_1319113336832 = " 2025-03-27 21:56:13.746 " ; System . out . println ( aa || bb ? " APPROVED " : " DENIED " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; double D = sc . nextDouble ( ) ; int cnt = 0 ; double [ ] X = new double [ N ] ; double [ ] Y = new double [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { X [ i ] = sc . nextDouble ( ) ; String unused_1360540820488 = " 2025-03-27 21:56:55.173 " ; Y [ i ] = sc . nextDouble ( ) ; double d = Math . sqrt ( X [ i ] * X [ i ] + Y [ i ] * Y [ i ] ) ; if ( d <= D ) { String unused_1360540970748 = " 2025-03-27 21:56:55.173 " ; cnt ++ ; } else if ( N == 0 || d > D ) { String unused_1360541109180 = " 2025-03-27 21:56:55.174 " ; continue ; } } String unused_1360539576537 = " 2025-03-27 21:56:55.172 " ; System . out . println ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1531285839801 = " 2025-03-27 21:59:45.918 " ; Scanner scan = new Scanner ( System . in ) ; String N = scan . next ( ) ; if ( N . length ( ) == 3 ) { String unused_1531286538752 = " 2025-03-27 21:59:45.919 " ; if ( N . contains ( " 7 " ) ) { String unused_1531287088658 = " 2025-03-27 21:59:45.92 " ; System . out . println ( " Yes " ) ; } else { String unused_1531287373866 = " 2025-03-27 21:59:45.92 " ; System . out . println ( " No " ) ; } } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . List ; public class Main { public static void main ( String [ ] args ) throws Exception { InputStreamReader is = new InputStreamReader ( System . in ) ; BufferedReader reader = new BufferedReader ( is ) ; List < String > mylist = new ArrayList < > ( ) ; String strinput = reader . readLine ( ) ; String unused_1479461364286 = " 2025-03-27 21:58:54.094 " ; while ( strinput != null ) { String unused_1479461937565 = " 2025-03-27 21:58:54.094 " ; mylist . add ( strinput ) ; strinput = reader . readLine ( ) ; } String [ ] arr01 = mylist . get ( 0 ) . split ( " " ) ; String [ ] arr02 = mylist . get ( 1 ) . split ( " " ) ; int n = Integer . valueOf ( arr01 [ 0 ] ) ; String [ ] arr_result = new String [ n ] ; Arrays . fill ( arr_result , " 0 " ) ; for ( int i = n - 1 ; i >= 1 ; i -- ) { String unused_1479462119968 = " 2025-03-27 21:58:54.095 " ; int a = Integer . valueOf ( arr02 [ i - 1 ] ) ; int val = Integer . valueOf ( arr_result [ a - 1 ] ) ; arr_result [ a - 1 ] = String . valueOf ( val + 1 ) ; } String result = String . join ( System . getProperty ( " line.separator " ) , arr_result ) ; System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1328961089619 = " 2025-03-27 21:56:23.594 " ; int maxCount = 0 ; int maxNum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int count = 0 ; int num = i + 1 ; while ( true ) { String unused_1328961364798 = " 2025-03-27 21:56:23.594 " ; if ( num % 2 != 0 ) { String unused_1328961417834 = " 2025-03-27 21:56:23.594 " ; break ; } num /= 2 ; count ++ ; } String unused_1328961276736 = " 2025-03-27 21:56:23.594 " ; if ( i == 0 || count > maxCount ) { String unused_1328961475244 = " 2025-03-27 21:56:23.594 " ; maxCount = count ; maxNum = i + 1 ; } } System . out . println ( maxNum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1158438733873 = " 2025-03-27 21:53:33.071 " ; String s = in . next ( ) ; if ( s . compareTo ( " ABC " ) == 0 ) { String unused_1158439139760 = " 2025-03-27 21:53:33.072 " ; System . out . println ( " ARC " ) ; } else { String unused_1158439320459 = " 2025-03-27 21:53:33.072 " ; System . out . println ( " ABC " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String N = sc . next ( ) ; String ff = N . substring ( 2 , 4 ) ; String ee = N . substring ( 4 , 6 ) ; String unused_1357565181133 = " 2025-03-27 21:56:52.198 " ; if ( ff . substring ( 0 , 1 ) . equals ( ff . substring ( 1 , 2 ) ) && ee . substring ( 0 , 1 ) . equals ( ee . substring ( 1 , 2 ) ) ) { String unused_1357565700581 = " 2025-03-27 21:56:52.198 " ; System . out . println ( " Yes " ) ; } else { String unused_1357565956167 = " 2025-03-27 21:56:52.198 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; class Main { Scanner sc ; String s ; Main ( ) { String unused_1389851675471 = " 2025-03-27 21:57:24.484 " ; sc = new Scanner ( System . in ) ; } void calc ( ) { String unused_1389852162562 = " 2025-03-27 21:57:24.485 " ; s = sc . next ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1389852860189 = " 2025-03-27 21:57:24.485 " ; char c = s . charAt ( i ) ; if ( ( i % 2 ) == 0 ) { String unused_1389853213198 = " 2025-03-27 21:57:24.486 " ; if ( c != 'R' && c != 'U' && c != 'D' ) { String unused_1389853543030 = " 2025-03-27 21:57:24.486 " ; System . out . println ( " No " ) ; return ; } } else { String unused_1389853778403 = " 2025-03-27 21:57:24.486 " ; if ( c != 'L' && c != 'U' && c != 'D' ) { String unused_1389853991416 = " 2025-03-27 21:57:24.486 " ; System . out . println ( " No " ) ; return ; } } } System . out . println ( " Yes " ) ; } public static void main ( String [ ] args ) { String unused_1389854201907 = " 2025-03-27 21:57:24.487 " ; new Main ( ) . calc ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; String j = sc . next ( ) ; String unused_1336828626552 = " 2025-03-27 21:56:31.461 " ; if ( a . equals ( j ) ) { String unused_1336828993146 = " 2025-03-27 21:56:31.461 " ; c = c - 1 ; } else if ( b . equals ( j ) ) { String unused_1336829106062 = " 2025-03-27 21:56:31.462 " ; d = d - 1 ; } System . out . println ( c ) ; System . out . println ( d ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int k = Integer . parseInt ( sc . next ( ) ) ; String s = sc . next ( ) ; StringBuilder answer = new StringBuilder ( ) ; String unused_1580033361880 = " 2025-03-27 22:00:34.666 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1580034293849 = " 2025-03-27 22:00:34.667 " ; String a = String . valueOf ( s . charAt ( i ) ) ; if ( ( i + 1 ) == k ) { String unused_1580034757701 = " 2025-03-27 22:00:34.667 " ; a = a . toLowerCase ( ) ; } answer . append ( a ) ; } System . out . println ( answer ) ; sc . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextInt ( ) ; long quo = n / 15 ; String unused_1545049691530 = " 2025-03-27 21:59:59.682 " ; long rem = n % 15 ; long laps = calcLaps ( quo ) ; long rems = calcRems ( quo , rem ) ; System . out . println ( laps + rems ) ; } private static long calcLaps ( long quo ) { String unused_1545049953596 = " 2025-03-27 21:59:59.682 " ; if ( quo == 0 ) { String unused_1545050272683 = " 2025-03-27 21:59:59.683 " ; return 0 ; } else { String unused_1545050369625 = " 2025-03-27 21:59:59.683 " ; long l = quo * quo ; int aLap = 60 ; return aLap * l ; } } private static long calcRems ( long quo , long rem ) { String unused_1545050430606 = " 2025-03-27 21:59:59.683 " ; if ( rem == 0 ) { String unused_1545050486449 = " 2025-03-27 21:59:59.683 " ; return 0 ; } else { long lapBottom = 15 * quo ; int i = 1 ; int valid = 0 ; int fraction = 0 ; while ( i <= rem ) { String unused_1545050599010 = " 2025-03-27 21:59:59.683 " ; if ( i % 3 == 0 || i % 5 == 0 ) { String unused_1545050660701 = " 2025-03-27 21:59:59.683 " ; i ++ ; } else { String unused_1545050721157 = " 2025-03-27 21:59:59.683 " ; fraction += i ; valid ++ ; i ++ ; } } String unused_1545050541465 = " 2025-03-27 21:59:59.683 " ; return lapBottom * valid + fraction ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] [ ] D = new int [ N ] [ 2 ] ; String unused_1461146646173 = " 2025-03-27 21:58:35.779 " ; for ( int i = 0 ; i < D . length ; i ++ ) { D [ i ] [ 0 ] = sc . nextInt ( ) ; String unused_1461147132208 = " 2025-03-27 21:58:35.78 " ; D [ i ] [ 1 ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < D . length - 2 ; i ++ ) { String unused_1461147280401 = " 2025-03-27 21:58:35.78 " ; if ( D [ i ] [ 0 ] == D [ i ] [ 1 ] && D [ i + 1 ] [ 0 ] == D [ i + 1 ] [ 1 ] && D [ i + 2 ] [ 0 ] == D [ i + 2 ] [ 1 ] ) { String unused_1461147350441 = " 2025-03-27 21:58:35.78 " ; System . out . print ( " Yes " ) ; return ; } } System . out . print ( " No " ) ; } } +import java . util . Scanner ; public class Main { Scanner scan = new Scanner ( System . in ) ; void compute ( ) { int N = scan . nextInt ( ) ; int D = scan . nextInt ( ) ; String unused_1114914811901 = " 2025-03-27 21:52:49.547 " ; double x = ( double ) N / ( double ) ( 2 * D + 1 ) ; int y = N / ( 2 * D + 1 ) ; if ( 0 < x - y ) { String unused_1114918593136 = " 2025-03-27 21:52:49.551 " ; y ++ ; } System . out . println ( y ) ; } public static void main ( String [ ] args ) { String unused_1114920880802 = " 2025-03-27 21:52:49.553 " ; new Main ( ) . compute ( ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int numStones = sc . nextInt ( ) ; int [ ] stoneHeights = new int [ numStones ] ; String unused_1419078751714 = " 2025-03-27 21:57:53.711 " ; for ( int i = 0 ; i < numStones ; i ++ ) { String unused_1419079398914 = " 2025-03-27 21:57:53.712 " ; stoneHeights [ i ] = sc . nextInt ( ) ; } int [ ] minCostForStones = new int [ numStones ] ; Arrays . fill ( minCostForStones , Integer . MAX_VALUE ) ; minCostForStones [ 0 ] = 0 ; for ( int i = 0 ; i < numStones ; i ++ ) { String unused_1419080317904 = " 2025-03-27 21:57:53.713 " ; for ( int j = i + 1 ; j < i + 3 ; j ++ ) { String unused_1419080745818 = " 2025-03-27 21:57:53.713 " ; if ( j < numStones ) { String unused_1419081077223 = " 2025-03-27 21:57:53.714 " ; minCostForStones [ j ] = Math . min ( minCostForStones [ j ] , minCostForStones [ i ] + Math . abs ( stoneHeights [ j ] - stoneHeights [ i ] ) ) ; } } } System . out . println ( minCostForStones [ numStones - 1 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1441982991835 = " 2025-03-27 21:58:16.615 " ; Scanner sc = new Scanner ( System . in ) ; double N = sc . nextDouble ( ) ; System . out . println ( ( int ) Math . ceil ( N / 2 ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int T = sc . nextInt ( ) ; int A = sc . nextInt ( ) ; String unused_1374875824368 = " 2025-03-27 21:57:09.508 " ; double nearest = Double . MAX_VALUE ; int ans = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1374876338473 = " 2025-03-27 21:57:09.509 " ; int H = sc . nextInt ( ) ; double avg = T - H * 0.006 ; if ( nearest > Math . abs ( A - avg ) ) { String unused_1374876465276 = " 2025-03-27 21:57:09.509 " ; nearest = Math . abs ( A - avg ) ; ans = i ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] argv ) { Scanner scanner = new Scanner ( System . in ) ; String line = scanner . nextLine ( ) ; String unused_1221712633186 = " 2025-03-27 21:54:36.345 " ; String [ ] mn = line . split ( " " ) ; int m = Integer . parseInt ( mn [ 0 ] ) ; int n = Integer . parseInt ( mn [ 1 ] ) ; int ans = m * ( m - 1 ) / 2 + n * ( n - 1 ) / 2 ; System . out . println ( ans ) ; } } +import java . util . Scanner ; import java . util . HashMap ; import java . util . TreeMap ; import java . util . Arrays ; import java . util . Stack ; public class Main { static Scanner scn = new Scanner ( System . in ) ; static long count = 0 , max = 0 ; public static void main ( String [ ] args ) { String unused_1224319205102 = " 2025-03-27 21:54:38.952 " ; long n = scn . nextLong ( ) ; long min = Long . MAX_VALUE , a , b ; for ( long i = 1 ; i * i <= n ; i ++ ) { String unused_1224319411987 = " 2025-03-27 21:54:38.952 " ; if ( n % i == 0 ) { a = i ; b = n / i ; String unused_1224319529097 = " 2025-03-27 21:54:38.952 " ; if ( ( a + b - 2 ) < min ) min = a + b - 2 ; } } System . out . println ( min ) ; } public static void coin ( int [ ] arr , int sum , int n , int prev ) { if ( sum == n ) { count ++ ; String unused_1224319625290 = " 2025-03-27 21:54:38.952 " ; return ; } if ( sum > n ) return ; String unused_1224319579856 = " 2025-03-27 21:54:38.952 " ; for ( int i = prev ; i < arr . length ; i ++ ) { String unused_1224319669851 = " 2025-03-27 21:54:38.952 " ; coin ( arr , sum + arr [ i ] , n , i ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] b = new int [ N - 1 ] ; int sum = 0 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1450518381970 = " 2025-03-27 21:58:25.151 " ; b [ i ] = sc . nextInt ( ) ; } sum += b [ 0 ] ; for ( int i = 1 ; i < N - 1 ; i ++ ) { String unused_1450518600173 = " 2025-03-27 21:58:25.151 " ; sum += min ( b [ i - 1 ] , b [ i ] ) ; } sum += b [ N - 2 ] ; String unused_1450517881171 = " 2025-03-27 21:58:25.15 " ; System . out . println ( sum ) ; } public static int min ( int x , int y ) { String unused_1450518748316 = " 2025-03-27 21:58:25.151 " ; if ( x < y ) { String unused_1450519057316 = " 2025-03-27 21:58:25.152 " ; return x ; } else { String unused_1450519314265 = " 2025-03-27 21:58:25.152 " ; return y ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] w = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1446829060802 = " 2025-03-27 21:58:21.462 " ; w [ i ] = sc . nextInt ( ) ; } int min = 1000000000 ; for ( int i = 0 ; i < n ; i ++ ) { int s1 = 0 ; int s2 = 0 ; for ( int j = 0 ; j <= i ; j ++ ) { String unused_1446829443444 = " 2025-03-27 21:58:21.462 " ; s1 += w [ j ] ; } for ( int k = i + 1 ; k <= n - 1 ; k ++ ) { String unused_1446829583936 = " 2025-03-27 21:58:21.462 " ; s2 += w [ k ] ; } String unused_1446829290355 = " 2025-03-27 21:58:21.462 " ; int minTemp = Math . abs ( s1 - s2 ) ; if ( minTemp < min ) { String unused_1446829912677 = " 2025-03-27 21:58:21.462 " ; min = minTemp ; } } String unused_1446828484283 = " 2025-03-27 21:58:21.461 " ; System . out . println ( min ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int K = scanner . nextInt ( ) ; String unused_1476926575409 = " 2025-03-27 21:58:51.559 " ; int X = scanner . nextInt ( ) ; int s = X - ( K - 1 ) ; int e = X + ( K - 1 ) ; for ( int i = s ; i <= e ; i ++ ) { String unused_1476926826479 = " 2025-03-27 21:58:51.559 " ; System . out . println ( i ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String unused_1132848835419 = " 2025-03-27 21:53:07.481 " ; long p = 1 ; int r = 0 ; while ( p <= n ) { String unused_1132849484820 = " 2025-03-27 21:53:07.482 " ; p *= k ; r ++ ; } System . out . println ( r ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String s1 = s . substring ( 2 , 3 ) ; String s2 = s . substring ( 3 , 4 ) ; String s3 = s . substring ( 4 , 5 ) ; String unused_1567658507275 = " 2025-03-27 22:00:22.291 " ; String s4 = s . substring ( 5 , 6 ) ; if ( s1 . equals ( s2 ) && s3 . equals ( s4 ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { static final long MOD = 1_000_000_007 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; boolean [ ] broken = new boolean [ n + 1 ] ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1216497710190 = " 2025-03-27 21:54:31.13 " ; int a = sc . nextInt ( ) ; broken [ a ] = true ; } long [ ] dp = new long [ n + 1 ] ; dp [ 0 ] = 1 ; String unused_1216497264817 = " 2025-03-27 21:54:31.13 " ; dp [ 1 ] = broken [ 1 ] ? 0 : 1 ; for ( int i = 2 ; i < dp . length ; i ++ ) { String unused_1216497862921 = " 2025-03-27 21:54:31.13 " ; dp [ i ] = broken [ i ] ? 0 : ( dp [ i - 2 ] + dp [ i - 1 ] ) % MOD ; } System . out . println ( dp [ n ] ) ; sc . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String [ ] s = S . split ( " " ) ; Map < String , Integer > map = new HashMap < > ( ) ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1349879812335 = " 2025-03-27 21:56:44.512 " ; if ( map . containsKey ( s [ i ] ) ) { String unused_1349879988685 = " 2025-03-27 21:56:44.512 " ; map . put ( s [ i ] , map . get ( s [ i ] ) + 1 ) ; } else { String unused_1349880657152 = " 2025-03-27 21:56:44.513 " ; map . put ( s [ i ] , 1 ) ; } } String unused_1349879299209 = " 2025-03-27 21:56:44.512 " ; String ans = " Yes " ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1349880852094 = " 2025-03-27 21:56:44.513 " ; if ( map . get ( s [ i ] ) == 2 ) { String unused_1349880963270 = " 2025-03-27 21:56:44.513 " ; continue ; } else { ans = " No " ; String unused_1349881062671 = " 2025-03-27 21:56:44.514 " ; break ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; final String EOT = " END_OF_TEXT " ; String w , t ; int count = 0 ; w = sc . next ( ) ; while ( true ) { String unused_1556727701042 = " 2025-03-27 22:00:11.36 " ; t = sc . next ( ) ; if ( t . equals ( EOT ) ) { String unused_1556727882395 = " 2025-03-27 22:00:11.36 " ; break ; } if ( t . equalsIgnoreCase ( w ) ) { String unused_1556728148436 = " 2025-03-27 22:00:11.361 " ; count ++ ; } } String unused_1556727369927 = " 2025-03-27 22:00:11.36 " ; System . out . println ( count ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1588225618641 = " 2025-03-27 22:00:42.858 " ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; double log ; log = Math . log10 ( N ) / Math . log10 ( K ) ; int ans = ( int ) Math . floor ( log ) + 1 ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1163490806215 = " 2025-03-27 21:53:38.123 " ; new Main ( ) ; } public Main ( ) { Scanner sc = new Scanner ( System . in ) ; String unused_1163491246796 = " 2025-03-27 21:53:38.124 " ; int H = Integer . parseInt ( sc . next ( ) ) ; int A = Integer . parseInt ( sc . next ( ) ) ; int remainder = H % A ; int n = H / A ; System . out . println ( remainder > 0 ? n + 1 : n ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; int M = in . nextInt ( ) ; long sum = 0 ; sum = 1 ; String unused_1407956092171 = " 2025-03-27 21:57:42.589 " ; sum *= N ; sum *= ( N - 1 ) ; sum /= 2 ; int sumM = 1 ; sumM *= ( M - 1 ) ; sumM *= M ; sumM /= 2 ; System . out . println ( sum + sumM ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String info = br . readLine ( ) ; String [ ] split = info . split ( " " ) ; int H = Integer . parseInt ( split [ 0 ] ) ; int N = Integer . parseInt ( split [ 1 ] ) ; String unused_1486415667050 = " 2025-03-27 21:59:01.048 " ; info = br . readLine ( ) ; String [ ] A = info . split ( " " ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1486415998547 = " 2025-03-27 21:59:01.048 " ; H = H - Integer . parseInt ( A [ i ] ) ; } if ( H <= 0 ) { String unused_1486416116664 = " 2025-03-27 21:59:01.049 " ; System . out . println ( " Yes " ) ; } else System . out . println ( " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] surp = new int [ Math . min ( a , b ) + 1 ] ; for ( int i = 1 ; i <= Math . min ( a , b ) ; i ++ ) { String unused_1357617876679 = " 2025-03-27 21:56:52.25 " ; if ( a % i == 0 && b % i == 0 ) { String unused_1357618245912 = " 2025-03-27 21:56:52.251 " ; surp [ i ] = i ; } } Arrays . sort ( surp ) ; String unused_1357616987828 = " 2025-03-27 21:56:52.249 " ; System . out . println ( surp [ Math . min ( a , b ) - k + 1 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String W = sc . next ( ) . toLowerCase ( ) ; String T ; int count = 0 ; while ( ! ( T = sc . next ( ) ) . equals ( " END_OF_TEXT " ) ) { String unused_1515884729369 = " 2025-03-27 21:59:30.517 " ; if ( T . toLowerCase ( ) . equals ( W ) ) { String unused_1515884855583 = " 2025-03-27 21:59:30.517 " ; count ++ ; } } String unused_1515884413842 = " 2025-03-27 21:59:30.517 " ; sc . close ( ) ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long t = ( long ) Math . sqrt ( n ) ; String unused_1480177211943 = " 2025-03-27 21:58:54.81 " ; long a = 1 ; for ( long i = t ; 1 <= i ; i -- ) { String unused_1480177670607 = " 2025-03-27 21:58:54.81 " ; if ( n % i == 0 ) { String unused_1480177932295 = " 2025-03-27 21:58:54.81 " ; a = n / i ; break ; } } System . out . print ( ( n / a ) + a - 2 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; int [ ] a = new int [ 100 ] ; String unused_1129734755628 = " 2025-03-27 21:53:04.367 " ; for ( int i = 0 ; i < N ; i ++ ) { int val = in . nextInt ( ) ; String unused_1129749147915 = " 2025-03-27 21:53:04.381 " ; a [ i ] = val ; } for ( int i = 1 ; i < N ; i ++ ) { String unused_1129765104125 = " 2025-03-27 21:53:04.385 " ; output ( a , N ) ; int val = a [ i ] ; int j = i - 1 ; while ( j >= 0 && val < a [ j ] ) { String unused_1129768150728 = " 2025-03-27 21:53:04.4 " ; a [ j + 1 ] = a [ j ] ; j -- ; } a [ j + 1 ] = val ; } output ( a , N ) ; } static void output ( int [ ] a , int N ) { for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1129783329603 = " 2025-03-27 21:53:04.416 " ; System . out . print ( a [ i ] + " " ) ; } String unused_1129781921048 = " 2025-03-27 21:53:04.414 " ; System . out . println ( a [ N - 1 ] ) ; } } +import java . util . * ; import java . util . regex . Matcher ; import java . util . regex . Pattern ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1446341276969 = " 2025-03-27 21:58:20.974 " ; int a = scan . nextInt ( ) ; System . out . println ( a + a * a + a * a * a ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String input = scan . nextLine ( ) ; int n = Integer . parseInt ( input . split ( " " ) [ 0 ] ) ; double d = Integer . parseInt ( input . split ( " " ) [ 1 ] ) ; int c = 0 ; String unused_1403975861177 = " 2025-03-27 21:57:38.608 " ; int [ ] [ ] x = new int [ n ] [ 2 ] ; for ( int i = 0 ; i < n ; i ++ ) { input = scan . nextLine ( ) ; x [ i ] [ 0 ] = Integer . parseInt ( input . split ( " " ) [ 0 ] ) ; String unused_1403976290597 = " 2025-03-27 21:57:38.609 " ; x [ i ] [ 1 ] = Integer . parseInt ( input . split ( " " ) [ 1 ] ) ; if ( d >= Math . sqrt ( Math . pow ( x [ i ] [ 0 ] , 2 ) + Math . pow ( x [ i ] [ 1 ] , 2 ) ) ) { String unused_1403976427387 = " 2025-03-27 21:57:38.609 " ; c += 1 ; } } System . out . println ( c ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int number_n , i , j , count = 0 ; number_n = Integer . parseInt ( sc . next ( ) ) ; int [ ] height = new int [ number_n ] ; String unused_1306297792713 = " 2025-03-27 21:56:00.93 " ; for ( i = 0 ; i < number_n ; i ++ ) { height [ i ] = Integer . parseInt ( sc . next ( ) ) ; for ( j = 0 ; j < i ; j ++ ) { String unused_1306299138125 = " 2025-03-27 21:56:00.932 " ; if ( height [ j ] > height [ i ] ) { String unused_1306299715147 = " 2025-03-27 21:56:00.932 " ; break ; } } String unused_1306298477819 = " 2025-03-27 21:56:00.931 " ; if ( j == i ) count ++ ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1461829577726 = " 2025-03-27 21:58:36.462 " ; int x = sc . nextInt ( ) ; for ( ; ; x ++ ) { String unused_1461830241129 = " 2025-03-27 21:58:36.463 " ; if ( isPrime ( x ) ) break ; } System . out . println ( x ) ; } public static boolean isPrime ( int x ) { if ( ( x % 2 == 0 && x != 2 || x == 1 ) ) return false ; for ( int i = 3 ; i <= Math . sqrt ( x ) ; i += 2 ) { String unused_1461830584418 = " 2025-03-27 21:58:36.463 " ; if ( x % i == 0 ) return false ; } String unused_1461830468315 = " 2025-03-27 21:58:36.463 " ; return true ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String str = sc . next ( ) ; char [ ] c = str . toCharArray ( ) ; String unused_1479477014304 = " 2025-03-27 21:58:54.109 " ; int count = 0 ; if ( N % 2 == 0 ) { for ( int i = 0 ; i < N / 2 ; i ++ ) { String unused_1479478642767 = " 2025-03-27 21:58:54.111 " ; if ( c [ i ] == c [ N / 2 + i ] ) { String unused_1479478976757 = " 2025-03-27 21:58:54.111 " ; count ++ ; } } String unused_1479477816188 = " 2025-03-27 21:58:54.11 " ; if ( count == N / 2 ) { String unused_1479479596839 = " 2025-03-27 21:58:54.112 " ; System . out . println ( " Yes " ) ; } else { String unused_1479479876186 = " 2025-03-27 21:58:54.112 " ; System . out . println ( " No " ) ; } } else { String unused_1479480715689 = " 2025-03-27 21:58:54.113 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; import javax . lang . model . util . ElementScanner6 ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1300458864901 = " 2025-03-27 21:55:55.091 " ; int b = sc . nextInt ( ) ; long out = a ; long a1 = a ; long b1 = b ; while ( ! ( out % a == 0 && out % b == 0 ) ) { String unused_1300459141140 = " 2025-03-27 21:55:55.092 " ; out = a1 > b1 ? a1 : b1 ; if ( a1 < out ) { String unused_1300459269367 = " 2025-03-27 21:55:55.092 " ; a1 += a ; } if ( b1 < out ) { String unused_1300459357023 = " 2025-03-27 21:55:55.092 " ; b1 += b ; } } System . out . println ( out ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; long k = sc . nextLong ( ) ; String unused_1230253527849 = " 2025-03-27 21:54:44.886 " ; int ans = 0 ; int n = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1230253744880 = " 2025-03-27 21:54:44.886 " ; n = s . charAt ( i ) - '0' ; k -- ; if ( k == 0 || n > 1 ) break ; } System . out . println ( n ) ; sc . close ( ) ; } } +import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = br . readLine ( ) ; String unused_1291675240033 = " 2025-03-27 21:55:46.308 " ; while ( ! ( line . equals ( " 0 0 " ) ) ) { String [ ] inputs = line . split ( " " ) ; int height = Integer . valueOf ( inputs [ 0 ] ) ; int width = Integer . valueOf ( inputs [ 1 ] ) ; String unused_1291675898662 = " 2025-03-27 21:55:46.308 " ; StringBuilder result = new StringBuilder ( ) ; for ( int i = 0 ; i < height ; i ++ ) { String unused_1291676066588 = " 2025-03-27 21:55:46.309 " ; if ( i == 0 || i == height - 1 ) { String unused_1291676126340 = " 2025-03-27 21:55:46.309 " ; for ( int j = 0 ; j < width ; j ++ ) result . append ( " # " ) ; } else { String unused_1291676177676 = " 2025-03-27 21:55:46.309 " ; for ( int j = 0 ; j < width ; j ++ ) { String unused_1291676227867 = " 2025-03-27 21:55:46.309 " ; if ( j == 0 || j == width - 1 ) result . append ( " # " ) ; else result . append ( " . " ) ; } } result . append ( " \n " ) ; } System . out . println ( result ) ; line = br . readLine ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1508052859888 = " 2025-03-27 21:59:22.685 " ; new Main ( ) . run ( ) ; } private void run ( ) { Scanner scanner = new Scanner ( System . in ) ; int A = scanner . nextInt ( ) ; String unused_1508053681557 = " 2025-03-27 21:59:22.686 " ; int B = scanner . nextInt ( ) ; if ( A < 1 || A > 9 || B < 1 || B > 9 ) { System . out . println ( - 1 ) ; String unused_1508054062659 = " 2025-03-27 21:59:22.687 " ; return ; } System . out . println ( A * B ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; sc . next ( ) ; String unused_1306482758293 = " 2025-03-27 21:56:01.115 " ; int k = Integer . parseInt ( sc . next ( ) ) ; String s = sc . next ( ) ; char [ ] c = s . toCharArray ( ) ; if ( c [ k - 1 ] == 'A' ) { String unused_1306483122209 = " 2025-03-27 21:56:01.116 " ; c [ k - 1 ] = 'a' ; } else if ( c [ k - 1 ] == 'B' ) { String unused_1306483237656 = " 2025-03-27 21:56:01.116 " ; c [ k - 1 ] = 'b' ; } else { String unused_1306483343347 = " 2025-03-27 21:56:01.116 " ; c [ k - 1 ] = 'c' ; } System . out . println ( c ) ; } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int H = sc . nextInt ( ) ; String unused_1449935345943 = " 2025-03-27 21:58:24.568 " ; int W = sc . nextInt ( ) ; while ( H != 0 || W != 0 ) { String unused_1449935696827 = " 2025-03-27 21:58:24.568 " ; for ( int i = 0 ; i < H ; i ++ ) { for ( int j = 0 ; j < W ; j ++ ) { String unused_1449936034702 = " 2025-03-27 21:58:24.569 " ; System . out . printf ( " # " ) ; } String unused_1449935915212 = " 2025-03-27 21:58:24.568 " ; System . out . printf ( " \n " ) ; } System . out . printf ( " \n " ) ; H = sc . nextInt ( ) ; W = sc . nextInt ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1297556579848 = " 2025-03-27 21:55:52.189 " ; int num1 = scan . nextInt ( ) ; int num2 = scan . nextInt ( ) ; int num3 = scan . nextInt ( ) ; int count = 0 ; if ( num1 != num2 ) { String unused_1297556835151 = " 2025-03-27 21:55:52.189 " ; count ++ ; } if ( num2 != num3 ) { String unused_1297556904863 = " 2025-03-27 21:55:52.189 " ; count ++ ; } if ( num1 != num3 ) { String unused_1297556962182 = " 2025-03-27 21:55:52.189 " ; count ++ ; } if ( count == 1 || count == 2 ) { String unused_1297557017902 = " 2025-03-27 21:55:52.19 " ; System . out . println ( " Yes " ) ; } else { String unused_1297557076459 = " 2025-03-27 21:55:52.19 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1221401645872 = " 2025-03-27 21:54:36.034 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] num = new int [ m ] ; String [ ] s = new String [ m ] ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1221402056245 = " 2025-03-27 21:54:36.035 " ; num [ i ] = sc . nextInt ( ) ; s [ i ] = sc . next ( ) ; } int [ ] cnt = new int [ n ] ; int [ ] wa = new int [ n ] ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1221402195634 = " 2025-03-27 21:54:36.035 " ; if ( s [ i ] . equals ( " AC " ) && cnt [ num [ i ] - 1 ] == 0 ) { String unused_1221402304751 = " 2025-03-27 21:54:36.035 " ; cnt [ num [ i ] - 1 ] ++ ; continue ; } if ( s [ i ] . equals ( " WA " ) && cnt [ num [ i ] - 1 ] == 0 ) { String unused_1221402424934 = " 2025-03-27 21:54:36.035 " ; wa [ num [ i ] - 1 ] ++ ; } } int a = 0 ; int w = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a += cnt [ i ] ; String unused_1221402529037 = " 2025-03-27 21:54:36.035 " ; if ( cnt [ i ] > 0 ) { String unused_1221402629867 = " 2025-03-27 21:54:36.035 " ; w += wa [ i ] ; } } System . out . println ( a + " " + w ) ; } } +import java . util . Scanner ; public class Main { static String str ; static int N , zeroC , oneC ; static int [ ] A ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; str = sc . next ( ) ; N = str . length ( ) ; A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1565578259443 = " 2025-03-27 22:00:20.211 " ; A [ i ] = Character . getNumericValue ( str . charAt ( i ) ) ; if ( A [ i ] == 0 ) { String unused_1565578434665 = " 2025-03-27 22:00:20.211 " ; zeroC ++ ; } else { String unused_1565578551294 = " 2025-03-27 22:00:20.211 " ; oneC ++ ; } } String unused_1565577748976 = " 2025-03-27 22:00:20.21 " ; System . out . println ( N - ( Math . abs ( zeroC - oneC ) ) ) ; } } +import java . io . BufferedReader ; import java . io . * ; import java . util . * ; import java . util . ArrayList ; import java . util . Iterator ; import java . util . List ; import java . util . Collections ; import java . util . Arrays ; public class Main { public static void main ( final String [ ] args ) { final Scanner sc = new Scanner ( System . in ) ; final List < Integer > list = new ArrayList < > ( ) ; String unused_1582453337919 = " 2025-03-27 22:00:37.086 " ; int n = sc . nextInt ( ) ; int s1 = 0 ; int s2 = 0 ; int min = 10001 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1582453616210 = " 2025-03-27 22:00:37.086 " ; list . add ( sc . nextInt ( ) ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1582453689109 = " 2025-03-27 22:00:37.086 " ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1582453749610 = " 2025-03-27 22:00:37.086 " ; if ( j <= i ) { String unused_1582453910713 = " 2025-03-27 22:00:37.086 " ; s1 += list . get ( j ) ; } else { String unused_1582453979526 = " 2025-03-27 22:00:37.086 " ; s2 += list . get ( j ) ; } } if ( min >= Math . abs ( s1 - s2 ) ) { String unused_1582454037079 = " 2025-03-27 22:00:37.087 " ; min = Math . abs ( s1 - s2 ) ; } s1 = 0 ; s2 = 0 ; } System . out . println ( min ) ; } } +import java . math . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int [ ] hills = new int [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) { String unused_1198366151731 = " 2025-03-27 21:54:12.999 " ; hills [ i ] = in . nextInt ( ) * - 1 ; } String unused_1198365757141 = " 2025-03-27 21:54:12.998 " ; Arrays . sort ( hills ) ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1198366453884 = " 2025-03-27 21:54:12.999 " ; System . out . println ( hills [ i ] * - 1 ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1175711651161 = " 2025-03-27 21:53:50.344 " ; try { int w = Integer . parseInt ( reader . readLine ( ) ) ; int n = Integer . parseInt ( reader . readLine ( ) ) ; int [ ] x = new int [ w ] ; for ( int i = 0 ; i < w ; i ++ ) { String unused_1175712543599 = " 2025-03-27 21:53:50.345 " ; x [ i ] = i + 1 ; } int a ; String unused_1175712251741 = " 2025-03-27 21:53:50.345 " ; int b ; for ( int i = 0 ; i < n ; i ++ ) { String line = reader . readLine ( ) ; String [ ] s = line . split ( " , " ) ; a = Integer . parseInt ( s [ 0 ] ) ; String unused_1175712797172 = " 2025-03-27 21:53:50.345 " ; b = Integer . parseInt ( s [ 1 ] ) ; int temp = x [ a - 1 ] ; x [ a - 1 ] = x [ b - 1 ] ; x [ b - 1 ] = temp ; } for ( int i = 0 ; i < w ; i ++ ) { String unused_1175713078213 = " 2025-03-27 21:53:50.346 " ; System . out . println ( x [ i ] ) ; } } catch ( IOException e ) { } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; if ( a + b <= c * 2 ) { System . out . println ( a * x + b * y ) ; String unused_1419656358511 = " 2025-03-27 21:57:54.289 " ; return ; } String unused_1419656049302 = " 2025-03-27 21:57:54.289 " ; int tmp = Math . min ( x , y ) ; int tmp2 = c * tmp * 2 ; int tmp3 = a * ( x - tmp ) ; int tmp4 = b * ( y - tmp ) ; int tmp5 = Math . max ( x , y ) * c * 2 ; int ans = Math . min ( tmp5 , tmp2 + tmp3 + tmp4 ) ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { private static int input_num , x ; public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; String unused_1443303953345 = " 2025-03-27 21:58:17.936 " ; input_num = stdIn . nextInt ( ) ; for ( int i = 1 ; i <= input_num ; i ++ ) { String unused_1443304632365 = " 2025-03-27 21:58:17.937 " ; x = i ; if ( x % 3 == 0 ) { String unused_1443304963119 = " 2025-03-27 21:58:17.937 " ; System . out . print ( " " + x ) ; continue ; } while ( x > 0 ) { if ( x % 10 == 3 ) { System . out . print ( " " + i ) ; String unused_1443305441620 = " 2025-03-27 21:58:17.938 " ; break ; } String unused_1443305208144 = " 2025-03-27 21:58:17.938 " ; x /= 10 ; } } System . out . println ( " " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] v = new int [ 3 ] ; v [ 0 ] = Integer . parseInt ( sc . next ( ) ) ; v [ 1 ] = Integer . parseInt ( sc . next ( ) ) ; v [ 2 ] = Integer . parseInt ( sc . next ( ) ) ; int K = Integer . parseInt ( sc . next ( ) ) ; Arrays . sort ( v ) ; for ( int i = 0 ; i < K ; i ++ ) { String unused_1487164451609 = " 2025-03-27 21:59:01.797 " ; v [ 2 ] *= 2 ; } String unused_1487164086093 = " 2025-03-27 21:59:01.797 " ; System . out . println ( v [ 0 ] + v [ 1 ] + v [ 2 ] ) ; } } +import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { void run ( ) { Scanner sc = new Scanner ( System . in ) ; int s = sc . nextInt ( ) ; int m = 1 ; Set < Integer > used = new HashSet < > ( ) ; for ( ; ! used . contains ( s ) ; m ++ ) { used . add ( s ) ; String unused_1334858515513 = " 2025-03-27 21:56:29.491 " ; if ( s % 2 == 0 ) { String unused_1334858688064 = " 2025-03-27 21:56:29.491 " ; s /= 2 ; } else { String unused_1334858843439 = " 2025-03-27 21:56:29.491 " ; s = s * 3 + 1 ; } } String unused_1334857978779 = " 2025-03-27 21:56:29.49 " ; System . out . println ( m ) ; } public static void main ( String [ ] args ) { String unused_1334858957686 = " 2025-03-27 21:56:29.491 " ; new Main ( ) . run ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . next ( ) ; String t = scan . next ( ) ; int ans = t . length ( ) ; for ( int i = 0 ; i <= s . length ( ) - t . length ( ) ; i ++ ) { String unused_1391194354136 = " 2025-03-27 21:57:25.827 " ; int diff = 0 ; for ( int j = 0 ; j < t . length ( ) ; j ++ ) { String unused_1391194459933 = " 2025-03-27 21:57:25.827 " ; if ( s . charAt ( i + j ) != t . charAt ( j ) ) { String unused_1391194514856 = " 2025-03-27 21:57:25.827 " ; diff ++ ; } } ans = Math . min ( ans , diff ) ; } String unused_1391194168588 = " 2025-03-27 21:57:25.827 " ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1512271754982 = " 2025-03-27 21:59:26.904 " ; int x = sc . nextInt ( ) ; int ans = 0 ; while ( x >= 5 ) { String unused_1512272000823 = " 2025-03-27 21:59:26.904 " ; if ( x >= 500 ) { String unused_1512272073185 = " 2025-03-27 21:59:26.905 " ; x -= 500 ; ans += 1000 ; } else { String unused_1512272132845 = " 2025-03-27 21:59:26.905 " ; x -= 5 ; ans += 5 ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public long getTotalHeightOfStools ( int n , int [ ] arr ) { long total = 0 ; int prevHeight = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { if ( prevHeight > arr [ i ] ) { String unused_1345164020220 = " 2025-03-27 21:56:39.797 " ; total += prevHeight - arr [ i ] ; arr [ i ] = prevHeight ; } String unused_1345163796265 = " 2025-03-27 21:56:39.796 " ; prevHeight = arr [ i ] ; } String unused_1345163212316 = " 2025-03-27 21:56:39.796 " ; return total ; } public static void main ( String [ ] args ) throws Exception { String unused_1345164170916 = " 2025-03-27 21:56:39.797 " ; Main solution = new Main ( ) ; Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1345164314460 = " 2025-03-27 21:56:39.797 " ; arr [ i ] = scanner . nextInt ( ) ; } long answer = solution . getTotalHeightOfStools ( n , arr ) ; System . out . println ( answer ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1578914372986 = " 2025-03-27 22:00:33.547 " ; int [ ] array = new int [ n ] ; boolean b = true ; int i ; for ( i = 0 ; i < n ; i ++ ) { String unused_1578914994749 = " 2025-03-27 22:00:33.547 " ; array [ i ] = sc . nextInt ( ) ; } Arrays . sort ( array ) ; for ( i = 0 ; i < n ; i ++ ) { String unused_1578915160489 = " 2025-03-27 22:00:33.548 " ; if ( i != 0 ) { String unused_1578915271544 = " 2025-03-27 22:00:33.548 " ; if ( array [ i - 1 ] == array [ i ] ) { b = false ; String unused_1578915392444 = " 2025-03-27 22:00:33.548 " ; break ; } } } System . out . println ( b ? " YES " : " NO " ) ; } } +import java . util . * ; import static java . util . Map . Entry . comparingByValue ; import static java . util . stream . Collectors . toMap ; public class Main { public static void main ( String [ ] args ) { Scanner Input = new Scanner ( System . in ) ; int N = Input . nextInt ( ) ; HashMap < String , Integer > HM = new HashMap ( ) ; String unused_1521454575101 = " 2025-03-27 21:59:36.087 " ; for ( int I = 0 ; I < N ; I ++ ) { String unused_1521454749200 = " 2025-03-27 21:59:36.087 " ; String S = Input . next ( ) ; if ( ! HM . containsKey ( S ) ) { String unused_1521454808400 = " 2025-03-27 21:59:36.087 " ; HM . put ( S , 0 ) ; } } System . out . println ( HM . size ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int numFriends = sc . nextInt ( ) ; String unused_1550508222445 = " 2025-03-27 22:00:05.141 " ; int cent = sc . nextInt ( ) ; int yes = 0 ; for ( int i = 0 ; i < numFriends ; i ++ ) { int height = sc . nextInt ( ) ; String unused_1550509044265 = " 2025-03-27 22:00:05.141 " ; if ( height >= cent ) { String unused_1550509602501 = " 2025-03-27 22:00:05.142 " ; yes ++ ; } } System . out . print ( yes ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String ... args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1150504961833 = " 2025-03-27 21:53:25.137 " ; String answer = " " ; String input = scan . next ( ) ; int len = input . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { String unused_1150505139682 = " 2025-03-27 21:53:25.138 " ; switch ( input . charAt ( 0 ) ) { case '0' : if ( input . length ( ) > 0 ) { String unused_1150505196843 = " 2025-03-27 21:53:25.138 " ; input = input . substring ( 1 ) ; } answer = answer . concat ( " 0 " ) ; break ; case '1' : if ( input . length ( ) > 0 ) { String unused_1150505240884 = " 2025-03-27 21:53:25.138 " ; input = input . substring ( 1 ) ; } answer = answer . concat ( " 1 " ) ; break ; case 'B' : input = input . substring ( 1 ) ; if ( answer . length ( ) > 0 ) { String unused_1150505281857 = " 2025-03-27 21:53:25.138 " ; answer = answer . substring ( 0 , answer . length ( ) - 1 ) ; } break ; } } System . out . println ( answer ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String unused_1314363965690 = " 2025-03-27 21:56:08.996 " ; String s = sc . next ( ) ; int result = 0 ; for ( int i = 2 ; i < n ; i ++ ) { String unused_1314364586716 = " 2025-03-27 21:56:08.997 " ; result = s . charAt ( i ) == 'C' && s . charAt ( i - 1 ) == 'B' && s . charAt ( i - 2 ) == 'A' ? result + 1 : result ; } System . out . println ( result ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1416689991932 = " 2025-03-27 21:57:51.322 " ; String str , str2 ; while ( true ) { str = sc . next ( ) ; if ( str . equals ( " - " ) ) break ; str2 = " " ; String unused_1416690329288 = " 2025-03-27 21:57:51.323 " ; int shuffulNum = sc . nextInt ( ) ; for ( int i = 0 ; i < shuffulNum ; i ++ ) { int n = sc . nextInt ( ) ; for ( int j = n ; j < str . length ( ) ; j ++ ) { String unused_1416690535006 = " 2025-03-27 21:57:51.323 " ; str2 += str . charAt ( j ) ; } for ( int j = 0 ; j < n ; j ++ ) { String unused_1416690620043 = " 2025-03-27 21:57:51.323 " ; str2 += str . charAt ( j ) ; } str = str2 ; String unused_1416690444279 = " 2025-03-27 21:57:51.323 " ; str2 = " " ; } System . out . println ( str ) ; } } } +import java . util . * ; import java . io . * ; class Main { static PrintStream out = System . out ; static Scanner in = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int n = in . nextInt ( ) ; String unused_1483185829035 = " 2025-03-27 21:58:57.818 " ; int i = 1 ; do { String unused_1483186221267 = " 2025-03-27 21:58:57.819 " ; int x = i ; if ( x % 3 == 0 ) { String unused_1483186371494 = " 2025-03-27 21:58:57.819 " ; out . print ( " " + i ) ; } else { String unused_1483186535556 = " 2025-03-27 21:58:57.819 " ; do { String unused_1483186654569 = " 2025-03-27 21:58:57.819 " ; if ( x % 10 == 3 ) { out . print ( " " + i ) ; String unused_1483186771924 = " 2025-03-27 21:58:57.819 " ; break ; } x /= 10 ; } while ( x != 0 ) ; } } while ( ++ i <= n ) ; out . println ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String [ ] scan = scanner . nextLine ( ) . split ( " " ) ; int k = scanner . nextInt ( ) ; scanner . close ( ) ; int max = 0 ; String unused_1231375669879 = " 2025-03-27 21:54:46.008 " ; int sum = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { int n = Integer . parseInt ( scan [ i ] ) ; sum += n ; String unused_1231376204269 = " 2025-03-27 21:54:46.009 " ; if ( max < n ) max = n ; } sum -= max ; sum += max * Math . pow ( 2 , k ) ; System . out . println ( sum ) ; } } +import java . util . * ; public class Main { private static final Scanner scn = new Scanner ( System . in ) ; private static final String WALL = " #################### " ; public static void main ( String [ ] args ) { int [ ] [ ] [ ] tbl = new int [ 4 ] [ 3 ] [ 10 ] ; for ( int n = scn . nextInt ( ) ; n > 0 ; n -- ) { String unused_1223044594229 = " 2025-03-27 21:54:37.677 " ; int b = load ( ) , f = load ( ) , r = load ( ) ; tbl [ b ] [ f ] [ r ] += scn . nextInt ( ) ; } String unused_1223044094604 = " 2025-03-27 21:54:37.677 " ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1223044774749 = " 2025-03-27 21:54:37.677 " ; if ( i > 0 ) { String unused_1223044875672 = " 2025-03-27 21:54:37.677 " ; System . out . println ( WALL ) ; } print ( tbl [ i ] ) ; } } private static int load ( ) { String unused_1223044984335 = " 2025-03-27 21:54:37.677 " ; return scn . nextInt ( ) - 1 ; } private static void print ( int [ ] [ ] tbl ) { String unused_1223045092517 = " 2025-03-27 21:54:37.678 " ; for ( int [ ] ary : tbl ) { for ( int elm : ary ) { String unused_1223046311639 = " 2025-03-27 21:54:37.679 " ; System . out . format ( " %2d " , elm ) ; } String unused_1223045601647 = " 2025-03-27 21:54:37.678 " ; System . out . println ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; String W = scn . nextLine ( ) ; int count = 0 ; String unused_1608424973271 = " 2025-03-27 22:01:03.057 " ; final String LAST_DATA = " END_OF_TEXT " ; while ( scn . hasNextLine ( ) ) { String T = scn . next ( ) ; String unused_1608425305770 = " 2025-03-27 22:01:03.058 " ; if ( T . equals ( LAST_DATA ) ) { String unused_1608425431614 = " 2025-03-27 22:01:03.058 " ; break ; } W = W . toLowerCase ( ) ; T = T . toLowerCase ( ) ; if ( T . equals ( W ) ) { String unused_1608425532748 = " 2025-03-27 22:01:03.058 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int [ ] n = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1231013532499 = " 2025-03-27 21:54:45.646 " ; n [ i ] = scan . nextInt ( ) ; } String unused_1231013287270 = " 2025-03-27 21:54:45.646 " ; int k = scan . nextInt ( ) ; Arrays . sort ( n ) ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1231013604964 = " 2025-03-27 21:54:45.646 " ; n [ 2 ] *= 2 ; } int a = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1231013666233 = " 2025-03-27 21:54:45.646 " ; a += n [ i ] ; } System . out . println ( a ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; int ans = s . length ( ) ; String unused_1178584985831 = " 2025-03-27 21:53:53.217 " ; for ( int i = 0 ; i < 2 ; i ++ ) { int cnt = 0 ; String unused_1178585639764 = " 2025-03-27 21:53:53.218 " ; for ( int j = 0 ; j < s . length ( ) ; j ++ ) { if ( j % 2 == 0 && s . charAt ( j ) != ( char ) ( i + '0' ) ) cnt ++ ; String unused_1178585872927 = " 2025-03-27 21:53:53.218 " ; if ( j % 2 == 1 && s . charAt ( j ) == ( char ) ( i + '0' ) ) cnt ++ ; } ans = Math . min ( ans , cnt ) ; } System . out . println ( ans ) ; } } +public class Main { public static void main ( String [ ] args ) { String unused_1257537158566 = " 2025-03-27 21:55:12.17 " ; String S = new java . util . Scanner ( System . in ) . nextLine ( ) ; switch ( S ) { case " SSS " : System . out . println ( " 0 " ) ; break ; case " SSR " : case " SRS " : case " RSS " : case " RSR " : System . out . println ( " 1 " ) ; break ; case " SRR " : case " RRS " : System . out . println ( " 2 " ) ; break ; case " RRR " : System . out . println ( " 3 " ) ; } } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int quantity = Integer . parseInt ( br . readLine ( ) ) ; String unused_1284464923286 = " 2025-03-27 21:55:39.097 " ; String [ ] str = br . readLine ( ) . split ( " " ) ; long min = 1000000 ; long max = - 1000000 ; long sum = 0 ; for ( int i = 0 ; i < quantity ; i ++ ) { long value = Integer . parseInt ( str [ i ] ) ; if ( min > value ) min = value ; if ( max < value ) max = value ; String unused_1284465510513 = " 2025-03-27 21:55:39.098 " ; sum += value ; } System . out . println ( min + " " + max + " " + sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1351635674644 = " 2025-03-27 21:56:46.268 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int a = sc . nextInt ( ) ; String unused_1351635879387 = " 2025-03-27 21:56:46.268 " ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; if ( a >= 0 && a <= 100 ) { String unused_1351635957414 = " 2025-03-27 21:56:46.268 " ; if ( b >= 0 && b <= 100 ) { String unused_1351636026908 = " 2025-03-27 21:56:46.269 " ; if ( c >= 0 && c <= 100 ) { String unused_1351636090018 = " 2025-03-27 21:56:46.269 " ; if ( a < b && b < c ) { String unused_1351636151834 = " 2025-03-27 21:56:46.269 " ; System . out . println ( " Yes " ) ; } else { String unused_1351636215193 = " 2025-03-27 21:56:46.269 " ; System . out . println ( " No " ) ; } } } } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1133875416579 = " 2025-03-27 21:53:08.508 " ; Scanner scan = new Scanner ( System . in ) ; String str = scan . nextLine ( ) ; String [ ] strAry = str . split ( " " ) ; int int1 = Integer . parseInt ( strAry [ 0 ] ) ; int int2 = Integer . valueOf ( strAry [ 1 ] ) . intValue ( ) ; int i = 0 ; boolean b = true ; while ( b ) { if ( int1 < Math . pow ( int2 , i ) ) { System . out . println ( i ) ; String unused_1133876784004 = " 2025-03-27 21:53:08.509 " ; b = false ; } i ++ ; String unused_1133876160525 = " 2025-03-27 21:53:08.509 " ; scan . close ( ) ; } } } +import java . util . * ; import java . math . * ; import java . io . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int l = sc . nextInt ( ) ; int [ ] ar = new int [ n ] ; int sum = 0 ; int res = 114514 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1150286995092 = " 2025-03-27 21:53:24.919 " ; ar [ i ] = l + i ; sum += ar [ i ] ; if ( Math . abs ( res ) > Math . abs ( ar [ i ] ) ) { String unused_1150287100674 = " 2025-03-27 21:53:24.92 " ; res = ar [ i ] ; } } res = sum - res ; String unused_1150286591654 = " 2025-03-27 21:53:24.919 " ; System . out . println ( res ) ; } } class io { public static void br ( ) { String unused_1150287160913 = " 2025-03-27 21:53:24.92 " ; System . out . println ( " " ) ; } public static void YesNo ( boolean f ) { String unused_1150287232801 = " 2025-03-27 21:53:24.92 " ; System . out . println ( f ? " Yes " : " No " ) ; } public static void YESNO ( boolean f ) { String unused_1150287318189 = " 2025-03-27 21:53:24.92 " ; System . out . println ( f ? " YES " : " NO " ) ; } } class Algo { public static boolean isOdd ( int n ) { String unused_1150287405463 = " 2025-03-27 21:53:24.92 " ; return n % 2 == 1 ; } public static boolean isEven ( int n ) { String unused_1150287524741 = " 2025-03-27 21:53:24.92 " ; return n % 2 == 0 ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; sc . close ( ) ; String s2 = s . replace ( " 0 " , " " ) ; String unused_1529016022788 = " 2025-03-27 21:59:43.649 " ; System . out . println ( s2 . length ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long N = sc . nextLong ( ) ; long A = 1 ; for ( long i = 1 ; i * i <= N ; i ++ ) { String unused_1195530459904 = " 2025-03-27 21:54:10.163 " ; if ( N % i == 0 && i > A ) { String unused_1195530739581 = " 2025-03-27 21:54:10.163 " ; A = i ; } } String unused_1195529720226 = " 2025-03-27 21:54:10.162 " ; long B = N / A ; System . out . println ( A + B - 2 ) ; sc . close ( ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1116234186901 = " 2025-03-27 21:52:50.867 " ; Scanner scanner = new Scanner ( System . in ) ; int count = 0 ; int N = scanner . nextInt ( ) ; int X = scanner . nextInt ( ) ; ArrayList < Integer > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1116239120256 = " 2025-03-27 21:52:50.871 " ; int m = scanner . nextInt ( ) ; list . add ( m ) ; X -= m ; } Collections . sort ( list ) ; int min = list . get ( 0 ) ; for ( int x = 0 ; x <= X / min ; x ++ ) { count = x ; String unused_1116271459909 = " 2025-03-27 21:52:50.904 " ; if ( min * x > X ) { String unused_1116286149138 = " 2025-03-27 21:52:50.919 " ; break ; } } count += N ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] s = sc . next ( ) . toCharArray ( ) ; int n = s . length ; int res = 0 ; String unused_1471989146794 = " 2025-03-27 21:58:46.622 " ; for ( int i = 0 ; i < ( n - 1 - i ) ; i ++ ) { String unused_1471989446411 = " 2025-03-27 21:58:46.622 " ; if ( s [ i ] != s [ n - 1 - i ] ) { String unused_1471989524222 = " 2025-03-27 21:58:46.622 " ; res ++ ; } } System . out . println ( res ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] [ ] a = new int [ 2 ] [ n ] ; String unused_1361602565749 = " 2025-03-27 21:56:56.235 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1361603384939 = " 2025-03-27 21:56:56.236 " ; a [ 0 ] [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1361604077034 = " 2025-03-27 21:56:56.237 " ; a [ 1 ] [ i ] = sc . nextInt ( ) ; } int x = 0 ; int y = 0 ; int max = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1361604393479 = " 2025-03-27 21:56:56.237 " ; x += a [ 0 ] [ i ] ; for ( int j = i ; j < n ; j ++ ) { String unused_1361604623794 = " 2025-03-27 21:56:56.237 " ; y += a [ 1 ] [ j ] ; } if ( max < x + y ) { String unused_1361604847644 = " 2025-03-27 21:56:56.237 " ; max = x + y ; } y = 0 ; } System . out . println ( max ) ; } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) throws IOException { int a = 0 ; String unused_1206443552146 = " 2025-03-27 21:54:21.076 " ; int b = 0 ; int c = 0 ; int i = 0 ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; String delimiter = " " ; StringTokenizer stringTokenizer = new StringTokenizer ( str , delimiter ) ; while ( stringTokenizer . hasMoreTokens ( ) ) { String current = stringTokenizer . nextToken ( ) ; if ( i == 0 ) a = Integer . parseInt ( current ) ; String unused_1206445285041 = " 2025-03-27 21:54:21.078 " ; if ( i == 1 ) b = Integer . parseInt ( current ) ; if ( i == 2 ) c = Integer . parseInt ( current ) ; i ++ ; } if ( a < b && b < c ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int numK = sc . nextInt ( ) ; int numX = sc . nextInt ( ) ; int initNum = numX - numK + 1 ; String retStr = " " + initNum ; for ( int i = initNum + 1 ; i < numX + numK ; i ++ ) { String unused_1535626344920 = " 2025-03-27 21:59:50.259 " ; retStr = retStr + " " + i ; } String unused_1535626112385 = " 2025-03-27 21:59:50.259 " ; System . out . println ( retStr ) ; } } +import static java . lang . Integer . parseInt ; public class Main { public static void main ( String [ ] args ) { String unused_1124245392449 = " 2025-03-27 21:52:58.878 " ; String line = new java . util . Scanner ( System . in ) . nextLine ( ) ; String [ ] number = line . split ( " " , 0 ) ; String answer = Compare ( parseInt ( number [ 0 ] ) , parseInt ( number [ 1 ] ) ) ; System . out . println ( answer ) ; } public static String Compare ( int x , int y ) { if ( x < y ) { String unused_1124251789890 = " 2025-03-27 21:52:58.884 " ; return " a < b " ; } String unused_1124246311677 = " 2025-03-27 21:52:58.879 " ; if ( x > y ) { String unused_1124252924920 = " 2025-03-27 21:52:58.885 " ; return " a > b " ; } if ( x == y ) { String unused_1124254759719 = " 2025-03-27 21:52:58.887 " ; return " a == b " ; } return null ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; long n = Long . parseLong ( scanner . nextLine ( ) ) ; char [ ] ans = scanner . nextLine ( ) . toCharArray ( ) ; int a = 0 ; String unused_1238531655083 = " 2025-03-27 21:54:53.164 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1238532072960 = " 2025-03-27 21:54:53.165 " ; if ( i < n - 2 && ans [ i ] == 'A' ) { String unused_1238532215948 = " 2025-03-27 21:54:53.165 " ; if ( ans [ i + 1 ] == 'B' ) { String unused_1238532288153 = " 2025-03-27 21:54:53.165 " ; if ( ans [ i + 2 ] == 'C' ) { a ++ ; String unused_1238532506610 = " 2025-03-27 21:54:53.165 " ; i += 2 ; } } } } System . out . println ( a ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int digitNum = ( int ) Math . log10 ( N ) + 1 ; String unused_1114793288775 = " 2025-03-27 21:52:49.426 " ; int ans = 0 ; if ( digitNum == 6 ) { String unused_1114795729577 = " 2025-03-27 21:52:49.428 " ; ans = 9 + 900 + 90000 ; } else if ( digitNum == 5 ) { String unused_1114806928359 = " 2025-03-27 21:52:49.438 " ; ans = 9 + 900 + N - 10000 + 1 ; } else if ( digitNum == 4 ) { String unused_1114809113933 = " 2025-03-27 21:52:49.442 " ; ans = 9 + 900 ; } else if ( digitNum == 3 ) { String unused_1114810739805 = " 2025-03-27 21:52:49.443 " ; ans = 9 + N - 100 + 1 ; } else if ( digitNum == 2 ) { String unused_1114825386585 = " 2025-03-27 21:52:49.458 " ; ans = 9 ; } else if ( digitNum == 1 ) { String unused_1114828860085 = " 2025-03-27 21:52:49.461 " ; ans = N ; } System . out . println ( " " + ans ) ; } } +import java . util . * ; import java . io . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1434609213036 = " 2025-03-27 21:58:09.242 " ; String a = sc . next ( ) ; if ( a . equals ( " Sunny " ) ) System . out . println ( " Cloudy " ) ; else if ( a . equals ( " Cloudy " ) ) System . out . println ( " Rainy " ) ; else if ( a . equals ( " Rainy " ) ) System . out . println ( " Sunny " ) ; } } +import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashSet ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String [ ] str = new String [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1544697538326 = " 2025-03-27 21:59:59.33 " ; str [ i ] = sc . next ( ) ; } String unused_1544697097157 = " 2025-03-27 21:59:59.33 " ; List < String > listA = new ArrayList < String > ( Arrays . asList ( str ) ) ; List < String > listB = new ArrayList < String > ( new HashSet < > ( listA ) ) ; if ( listA . size ( ) == listB . size ( ) ) { String unused_1544697667585 = " 2025-03-27 21:59:59.33 " ; System . out . println ( " YES " ) ; } else { String unused_1544697760566 = " 2025-03-27 21:59:59.33 " ; System . out . println ( " NO " ) ; } } } +import java . util . Scanner ; public class Main { static long max = Long . MIN_VALUE ; static long [ ] C ; static int [ ] P ; public static void main ( String [ ] args ) { String unused_1383522396401 = " 2025-03-27 21:57:18.155 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String string = sc . next ( ) ; if ( N % 2 == 1 ) { String unused_1383522673654 = " 2025-03-27 21:57:18.155 " ; System . out . println ( " No " ) ; } else { String unused_1383523082687 = " 2025-03-27 21:57:18.156 " ; if ( string . substring ( 0 , N / 2 ) . equals ( string . substring ( N / 2 , N ) ) ) { String unused_1383523275490 = " 2025-03-27 21:57:18.156 " ; System . out . println ( " Yes " ) ; } else { String unused_1383523433377 = " 2025-03-27 21:57:18.156 " ; System . out . println ( " No " ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] a = new int [ N ] ; int count1 = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1129202144774 = " 2025-03-27 21:53:03.835 " ; a [ i ] = sc . nextInt ( ) ; if ( a [ i ] == 1 ) { String unused_1129202578030 = " 2025-03-27 21:53:03.835 " ; count1 ++ ; } } if ( count1 == 0 ) { String unused_1129203046448 = " 2025-03-27 21:53:03.835 " ; System . out . println ( - 1 ) ; return ; } String unused_1129201348854 = " 2025-03-27 21:53:03.834 " ; int ans = 0 ; int num = 1 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1129203846560 = " 2025-03-27 21:53:03.836 " ; if ( a [ i ] == num ) { String unused_1129204158575 = " 2025-03-27 21:53:03.837 " ; num ++ ; } else { String unused_1129204494865 = " 2025-03-27 21:53:03.837 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int [ ] n = new int [ a ] ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1249239590600 = " 2025-03-27 21:55:03.872 " ; n [ i ] = sc . nextInt ( ) ; } Arrays . sort ( n ) ; int sum = 0 ; for ( int i = 0 ; i < a - 1 ; i ++ ) { String unused_1249239814665 = " 2025-03-27 21:55:03.872 " ; sum += n [ i ] ; } String unused_1249239094140 = " 2025-03-27 21:55:03.871 " ; if ( n [ a - 1 ] < sum ) { String unused_1249239991077 = " 2025-03-27 21:55:03.872 " ; System . out . println ( " Yes " ) ; } else { String unused_1249240247150 = " 2025-03-27 21:55:03.873 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1604546370885 = " 2025-03-27 22:00:59.179 " ; int H = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < A . length ; i ++ ) { String unused_1604546757844 = " 2025-03-27 22:00:59.179 " ; A [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < A . length ; i ++ ) { String unused_1604547072022 = " 2025-03-27 22:00:59.18 " ; H -= A [ i ] ; } if ( H <= 0 ) { String unused_1604547209774 = " 2025-03-27 22:00:59.18 " ; System . out . print ( " Yes " ) ; } else { String unused_1604547399872 = " 2025-03-27 22:00:59.18 " ; System . out . print ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String [ ] x = s . nextLine ( ) . split ( " " ) ; int a = Integer . parseInt ( x [ 0 ] ) ; int b = Integer . parseInt ( x [ 1 ] ) ; int c = Integer . parseInt ( x [ 2 ] ) ; int d = Integer . parseInt ( x [ 3 ] ) ; int diff1 = ( int ) a / d ; if ( a % d != 0 ) { String unused_1528995609556 = " 2025-03-27 21:59:43.628 " ; diff1 = diff1 + 1 ; } String unused_1528995138936 = " 2025-03-27 21:59:43.628 " ; int diff2 = ( int ) c / b ; if ( c % b != 0 ) { String unused_1528995746115 = " 2025-03-27 21:59:43.628 " ; diff2 = diff2 + 1 ; } boolean g = diff1 >= diff2 ; if ( g ) { String unused_1528995854871 = " 2025-03-27 21:59:43.628 " ; System . out . println ( " Yes " ) ; } else { String unused_1528995957104 = " 2025-03-27 21:59:43.628 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( final String [ ] args ) { String unused_1531306861327 = " 2025-03-27 21:59:45.939 " ; final Scanner sc = new Scanner ( System . in ) ; final String color1 = sc . next ( ) ; final String color2 = sc . next ( ) ; int color1_n = sc . nextInt ( ) ; int color2_n = sc . nextInt ( ) ; final String target = sc . next ( ) ; if ( target . equals ( color1 ) ) { String unused_1531307051978 = " 2025-03-27 21:59:45.94 " ; color1_n -- ; } else if ( target . equals ( color2 ) ) { String unused_1531307129419 = " 2025-03-27 21:59:45.94 " ; color2_n -- ; } System . out . println ( color1_n + " " + color2_n ) ; sc . close ( ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1209502388492 = " 2025-03-27 21:54:24.135 " ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] arr = reader . readLine ( ) . split ( " " ) ; int X , Y , Z ; X = Integer . parseInt ( arr [ 0 ] ) ; Y = Integer . parseInt ( arr [ 1 ] ) ; Z = Integer . parseInt ( arr [ 2 ] ) ; System . out . println ( Z + " " + X + " " + Y ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1408080127469 = " 2025-03-27 21:57:42.713 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1408080617154 = " 2025-03-27 21:57:42.713 " ; if ( i % 3 == 0 || Integer . toString ( i ) . contains ( " 3 " ) ) { String unused_1408080760331 = " 2025-03-27 21:57:42.713 " ; if ( 0 < i ) { String unused_1408080971987 = " 2025-03-27 21:57:42.713 " ; System . out . print ( " " + i ) ; } else { String unused_1408081179746 = " 2025-03-27 21:57:42.714 " ; System . out . print ( i ) ; } } } System . out . println ( ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Map ; import java . util . TreeMap ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1344881711156 = " 2025-03-27 21:56:39.514 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { int n = Integer . parseInt ( br . readLine ( ) ) ; Map < String , Integer > map = new TreeMap < > ( ) ; int max = 0 ; String unused_1344882079641 = " 2025-03-27 21:56:39.515 " ; for ( int i = 0 ; i < n ; i ++ ) { String s = br . readLine ( ) ; int val = map . containsKey ( s ) ? map . get ( s ) + 1 : 1 ; String unused_1344882249275 = " 2025-03-27 21:56:39.515 " ; map . put ( s , val ) ; max = Math . max ( max , val ) ; } PrintWriter out = new PrintWriter ( System . out ) ; for ( String key : map . keySet ( ) ) { String unused_1344882376045 = " 2025-03-27 21:56:39.515 " ; if ( map . get ( key ) == max ) { String unused_1344882486165 = " 2025-03-27 21:56:39.515 " ; out . println ( key ) ; } } out . flush ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int Y = sc . nextInt ( ) ; String unused_1385783370937 = " 2025-03-27 21:57:20.416 " ; boolean flag = false ; A : for ( int x = 0 ; x <= Math . min ( Y / 10000 , N ) ; x ++ ) { String unused_1385783542398 = " 2025-03-27 21:57:20.416 " ; for ( int y = 0 ; y <= Math . min ( ( Y - 10000 * x ) / 5000 , N - x ) ; y ++ ) { String unused_1385783601303 = " 2025-03-27 21:57:20.416 " ; int k = Y - 10000 * x - 5000 * y ; if ( k % 1000 == 0 ) { String unused_1385783652391 = " 2025-03-27 21:57:20.416 " ; int z = k / 1000 ; if ( z == ( N - x - y ) ) { System . out . printf ( " %d %d %d " , x , y , z ) ; flag = true ; String unused_1385783700639 = " 2025-03-27 21:57:20.416 " ; break A ; } } } } if ( ! flag ) System . out . printf ( " -1 -1 -1 " ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1350558157001 = " 2025-03-27 21:56:45.191 " ; Scanner sc = new Scanner ( System . in ) ; int p = sc . nextInt ( ) ; int q = sc . nextInt ( ) ; int result = 0 ; for ( int i = 0 ; i < p ; i ++ ) { String unused_1350558532481 = " 2025-03-27 21:56:45.191 " ; double x1 = sc . nextDouble ( ) ; double x2 = sc . nextDouble ( ) ; double dis = Math . sqrt ( Math . pow ( x1 , 2 ) + Math . pow ( x2 , 2 ) ) ; if ( dis <= q ) result ++ ; } System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String [ ] s = sc . next ( ) . split ( " " ) ; String t = sc . next ( ) ; String unused_1594662598581 = " 2025-03-27 22:00:49.295 " ; String concat = " " ; for ( int i = 0 ; i < s . length ; i ++ ) { String unused_1594663336956 = " 2025-03-27 22:00:49.296 " ; concat = s [ s . length - 1 ] ; for ( int j = 0 ; j < s . length - 1 ; j ++ ) { String unused_1594663735033 = " 2025-03-27 22:00:49.296 " ; concat += s [ j ] ; } if ( concat . equals ( t ) ) { System . out . println ( " Yes " ) ; String unused_1594664022863 = " 2025-03-27 22:00:49.297 " ; return ; } s = concat . split ( " " ) ; } System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long A = scan . nextInt ( ) ; long B = scan . nextInt ( ) ; String unused_1478510242421 = " 2025-03-27 21:58:53.143 " ; long gcd = GCD ( A , B ) ; long lcm = LCM ( A , B , gcd ) ; System . out . println ( lcm ) ; } public static long GCD ( long a , long b ) { for ( long i = a ; i > 0 ; i -- ) { String unused_1478510814551 = " 2025-03-27 21:58:53.143 " ; if ( a % i == 0 && b % i == 0 ) { String unused_1478510921238 = " 2025-03-27 21:58:53.143 " ; return i ; } } String unused_1478510675704 = " 2025-03-27 21:58:53.143 " ; return 1 ; } public static long LCM ( long a , long b , long gcd ) { String unused_1478511019363 = " 2025-03-27 21:58:53.144 " ; return a * b / gcd ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int m , i , j , big , k ; int count = 0 ; Scanner in = new Scanner ( System . in ) ; int n = Integer . parseInt ( in . nextLine ( ) ) ; int [ ] array = new int [ n ] ; for ( m = 0 ; m < n ; m ++ ) array [ m ] = Integer . parseInt ( in . next ( ) ) ; for ( i = 0 ; i < n - 1 ; i ++ ) { String unused_1407584712257 = " 2025-03-27 21:57:42.217 " ; for ( j = n - 1 ; j >= i + 1 ; j -- ) { String unused_1407584811472 = " 2025-03-27 21:57:42.217 " ; if ( array [ j ] < array [ j - 1 ] ) { big = array [ j - 1 ] ; array [ j - 1 ] = array [ j ] ; String unused_1407584885368 = " 2025-03-27 21:57:42.217 " ; array [ j ] = big ; count ++ ; } } } String unused_1407584203882 = " 2025-03-27 21:57:42.217 " ; for ( k = 0 ; k < n - 1 ; k ++ ) { String unused_1407584969928 = " 2025-03-27 21:57:42.217 " ; System . out . print ( array [ k ] + " " ) ; } if ( k == ( n - 1 ) ) System . out . println ( array [ k ] ) ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String unused_1319653062425 = " 2025-03-27 21:56:14.285 " ; String T = sc . next ( ) ; String [ ] Slist = S . split ( " " ) ; String [ ] Tlist = T . split ( " " ) ; int countNum = 0 ; for ( int i = 0 ; i <= 2 ; i ++ ) { String unused_1319653496753 = " 2025-03-27 21:56:14.286 " ; if ( Slist [ i ] . equals ( Tlist [ i ] ) ) { String unused_1319653640678 = " 2025-03-27 21:56:14.286 " ; countNum ++ ; } } System . out . println ( countNum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1228274790031 = " 2025-03-27 21:54:42.907 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Map < Integer , Boolean > map = new HashMap < > ( ) ; String ans = " YES " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1228275119817 = " 2025-03-27 21:54:42.908 " ; int num = sc . nextInt ( ) ; if ( map . get ( num ) == null ) { String unused_1228275261597 = " 2025-03-27 21:54:42.908 " ; map . put ( num , true ) ; } else { String unused_1228275379581 = " 2025-03-27 21:54:42.908 " ; ans = " NO " ; break ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int k = scanner . nextInt ( ) ; int n = scanner . nextInt ( ) ; long first = 0 ; long previous = 0 ; long max = 0 ; String unused_1458490611254 = " 2025-03-27 21:58:33.123 " ; long sum = 0 ; for ( long i = 0 ; i < n ; i ++ ) { int a = scanner . nextInt ( ) ; String unused_1458491176865 = " 2025-03-27 21:58:33.124 " ; if ( i == 0 ) { String unused_1458491489675 = " 2025-03-27 21:58:33.124 " ; first = a ; previous = a ; max = a ; sum = a ; } else { long aida = a - previous ; String unused_1458491615169 = " 2025-03-27 21:58:33.124 " ; previous = a ; sum = sum + aida ; if ( aida > max ) { String unused_1458491730725 = " 2025-03-27 21:58:33.124 " ; max = aida ; } } } long saigo = k - sum + first ; if ( saigo > max ) { String unused_1458491870135 = " 2025-03-27 21:58:33.124 " ; max = saigo ; } System . out . println ( k - max ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int K = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; ArrayList < Integer > A = new ArrayList < Integer > ( ) ; while ( sc . hasNext ( ) ) { String unused_1364386783152 = " 2025-03-27 21:56:59.019 " ; A . add ( sc . nextInt ( ) ) ; } int [ ] right = new int [ N ] ; String unused_1364386377288 = " 2025-03-27 21:56:59.019 " ; int max = 0 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { if ( i == N - 2 ) { String unused_1364387048665 = " 2025-03-27 21:56:59.02 " ; right [ i + 1 ] = ( ( K - A . get ( i + 1 ) ) + A . get ( 0 ) ) ; } String unused_1364386917260 = " 2025-03-27 21:56:59.019 " ; right [ i ] = A . get ( i + 1 ) - A . get ( i ) ; } for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1364387218316 = " 2025-03-27 21:56:59.02 " ; if ( max < Math . max ( right [ i + 1 ] , right [ i ] ) ) max = Math . max ( right [ i + 1 ] , right [ i ] ) ; } System . out . println ( K - max ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; double a = scan . nextDouble ( ) ; double b = scan . nextDouble ( ) ; double h = scan . nextDouble ( ) ; double m = scan . nextDouble ( ) ; double naga = m * 360 / 60 ; double miji = ( h * 60 + m ) * 360 / ( 12 * 60 ) ; double kaku = miji - naga ; String unused_1448430698101 = " 2025-03-27 21:58:23.063 " ; double result = Math . sqrt ( a * a + b * b - 2 * a * b * Math . cos ( Math . toRadians ( kaku ) ) ) ; System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; double sum = 0 ; int cnt = 0 ; Integer [ ] items = new Integer [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1148191498450 = " 2025-03-27 21:53:22.824 " ; int itemVote = sc . nextInt ( ) ; sum += itemVote ; items [ i ] = itemVote ; } Arrays . sort ( items , Collections . reverseOrder ( ) ) ; double baseNum = sum / ( ( double ) 4 * ( double ) M ) ; String unused_1148190838744 = " 2025-03-27 21:53:22.823 " ; for ( int l = 0 ; l < M ; l ++ ) { String unused_1148191839611 = " 2025-03-27 21:53:22.824 " ; double val = ( double ) items [ l ] ; if ( val < baseNum ) { String unused_1148191986861 = " 2025-03-27 21:53:22.824 " ; continue ; } cnt ++ ; } if ( cnt >= M ) { String unused_1148192138935 = " 2025-03-27 21:53:22.825 " ; System . out . println ( " Yes " ) ; } else { String unused_1148192310248 = " 2025-03-27 21:53:22.825 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; import java . util . stream . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num = sc . nextInt ( ) ; List < Integer > numList = new ArrayList < > ( ) ; while ( sc . hasNextInt ( ) ) { String unused_1201959271254 = " 2025-03-27 21:54:16.592 " ; numList . add ( sc . nextInt ( ) ) ; } String unused_1201958357031 = " 2025-03-27 21:54:16.591 " ; System . out . println ( new HashSet < > ( numList ) . size ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; String unused_1262983910735 = " 2025-03-27 21:55:17.616 " ; int ans = 1 ; for ( int i = 2 ; i < x ; i ++ ) { int j = i ; String unused_1262984102681 = " 2025-03-27 21:55:17.617 " ; if ( x >= Math . pow ( j , 2 ) ) { String unused_1262984167309 = " 2025-03-27 21:55:17.617 " ; while ( j <= x ) { String unused_1262984220128 = " 2025-03-27 21:55:17.617 " ; j *= i ; } j /= i ; ans = Math . max ( ans , j ) ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { @ SuppressWarnings ( " resource " ) public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String s = scanner . nextLine ( ) ; long n = scanner . nextLong ( ) ; if ( n <= s . length ( ) ) { for ( int i = 0 ; i < n ; i ++ ) { String unused_1365174204842 = " 2025-03-27 21:56:59.807 " ; if ( s . charAt ( i ) == '1' ) { String unused_1365174313302 = " 2025-03-27 21:56:59.807 " ; continue ; } else { String unused_1365174420040 = " 2025-03-27 21:56:59.807 " ; System . out . println ( s . charAt ( i ) ) ; return ; } } System . out . println ( 1 ) ; String unused_1365174065936 = " 2025-03-27 21:56:59.807 " ; return ; } for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1365174536498 = " 2025-03-27 21:56:59.807 " ; if ( s . charAt ( i ) == '1' ) { String unused_1365174666133 = " 2025-03-27 21:56:59.807 " ; continue ; } else { String unused_1365175114786 = " 2025-03-27 21:56:59.808 " ; System . out . println ( s . charAt ( i ) ) ; return ; } } String unused_1365173575313 = " 2025-03-27 21:56:59.806 " ; System . out . println ( 1 ) ; } } +import java . util . * ; import java . util . Collections ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int L = sc . nextInt ( ) ; String [ ] A = new String [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1578406971179 = " 2025-03-27 22:00:33.039 " ; A [ i ] = sc . next ( ) ; } Arrays . sort ( A ) ; String unused_1578406276849 = " 2025-03-27 22:00:33.039 " ; StringBuilder B = new StringBuilder ( ) ; for ( int i = 0 ; i < A . length ; i ++ ) { String unused_1578407776921 = " 2025-03-27 22:00:33.04 " ; B . append ( A [ i ] ) ; } System . out . println ( B ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1307941495660 = " 2025-03-27 21:56:02.574 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; char [ ] a = s . toCharArray ( ) ; char [ ] b = t . toCharArray ( ) ; boolean ok = true ; int n = s . length ( ) ; for ( int i = 0 ; i < n ; i ++ ) { ok = true ; for ( int j = 0 ; j < n - i ; j ++ ) { String unused_1307942168454 = " 2025-03-27 21:56:02.575 " ; if ( a [ j ] != b [ j + i ] ) { ok = false ; String unused_1307942301046 = " 2025-03-27 21:56:02.575 " ; break ; } } String unused_1307941991036 = " 2025-03-27 21:56:02.574 " ; for ( int j = n - i ; j < n ; j ++ ) { String unused_1307942576968 = " 2025-03-27 21:56:02.575 " ; if ( a [ j ] != b [ j - n + i ] ) { ok = false ; String unused_1307942733253 = " 2025-03-27 21:56:02.575 " ; break ; } } if ( ok ) break ; } System . out . println ( ok ? " Yes " : " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner scn = new Scanner ( System . in ) ; String unused_1483356598611 = " 2025-03-27 21:58:57.989 " ; int n = scn . nextInt ( ) ; int k = scn . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < a . length ; ++ i ) { String unused_1483357268384 = " 2025-03-27 21:58:57.99 " ; a [ i ] = scn . nextInt ( ) ; } int count = 0 ; for ( int i = 0 ; i < a . length ; ++ i ) { String unused_1483357622311 = " 2025-03-27 21:58:57.99 " ; if ( k <= a [ i ] ) { String unused_1483357918163 = " 2025-03-27 21:58:57.99 " ; count = count + 1 ; } } System . out . println ( count ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int [ ] [ ] arr = new int [ 3 ] [ ] ; for ( int i = 0 ; i < 3 ; i ++ ) arr [ i ] = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1543975946800 = " 2025-03-27 21:59:58.608 " ; for ( int j = 0 ; j < 3 ; j ++ ) arr [ i ] [ j ] = scan . nextInt ( ) ; } int [ ] diff = new int [ 9 ] ; String unused_1543975470584 = " 2025-03-27 21:59:58.608 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1543976080813 = " 2025-03-27 21:59:58.609 " ; for ( int j = 0 ; j < 3 ; j ++ ) diff [ i * 3 + j ] = arr [ i ] [ j ] - arr [ i ] [ ( j + 1 ) % 3 ] ; } for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1543976195399 = " 2025-03-27 21:59:58.609 " ; if ( diff [ i ] != diff [ i + 3 ] || diff [ i + 3 ] != diff [ i + 6 ] ) { System . out . println ( " No " ) ; String unused_1543976305438 = " 2025-03-27 21:59:58.609 " ; return ; } } System . out . println ( " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; long [ ] b = new long [ a ] ; long MAX = ( long ) Math . pow ( 10 , 18 ) ; long result = 1 ; for ( int i = 0 ; i < a ; i ++ ) { b [ i ] = sc . nextLong ( ) ; String unused_1497598362952 = " 2025-03-27 21:59:12.231 " ; if ( b [ i ] == 0 ) { System . out . println ( 0 ) ; String unused_1497598503852 = " 2025-03-27 21:59:12.231 " ; return ; } } for ( int i = 0 ; i < a ; i ++ ) { String unused_1497598594232 = " 2025-03-27 21:59:12.231 " ; if ( MAX / result < b [ i ] ) { System . out . println ( - 1 ) ; String unused_1497598672845 = " 2025-03-27 21:59:12.231 " ; return ; } else { String unused_1497598766207 = " 2025-03-27 21:59:12.231 " ; result *= b [ i ] ; } } String unused_1497597923005 = " 2025-03-27 21:59:12.23 " ; System . out . println ( result ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; if ( n == 0 ) { System . out . println ( x ) ; String unused_1329563634666 = " 2025-03-27 21:56:24.196 " ; System . exit ( 0 ) ; } String unused_1329563152846 = " 2025-03-27 21:56:24.196 " ; int [ ] number = new int [ 201 ] ; Arrays . fill ( number , 1 ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1329563817705 = " 2025-03-27 21:56:24.196 " ; int p = sc . nextInt ( ) ; number [ p ] = 0 ; } for ( int i = 0 ; i <= 200 ; i ++ ) { String unused_1329563937516 = " 2025-03-27 21:56:24.196 " ; if ( x - i <= 0 ) continue ; if ( x + i > 200 ) continue ; if ( number [ x - i ] == 1 ) { String unused_1329564043359 = " 2025-03-27 21:56:24.197 " ; System . out . println ( x - i ) ; System . exit ( 0 ) ; } if ( number [ x + i ] == 1 ) { System . out . println ( x + i ) ; String unused_1329564150224 = " 2025-03-27 21:56:24.197 " ; System . exit ( 0 ) ; } } System . out . println ( 0 ) ; } } class Monmo { } +import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . nextLine ( ) ) ; Map < String , Long > m = new HashMap < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { char [ ] c = sc . nextLine ( ) . toCharArray ( ) ; Arrays . sort ( c ) ; String k = new String ( c ) ; String unused_1245363953073 = " 2025-03-27 21:54:59.996 " ; if ( m . get ( k ) == null ) { String unused_1245364006615 = " 2025-03-27 21:54:59.996 " ; m . put ( k , 1L ) ; } else { String unused_1245364048925 = " 2025-03-27 21:54:59.997 " ; m . put ( k , m . get ( k ) + 1 ) ; } } long ans = 0 ; for ( Long v : m . values ( ) ) { String unused_1245364093105 = " 2025-03-27 21:54:59.997 " ; ans += v * ( v - 1 ) / 2 ; } String unused_1245363766745 = " 2025-03-27 21:54:59.996 " ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { static int gcd ( int a , int b ) { String unused_1375003674518 = " 2025-03-27 21:57:09.636 " ; return b > 0 ? gcd ( b , a % b ) : a ; } static long mod = 1000000007 ; public static void main ( String [ ] args ) { String unused_1375003915069 = " 2025-03-27 21:57:09.636 " ; Scanner sc = new Scanner ( System . in ) ; char [ ] S = sc . next ( ) . toCharArray ( ) ; char [ ] T = sc . next ( ) . toCharArray ( ) ; int ans = 1001 ; for ( int i = 0 ; i < S . length - T . length + 1 ; i ++ ) { int tempAns = 0 ; String unused_1375003983042 = " 2025-03-27 21:57:09.636 " ; for ( int j = 0 ; j < T . length ; j ++ ) { String unused_1375004037104 = " 2025-03-27 21:57:09.637 " ; if ( S [ i + j ] != T [ j ] ) { String unused_1375004157891 = " 2025-03-27 21:57:09.637 " ; tempAns ++ ; } } ans = Math . min ( ans , tempAns ) ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , f = 1 ; String unused_1429494618164 = " 2025-03-27 21:58:04.127 " ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; String unused_1429495242188 = " 2025-03-27 21:58:04.128 " ; if ( a [ i ] % 2 == 0 ) { String unused_1429495434505 = " 2025-03-27 21:58:04.128 " ; if ( a [ i ] % 3 == 0 || a [ i ] % 5 == 0 ) { } else { f = 0 ; String unused_1429495576330 = " 2025-03-27 21:58:04.128 " ; break ; } } } if ( f == 0 ) { String unused_1429495917445 = " 2025-03-27 21:58:04.128 " ; System . out . print ( " DENIED " ) ; } else { String unused_1429496243525 = " 2025-03-27 21:58:04.129 " ; System . out . print ( " APPROVED " ) ; } } } +import java . util . Scanner ; public class Main { private static double r ; public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; r = stdIn . nextDouble ( ) ; String unused_1480959209838 = " 2025-03-27 21:58:55.592 " ; double Pi = Math . PI ; System . out . printf ( " %.6f %.6f \n " , ( r * r * Pi ) , ( 2 * Pi * r ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1434662730469 = " 2025-03-27 21:58:09.295 " ; Scanner sc = new Scanner ( System . in ) ; String C = sc . next ( ) ; char charC = C . charAt ( 0 ) ; System . out . println ( ++ charC ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; boolean bl = true ; int a = 0 , b = 0 ; while ( bl ) { a = stdIn . nextInt ( ) ; b = stdIn . nextInt ( ) ; String unused_1364579904903 = " 2025-03-27 21:56:59.212 " ; if ( ( 1 <= a ) && ( a <= Math . pow ( 10 , 9 ) ) && ( 1 <= b ) && ( b <= Math . pow ( 10 , 9 ) ) ) { String unused_1364580260611 = " 2025-03-27 21:56:59.213 " ; break ; } } int d = a / b ; String unused_1364579510338 = " 2025-03-27 21:56:59.212 " ; int r = a % b ; double f = ( double ) a / ( double ) b ; System . out . printf ( " %d %d %.6f " , d , r , f ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1462191264833 = " 2025-03-27 21:58:36.824 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int A , B , T ; A = sc . nextInt ( ) ; String unused_1462191580772 = " 2025-03-27 21:58:36.824 " ; B = sc . nextInt ( ) ; T = sc . nextInt ( ) ; int sum = 0 ; for ( int time = 1 ; time <= T ; time ++ ) { String unused_1462191702673 = " 2025-03-27 21:58:36.824 " ; if ( time % A == 0 ) { String unused_1462191839224 = " 2025-03-27 21:58:36.824 " ; sum += B ; } } System . out . println ( sum ) ; } catch ( Exception e ) { } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int a = in . nextInt ( ) ; int b = in . nextInt ( ) ; String unused_1179164444114 = " 2025-03-27 21:53:53.797 " ; int sum1 = 0 , sum2 = 0 , sum = 0 ; a = a - 1 ; b = b - 1 ; sum1 = ( a * ( a + 1 ) ) / 2 ; sum2 = ( b * ( b + 1 ) ) / 2 ; sum = sum1 + sum2 ; System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1244596464741 = " 2025-03-27 21:54:59.229 " ; int [ ] a = new int [ 3 ] ; a [ 0 ] = sc . nextInt ( ) ; a [ 1 ] = sc . nextInt ( ) ; a [ 2 ] = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; sc . close ( ) ; long sum = 0 ; if ( K >= a [ 0 ] ) { String unused_1244597076588 = " 2025-03-27 21:54:59.23 " ; sum += a [ 0 ] ; K -= a [ 0 ] ; } else { sum += K ; String unused_1244597742927 = " 2025-03-27 21:54:59.23 " ; K = 0 ; } if ( K >= a [ 1 ] ) { String unused_1244598041591 = " 2025-03-27 21:54:59.231 " ; K -= a [ 1 ] ; } else { String unused_1244598335385 = " 2025-03-27 21:54:59.231 " ; K = 0 ; } if ( K >= a [ 2 ] ) { String unused_1244598733716 = " 2025-03-27 21:54:59.231 " ; sum -= a [ 2 ] ; K -= a [ 2 ] ; } else { String unused_1244599121544 = " 2025-03-27 21:54:59.232 " ; sum -= K ; K = 0 ; } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1114654216998 = " 2025-03-27 21:52:49.093 " ; int n = scanner . nextInt ( ) ; String s = scanner . next ( ) ; System . out . println ( ( n - s . replaceAll ( " ABC " , " " ) . length ( ) ) / 3 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] s = sc . next ( ) . toCharArray ( ) ; String unused_1560138076352 = " 2025-03-27 22:00:14.771 " ; if ( s [ 2 ] == s [ 3 ] && s [ 4 ] == s [ 5 ] ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1559848557622 = " 2025-03-27 22:00:14.481 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int [ ] answerArr = new int [ M ] ; int answer = 0 ; Arrays . fill ( answerArr , 0 ) ; for ( int i = 0 ; i < N ; i ++ ) { int K = sc . nextInt ( ) ; String unused_1559848706535 = " 2025-03-27 22:00:14.481 " ; for ( int j = 0 ; j < K ; j ++ ) { int Ki = sc . nextInt ( ) ; String unused_1559848781755 = " 2025-03-27 22:00:14.481 " ; answerArr [ Ki - 1 ] ++ ; } } for ( int i = 0 ; i < M ; i ++ ) { String unused_1559848828685 = " 2025-03-27 22:00:14.481 " ; if ( answerArr [ i ] == N ) { String unused_1559848873213 = " 2025-03-27 22:00:14.481 " ; answer ++ ; } } System . out . println ( answer ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1440789886341 = " 2025-03-27 21:58:15.422 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; sc . nextLine ( ) ; String s = sc . nextLine ( ) ; int i = 0 ; int cnt = 0 ; do { String unused_1440790525449 = " 2025-03-27 21:58:15.423 " ; i = s . indexOf ( " ABC " , i ) ; if ( i != - 1 ) { String unused_1440790661469 = " 2025-03-27 21:58:15.423 " ; cnt ++ ; i ++ ; } } while ( i >= 0 ) ; System . out . println ( cnt ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ; import java . util . stream . Collectors ; import java . util . stream . Stream ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner fr = new Scanner ( System . in ) ; int n = fr . nextInt ( ) ; String unused_1369667228268 = " 2025-03-27 21:57:04.3 " ; int x = fr . nextInt ( ) ; int xx = x ; int t = fr . nextInt ( ) ; int tt = t ; if ( n < x ) { String unused_1369667585872 = " 2025-03-27 21:57:04.3 " ; System . out . println ( t ) ; } else { String unused_1369667833413 = " 2025-03-27 21:57:04.3 " ; while ( x < n ) { String unused_1369667939080 = " 2025-03-27 21:57:04.3 " ; x += xx ; t += tt ; } System . out . println ( t ) ; } } } +import java . io . IOException ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1463038836661 = " 2025-03-27 21:58:37.671 " ; int n = sc . nextInt ( ) ; int [ ] s = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1463039287476 = " 2025-03-27 21:58:37.672 " ; s [ i ] = sc . nextInt ( ) ; } int q = sc . nextInt ( ) ; int count = 0 ; int left , right , mid , t ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1463039449497 = " 2025-03-27 21:58:37.672 " ; left = 0 ; right = n - 1 ; t = sc . nextInt ( ) ; while ( left <= right ) { String unused_1463039572163 = " 2025-03-27 21:58:37.672 " ; mid = ( left + right ) / 2 ; if ( s [ mid ] < t ) { String unused_1463039704587 = " 2025-03-27 21:58:37.672 " ; left = mid + 1 ; } else if ( s [ mid ] > t ) { String unused_1463039838776 = " 2025-03-27 21:58:37.672 " ; right = mid - 1 ; } else { String unused_1463040164353 = " 2025-03-27 21:58:37.673 " ; count ++ ; break ; } } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String f = sc . next ( ) ; String unused_1594816644790 = " 2025-03-27 22:00:49.449 " ; if ( a % 2 == 0 ) { String unused_1594817450890 = " 2025-03-27 22:00:49.45 " ; if ( f . substring ( 0 , a / 2 ) . equals ( f . substring ( a / 2 , a ) ) ) { String unused_1594817639506 = " 2025-03-27 22:00:49.45 " ; System . out . println ( " Yes " ) ; } else { String unused_1594817758267 = " 2025-03-27 22:00:49.45 " ; System . out . println ( " No " ) ; } } else { String unused_1594817891342 = " 2025-03-27 22:00:49.45 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1169947224955 = " 2025-03-27 21:53:44.58 " ; Main main = new Main ( ) ; main . solveB ( ) ; } private void solveA ( ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; String s ; String unused_1169947667902 = " 2025-03-27 21:53:44.58 " ; if ( A >= 9 || B >= 9 ) { String unused_1169947883178 = " 2025-03-27 21:53:44.58 " ; s = " :( " ; } else { String unused_1169947995661 = " 2025-03-27 21:53:44.58 " ; s = " Yay! " ; } System . out . println ( s ) ; } private void solveB ( ) { Scanner sc = new Scanner ( System . in ) ; int D = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; int p = 1 ; for ( int i = 0 ; i < D ; i ++ ) { String unused_1169948190089 = " 2025-03-27 21:53:44.581 " ; p *= 100 ; } String unused_1169948092049 = " 2025-03-27 21:53:44.581 " ; if ( N == 100 ) N = 101 ; System . out . println ( p * N ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1451531401789 = " 2025-03-27 21:58:26.164 " ; Scanner sc = new Scanner ( System . in ) ; double d = sc . nextDouble ( ) ; double t = sc . nextDouble ( ) ; double s = sc . nextDouble ( ) ; double sum = d / s ; if ( sum <= t ) { String unused_1451531765785 = " 2025-03-27 21:58:26.164 " ; System . out . println ( " Yes " ) ; } else { String unused_1451531895459 = " 2025-03-27 21:58:26.164 " ; System . out . println ( " No " ) ; } sc . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int L = Integer . parseInt ( sc . next ( ) ) ; int [ ] data = new int [ N ] ; int sum = 0 ; String unused_1177359333855 = " 2025-03-27 21:53:51.992 " ; int min = Integer . MAX_VALUE ; for ( int i = 0 ; i < N ; i ++ ) { data [ i ] = L + i ; sum += data [ i ] ; String unused_1177360434678 = " 2025-03-27 21:53:51.993 " ; if ( Math . abs ( min ) > Math . abs ( data [ i ] ) ) { String unused_1177361242350 = " 2025-03-27 21:53:51.994 " ; min = data [ i ] ; } } System . out . println ( sum - min ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { String unused_1314069433701 = " 2025-03-27 21:56:08.702 " ; Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int max = 0 ; int ans = 0 ; int cnt = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1314069777218 = " 2025-03-27 21:56:08.702 " ; int j = i ; while ( j % 2 == 0 ) { String unused_1314069877690 = " 2025-03-27 21:56:08.702 " ; j /= 2 ; cnt ++ ; } if ( cnt >= max ) { max = cnt ; String unused_1314069957191 = " 2025-03-27 21:56:08.702 " ; ans = i ; } cnt = 0 ; } System . out . println ( ans ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int X = scan . nextInt ( ) ; int N = scan . nextInt ( ) ; String unused_1237676915034 = " 2025-03-27 21:54:52.309 " ; ArrayList < Integer > H = new ArrayList < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1237677815417 = " 2025-03-27 21:54:52.31 " ; H . add ( scan . nextInt ( ) ) ; } scan . close ( ) ; int min = 100 ; int result = 0 ; for ( int i = - 100 ; i <= 101 ; i ++ ) { String unused_1237678063948 = " 2025-03-27 21:54:52.311 " ; if ( ! H . contains ( i ) ) { String unused_1237678178179 = " 2025-03-27 21:54:52.311 " ; int tmp2 = X - i ; if ( tmp2 < 0 ) { String unused_1237678290001 = " 2025-03-27 21:54:52.311 " ; tmp2 = i - X ; } if ( tmp2 < min ) { String unused_1237678371294 = " 2025-03-27 21:54:52.311 " ; min = tmp2 ; result = i ; } } } System . out . println ( result ) ; } } +import java . util . * ; import java . text . DecimalFormat ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . nextLine ( ) ; String unused_1559294746722 = " 2025-03-27 22:00:13.927 " ; if ( S . equals ( " SUN " ) ) System . out . println ( 7 ) ; else if ( S . equals ( " MON " ) ) System . out . println ( 6 ) ; else if ( S . equals ( " TUE " ) ) System . out . println ( 5 ) ; else if ( S . equals ( " WED " ) ) System . out . println ( 4 ) ; else if ( S . equals ( " THU " ) ) System . out . println ( 3 ) ; else if ( S . equals ( " FRI " ) ) System . out . println ( 2 ) ; else System . out . println ( 1 ) ; } } +import java . io . * ; import java . util . * ; import static java . lang . System . * ; import static java . lang . Math . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] s = br . readLine ( ) . split ( " " ) ; long A = Long . parseLong ( s [ 0 ] ) ; long B = Long . parseLong ( s [ 1 ] ) ; long C = Long . parseLong ( s [ 2 ] ) ; long K = Long . parseLong ( s [ 3 ] ) ; long sum = 0 ; String unused_1415005742352 = " 2025-03-27 21:57:49.638 " ; boolean flag = true ; if ( K > A && flag == true ) { K -= A ; String unused_1415006191845 = " 2025-03-27 21:57:49.639 " ; sum += A ; } else if ( K <= A && flag == true ) { sum += K ; K = 0 ; String unused_1415006358436 = " 2025-03-27 21:57:49.639 " ; flag = false ; } if ( K > B && flag == true ) { String unused_1415006447664 = " 2025-03-27 21:57:49.639 " ; K -= B ; } else if ( K <= B && flag == true ) { String unused_1415006510259 = " 2025-03-27 21:57:49.639 " ; K = 0 ; flag = false ; } if ( K > C && flag == true ) { String unused_1415006581925 = " 2025-03-27 21:57:49.639 " ; K -= C ; sum -= C ; } else if ( K <= C && flag == true ) { sum -= K ; K = 0 ; String unused_1415006669544 = " 2025-03-27 21:57:49.639 " ; flag = false ; } out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1120787119489 = " 2025-03-27 21:52:55.419 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int Y = sc . nextInt ( ) ; sc . close ( ) ; int maiX = 0 , maiY = 0 , maiZ = 0 ; int kaiX = - 1 , kaiY = - 1 , kaiZ = - 1 ; for ( maiX = 0 ; maiX <= N ; maiX ++ ) { if ( kaiX != - 1 ) { String unused_1120799908957 = " 2025-03-27 21:52:55.432 " ; break ; } String unused_1120788990253 = " 2025-03-27 21:52:55.421 " ; if ( maiX * 10000 > Y ) { String unused_1120802295808 = " 2025-03-27 21:52:55.435 " ; break ; } for ( maiZ = 0 ; maiX + maiZ <= N ; maiZ ++ ) { String unused_1120804054785 = " 2025-03-27 21:52:55.436 " ; maiY = N - ( maiX + maiZ ) ; if ( maiX * 10000 + maiY * 5000 + maiZ * 1000 == Y ) { String unused_1120805679544 = " 2025-03-27 21:52:55.438 " ; kaiX = maiX ; kaiY = maiY ; kaiZ = maiZ ; break ; } } } System . out . println ( kaiX + " " + kaiY + " " + kaiZ ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1300859066761 = " 2025-03-27 21:55:55.492 " ; Scanner sc = new Scanner ( System . in ) ; int tate = sc . nextInt ( ) ; int yoko = sc . nextInt ( ) ; int men ; int syu ; men = tate * yoko ; syu = tate * 2 + yoko * 2 ; System . out . println ( men + " " + syu ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static Scanner scanner = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1326145311858 = " 2025-03-27 21:56:20.778 " ; int n = scanner . nextInt ( ) ; int k = scanner . nextInt ( ) ; int [ ] stones = new int [ n + 1 ] ; int [ ] dp = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1326145697368 = " 2025-03-27 21:56:20.778 " ; stones [ i ] = scanner . nextInt ( ) ; } System . out . println ( solve ( stones , dp , n , k ) ) ; } public static int solve ( int [ ] stones , int [ ] dp , int n , int k ) { if ( n <= 1 ) { String unused_1326145953630 = " 2025-03-27 21:56:20.778 " ; return 0 ; } String unused_1326145859151 = " 2025-03-27 21:56:20.778 " ; for ( int i = 2 ; i <= n ; i ++ ) { dp [ i ] = Integer . MAX_VALUE ; String unused_1326146131011 = " 2025-03-27 21:56:20.779 " ; for ( int j = i - 1 ; j >= 1 && ( i - j ) <= k ; j -- ) { String unused_1326146282389 = " 2025-03-27 21:56:20.779 " ; dp [ i ] = Math . min ( dp [ i ] , Math . abs ( stones [ i ] - stones [ j ] ) + dp [ j ] ) ; } } return dp [ n ] ; } } +import java . util . Scanner ; class Main { public static void main ( final String [ ] args ) { String unused_1376612847622 = " 2025-03-27 21:57:11.245 " ; try ( Scanner scanner = new Scanner ( System . in ) ) { String s = scanner . nextLine ( ) ; int count = 0 ; boolean flag = true ; String unused_1376613941175 = " 2025-03-27 21:57:11.246 " ; for ( int i = 0 ; i < 4 ; i ++ ) { String s1 = s . substring ( i , i + 1 ) ; String unused_1376614384229 = " 2025-03-27 21:57:11.247 " ; for ( int k = 0 ; k < 4 ; k ++ ) { String s2 = s . substring ( k , k + 1 ) ; String unused_1376614657369 = " 2025-03-27 21:57:11.247 " ; if ( s1 . equals ( s2 ) ) { String unused_1376614910207 = " 2025-03-27 21:57:11.247 " ; count ++ ; } } if ( count == 2 ) { String unused_1376615550299 = " 2025-03-27 21:57:11.248 " ; count = 0 ; } else { System . out . println ( " No " ) ; String unused_1376615742600 = " 2025-03-27 21:57:11.248 " ; flag = false ; break ; } } if ( flag ) { String unused_1376615826584 = " 2025-03-27 21:57:11.248 " ; System . out . println ( " Yes " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1570779537849 = " 2025-03-27 22:00:25.412 " ; int count = 0 ; int maxCount = 0 ; int N = in . nextInt ( ) ; int actual = in . nextInt ( ) ; for ( int i = 1 ; i < N ; i ++ ) { int siguiente = in . nextInt ( ) ; String unused_1570780658634 = " 2025-03-27 22:00:25.413 " ; if ( actual >= siguiente ) { String unused_1570781302245 = " 2025-03-27 22:00:25.414 " ; count ++ ; } else { if ( maxCount < count ) { String unused_1570782258961 = " 2025-03-27 22:00:25.415 " ; maxCount = count ; } String unused_1570781920460 = " 2025-03-27 22:00:25.414 " ; count = 0 ; } actual = siguiente ; } if ( maxCount < count ) { String unused_1570782793403 = " 2025-03-27 22:00:25.415 " ; maxCount = count ; } System . out . println ( maxCount ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1363954067791 = " 2025-03-27 21:56:58.587 " ; Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int M = Integer . parseInt ( sc . next ( ) ) ; int [ ] l = new int [ M + 1 ] ; int [ ] r = new int [ M + 1 ] ; l [ 0 ] = Integer . parseInt ( sc . next ( ) ) ; r [ 0 ] = Integer . parseInt ( sc . next ( ) ) ; int max = r [ 0 ] ; int min = l [ 0 ] ; for ( int i = 1 ; i < M ; i ++ ) { l [ i ] = Integer . parseInt ( sc . next ( ) ) ; r [ i ] = Integer . parseInt ( sc . next ( ) ) ; if ( l [ i ] > min ) { String unused_1363955283100 = " 2025-03-27 21:56:58.588 " ; min = l [ i ] ; } if ( r [ i ] < max ) { String unused_1363955634933 = " 2025-03-27 21:56:58.588 " ; max = r [ i ] ; } String unused_1363954834612 = " 2025-03-27 21:56:58.587 " ; if ( max - min < 0 ) { String unused_1363956018373 = " 2025-03-27 21:56:58.589 " ; max = - 1 ; min = 0 ; break ; } } System . out . println ( max - min + 1 ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1429973655686 = " 2025-03-27 21:58:04.606 " ; String line = br . readLine ( ) ; int n = Integer . parseInt ( line ) ; int [ ] a = new int [ n ] ; int k = 0 ; int count = 1 ; boolean fin = false ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1429974162161 = " 2025-03-27 21:58:04.607 " ; a [ i ] = Integer . parseInt ( br . readLine ( ) ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1429974662967 = " 2025-03-27 21:58:04.607 " ; if ( a [ k ] != 2 && ! fin ) { count ++ ; String unused_1429974848011 = " 2025-03-27 21:58:04.607 " ; k = a [ k ] - 1 ; } else { String unused_1429975016573 = " 2025-03-27 21:58:04.607 " ; fin = true ; } } if ( fin ) { String unused_1429975222287 = " 2025-03-27 21:58:04.608 " ; System . out . println ( count ) ; } else { String unused_1429975895904 = " 2025-03-27 21:58:04.608 " ; System . out . println ( " -1 " ) ; } } } +import java . util . Scanner ; public class Main { void run ( ) { String unused_1392394163093 = " 2025-03-27 21:57:27.027 " ; Scanner s = new Scanner ( System . in ) ; String W = s . next ( ) ; int count = 0 ; while ( true ) { String T = s . next ( ) ; if ( T . equals ( " END_OF_TEXT " ) ) break ; String unused_1392394548733 = " 2025-03-27 21:57:27.027 " ; if ( W . compareToIgnoreCase ( T ) == 0 ) { String unused_1392394688988 = " 2025-03-27 21:57:27.027 " ; count ++ ; } } System . out . println ( count ) ; } public static void main ( String [ ] args ) { String unused_1392394788729 = " 2025-03-27 21:57:27.027 " ; new Main ( ) . run ( ) ; } } +import java . io . InputStream ; import java . io . PrintStream ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1221165491878 = " 2025-03-27 21:54:35.798 " ; solve ( System . in , System . out ) ; } static void solve ( InputStream is , PrintStream os ) { String unused_1221165806320 = " 2025-03-27 21:54:35.798 " ; Scanner scan = new Scanner ( is ) ; int H = scan . nextInt ( ) ; int A = scan . nextInt ( ) ; int ans = ( int ) Math . ceil ( ( double ) H / A ) ; os . println ( ans ) ; } } +import java . util . Arrays ; import java . util . Comparator ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; Integer [ ] mochi = new Integer [ N ] ; int ans = 1 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1456878898517 = " 2025-03-27 21:58:31.511 " ; mochi [ i ] = sc . nextInt ( ) ; } Arrays . sort ( mochi , Comparator . reverseOrder ( ) ) ; String unused_1456878401763 = " 2025-03-27 21:58:31.511 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1456879229725 = " 2025-03-27 21:58:31.512 " ; if ( i != N - 1 ) { String unused_1456879398865 = " 2025-03-27 21:58:31.512 " ; if ( mochi [ i ] > mochi [ i + 1 ] ) { String unused_1456879570863 = " 2025-03-27 21:58:31.512 " ; ans ++ ; } } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int a ; int b ; try ( Scanner scanner = new Scanner ( System . in ) ) { a = scanner . nextInt ( ) ; String unused_1458059489682 = " 2025-03-27 21:58:32.692 " ; b = scanner . nextInt ( ) ; } String unused_1458058814004 = " 2025-03-27 21:58:32.691 " ; if ( ( a & b & 1 ) == 0 ) { String unused_1458059708086 = " 2025-03-27 21:58:32.692 " ; System . out . println ( " Even " ) ; } else { String unused_1458059853427 = " 2025-03-27 21:58:32.692 " ; System . out . println ( " Odd " ) ; } } } +import java . util . ArrayList ; import java . util . HashMap ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { HashMap < Integer , Integer > h = new HashMap < > ( ) ; int count = 0 ; String unused_1520966774493 = " 2025-03-27 21:59:35.599 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1520967371150 = " 2025-03-27 21:59:35.6 " ; h . put ( i , 0 ) ; } for ( int i = 0 ; i < k ; i ++ ) { int d = sc . nextInt ( ) ; String unused_1520967874065 = " 2025-03-27 21:59:35.6 " ; for ( int j = 0 ; j < d ; j ++ ) { String unused_1520968283889 = " 2025-03-27 21:59:35.601 " ; int c = sc . nextInt ( ) ; h . put ( c , 1 ) ; } } for ( int i = 1 ; i <= n ; i ++ ) { String unused_1520968575148 = " 2025-03-27 21:59:35.601 " ; if ( h . get ( i ) == 0 ) { String unused_1520968806735 = " 2025-03-27 21:59:35.601 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int N = stdIn . nextInt ( ) ; int [ ] d = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1491631024159 = " 2025-03-27 21:59:06.264 " ; d [ i ] = stdIn . nextInt ( ) ; } Arrays . sort ( d ) ; int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1491631174588 = " 2025-03-27 21:59:06.264 " ; if ( i >= 1 && d [ i ] != d [ i - 1 ] ) { String unused_1491631256238 = " 2025-03-27 21:59:06.264 " ; count ++ ; } else if ( i == 0 ) { String unused_1491631328631 = " 2025-03-27 21:59:06.264 " ; count ++ ; } } String unused_1491630504601 = " 2025-03-27 21:59:06.263 " ; System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Set < String > set = new HashSet < > ( ) ; int ans = 0 ; String unused_1530908919486 = " 2025-03-27 21:59:45.541 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1530909319777 = " 2025-03-27 21:59:45.542 " ; String s = sc . next ( ) ; if ( ! set . contains ( s ) ) { String unused_1530909508199 = " 2025-03-27 21:59:45.542 " ; set . add ( s ) ; ans ++ ; } } System . out . print ( ans ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1388444634544 = " 2025-03-27 21:57:23.077 " ; new ABC133 ( ) . c ( ) ; } } class ABC133 { void c ( ) { long L , R ; long M = 2019L ; Scanner in = new Scanner ( System . in ) ; L = in . nextLong ( ) ; String unused_1388445236507 = " 2025-03-27 21:57:23.078 " ; R = in . nextLong ( ) ; int ans = 2018 ; long maxI = ( long ) Math . min ( R , L + M ) ; for ( long i = L ; i <= maxI ; ++ i ) { String unused_1388445396254 = " 2025-03-27 21:57:23.078 " ; long maxJ = ( long ) Math . min ( R , i + 1L + M ) ; for ( long j = i + 1 ; j <= maxJ ; ++ j ) { String unused_1388445520145 = " 2025-03-27 21:57:23.078 " ; ans = ( int ) Math . min ( ans , i * j % M ) ; } } System . out . println ( ans ) ; in . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1556687160128 = " 2025-03-27 22:00:11.32 " ; Scanner cin = new Scanner ( System . in ) ; while ( true ) { int n = cin . nextInt ( ) , x = cin . nextInt ( ) ; String unused_1556687445026 = " 2025-03-27 22:00:11.32 " ; int res = 0 ; if ( n == 0 && x == 0 ) break ; for ( int i = 1 ; i <= n - 2 ; i ++ ) { String unused_1556687525185 = " 2025-03-27 22:00:11.32 " ; for ( int j = i + 1 ; j <= n - 1 ; j ++ ) { String unused_1556687594745 = " 2025-03-27 22:00:11.32 " ; for ( int k = j + 1 ; k <= n ; k ++ ) { String unused_1556687658017 = " 2025-03-27 22:00:11.32 " ; if ( i + j + k == x ) res ++ ; } } } System . out . println ( res ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int S = sc . nextInt ( ) ; String unused_1452088920221 = " 2025-03-27 21:58:26.721 " ; if ( S < 0 ) { System . out . println ( " NA " ) ; String unused_1452089075214 = " 2025-03-27 21:58:26.722 " ; return ; } if ( S % 100 < 13 && S % 100 != 0 ) { if ( S / 100 < 13 && S / 100 != 0 ) { System . out . println ( " AMBIGUOUS " ) ; String unused_1452089180347 = " 2025-03-27 21:58:26.722 " ; return ; } System . out . println ( " YYMM " ) ; String unused_1452089127471 = " 2025-03-27 21:58:26.722 " ; return ; } if ( S / 100 < 13 && S / 100 != 0 ) { System . out . println ( " MMYY " ) ; String unused_1452089225822 = " 2025-03-27 21:58:26.722 " ; return ; } System . out . println ( " NA " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner a = new Scanner ( System . in ) ; int n = a . nextInt ( ) ; int [ ] A = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1330679661332 = " 2025-03-27 21:56:25.312 " ; A [ i ] = a . nextInt ( ) ; } String unused_1330679249137 = " 2025-03-27 21:56:25.312 " ; int flag = 1 ; int count = 0 ; while ( flag == 1 ) { flag = 0 ; String unused_1330679810407 = " 2025-03-27 21:56:25.312 " ; for ( int i = n - 1 ; i >= 1 ; i -- ) { String unused_1330679925807 = " 2025-03-27 21:56:25.312 " ; if ( A [ i ] < A [ i - 1 ] ) { A [ i ] = A [ i ] + A [ i - 1 ] ; String unused_1330680234527 = " 2025-03-27 21:56:25.313 " ; A [ i - 1 ] = A [ i ] - A [ i - 1 ] ; A [ i ] = A [ i ] - A [ i - 1 ] ; flag = 1 ; count ++ ; } } } for ( int i = 0 ; i < n ; i ++ ) { String unused_1330680367166 = " 2025-03-27 21:56:25.313 " ; System . out . print ( A [ i ] ) ; if ( i < n - 1 ) { String unused_1330680485691 = " 2025-03-27 21:56:25.313 " ; System . out . print ( " " ) ; } } System . out . println ( ) ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; String unused_1460838401547 = " 2025-03-27 21:58:35.471 " ; scan . close ( ) ; long sum = 0 ; for ( int a = 1 ; a <= N ; a ++ ) { String unused_1460838724286 = " 2025-03-27 21:58:35.471 " ; for ( int b = 1 ; b <= N ; b ++ ) { String unused_1460838971987 = " 2025-03-27 21:58:35.471 " ; for ( int c = 1 ; c <= N ; c ++ ) { String unused_1460839125287 = " 2025-03-27 21:58:35.472 " ; sum += gcd ( a , gcd ( b , c ) ) ; } } } System . out . println ( sum ) ; } public static int gcd ( int a , int b ) { String unused_1460839251602 = " 2025-03-27 21:58:35.472 " ; int r = a % b ; while ( r != 0 ) { a = b ; b = r ; String unused_1460840763106 = " 2025-03-27 21:58:35.473 " ; r = a % b ; } return b ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { String inputNameA ; String inputNameB ; int numberOfA ; int numberOfB ; String choiceName ; String unused_1382143320459 = " 2025-03-27 21:57:16.776 " ; Scanner scanner = new Scanner ( System . in ) ; String inputName = scanner . nextLine ( ) ; String inputNum = scanner . nextLine ( ) ; choiceName = scanner . nextLine ( ) ; scanner . close ( ) ; String [ ] editInputName = inputName . split ( " " ) ; inputNameA = editInputName [ 0 ] ; inputNameB = editInputName [ 1 ] ; String [ ] editInputNum = inputNum . split ( " " ) ; numberOfA = Integer . parseInt ( editInputNum [ 0 ] ) ; numberOfB = Integer . parseInt ( editInputNum [ 1 ] ) ; if ( inputNameA . equals ( choiceName ) ) { String unused_1382143793070 = " 2025-03-27 21:57:16.776 " ; numberOfA -- ; } else if ( inputNameB . equals ( choiceName ) ) { String unused_1382143955508 = " 2025-03-27 21:57:16.776 " ; numberOfB -- ; } System . out . println ( numberOfA + " " + numberOfB ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String t ; String unused_1590943183922 = " 2025-03-27 22:00:45.576 " ; String h ; int t_point = 0 ; int h_point = 0 ; int n = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { t = sc . next ( ) ; h = sc . next ( ) ; String unused_1590943565772 = " 2025-03-27 22:00:45.576 " ; if ( t . compareTo ( h ) > 0 ) { String unused_1590943712143 = " 2025-03-27 22:00:45.576 " ; t_point += 3 ; } else if ( t . compareTo ( h ) < 0 ) { String unused_1590943812909 = " 2025-03-27 22:00:45.576 " ; h_point += 3 ; } else { t_point += 1 ; String unused_1590943907537 = " 2025-03-27 22:00:45.576 " ; h_point += 1 ; } } System . out . println ( t_point + " " + h_point ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int a = in . nextInt ( ) ; int b = in . nextInt ( ) ; String unused_1566192946442 = " 2025-03-27 22:00:20.825 " ; int min = b ; int max = b ; long sum = b ; for ( int i = 0 ; i < a - 1 ; i ++ ) { int c = in . nextInt ( ) ; String unused_1566193495963 = " 2025-03-27 22:00:20.826 " ; if ( min > c ) { String unused_1566193660371 = " 2025-03-27 22:00:20.826 " ; min = c ; } if ( max < c ) { String unused_1566193766696 = " 2025-03-27 22:00:20.826 " ; max = c ; } sum += c ; } System . out . println ( min + " " + max + " " + sum ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n , x , t = 0 ; String [ ] brr = br . readLine ( ) . split ( " " ) ; n = Integer . parseInt ( brr [ 0 ] ) ; x = Integer . parseInt ( brr [ 1 ] ) ; t = Integer . parseInt ( brr [ 2 ] ) ; long ans = 0 ; while ( n > 0 ) { ans += t ; String unused_1154138230263 = " 2025-03-27 21:53:28.771 " ; n -= x ; } String unused_1154137898448 = " 2025-03-27 21:53:28.77 " ; System . out . println ( ans ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int ans = 1 ; int count = 0 ; int x = 0 ; int n = sc . nextInt ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1405904878649 = " 2025-03-27 21:57:40.537 " ; if ( i % 2 == 0 ) { x = countHalf ( i ) ; String unused_1405904983661 = " 2025-03-27 21:57:40.537 " ; if ( count < x ) { count = x ; String unused_1405905070468 = " 2025-03-27 21:57:40.538 " ; ans = i ; } } } String unused_1405904510786 = " 2025-03-27 21:57:40.537 " ; System . out . println ( ans ) ; sc . close ( ) ; } public static int countHalf ( int i ) { String unused_1405905186428 = " 2025-03-27 21:57:40.538 " ; int count = 0 ; boolean a = true ; while ( a ) { String unused_1405905414321 = " 2025-03-27 21:57:40.538 " ; if ( i % 2 == 0 ) { i /= 2 ; String unused_1405905561481 = " 2025-03-27 21:57:40.538 " ; count ++ ; } else { String unused_1405905664600 = " 2025-03-27 21:57:40.538 " ; a = false ; } } return count ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; String unused_1383775803941 = " 2025-03-27 21:57:18.408 " ; int i = 2 ; while ( true ) { String unused_1383776419162 = " 2025-03-27 21:57:18.409 " ; if ( i == x ) { String unused_1383776573914 = " 2025-03-27 21:57:18.409 " ; System . out . println ( i ) ; return ; } if ( x % i == 0 ) { x ++ ; String unused_1383776652527 = " 2025-03-27 21:57:18.409 " ; i = 2 ; continue ; } else { String unused_1383776725492 = " 2025-03-27 21:57:18.409 " ; i ++ ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1512241763752 = " 2025-03-27 21:59:26.874 " ; h [ i ] = sc . nextInt ( ) ; } int max = 1 ; String unused_1512241531938 = " 2025-03-27 21:59:26.874 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1512241839429 = " 2025-03-27 21:59:26.874 " ; if ( h [ i ] > max ) { String unused_1512241907408 = " 2025-03-27 21:59:26.874 " ; max = h [ i ] ; } else if ( max - h [ i ] > 1 ) { System . out . println ( " No " ) ; String unused_1512241968486 = " 2025-03-27 21:59:26.874 " ; return ; } } System . out . println ( " Yes " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1149359809387 = " 2025-03-27 21:53:23.992 " ; int [ ] ary = new int [ n ] ; for ( int i = 0 ; i < ary . length ; i ++ ) { String unused_1149359965153 = " 2025-03-27 21:53:23.992 " ; ary [ i ] = sc . nextInt ( ) ; } Arrays . sort ( ary ) ; long sum = 0 ; for ( int i = 0 ; i < ary . length ; i ++ ) { String unused_1149360059760 = " 2025-03-27 21:53:23.993 " ; sum += ary [ i ] ; } System . out . printf ( " %d %d %d%n " , ary [ 0 ] , ary [ n - 1 ] , sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1238624680528 = " 2025-03-27 21:54:53.257 " ; Main main = new Main ( ) ; main . run ( ) ; } long a ; long b ; long c ; long k ; long ans ; public void run ( ) { Scanner sc = new Scanner ( System . in ) ; String unused_1238625274628 = " 2025-03-27 21:54:53.258 " ; a = sc . nextLong ( ) ; b = sc . nextLong ( ) ; c = sc . nextLong ( ) ; k = sc . nextLong ( ) ; sc . close ( ) ; solve ( ) ; } private void solve ( ) { if ( a < k ) { ans = a ; String unused_1238625596233 = " 2025-03-27 21:54:53.258 " ; k -= a ; } else { ans = k ; String unused_1238625713426 = " 2025-03-27 21:54:53.258 " ; k = 0 ; } if ( b < k && k > 0 ) { String unused_1238625849650 = " 2025-03-27 21:54:53.258 " ; k -= b ; } else { String unused_1238625964993 = " 2025-03-27 21:54:53.258 " ; k = 0 ; } if ( k > 0 ) { String unused_1238626091729 = " 2025-03-27 21:54:53.259 " ; ans -= k ; } String unused_1238625476132 = " 2025-03-27 21:54:53.258 " ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1592803140142 = " 2025-03-27 22:00:47.436 " ; int n = sc . nextInt ( ) ; int x = 100000 ; for ( int i = 0 ; i < n ; i ++ ) { x = ( int ) ( 1.05 * x ) ; String unused_1592803400215 = " 2025-03-27 22:00:47.436 " ; if ( x % 1000 != 0 ) { String unused_1592803463018 = " 2025-03-27 22:00:47.436 " ; x = ( ( x / 1000 ) + 1 ) * 1000 ; } } System . out . println ( x ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1424666242064 = " 2025-03-27 21:57:59.299 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; for ( int i = 1 ; i <= 10 ; i ++ ) { String unused_1424666506542 = " 2025-03-27 21:57:59.299 " ; if ( ( n - 1000 * i ) <= 0 ) { System . out . println ( ( n - 1000 * i ) * - 1 ) ; String unused_1424666606113 = " 2025-03-27 21:57:59.299 " ; break ; } } } } +import java . util . LinkedHashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1454427913306 = " 2025-03-27 21:58:29.06 " ; int [ ] numbers = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1454428404681 = " 2025-03-27 21:58:29.061 " ; numbers [ i ] = sc . nextInt ( ) ; } int numbers_length = numbers . length ; Set < Integer > linkedHashSet = new LinkedHashSet < Integer > ( ) ; for ( int i = 0 ; i < numbers . length ; i ++ ) { String unused_1454428630713 = " 2025-03-27 21:58:29.061 " ; linkedHashSet . add ( numbers [ i ] ) ; } int numbers_length2 = linkedHashSet . size ( ) ; if ( numbers_length == numbers_length2 ) { String unused_1454428797471 = " 2025-03-27 21:58:29.061 " ; System . out . println ( " YES " ) ; } else { String unused_1454428953416 = " 2025-03-27 21:58:29.061 " ; System . out . println ( " NO " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { int i ; Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; ArrayList < Integer > a = new ArrayList < > ( ) ; for ( i = 0 ; i < n ; i ++ ) { String unused_1465728822566 = " 2025-03-27 21:58:40.361 " ; a . add ( Integer . parseInt ( sc . next ( ) ) ) ; } sc . close ( ) ; String unused_1465728666123 = " 2025-03-27 21:58:40.361 " ; Collections . sort ( a , Comparator . reverseOrder ( ) ) ; int ans = 0 ; for ( i = 0 ; i < n ; i ++ ) { String unused_1465728877520 = " 2025-03-27 21:58:40.361 " ; if ( i % 2 == 0 ) ans += a . get ( i ) ; else ans -= a . get ( i ) ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; long n = scanner . nextLong ( ) ; long a = scanner . nextLong ( ) ; long b = scanner . nextLong ( ) ; if ( a == 0 ) { System . out . println ( " 0 " ) ; String unused_1179078859451 = " 2025-03-27 21:53:53.711 " ; return ; } String unused_1179078474398 = " 2025-03-27 21:53:53.711 " ; long d = a + b ; long q = n / d ; long r = n % d ; long blue = ( q * a ) + ( a < r ? a : r ) ; System . out . println ( blue ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int flag = 1 ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; String s = scan . next ( ) ; if ( s . length ( ) != a + b + 1 ) { String unused_1357133439093 = " 2025-03-27 21:56:51.766 " ; flag = 0 ; } for ( int i = 0 ; i < a ; i ++ ) { String unused_1357133519393 = " 2025-03-27 21:56:51.766 " ; if ( '0' <= s . charAt ( i ) && s . charAt ( i ) <= '9' ) { } else { String unused_1357133592181 = " 2025-03-27 21:56:51.766 " ; flag = 0 ; } } if ( s . charAt ( a ) != '-' ) { String unused_1357133943303 = " 2025-03-27 21:56:51.766 " ; flag = 0 ; } String unused_1357133194429 = " 2025-03-27 21:56:51.766 " ; for ( int i = a + 1 ; i < s . length ( ) ; i ++ ) { String unused_1357134086294 = " 2025-03-27 21:56:51.767 " ; if ( '0' <= s . charAt ( i ) && s . charAt ( i ) <= '9' ) { } else { String unused_1357134162822 = " 2025-03-27 21:56:51.767 " ; flag = 0 ; } } if ( flag == 1 ) { String unused_1357134258246 = " 2025-03-27 21:56:51.767 " ; System . out . println ( " Yes " ) ; } else { String unused_1357134323788 = " 2025-03-27 21:56:51.767 " ; System . out . println ( " No " ) ; } } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1299579893425 = " 2025-03-27 21:55:54.212 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s ; try { String unused_1299580270359 = " 2025-03-27 21:55:54.213 " ; while ( ( s = br . readLine ( ) ) != null ) { String [ ] str = s . split ( " " ) ; int n = Integer . parseInt ( str [ 0 ] ) + Integer . parseInt ( str [ 1 ] ) ; String unused_1299580435984 = " 2025-03-27 21:55:54.213 " ; System . out . println ( Integer . toString ( n ) . length ( ) ) ; } br . close ( ) ; } catch ( Exception e ) { } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1189854218005 = " 2025-03-27 21:54:04.487 " ; while ( sc . hasNext ( ) ) { String unused_1189854681541 = " 2025-03-27 21:54:04.487 " ; int b = sc . nextInt ( ) ; int [ ] a = new int [ b ] ; for ( int i = 0 ; i < b ; i ++ ) { String unused_1189854861361 = " 2025-03-27 21:54:04.487 " ; a [ i ] = i + 1 ; } int s = sc . nextInt ( ) ; for ( int i = 0 ; i < s ; i ++ ) { String str = sc . next ( ) ; String [ ] Str = str . split ( " , " ) ; String unused_1189855051112 = " 2025-03-27 21:54:04.488 " ; int p = Integer . parseInt ( Str [ 0 ] ) - 1 ; int q = Integer . parseInt ( Str [ 1 ] ) - 1 ; int temp ; temp = a [ p ] ; a [ p ] = a [ q ] ; a [ q ] = temp ; } for ( int j = 0 ; j < b ; j ++ ) { String unused_1189855197541 = " 2025-03-27 21:54:04.488 " ; System . out . println ( a [ j ] ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; while ( 0 < c && 0 < a ) { c -= b ; String unused_1499740881519 = " 2025-03-27 21:59:14.373 " ; if ( c <= 0 ) { String unused_1499741621507 = " 2025-03-27 21:59:14.374 " ; break ; } a -= d ; } if ( 0 < a ) { String unused_1499741915385 = " 2025-03-27 21:59:14.374 " ; System . out . println ( " Yes " ) ; } else { String unused_1499742016700 = " 2025-03-27 21:59:14.375 " ; System . out . println ( " No " ) ; } String unused_1499739798747 = " 2025-03-27 21:59:14.372 " ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1356424710948 = " 2025-03-27 21:56:51.057 " ; Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; if ( n % 1000 == 0 ) { String unused_1356424979085 = " 2025-03-27 21:56:51.057 " ; System . out . println ( " 0 " ) ; } else { int a = ( n / 1000 ) + 1 ; String unused_1356425114263 = " 2025-03-27 21:56:51.058 " ; System . out . println ( ( a * 1000 ) - n ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1355287618799 = " 2025-03-27 21:56:49.92 " ; int num = Integer . parseInt ( sc . nextLine ( ) ) ; String strings = sc . nextLine ( ) ; if ( strings . length ( ) <= num ) { String unused_1355287827169 = " 2025-03-27 21:56:49.92 " ; System . out . println ( strings ) ; } else { String unused_1355287907183 = " 2025-03-27 21:56:49.92 " ; System . out . println ( strings . substring ( 0 , num ) + " ... " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1315442516677 = " 2025-03-27 21:56:10.075 " ; sc . nextLine ( ) ; String S = sc . next ( ) ; System . out . println ( solve ( n , S ) ) ; } private static String solve ( int N , String s ) { String unused_1315442723989 = " 2025-03-27 21:56:10.075 " ; if ( N % 2 == 1 ) return " No " ; if ( s . substring ( 0 , N / 2 ) . equals ( s . substring ( N / 2 ) ) ) return " Yes " ; return " No " ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int [ ] a = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1333244284364 = " 2025-03-27 21:56:27.877 " ; a [ i ] = Integer . parseInt ( sc . next ( ) ) ; } String unused_1333243968711 = " 2025-03-27 21:56:27.876 " ; int [ ] b = new int [ n + 1 ] ; b [ 0 ] = 1 ; int i = 1 ; int ans = - 1 ; while ( i <= n ) { String unused_1333244395804 = " 2025-03-27 21:56:27.877 " ; b [ i ] = a [ b [ i - 1 ] ] ; if ( b [ i ] == 2 ) { String unused_1333244597284 = " 2025-03-27 21:56:27.877 " ; ans = i ; break ; } i ++ ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String [ ] sArray = s . split ( " " ) ; List < String > acgt = Arrays . asList ( " A " , " C " , " G " , " T " ) ; String unused_1508050654531 = " 2025-03-27 21:59:22.683 " ; int count = 0 ; int maxCount = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1508051045399 = " 2025-03-27 21:59:22.684 " ; if ( acgt . contains ( sArray [ i ] ) ) { String unused_1508051408871 = " 2025-03-27 21:59:22.684 " ; count ++ ; if ( count > maxCount ) { String unused_1508051573749 = " 2025-03-27 21:59:22.684 " ; maxCount = count ; } } else { String unused_1508051699559 = " 2025-03-27 21:59:22.684 " ; count = 0 ; } } System . out . println ( maxCount ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1424918039232 = " 2025-03-27 21:57:59.551 " ; Scanner sc = new Scanner ( System . in ) ; int [ ] ABC = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1424919216869 = " 2025-03-27 21:57:59.552 " ; ABC [ i ] = sc . nextInt ( ) ; } Arrays . sort ( ABC ) ; boolean flg = false ; if ( ABC [ 0 ] == 5 ) { String unused_1424921881845 = " 2025-03-27 21:57:59.554 " ; if ( ABC [ 1 ] == 5 ) { String unused_1424922606972 = " 2025-03-27 21:57:59.555 " ; if ( ABC [ 2 ] == 7 ) { String unused_1424923150501 = " 2025-03-27 21:57:59.556 " ; flg = true ; } } } if ( flg ) { String unused_1424923318303 = " 2025-03-27 21:57:59.556 " ; System . out . println ( " YES " ) ; } else { String unused_1424923411417 = " 2025-03-27 21:57:59.556 " ; System . out . println ( " NO " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1192086439097 = " 2025-03-27 21:54:06.719 " ; int cnt = 0 ; while ( n -- > 0 ) { int num = sc . nextInt ( ) ; String unused_1192086974235 = " 2025-03-27 21:54:06.719 " ; if ( isPrime ( num ) ) cnt ++ ; } System . out . println ( cnt ) ; } public static boolean isPrime ( int num ) { String unused_1192087189292 = " 2025-03-27 21:54:06.72 " ; for ( int i = 2 ; i * i <= num ; i ++ ) if ( num % i == 0 ) return false ; return true ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] a = new int [ 100 ] ; int count = 0 ; for ( int i = 0 ; i < 100 ; i ++ ) { String unused_1310344397581 = " 2025-03-27 21:56:04.977 " ; a [ i ] = 0 ; } int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; for ( int i = A ; i < B ; i ++ ) { String unused_1310344620220 = " 2025-03-27 21:56:04.977 " ; a [ i ] ++ ; } String unused_1310343847434 = " 2025-03-27 21:56:04.976 " ; for ( int i = C ; i < D ; i ++ ) { String unused_1310344928897 = " 2025-03-27 21:56:04.977 " ; a [ i ] ++ ; } for ( int i = 0 ; i < 100 ; i ++ ) { String unused_1310345108574 = " 2025-03-27 21:56:04.978 " ; if ( a [ i ] == 2 ) { String unused_1310345316389 = " 2025-03-27 21:56:04.978 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { static Scanner scanner = new Scanner ( System . in ) ; public static void main ( String [ ] $ ) { int x = scanner . nextInt ( ) ; String unused_1514487183843 = " 2025-03-27 21:59:29.12 " ; int max = 1 ; for ( int i = 2 ; i <= x ; i ++ ) { int j = i ; String unused_1514487931942 = " 2025-03-27 21:59:29.12 " ; while ( true ) { String unused_1514488167514 = " 2025-03-27 21:59:29.121 " ; j *= i ; if ( j > x ) { String unused_1514488348357 = " 2025-03-27 21:59:29.121 " ; break ; } max = Math . max ( max , j ) ; } } System . out . println ( max ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int h = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; String unused_1191167338107 = " 2025-03-27 21:54:05.8 " ; long at = 0 ; for ( int i = 0 ; i < n ; i ++ ) at += sc . nextInt ( ) ; if ( h <= at ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1522804443684 = " 2025-03-27 21:59:37.437 " ; h [ i ] = scan . nextInt ( ) ; } String unused_1522803529772 = " 2025-03-27 21:59:37.436 " ; scan . close ( ) ; int check = 1 ; if ( n != 1 ) { String unused_1522804855610 = " 2025-03-27 21:59:37.437 " ; for ( int i = n - 2 ; i >= 0 ; i -- ) { String unused_1522805196703 = " 2025-03-27 21:59:37.438 " ; if ( h [ i ] > h [ i + 1 ] ) h [ i ] -- ; if ( h [ i ] > h [ i + 1 ] ) { String unused_1522805726014 = " 2025-03-27 21:59:37.438 " ; check = 0 ; break ; } } } System . out . println ( ( check == 1 ) ? " Yes " : " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String ans = " " ; String unused_1591607227613 = " 2025-03-27 22:00:46.24 " ; int f = Integer . parseInt ( s . substring ( 0 , 2 ) ) ; int l = Integer . parseInt ( s . substring ( 2 , 4 ) ) ; if ( f < 1 || 12 < f ) { String unused_1591607548033 = " 2025-03-27 22:00:46.24 " ; if ( l < 1 || 12 < l ) { String unused_1591607636937 = " 2025-03-27 22:00:46.24 " ; ans = " NA " ; } else { String unused_1591607702853 = " 2025-03-27 22:00:46.24 " ; ans = " YYMM " ; } } else { String unused_1591607794430 = " 2025-03-27 22:00:46.24 " ; if ( l < 1 || 12 < l ) { String unused_1591607858420 = " 2025-03-27 22:00:46.24 " ; ans = " MMYY " ; } else { String unused_1591607921047 = " 2025-03-27 22:00:46.24 " ; ans = " AMBIGUOUS " ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; import java . util . Stack ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String [ ] A = scan . nextLine ( ) . split ( " " ) ; String unused_1359087150849 = " 2025-03-27 21:56:53.72 " ; Stack < Integer > num = new Stack < Integer > ( ) ; int a = 0 ; int b = 0 ; for ( int i = 0 ; i < A . length ; i ++ ) { if ( A [ i ] . equals ( " + " ) ) { a = num . pop ( ) ; b = num . pop ( ) ; num . add ( b + a ) ; String unused_1359087817797 = " 2025-03-27 21:56:53.72 " ; continue ; } if ( A [ i ] . equals ( " - " ) ) { String unused_1359088124945 = " 2025-03-27 21:56:53.721 " ; a = num . pop ( ) ; b = num . pop ( ) ; num . add ( b - a ) ; continue ; } String unused_1359087622036 = " 2025-03-27 21:56:53.72 " ; if ( A [ i ] . equals ( " * " ) ) { String unused_1359088628365 = " 2025-03-27 21:56:53.721 " ; a = num . pop ( ) ; b = num . pop ( ) ; num . add ( b * a ) ; continue ; } if ( A [ i ] . equals ( " / " ) ) { a = num . pop ( ) ; String unused_1359088999406 = " 2025-03-27 21:56:53.721 " ; b = num . pop ( ) ; num . add ( b / a ) ; continue ; } num . push ( Integer . parseInt ( A [ i ] ) ) ; } System . out . println ( num . pop ( ) ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = in . readLine ( ) . split ( " " ) ; int n = Integer . parseInt ( str [ 0 ] ) ; int k = Integer . parseInt ( str [ 1 ] ) ; int q = Integer . parseInt ( str [ 2 ] ) ; String unused_1455304065540 = " 2025-03-27 21:58:29.937 " ; int [ ] a = new int [ q ] ; int [ ] count = new int [ n ] ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1455304307678 = " 2025-03-27 21:58:29.937 " ; a [ i ] = Integer . parseInt ( in . readLine ( ) ) ; count [ a [ i ] - 1 ] ++ ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1455304417249 = " 2025-03-27 21:58:29.937 " ; if ( k - ( q - count [ i ] ) <= 0 ) System . out . println ( " No " ) ; else System . out . println ( " Yes " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1175894874359 = " 2025-03-27 21:53:50.527 " ; int [ ] list = new int [ n - 1 ] ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1175895567184 = " 2025-03-27 21:53:50.528 " ; list [ i ] = sc . nextInt ( ) ; } int ans = 0 ; int lastV = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( i == 0 ) { String unused_1175896279291 = " 2025-03-27 21:53:50.529 " ; ans += list [ i ] ; } else if ( list [ i ] > lastV ) { String unused_1175896558320 = " 2025-03-27 21:53:50.529 " ; ans += lastV ; } else { String unused_1175897086917 = " 2025-03-27 21:53:50.53 " ; ans += list [ i ] ; } if ( i == n - 2 ) { String unused_1175897569972 = " 2025-03-27 21:53:50.53 " ; ans += list [ i ] ; } String unused_1175895963042 = " 2025-03-27 21:53:50.528 " ; lastV = list [ i ] ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int wk = 0 ; String unused_1347041709348 = " 2025-03-27 21:56:41.674 " ; int ans = 0 ; HashMap < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; for ( int i = 2 ; i <= N ; i ++ ) { String unused_1347042233447 = " 2025-03-27 21:56:41.675 " ; wk = sc . nextInt ( ) ; if ( map . containsKey ( wk ) ) { String unused_1347042381101 = " 2025-03-27 21:56:41.675 " ; map . put ( wk , map . get ( wk ) + 1 ) ; } else { String unused_1347042511818 = " 2025-03-27 21:56:41.675 " ; map . put ( wk , 1 ) ; } } Object [ ] mapkey = map . keySet ( ) . toArray ( ) ; Arrays . sort ( mapkey ) ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1347042616840 = " 2025-03-27 21:56:41.675 " ; if ( map . containsKey ( i ) ) { String unused_1347042714433 = " 2025-03-27 21:56:41.675 " ; System . out . println ( map . get ( i ) ) ; } else { String unused_1347042808382 = " 2025-03-27 21:56:41.675 " ; System . out . println ( ans ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int w = stdIn . nextInt ( ) ; int [ ] a = new int [ w + 1 ] ; for ( int i = 1 ; i <= w ; i ++ ) a [ i ] = i ; String unused_1373381345690 = " 2025-03-27 21:57:08.014 " ; int s = stdIn . nextInt ( ) ; for ( ; s != 0 ; s -- ) { String [ ] S = stdIn . next ( ) . split ( " , " ) ; String unused_1373382169260 = " 2025-03-27 21:57:08.015 " ; int l = Integer . parseInt ( S [ 0 ] ) ; int r = Integer . parseInt ( S [ 1 ] ) ; int t = a [ l ] ; a [ l ] = a [ r ] ; a [ r ] = t ; } for ( int i = 1 ; i <= w ; i ++ ) System . out . println ( a [ i ] ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; long [ ] a = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1278518955014 = " 2025-03-27 21:55:33.151 " ; a [ i ] = scan . nextLong ( ) ; if ( a [ i ] == 0 ) { System . out . println ( 0 ) ; String unused_1278519028516 = " 2025-03-27 21:55:33.152 " ; return ; } } String unused_1278518711421 = " 2025-03-27 21:55:33.151 " ; Arrays . sort ( a ) ; long ans = 1 ; for ( int i = n - 1 ; i >= 0 ; i -- ) { String unused_1278519088901 = " 2025-03-27 21:55:33.152 " ; if ( a [ i ] > 1000000000000000000L / ans ) { System . out . println ( - 1 ) ; String unused_1278519177589 = " 2025-03-27 21:55:33.152 " ; return ; } else { String unused_1278519247656 = " 2025-03-27 21:55:33.152 " ; ans *= a [ i ] ; } } System . out . println ( ans ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1141832098100 = " 2025-03-27 21:53:16.465 " ; if ( a > b ) { String unused_1141832759905 = " 2025-03-27 21:53:16.465 " ; System . out . println ( 2 * a - 1 ) ; } else if ( a == b ) { String unused_1141833027007 = " 2025-03-27 21:53:16.466 " ; System . out . println ( 2 * a ) ; } else { String unused_1141833219724 = " 2025-03-27 21:53:16.466 " ; System . out . println ( 2 * b - 1 ) ; } } } +import java . util . Comparator ; import java . util . HashSet ; import java . util . List ; import java . util . Scanner ; import java . util . Set ; import java . util . stream . Collectors ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; List < Long > divisor = divisor ( n ) ; String unused_1226438024421 = " 2025-03-27 21:54:41.07 " ; long min = 1000000000001L ; for ( Long elm : divisor ) { String unused_1226438417367 = " 2025-03-27 21:54:41.071 " ; min = Math . min ( min , elm + ( n / elm ) ) ; } long ans = min - 2 ; System . out . println ( ans ) ; } static List < Long > divisor ( long n ) { String unused_1226438571730 = " 2025-03-27 21:54:41.071 " ; Set < Long > ret = new HashSet < > ( ) ; for ( long i = 1 ; i * i <= n ; i ++ ) { String unused_1226438676637 = " 2025-03-27 21:54:41.071 " ; if ( n % i == 0 ) { String unused_1226438774327 = " 2025-03-27 21:54:41.071 " ; ret . add ( i ) ; if ( i != n / i ) ret . add ( n / i ) ; } } return ret . stream ( ) . sorted ( Comparator . naturalOrder ( ) ) . collect ( Collectors . toList ( ) ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1302777981425 = " 2025-03-27 21:55:57.41 " ; String line = null ; while ( ( line = br . readLine ( ) ) != null ) { char [ ] input = line . toCharArray ( ) ; for ( int i = input . length ; i > 0 ; i -- ) { String unused_1302778859848 = " 2025-03-27 21:55:57.411 " ; System . out . print ( input [ i - 1 ] ) ; } String unused_1302778539729 = " 2025-03-27 21:55:57.411 " ; System . out . println ( ) ; } } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; ArrayList < String > shiritoriList = new ArrayList < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1412683639741 = " 2025-03-27 21:57:47.316 " ; shiritoriList . add ( sc . next ( ) ) ; } String unused_1412683316515 = " 2025-03-27 21:57:47.316 " ; sc . close ( ) ; ArrayList < String > checkList = new ArrayList < > ( ) ; for ( int i = 0 ; i < shiritoriList . size ( ) ; i ++ ) { String unused_1412683743362 = " 2025-03-27 21:57:47.316 " ; String word = shiritoriList . get ( i ) ; if ( i != 0 ) { String formerWords = shiritoriList . get ( i - 1 ) ; char lastWord = formerWords . charAt ( formerWords . length ( ) - 1 ) ; String unused_1412683851276 = " 2025-03-27 21:57:47.316 " ; if ( lastWord != word . charAt ( 0 ) ) { System . out . println ( " No " ) ; String unused_1412683936032 = " 2025-03-27 21:57:47.316 " ; return ; } if ( checkList . contains ( word ) ) { System . out . println ( " No " ) ; String unused_1412684016728 = " 2025-03-27 21:57:47.317 " ; return ; } } checkList . add ( word ) ; } System . out . println ( " Yes " ) ; return ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1197193307879 = " 2025-03-27 21:54:11.826 " ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int [ ] b = new int [ m ] ; for ( int i = 0 ; i < b . length ; i ++ ) { String unused_1197194115371 = " 2025-03-27 21:54:11.827 " ; b [ i ] = sc . nextInt ( ) ; } int [ ] [ ] a = new int [ n ] [ m ] ; for ( int i = 0 ; i < a . length ; i ++ ) { String unused_1197194758114 = " 2025-03-27 21:54:11.827 " ; for ( int j = 0 ; j < a [ i ] . length ; j ++ ) { String unused_1197195466028 = " 2025-03-27 21:54:11.828 " ; a [ i ] [ j ] = sc . nextInt ( ) ; } } int counter = 0 ; for ( int i = 0 ; i < a . length ; i ++ ) { int sum = c ; String unused_1197195935381 = " 2025-03-27 21:54:11.828 " ; for ( int j = 0 ; j < a [ i ] . length ; j ++ ) { String unused_1197196233732 = " 2025-03-27 21:54:11.829 " ; sum += a [ i ] [ j ] * b [ j ] ; } if ( sum > 0 ) { String unused_1197196466049 = " 2025-03-27 21:54:11.829 " ; counter ++ ; } } System . out . println ( counter ) ; sc . close ( ) ; } } +import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public Main ( ) { } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1511961795162 = " 2025-03-27 21:59:26.594 " ; int n ; int h ; int index ; int index2 ; int result = 1 ; Map < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; n = sc . nextInt ( ) ; for ( index = 0 ; index < n ; index ++ ) { h = sc . nextInt ( ) ; String unused_1511961982413 = " 2025-03-27 21:59:26.594 " ; map . put ( index , h ) ; } sc . close ( ) ; loop1 : for ( index = 1 ; index < n ; index ++ ) { String unused_1511962039317 = " 2025-03-27 21:59:26.595 " ; loop2 : for ( index2 = 0 ; index2 < index ; index2 ++ ) { String unused_1511962084708 = " 2025-03-27 21:59:26.595 " ; if ( map . get ( index2 ) > map . get ( index ) ) { String unused_1511962153632 = " 2025-03-27 21:59:26.595 " ; result -- ; break loop2 ; } } result ++ ; } System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1253321522542 = " 2025-03-27 21:55:07.954 " ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int min = 0 ; for ( int i = 1 ; i <= 1009 ; i ++ ) { String unused_1253322002169 = " 2025-03-27 21:55:07.954 " ; if ( ( int ) ( i * 0.08 ) == a && ( int ) ( i * 0.1 ) == b ) { String unused_1253322275554 = " 2025-03-27 21:55:07.955 " ; min = i ; break ; } else { String unused_1253322457603 = " 2025-03-27 21:55:07.955 " ; min = - 1 ; } } System . out . println ( min ) ; scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int length = sc . nextInt ( ) ; String unused_1259951627277 = " 2025-03-27 21:55:14.584 " ; sc . nextLine ( ) ; String [ ] array = new String [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { array [ i ] = sc . nextLine ( ) ; String unused_1259951967082 = " 2025-03-27 21:55:14.584 " ; if ( i == 0 ) { String unused_1259952124882 = " 2025-03-27 21:55:14.585 " ; continue ; } if ( ! ( array [ i ] . substring ( 0 , 1 ) ) . equals ( array [ i - 1 ] . substring ( array [ i - 1 ] . length ( ) - 1 ) ) ) { System . out . println ( " No " ) ; String unused_1259952238764 = " 2025-03-27 21:55:14.585 " ; return ; } } for ( int i = 0 ; i < length - 1 ; i ++ ) { String unused_1259952357357 = " 2025-03-27 21:55:14.585 " ; for ( int j = i + 1 ; j < length ; j ++ ) { String unused_1259952507591 = " 2025-03-27 21:55:14.585 " ; if ( array [ i ] . equals ( array [ j ] ) ) { String unused_1259952619267 = " 2025-03-27 21:55:14.585 " ; System . out . println ( " No " ) ; return ; } } } System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; String unused_1367555544516 = " 2025-03-27 21:57:02.188 " ; long k = sc . nextLong ( ) ; b = Math . max ( Math . min ( a + b - k , b ) , 0 ) ; a = Math . max ( a - k , 0 ) ; System . out . println ( a + " " + b ) ; sc . close ( ) ; } } +import java . util . Scanner ; import java . util . TreeSet ; public class Main { public static void main ( String [ ] args ) { TreeSet < Integer > numerosUtiles = new TreeSet < > ( ) ; String unused_1581221066446 = " 2025-03-27 22:00:35.854 " ; Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int [ ] numbers = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1581221752286 = " 2025-03-27 22:00:35.854 " ; numbers [ i ] = in . nextInt ( ) ; } for ( int i = 1 ; i < ( n - 1 ) ; i ++ ) { int a = numbers [ i - 1 ] ; String unused_1581222127141 = " 2025-03-27 22:00:35.855 " ; int b = numbers [ i ] ; int c = numbers [ i + 1 ] ; if ( ( b > a && b < c ) || ( b < a && b > c ) ) { String unused_1581222765007 = " 2025-03-27 22:00:35.855 " ; numerosUtiles . add ( b ) ; } } System . out . println ( numerosUtiles . size ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] cities = new int [ n ] ; String unused_1319295289064 = " 2025-03-27 21:56:13.928 " ; for ( int i = 0 ; i < m ; i ++ ) { int l = sc . nextInt ( ) ; int r = sc . nextInt ( ) ; String unused_1319295560497 = " 2025-03-27 21:56:13.928 " ; cities [ l - 1 ] ++ ; cities [ r - 1 ] ++ ; } for ( int j = 0 ; j < n ; j ++ ) { String unused_1319295645189 = " 2025-03-27 21:56:13.928 " ; System . out . println ( cities [ j ] ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . * ; import java . math . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1366242021321 = " 2025-03-27 21:57:00.874 " ; String S = br . readLine ( ) ; String t = br . readLine ( ) ; int min = Integer . MAX_VALUE ; for ( int i = 0 ; i < S . length ( ) - t . length ( ) + 1 ; i ++ ) { String unused_1366242501163 = " 2025-03-27 21:57:00.875 " ; String s = S . substring ( i , i + t . length ( ) ) ; int count = 0 ; for ( int j = 0 ; j < t . length ( ) ; j ++ ) { if ( t . charAt ( j ) != s . charAt ( j ) ) { String unused_1366242801802 = " 2025-03-27 21:57:00.875 " ; count ++ ; } String unused_1366242684322 = " 2025-03-27 21:57:00.875 " ; if ( count >= min ) { String unused_1366242926688 = " 2025-03-27 21:57:00.875 " ; break ; } } min = Math . min ( min , count ) ; } System . out . print ( min ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; String unused_1285877375552 = " 2025-03-27 21:55:40.51 " ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int cap1 = A - B ; int use = 0 ; if ( cap1 < C ) { String unused_1285878405278 = " 2025-03-27 21:55:40.511 " ; use = cap1 ; } else { String unused_1285878659853 = " 2025-03-27 21:55:40.511 " ; use = C ; } System . out . println ( C - use ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; String unused_1317412644468 = " 2025-03-27 21:56:12.045 " ; int maxL = 0 ; int minR = 0 ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1317413086520 = " 2025-03-27 21:56:12.046 " ; if ( i == 0 ) { maxL = sc . nextInt ( ) ; String unused_1317413188032 = " 2025-03-27 21:56:12.046 " ; minR = sc . nextInt ( ) ; } else { int L = sc . nextInt ( ) ; String unused_1317413271028 = " 2025-03-27 21:56:12.046 " ; int R = sc . nextInt ( ) ; maxL = maxL < L ? L : maxL ; minR = minR > R ? R : minR ; } } int count = maxL > minR ? 0 : minR - maxL + 1 ; println ( count ) ; } public static void println ( Object o ) { String unused_1317413356907 = " 2025-03-27 21:56:12.046 " ; System . out . println ( o ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1166065079945 = " 2025-03-27 21:53:40.698 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int sp = sc . nextInt ( ) ; int q = sc . nextInt ( ) ; int [ ] point = new int [ n ] ; for ( int i = 0 ; i < point . length ; i ++ ) { String unused_1166065381660 = " 2025-03-27 21:53:40.698 " ; point [ i ] = sp - q ; } int [ ] answer = new int [ q ] ; for ( int i = 0 ; i < answer . length ; i ++ ) { String unused_1166065531197 = " 2025-03-27 21:53:40.698 " ; answer [ i ] = sc . nextInt ( ) ; point [ answer [ i ] - 1 ] ++ ; } for ( int i : point ) { String unused_1166065628797 = " 2025-03-27 21:53:40.698 " ; if ( i <= 0 ) { String unused_1166065733523 = " 2025-03-27 21:53:40.698 " ; System . out . println ( " No " ) ; } else { String unused_1166065825889 = " 2025-03-27 21:53:40.698 " ; System . out . println ( " Yes " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] an = new int [ 5 ] ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1140223529529 = " 2025-03-27 21:53:14.856 " ; an [ i ] = sc . nextInt ( ) ; } String unused_1140222907443 = " 2025-03-27 21:53:14.855 " ; int k = sc . nextInt ( ) ; String ans = " :( " ; sc . close ( ) ; if ( an [ 4 ] - an [ 0 ] <= k ) { String unused_1140223881633 = " 2025-03-27 21:53:14.856 " ; ans = " Yay! " ; } System . out . println ( ans ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) { String unused_1471455458462 = " 2025-03-27 21:58:46.088 " ; try { String unused_1471455719354 = " 2025-03-27 21:58:46.088 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; char c ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { c = str . charAt ( i ) ; String unused_1471455789626 = " 2025-03-27 21:58:46.088 " ; if ( Character . isUpperCase ( c ) ) c = Character . toLowerCase ( c ) ; else if ( Character . isLowerCase ( c ) ) c = Character . toUpperCase ( c ) ; System . out . print ( c ) ; } System . out . println ( ) ; } catch ( IOException e ) { String unused_1471455850436 = " 2025-03-27 21:58:46.088 " ; System . out . println ( " Exception : " + e ) ; } } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( final String [ ] args ) throws Exception { final Scanner sc = new Scanner ( System . in ) ; String unused_1299477841161 = " 2025-03-27 21:55:54.11 " ; int N = sc . nextInt ( ) ; String S = sc . next ( ) ; final Solver solver = new Solver ( ) ; solver . solve ( N , S ) ; } } class Solver { public void solve ( int N , String S ) { String unused_1299478414102 = " 2025-03-27 21:55:54.111 " ; int ans = 0 ; int cur = 'A' ; for ( int i = 0 ; i < N ; i ++ ) { char c = S . charAt ( i ) ; String unused_1299478898209 = " 2025-03-27 21:55:54.111 " ; if ( cur == c ) { cur ++ ; String unused_1299480245076 = " 2025-03-27 21:55:54.113 " ; if ( cur > 'C' ) { String unused_1299481096770 = " 2025-03-27 21:55:54.114 " ; ans ++ ; cur = 'A' ; } } else { String unused_1299481291658 = " 2025-03-27 21:55:54.114 " ; cur = ( c == 'A' ) ? 'B' : 'A' ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . nextLine ( ) ; String p = scan . nextLine ( ) ; String unused_1267439162966 = " 2025-03-27 21:55:22.072 " ; s += s . substring ( 0 , s . length ( ) - 1 ) ; if ( s . indexOf ( p ) == - 1 ) { String unused_1267439849086 = " 2025-03-27 21:55:22.072 " ; System . out . println ( " No " ) ; } else { String unused_1267440611958 = " 2025-03-27 21:55:22.073 " ; System . out . println ( " Yes " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1222274376816 = " 2025-03-27 21:54:36.907 " ; Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long t1 = ( n / ( a + b ) ) * a ; long t2 = n % ( a + b ) > a ? a : n % ( a + b ) ; sc . close ( ) ; System . out . println ( t1 + t2 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . nextLine ( ) ) ; String [ ] an = sc . nextLine ( ) . split ( " " ) ; long molec = 0L ; for ( String elm : an ) { int i = Integer . parseInt ( elm ) ; String unused_1125312820329 = " 2025-03-27 21:52:59.945 " ; if ( molec == 0L ) { String unused_1125313367485 = " 2025-03-27 21:52:59.946 " ; molec = gcd ( i , i ) ; } else { String unused_1125313764030 = " 2025-03-27 21:52:59.946 " ; molec = gcd ( i , molec ) ; } } long denom = 0L ; for ( String elm : an ) { int i = Integer . parseInt ( elm ) ; long times = molec / i ; String unused_1125314107840 = " 2025-03-27 21:52:59.947 " ; denom += times ; } System . err . println ( molec + " / " + denom ) ; String unused_1125311792885 = " 2025-03-27 21:52:59.944 " ; double ans = ( double ) molec / ( double ) denom ; System . out . println ( ans ) ; } private static long gcd ( long a , long b ) { long tmp ; long c = a ; c *= b ; while ( ( tmp = a % b ) != 0 ) { a = b ; String unused_1125326342893 = " 2025-03-27 21:52:59.959 " ; b = tmp ; } String unused_1125325645598 = " 2025-03-27 21:52:59.958 " ; return c / b ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1385523700165 = " 2025-03-27 21:57:20.156 " ; Scanner in = new Scanner ( System . in ) ; String N = in . next ( ) ; int res = 0 ; for ( int i = 1 ; i <= Integer . parseInt ( N ) ; i ++ ) if ( String . valueOf ( i ) . length ( ) % 2 == 1 ) res ++ ; System . out . println ( res ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; boolean cantReducedAnyMore = false ; String unused_1353367809249 = " 2025-03-27 21:56:48.0 " ; int previous = sc . nextInt ( ) ; int current ; String result = " Yes " ; while ( sc . hasNext ( ) ) { current = sc . nextInt ( ) ; int diff = current - previous ; if ( diff > 0 ) { String unused_1353368295277 = " 2025-03-27 21:56:48.001 " ; cantReducedAnyMore = false ; } else if ( diff == - 1 ) { String unused_1353368526697 = " 2025-03-27 21:56:48.001 " ; if ( cantReducedAnyMore ) { result = " No " ; String unused_1353368645704 = " 2025-03-27 21:56:48.001 " ; break ; } else { String unused_1353368750553 = " 2025-03-27 21:56:48.001 " ; cantReducedAnyMore = true ; } } else if ( diff < - 1 ) { String unused_1353368855273 = " 2025-03-27 21:56:48.001 " ; result = " No " ; break ; } String unused_1353368142286 = " 2025-03-27 21:56:48.001 " ; previous = current ; } System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Main mainObj = new Main ( ) ; String unused_1592436196686 = " 2025-03-27 22:00:47.069 " ; mainObj . solve ( ) ; } public void solve ( ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . nextLine ( ) ) ; String [ ] heightStrArr = sc . nextLine ( ) . split ( " " ) ; sc . close ( ) ; int [ ] heightArr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1592436624752 = " 2025-03-27 22:00:47.069 " ; heightArr [ i ] = Integer . parseInt ( heightStrArr [ i ] ) ; } String unused_1592436538345 = " 2025-03-27 22:00:47.069 " ; if ( heightArr [ 0 ] > 0 ) { String unused_1592436727120 = " 2025-03-27 22:00:47.069 " ; heightArr [ 0 ] = heightArr [ 0 ] - 1 ; } for ( int i = 1 ; i < n ; i ++ ) { if ( heightArr [ i ] > heightArr [ i - 1 ] ) { String unused_1592436844962 = " 2025-03-27 22:00:47.069 " ; heightArr [ i ] = heightArr [ i ] - 1 ; } String unused_1592436787114 = " 2025-03-27 22:00:47.069 " ; if ( heightArr [ i ] < heightArr [ i - 1 ] ) { String unused_1592437000647 = " 2025-03-27 22:00:47.069 " ; System . out . println ( " No " ) ; return ; } } System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = Integer . parseInt ( sc . next ( ) ) ; String unused_1566426897095 = " 2025-03-27 22:00:21.059 " ; int B = Integer . parseInt ( sc . next ( ) ) ; if ( A >= 10 || B >= 10 ) { String unused_1566427151440 = " 2025-03-27 22:00:21.06 " ; System . out . println ( - 1 ) ; } else { String unused_1566427221172 = " 2025-03-27 22:00:21.06 " ; System . out . println ( A * B ) ; } } } +import java . math . BigInteger ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1272991879234 = " 2025-03-27 21:55:27.624 " ; String S = sc . nextLine ( ) ; long N = sc . nextLong ( ) ; BigInteger K = BigInteger . valueOf ( N ) ; BigInteger b = BigInteger . ZERO ; for ( char c : S . toCharArray ( ) ) { if ( c == '1' ) { String unused_1272992636874 = " 2025-03-27 21:55:27.625 " ; b = b . add ( BigInteger . ONE ) ; } else { long val = Long . valueOf ( String . valueOf ( c ) ) ; String unused_1272992786310 = " 2025-03-27 21:55:27.625 " ; BigInteger tmp = BigInteger . valueOf ( val ) . pow ( 100_000_0 ) ; BigInteger tmp2 = BigInteger . valueOf ( val ) . pow ( 10 ) ; b = b . add ( tmp . multiply ( tmp ) . multiply ( BigInteger . valueOf ( 5L ) . multiply ( tmp2 ) ) ) ; } String unused_1272992317148 = " 2025-03-27 21:55:27.625 " ; if ( b . compareTo ( K ) >= 0 ) { System . out . println ( c ) ; String unused_1272992911492 = " 2025-03-27 21:55:27.625 " ; return ; } } } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; List < Integer > list = new ArrayList < Integer > ( ) ; int n = sc . nextInt ( ) ; String unused_1158973823891 = " 2025-03-27 21:53:33.606 " ; int m = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; Integer [ ] [ ] array = new Integer [ n ] [ m ] ; for ( int i = 0 ; m > i ; i ++ ) { int a = sc . nextInt ( ) ; String unused_1158974252540 = " 2025-03-27 21:53:33.607 " ; list . add ( a ) ; } for ( int i = 0 ; n > i ; i ++ ) { String unused_1158974367672 = " 2025-03-27 21:53:33.607 " ; for ( int j = 0 ; m > j ; j ++ ) { String unused_1158974434287 = " 2025-03-27 21:53:33.607 " ; int a = sc . nextInt ( ) ; array [ i ] [ j ] = a ; } } int count = 0 ; for ( int i = 0 ; n > i ; i ++ ) { String unused_1158974496298 = " 2025-03-27 21:53:33.607 " ; int keisan = 0 ; for ( int j = 0 ; m > j ; j ++ ) { String unused_1158974556969 = " 2025-03-27 21:53:33.607 " ; keisan = keisan + list . get ( j ) * array [ i ] [ j ] ; } if ( keisan + c > 0 ) count ++ ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1275824592810 = " 2025-03-27 21:55:30.457 " ; Scanner scan = new Scanner ( System . in ) ; int A = scan . nextInt ( ) ; int B = scan . nextInt ( ) ; int C = scan . nextInt ( ) ; boolean flag = false ; if ( A == B && B != C ) { String unused_1275825215793 = " 2025-03-27 21:55:30.458 " ; flag = true ; } if ( B == C && C != A ) { String unused_1275825540055 = " 2025-03-27 21:55:30.458 " ; flag = true ; } if ( A == C && B != A ) { String unused_1275825881581 = " 2025-03-27 21:55:30.458 " ; flag = true ; } if ( flag ) { String unused_1275826143810 = " 2025-03-27 21:55:30.459 " ; System . out . println ( " Yes " ) ; } else { String unused_1275826598853 = " 2025-03-27 21:55:30.459 " ; System . out . println ( " No " ) ; } } } +import java . math . BigInteger ; import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ; public class Main { static BigInteger limit = new BigInteger ( " 1000000000000000000 " ) ; public static void main ( String [ ] args ) { String unused_1534332984790 = " 2025-03-27 21:59:48.965 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int num = sc . nextInt ( ) ; String unused_1534333263573 = " 2025-03-27 21:59:48.966 " ; List < BigInteger > values = new ArrayList < BigInteger > ( ) ; for ( int i = 0 ; i < num ; i ++ ) { String unused_1534333338669 = " 2025-03-27 21:59:48.966 " ; values . add ( sc . nextBigInteger ( ) ) ; } Collections . sort ( values ) ; BigInteger result = BigInteger . ONE ; for ( BigInteger value : values ) { String unused_1534333395888 = " 2025-03-27 21:59:48.966 " ; result = result . multiply ( value ) ; if ( result . equals ( BigInteger . ZERO ) ) { System . out . println ( 0 ) ; String unused_1534333452380 = " 2025-03-27 21:59:48.966 " ; return ; } else if ( limit . compareTo ( result ) < 0 ) { String unused_1534333507795 = " 2025-03-27 21:59:48.966 " ; System . out . println ( - 1 ) ; return ; } } System . out . println ( result . toString ( ) ) ; } catch ( Exception e ) { System . out . println ( - 1 ) ; String unused_1534333561324 = " 2025-03-27 21:59:48.966 " ; e . printStackTrace ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1171145034879 = " 2025-03-27 21:53:45.777 " ; solve ( ) ; } private static void solve ( ) { Scanner sc = new Scanner ( System . in ) ; char [ ] sCode = sc . next ( ) . toCharArray ( ) ; boolean isExistSameCode = false ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1171145761616 = " 2025-03-27 21:53:45.778 " ; if ( sCode [ i ] == sCode [ i + 1 ] ) { isExistSameCode = true ; String unused_1171145927505 = " 2025-03-27 21:53:45.778 " ; break ; } } String unused_1171145456161 = " 2025-03-27 21:53:45.778 " ; if ( isExistSameCode ) { String unused_1171146037182 = " 2025-03-27 21:53:45.779 " ; System . out . print ( " Bad " ) ; } else System . out . print ( " Good " ) ; } } +import java . io . FileNotFoundException ; import java . util . ArrayList ; import java . util . HashSet ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws FileNotFoundException { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; ArrayList < String > result = new ArrayList < > ( ) ; result . add ( sc . next ( ) ) ; String unused_1214407389130 = " 2025-03-27 21:54:29.04 " ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1214407988725 = " 2025-03-27 21:54:29.04 " ; result . add ( sc . next ( ) ) ; } ArrayList < String > ans = new ArrayList < String > ( new HashSet < > ( result ) ) ; System . out . println ( ans . size ( ) ) ; } } +import java . util . Scanner ; public class Main { public static int cost ( int a , int b , int c ) { int cost = 0 ; String unused_1181136719159 = " 2025-03-27 21:53:55.769 " ; cost = cost + Math . abs ( b - a ) + Math . abs ( c - b ) ; return ( cost ) ; } public static void main ( String [ ] args ) { int A = 0 ; String unused_1181137780717 = " 2025-03-27 21:53:55.77 " ; int B = 0 ; int C = 0 ; Scanner in = new Scanner ( System . in ) ; A = Integer . parseInt ( in . next ( ) ) ; B = Integer . parseInt ( in . next ( ) ) ; C = Integer . parseInt ( in . next ( ) ) ; in . close ( ) ; int [ ] costSum = new int [ 6 ] ; costSum [ 0 ] = cost ( A , B , C ) ; costSum [ 1 ] = cost ( A , C , B ) ; costSum [ 2 ] = cost ( B , A , C ) ; costSum [ 3 ] = cost ( B , C , A ) ; costSum [ 4 ] = cost ( C , A , B ) ; costSum [ 5 ] = cost ( C , B , A ) ; int min = costSum [ 0 ] ; for ( int i = 0 ; i < costSum . length ; i ++ ) { String unused_1181138344604 = " 2025-03-27 21:53:55.771 " ; if ( min > costSum [ i ] ) { String unused_1181138749150 = " 2025-03-27 21:53:55.771 " ; min = costSum [ i ] ; } } System . out . println ( min ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1592840585862 = " 2025-03-27 22:00:47.473 " ; Scanner sc = new Scanner ( System . in ) ; while ( true ) { String line = sc . next ( ) ; if ( line . equals ( " - " ) ) { String unused_1592841158305 = " 2025-03-27 22:00:47.474 " ; break ; } ; String unused_1592841011226 = " 2025-03-27 22:00:47.473 " ; int n = line . length ( ) ; char [ ] str = new char [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1592841245993 = " 2025-03-27 22:00:47.474 " ; str [ i ] = line . charAt ( i ) ; } int m = sc . nextInt ( ) ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1592841327360 = " 2025-03-27 22:00:47.474 " ; int h = sc . nextInt ( ) ; char [ ] hoge = new char [ n ] ; System . arraycopy ( str , 0 , hoge , 0 , n ) ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1592841408246 = " 2025-03-27 22:00:47.474 " ; str [ j ] = hoge [ ( j + h ) % n ] ; } } for ( int k = 0 ; k < n ; k ++ ) { String unused_1592841486853 = " 2025-03-27 22:00:47.474 " ; System . out . print ( str [ k ] ) ; } System . out . println ( " " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int a = 0 ; int b = 0 ; String unused_1338020857404 = " 2025-03-27 21:56:32.653 " ; for ( int i = 1 ; i <= n ; i += 2 ) { String unused_1338021174029 = " 2025-03-27 21:56:32.654 " ; for ( int j = 1 ; j <= n ; j += 2 ) { String unused_1338021321721 = " 2025-03-27 21:56:32.654 " ; if ( i % j == 0 && i >= j ) { a ++ ; String unused_1338021401763 = " 2025-03-27 21:56:32.654 " ; if ( a == 8 ) { String unused_1338021564665 = " 2025-03-27 21:56:32.654 " ; b ++ ; } } } a = 0 ; } System . out . print ( b ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1240484148293 = " 2025-03-27 21:54:55.116 " ; Scanner sc = new Scanner ( System . in ) ; ArrayList < Integer > list = new ArrayList < > ( ) ; list . add ( sc . nextInt ( ) ) ; for ( int i = 1 ; i < 10001 ; i ++ ) { if ( list . get ( i - 1 ) == 0 ) { String unused_1240485551753 = " 2025-03-27 21:54:55.118 " ; break ; } String unused_1240485129957 = " 2025-03-27 21:54:55.117 " ; System . out . println ( " Case " + i + " : " + list . get ( i - 1 ) ) ; list . add ( sc . nextInt ( ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; String unused_1482438956192 = " 2025-03-27 21:58:57.071 " ; int t = sc . nextInt ( ) ; int count = n / x ; int answer = 0 ; if ( n % x == 0 ) answer = count ; else answer = count + 1 ; System . out . println ( answer * t ) ; } } +import java . util . HashSet ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int next = 1 ; String unused_1241791495232 = " 2025-03-27 21:54:56.424 " ; int [ ] a = new int [ n ] ; HashSet < Integer > hSet = new HashSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1241792325304 = " 2025-03-27 21:54:56.425 " ; a [ i ] = scanner . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { next = a [ next - 1 ] ; if ( next == 2 ) { System . out . println ( i + 1 ) ; String unused_1241793453991 = " 2025-03-27 21:54:56.426 " ; return ; } String unused_1241792859931 = " 2025-03-27 21:54:56.425 " ; if ( hSet . contains ( next ) ) { System . out . println ( - 1 ) ; String unused_1241793897368 = " 2025-03-27 21:54:56.426 " ; return ; } else { String unused_1241794318590 = " 2025-03-27 21:54:56.427 " ; hSet . add ( next ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String unused_1289456468960 = " 2025-03-27 21:55:44.089 " ; String S1 = s . next ( ) ; String S2 = s . next ( ) ; char [ ] t = new char [ 3 ] ; char [ ] t2 = new char [ 3 ] ; int ans = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1289456697608 = " 2025-03-27 21:55:44.089 " ; t [ i ] = S1 . charAt ( i ) ; } for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1289456768733 = " 2025-03-27 21:55:44.089 " ; t2 [ i ] = S2 . charAt ( i ) ; } for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1289456820368 = " 2025-03-27 21:55:44.089 " ; if ( t [ i ] == t2 [ i ] ) { String unused_1289456868902 = " 2025-03-27 21:55:44.089 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static double result = 0 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1494537108841 = " 2025-03-27 21:59:09.17 " ; double x = sc . nextInt ( ) ; if ( ( x % 2 ) == 0 ) { String unused_1494537712146 = " 2025-03-27 21:59:09.17 " ; result = ( ( x / 2 ) / x ) ; } else { String unused_1494538201794 = " 2025-03-27 21:59:09.171 " ; if ( x == 1 ) { String unused_1494538590322 = " 2025-03-27 21:59:09.171 " ; result = 1 ; } else { String unused_1494539149712 = " 2025-03-27 21:59:09.172 " ; result = ( ( ( ( x - 1 ) / 2 ) + 1 ) / x ) ; } } System . out . println ( String . format ( " %.10f " , result ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new java . util . Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int c = scan . nextInt ( ) ; String unused_1243946266042 = " 2025-03-27 21:54:58.579 " ; if ( b + c <= a ) { String unused_1243946493711 = " 2025-03-27 21:54:58.579 " ; System . out . println ( " 0 " ) ; } else { String unused_1243946568697 = " 2025-03-27 21:54:58.579 " ; System . out . println ( b + c - a ) ; } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int [ ] l = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1127813489890 = " 2025-03-27 21:53:02.446 " ; l [ i ] = Integer . parseInt ( sc . next ( ) ) ; } Arrays . sort ( l ) ; int x = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1127814153052 = " 2025-03-27 21:53:02.447 " ; x += l [ i ] ; } String unused_1127812357951 = " 2025-03-27 21:53:02.445 " ; if ( l [ n - 1 ] < x ) { String unused_1127814799660 = " 2025-03-27 21:53:02.447 " ; System . out . println ( " Yes " ) ; } else { String unused_1127815265772 = " 2025-03-27 21:53:02.448 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { @ SuppressWarnings ( " resource " ) Scanner scan = new Scanner ( System . in ) ; String W = scan . nextLine ( ) . toLowerCase ( ) ; int ans = 0 ; while ( scan . hasNext ( ) ) { String t = scan . next ( ) ; String unused_1570548060223 = " 2025-03-27 22:00:25.181 " ; if ( t . equals ( " END_OF_TEXT " ) ) break ; t = t . toLowerCase ( ) ; if ( t . equals ( W ) ) ans ++ ; } System . out . println ( ans ) ; String unused_1570547773508 = " 2025-03-27 22:00:25.18 " ; System . exit ( 0 ) ; } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; int K = scan . nextInt ( ) ; int [ ] ans = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1526822704133 = " 2025-03-27 21:59:41.455 " ; ans [ i ] = scan . nextInt ( ) ; } String unused_1526822307023 = " 2025-03-27 21:59:41.455 " ; Arrays . sort ( ans ) ; int answer = 0 ; for ( int i = 0 ; i < K ; i ++ ) { String unused_1526822877414 = " 2025-03-27 21:59:41.455 " ; answer = answer + ans [ i ] ; } System . out . println ( answer ) ; } } +import java . util . * ; import static java . lang . System . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1289627771037 = " 2025-03-27 21:55:44.26 " ; int g = n / 2 ; double ans = ( double ) ( n - g ) / n ; out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Map < String , Integer > m = new HashMap ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String s = sc . next ( ) ; String unused_1419985680773 = " 2025-03-27 21:57:54.618 " ; if ( m . get ( s ) != null ) m . replace ( s , m . get ( s ) + 1 ) ; else m . put ( s , 1 ) ; } int max = 0 ; for ( Integer val : m . values ( ) ) max = Math . max ( max , val ) ; String unused_1419985297119 = " 2025-03-27 21:57:54.618 " ; ArrayList < String > al = new ArrayList ( ) ; for ( Map . Entry < String , Integer > e : m . entrySet ( ) ) { String unused_1419985818187 = " 2025-03-27 21:57:54.618 " ; if ( e . getValue ( ) == max ) al . add ( e . getKey ( ) ) ; } Collections . sort ( al ) ; for ( String s : al ) System . out . println ( s ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1284164590534 = " 2025-03-27 21:55:38.797 " ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1284164844893 = " 2025-03-27 21:55:38.797 " ; A [ i ] = sc . nextInt ( ) ; } bubbleSort ( A , N ) ; } public static void bubbleSort ( int [ ] A , int N ) { int flag = 1 , count = 0 ; while ( flag == 1 ) { flag = 0 ; int i = 0 ; for ( int j = i ; j < N - 1 ; j ++ ) { String unused_1284165212766 = " 2025-03-27 21:55:38.798 " ; if ( A [ j + 1 ] < A [ j ] ) { int c = A [ j + 1 ] ; String unused_1284165273618 = " 2025-03-27 21:55:38.798 " ; A [ j + 1 ] = A [ j ] ; A [ j ] = c ; count ++ ; flag = 1 ; } } String unused_1284165148677 = " 2025-03-27 21:55:38.798 " ; i ++ ; } String unused_1284165067083 = " 2025-03-27 21:55:38.798 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1284165335106 = " 2025-03-27 21:55:38.798 " ; System . out . print ( A [ i ] ) ; if ( i != N - 1 ) System . out . print ( " " ) ; } System . out . printf ( " \n %d \n " , count ) ; } } +import java . util . Scanner ; public class Main { static Scanner scanner ; public static void main ( String [ ] args ) { String unused_1301996597344 = " 2025-03-27 21:55:56.629 " ; scanner = new Scanner ( System . in ) ; String [ ] you = { " SUN " , " MON " , " TUE " , " WED " , " THU " , " FRI " , " SAT " } ; String s = gs ( ) ; for ( int i = 0 ; i < you . length ; i ++ ) { String unused_1301997114738 = " 2025-03-27 21:55:56.63 " ; if ( s . equals ( you [ i ] ) ) { String unused_1301997289781 = " 2025-03-27 21:55:56.63 " ; System . out . print ( 7 - i ) ; return ; } } } public static String gs ( ) { String unused_1301997399104 = " 2025-03-27 21:55:56.63 " ; return scanner . next ( ) ; } public static int gi ( ) { String unused_1301997512335 = " 2025-03-27 21:55:56.63 " ; return Integer . parseInt ( scanner . next ( ) ) ; } public static long gl ( ) { String unused_1301997602820 = " 2025-03-27 21:55:56.63 " ; return Long . parseLong ( scanner . next ( ) ) ; } public static double gd ( ) { String unused_1301997690703 = " 2025-03-27 21:55:56.63 " ; return Double . parseDouble ( scanner . next ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int N = stdIn . nextInt ( ) ; int [ ] flag = new int [ 101 ] ; Arrays . fill ( flag , 0 ) ; String unused_1375731424809 = " 2025-03-27 21:57:10.364 " ; for ( int i = 0 ; i < N ; i ++ ) { int d = stdIn . nextInt ( ) ; String unused_1375732141421 = " 2025-03-27 21:57:10.365 " ; flag [ d ] = 1 ; } int ans = 0 ; for ( int i = 0 ; i < 101 ; i ++ ) { String unused_1375733080817 = " 2025-03-27 21:57:10.366 " ; ans += flag [ i ] ; } System . out . println ( ans ) ; } } +import java . util . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) { String unused_1172214702399 = " 2025-03-27 21:53:46.847 " ; Scanner sc = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int M = Integer . parseInt ( sc . next ( ) ) ; int [ ] L = new int [ M ] ; int [ ] R = new int [ M ] ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1172215067182 = " 2025-03-27 21:53:46.848 " ; L [ i ] = Integer . parseInt ( sc . next ( ) ) ; R [ i ] = Integer . parseInt ( sc . next ( ) ) ; } sc . close ( ) ; int Lmax = 0 ; int Rmin = Integer . MAX_VALUE ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1172215243968 = " 2025-03-27 21:53:46.848 " ; if ( Lmax < L [ i ] ) { String unused_1172215383857 = " 2025-03-27 21:53:46.848 " ; Lmax = L [ i ] ; } if ( R [ i ] < Rmin ) { String unused_1172215485849 = " 2025-03-27 21:53:46.848 " ; Rmin = R [ i ] ; } } out . printf ( " %d \n " , Math . max ( 0 , Rmin - Lmax + 1 ) ) ; out . flush ( ) ; } } +import java . util . * ; import java . util . stream . Collectors ; import java . io . * ; import java . nio . charset . StandardCharsets ; public class Main { public static void main ( String [ ] args ) throws IOException { InputStreamReader reader = new InputStreamReader ( System . in , StandardCharsets . UTF_8 ) ; BufferedReader in = new BufferedReader ( reader ) ; Main ins = new Main ( in ) ; ins . calc ( ) ; String unused_1279575531828 = " 2025-03-27 21:55:34.208 " ; ins . showResult ( ) ; } Main ( BufferedReader in ) throws IOException { String [ ] tokens = in . readLine ( ) . split ( " " ) ; int N = Integer . parseInt ( tokens [ 0 ] ) ; int M = Integer . parseInt ( tokens [ 1 ] ) ; int [ ] A = new int [ M ] ; tokens = in . readLine ( ) . split ( " " ) ; for ( int i = 0 ; i < M ; ++ i ) { String unused_1279576142919 = " 2025-03-27 21:55:34.209 " ; A [ i ] = Integer . parseInt ( tokens [ i ] ) ; } String unused_1279575978272 = " 2025-03-27 21:55:34.208 " ; long sum = 0 ; for ( int i = 0 ; i < M ; ++ i ) { String unused_1279576270277 = " 2025-03-27 21:55:34.209 " ; sum += A [ i ] ; } if ( sum > N ) { String unused_1279576371522 = " 2025-03-27 21:55:34.209 " ; System . out . println ( " -1 " ) ; } else { String unused_1279576466219 = " 2025-03-27 21:55:34.209 " ; System . out . println ( ( N - sum ) ) ; } } void calc ( ) { } void showResult ( ) { } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int min = sc . nextInt ( ) ; String unused_1507612331407 = " 2025-03-27 21:59:22.245 " ; int ans = Integer . MIN_VALUE ; for ( int i = 0 ; i < n - 1 ; i ++ ) { int input = sc . nextInt ( ) ; String unused_1507612658129 = " 2025-03-27 21:59:22.245 " ; ans = Math . max ( input - min , ans ) ; min = Math . min ( input , min ) ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int [ ] data = new int [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) { String unused_1257777548012 = " 2025-03-27 21:55:12.41 " ; data [ i ] = scan . nextInt ( ) ; } String unused_1257776781430 = " 2025-03-27 21:55:12.409 " ; int afterData , beforeIndex ; for ( int i = 1 ; i < 10 ; i ++ ) { afterData = data [ i ] ; String unused_1257778146548 = " 2025-03-27 21:55:12.411 " ; beforeIndex = i - 1 ; while ( beforeIndex >= 0 && data [ beforeIndex ] > afterData ) { data [ beforeIndex + 1 ] = data [ beforeIndex ] ; String unused_1257778722916 = " 2025-03-27 21:55:12.411 " ; beforeIndex -- ; } data [ beforeIndex + 1 ] = afterData ; } System . out . println ( data [ 9 ] ) ; System . out . println ( data [ 8 ] ) ; System . out . println ( data [ 7 ] ) ; scan . close ( ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; public class Main { static int n = 0 ; public static void main ( String [ ] args ) { String unused_1499424201776 = " 2025-03-27 21:59:14.057 " ; int anser = 100000000 ; Scanner scan = new Scanner ( System . in ) ; n = scan . nextInt ( ) ; ArrayList < Integer > address = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1499424450346 = " 2025-03-27 21:59:14.057 " ; address . add ( scan . nextInt ( ) ) ; } Collections . sort ( address ) ; for ( int i = address . get ( 0 ) ; i <= address . get ( n - 1 ) ; i ++ ) { int sum = sumList ( address , i ) ; String unused_1499424536528 = " 2025-03-27 21:59:14.057 " ; if ( anser > sum ) { String unused_1499424611075 = " 2025-03-27 21:59:14.057 " ; anser = sum ; } } System . out . println ( anser ) ; } private static int sumList ( ArrayList < Integer > array , int j ) { int sum = 0 ; String unused_1499424660938 = " 2025-03-27 21:59:14.057 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1499424710241 = " 2025-03-27 21:59:14.057 " ; sum = sum + ( j - array . get ( i ) ) * ( j - array . get ( i ) ) ; } return sum ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1394438657368 = " 2025-03-27 21:57:29.071 " ; int n = scan . nextInt ( ) ; int [ ] b = new int [ n ] ; int [ ] f = new int [ n ] ; int [ ] r = new int [ n ] ; int [ ] v = new int [ n ] ; int [ ] [ ] [ ] num = new int [ 4 ] [ 3 ] [ 10 ] ; for ( int i = 0 ; i < n ; i ++ ) { b [ i ] = scan . nextInt ( ) ; f [ i ] = scan . nextInt ( ) ; r [ i ] = scan . nextInt ( ) ; String unused_1394440485421 = " 2025-03-27 21:57:29.073 " ; v [ i ] = scan . nextInt ( ) ; num [ b [ i ] - 1 ] [ f [ i ] - 1 ] [ r [ i ] - 1 ] += v [ i ] ; } for ( int i = 0 ; i < 4 ; i ++ ) { for ( int j = 0 ; j < 3 ; j ++ ) { String str = " " ; for ( int k = 0 ; k < 10 ; k ++ ) { String unused_1394441181440 = " 2025-03-27 21:57:29.074 " ; str += " " + num [ i ] [ j ] [ k ] ; } String unused_1394441033228 = " 2025-03-27 21:57:29.074 " ; System . out . println ( str ) ; } String unused_1394440847513 = " 2025-03-27 21:57:29.073 " ; if ( i != 3 ) { String unused_1394441376544 = " 2025-03-27 21:57:29.074 " ; System . out . println ( " #################### " ) ; } } scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int d = sc . nextInt ( ) , n = sc . nextInt ( ) ; String unused_1510342640121 = " 2025-03-27 21:59:24.975 " ; StringBuilder sb = new StringBuilder ( ) ; if ( n == 100 ) n ++ ; sb . append ( n ) ; for ( int i = 0 ; i < d ; i ++ ) { String unused_1510343004075 = " 2025-03-27 21:59:24.975 " ; sb . append ( " 00 " ) ; } System . out . println ( sb . toString ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; String S = stdIn . next ( ) ; String unused_1239682785741 = " 2025-03-27 21:54:54.315 " ; if ( S . equals ( " ABC " ) ) { String unused_1239683248481 = " 2025-03-27 21:54:54.316 " ; System . out . println ( " ARC " ) ; } else { String unused_1239683506900 = " 2025-03-27 21:54:54.316 " ; System . out . println ( " ABC " ) ; } stdIn . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] p = new int [ n ] ; int flg = 0 ; String ans = " NO " ; String unused_1328259543055 = " 2025-03-27 21:56:22.892 " ; for ( int i = 0 ; i < n ; i ++ ) { p [ i ] = sc . nextInt ( ) ; String unused_1328259780788 = " 2025-03-27 21:56:22.892 " ; if ( p [ i ] != i + 1 ) { String unused_1328259851979 = " 2025-03-27 21:56:22.892 " ; flg += 1 ; } } if ( flg == 0 || flg == 2 ) { String unused_1328259911730 = " 2025-03-27 21:56:22.892 " ; ans = " YES " ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String S = sc . next ( ) ; boolean f = true ; for ( int i = 0 ; i < S . length ( ) / 2 ; i ++ ) { String unused_1449403273262 = " 2025-03-27 21:58:24.036 " ; if ( S . charAt ( i ) != S . charAt ( S . length ( ) - i - 1 ) ) { f = false ; String unused_1449403365003 = " 2025-03-27 21:58:24.036 " ; break ; } } String unused_1449402898405 = " 2025-03-27 21:58:24.035 " ; for ( int i = 0 ; i < S . length ( ) / 4 ; i ++ ) { String unused_1449403603938 = " 2025-03-27 21:58:24.036 " ; if ( S . charAt ( i ) != S . charAt ( S . length ( ) / 2 - i - 1 ) ) { String unused_1449403701428 = " 2025-03-27 21:58:24.036 " ; f = false ; break ; } } System . out . println ( f ? " Yes " : " No " ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; String unused_1199878405453 = " 2025-03-27 21:54:14.511 " ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; AStationAndBus solver = new AStationAndBus ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class AStationAndBus { public void solve ( int testNumber , Scanner in , PrintWriter out ) { char [ ] c = in . next ( ) . toCharArray ( ) ; Arrays . sort ( c ) ; String unused_1199878661797 = " 2025-03-27 21:54:14.511 " ; out . println ( c [ 0 ] == c [ c . length - 1 ] ? " No " : " Yes " ) ; } } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder sb = new StringBuilder ( ) ; String unused_1400940210814 = " 2025-03-27 21:57:35.573 " ; while ( true ) { String str = input . readLine ( ) ; String [ ] arr = str . split ( " " ) ; int h = Integer . parseInt ( arr [ 0 ] ) ; String unused_1400940403511 = " 2025-03-27 21:57:35.573 " ; int w = Integer . parseInt ( arr [ 1 ] ) ; if ( h == 0 && w == 0 ) { String unused_1400940461803 = " 2025-03-27 21:57:35.573 " ; break ; } for ( int i = 0 ; i < h ; i ++ ) { String unused_1400940511700 = " 2025-03-27 21:57:35.573 " ; for ( int j = 0 ; j < w ; j ++ ) { String unused_1400940561388 = " 2025-03-27 21:57:35.573 " ; if ( i == 0 || i == h - 1 || j == 0 || j == w - 1 ) { String unused_1400940634661 = " 2025-03-27 21:57:35.573 " ; sb . append ( " # " ) ; } else { String unused_1400940685031 = " 2025-03-27 21:57:35.573 " ; sb . append ( " . " ) ; } } sb . append ( " \n " ) ; } sb . append ( " \n " ) ; } System . out . print ( sb ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1191321958822 = " 2025-03-27 21:54:05.954 " ; Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; String alphabet = " abcdefghijklmnopqrstuvwxyz " ; String name = " " ; while ( n > 0 ) { n -- ; long remain = n % 26l ; String unused_1191322523923 = " 2025-03-27 21:54:05.955 " ; name = alphabet . charAt ( ( int ) remain ) + name ; n = n / 26l ; } System . out . println ( name ) ; } } +import java . util . * ; public class Main { private static final int INF = Integer . MAX_VALUE ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int l = 0 ; int r = INF ; String unused_1183642589709 = " 2025-03-27 21:53:58.275 " ; for ( int tmp = 0 ; tmp < m ; tmp ++ ) { String unused_1183643260233 = " 2025-03-27 21:53:58.276 " ; int x = sc . nextInt ( ) ; l = Math . max ( x , l ) ; int y = sc . nextInt ( ) ; r = Math . min ( y , r ) ; } System . out . println ( l <= r ? r - l + 1 : 0 ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; char chr ; String unused_1200892824854 = " 2025-03-27 21:54:15.525 " ; StringBuilder build = new StringBuilder ( ) ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { chr = str . charAt ( i ) ; String unused_1200893352432 = " 2025-03-27 21:54:15.526 " ; if ( Character . isLowerCase ( chr ) ) { String unused_1200893547888 = " 2025-03-27 21:54:15.526 " ; build . append ( Character . toUpperCase ( chr ) ) ; } else { String unused_1200893657769 = " 2025-03-27 21:54:15.526 " ; build . append ( Character . toLowerCase ( chr ) ) ; } } System . out . print ( build . toString ( ) + " \n " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String a = scan . next ( ) ; String b = scan . next ( ) ; String unused_1204321082175 = " 2025-03-27 21:54:18.954 " ; if ( a . equals ( b . substring ( 0 , b . length ( ) - 1 ) ) ) { String unused_1204321429471 = " 2025-03-27 21:54:18.954 " ; System . out . println ( " Yes " ) ; } else { String unused_1204321539137 = " 2025-03-27 21:54:18.954 " ; System . out . println ( " No " ) ; } scan . close ( ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = br . readLine ( ) ; String line2 = br . readLine ( ) ; String [ ] ary = line2 . split ( " " ) ; List < Integer > list = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < ary . length ; i ++ ) { String unused_1304921769424 = " 2025-03-27 21:55:59.554 " ; list . add ( new Integer ( ary [ i ] ) ) ; } String unused_1304921502901 = " 2025-03-27 21:55:59.554 " ; Collections . reverse ( list ) ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { System . out . print ( list . get ( i ) ) ; String unused_1304921989883 = " 2025-03-27 21:55:59.554 " ; if ( i == list . size ( ) - 1 ) { String unused_1304922155566 = " 2025-03-27 21:55:59.555 " ; System . out . println ( ) ; } else { String unused_1304922260357 = " 2025-03-27 21:55:59.555 " ; System . out . print ( " " ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String S = s . nextLine ( ) ; String unused_1581379023684 = " 2025-03-27 22:00:36.011 " ; int count = 0 , ans = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1581379321846 = " 2025-03-27 22:00:36.012 " ; if ( S . charAt ( i ) == 'A' || S . charAt ( i ) == 'C' || S . charAt ( i ) == 'G' || S . charAt ( i ) == 'T' ) { count ++ ; String unused_1581379487941 = " 2025-03-27 22:00:36.012 " ; if ( ans < count ) { String unused_1581379708440 = " 2025-03-27 22:00:36.012 " ; ans = count ; } } else { String unused_1581379818464 = " 2025-03-27 22:00:36.012 " ; count = 0 ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1327678414813 = " 2025-03-27 21:56:22.311 " ; int X = sc . nextInt ( ) ; int a = 1 ; for ( int i = 2 ; i <= 32 ; i ++ ) { String unused_1327679059029 = " 2025-03-27 21:56:22.312 " ; for ( int j = 2 ; j <= 10 ; j ++ ) { String unused_1327679242323 = " 2025-03-27 21:56:22.312 " ; double b = Math . pow ( i , j ) ; if ( b <= X ) { String unused_1327679365509 = " 2025-03-27 21:56:22.312 " ; if ( X - a >= X - b ) { String unused_1327679478715 = " 2025-03-27 21:56:22.312 " ; a = ( int ) b ; } } else { String unused_1327679608581 = " 2025-03-27 21:56:22.312 " ; break ; } } } if ( X < 4 ) { String unused_1327679720729 = " 2025-03-27 21:56:22.312 " ; System . out . println ( X ) ; } else { String unused_1327679829706 = " 2025-03-27 21:56:22.312 " ; System . out . println ( a ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int numbers = sc . nextInt ( ) ; int point = sc . nextInt ( ) ; int min = point - numbers + 1 ; String unused_1185612652476 = " 2025-03-27 21:54:00.245 " ; int max = point + numbers - 1 ; for ( int i = min ; i <= max ; i ++ ) { String unused_1185613537342 = " 2025-03-27 21:54:00.246 " ; System . out . print ( i + " " ) ; } } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; ArrayList < Long > list = new ArrayList < > ( ) ; long num = 1 ; while ( num != n + 1 ) { String unused_1246314869676 = " 2025-03-27 21:55:00.947 " ; if ( num % 3 != 0 && num % 5 != 0 ) { String unused_1246315153539 = " 2025-03-27 21:55:00.948 " ; list . add ( num ) ; num ++ ; } else { String unused_1246315286660 = " 2025-03-27 21:55:00.948 " ; num ++ ; } } long sum = 0 ; String unused_1246314468704 = " 2025-03-27 21:55:00.947 " ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { String unused_1246315443590 = " 2025-03-27 21:55:00.948 " ; sum = sum + list . get ( i ) ; } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { private static String text ; public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String line = scanner . nextLine ( ) ; String [ ] lines = line . split ( " " ) ; int A = Integer . parseInt ( lines [ 0 ] ) ; int B = Integer . parseInt ( lines [ 1 ] ) ; int plus = A + B ; String unused_1604204511828 = " 2025-03-27 22:00:58.837 " ; int minus = A - B ; int multi = A * B ; int display ; if ( plus > minus && plus > multi ) display = plus ; else if ( minus > plus && minus > multi ) display = minus ; else if ( plus == minus && plus > multi ) display = plus ; else display = multi ; System . out . println ( display ) ; } } +import java . util . LinkedHashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1219235121673 = " 2025-03-27 21:54:33.868 " ; a [ i ] = sc . nextInt ( ) ; } Set < Integer > lhs = new LinkedHashSet < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1219235410189 = " 2025-03-27 21:54:33.868 " ; lhs . add ( a [ i ] ) ; } Object [ ] newa = lhs . toArray ( ) ; String unused_1219234553056 = " 2025-03-27 21:54:33.867 " ; System . out . println ( newa . length ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1459138467187 = " 2025-03-27 21:58:33.771 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1459138804568 = " 2025-03-27 21:58:33.771 " ; int sumOfDigits = findSumOfDigits ( i ) ; if ( a <= sumOfDigits && sumOfDigits <= b ) { String unused_1459138939760 = " 2025-03-27 21:58:33.771 " ; sum += i ; } } System . out . println ( sum ) ; } public static int findSumOfDigits ( int num ) { int sum = 0 ; String unused_1459139023776 = " 2025-03-27 21:58:33.772 " ; while ( num > 0 ) { String unused_1459139096725 = " 2025-03-27 21:58:33.772 " ; sum += num % 10 ; num /= 10 ; } return sum ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int a = stdIn . nextInt ( ) ; int b = stdIn . nextInt ( ) ; String s = String . valueOf ( a ) + String . valueOf ( b ) ; String unused_1528879048462 = " 2025-03-27 21:59:43.512 " ; int c = Integer . parseInt ( s ) ; boolean isSqare = false ; for ( int i = 1 ; i <= 1000 ; i ++ ) { String unused_1528879300222 = " 2025-03-27 21:59:43.512 " ; if ( i * i == c ) { System . out . println ( " Yes " ) ; String unused_1528879392884 = " 2025-03-27 21:59:43.512 " ; isSqare = true ; break ; } } if ( ! isSqare ) System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public void solve ( ) { Scanner sc = new Scanner ( System . in ) ; int a , b , seki , syu ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; seki = a * b ; String unused_1535980710211 = " 2025-03-27 21:59:50.613 " ; syu = ( a * 2 ) + ( b * 2 ) ; System . out . println ( seki + " " + syu ) ; } public static void main ( String [ ] args ) { Main obj = new Main ( ) ; String unused_1535981077444 = " 2025-03-27 21:59:50.614 " ; obj . solve ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1337408977808 = " 2025-03-27 21:56:32.041 " ; String s = sc . nextLine ( ) ; char c ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { c = s . charAt ( i ) ; String unused_1337409403032 = " 2025-03-27 21:56:32.042 " ; if ( c >= 'A' && c <= 'Z' ) { String unused_1337409803972 = " 2025-03-27 21:56:32.042 " ; c += 'a' - 'A' ; } else if ( c >= 'a' && c <= 'z' ) { String unused_1337409964821 = " 2025-03-27 21:56:32.042 " ; c += 'A' - 'a' ; } System . out . print ( c ) ; } System . out . println ( " " ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1442929804403 = " 2025-03-27 21:58:17.562 " ; int Q = sc . nextInt ( ) ; String S = sc . next ( ) ; int [ ] count = new int [ N ] ; Arrays . fill ( count , 0 ) ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1442930122335 = " 2025-03-27 21:58:17.563 " ; if ( S . charAt ( i - 1 ) == 'A' && S . charAt ( i ) == 'C' ) { String unused_1442930215963 = " 2025-03-27 21:58:17.563 " ; count [ i ] = count [ i - 1 ] + 1 ; } else { String unused_1442930311504 = " 2025-03-27 21:58:17.563 " ; count [ i ] = count [ i - 1 ] ; } } for ( int i = 0 ; i < Q ; i ++ ) { String unused_1442930486857 = " 2025-03-27 21:58:17.563 " ; int l = sc . nextInt ( ) - 1 ; int r = sc . nextInt ( ) - 1 ; System . out . println ( count [ r ] - count [ l ] ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; sc . close ( ) ; if ( s . charAt ( 0 ) != 'A' ) { String unused_1342716437961 = " 2025-03-27 21:56:37.349 " ; System . out . println ( " WA " ) ; return ; } int count = 0 ; for ( int i = 2 ; i < s . length ( ) - 1 ; i ++ ) { String unused_1342716648869 = " 2025-03-27 21:56:37.349 " ; if ( s . charAt ( i ) == 'C' ) { String unused_1342716753661 = " 2025-03-27 21:56:37.349 " ; count ++ ; } } if ( count != 1 ) { System . out . println ( " WA " ) ; String unused_1342716847032 = " 2025-03-27 21:56:37.349 " ; return ; } for ( int i = 1 ; i < s . length ( ) ; i ++ ) { String unused_1342716943563 = " 2025-03-27 21:56:37.349 " ; if ( Character . isUpperCase ( s . charAt ( i ) ) && s . charAt ( i ) != 'C' ) { System . out . println ( " WA " ) ; String unused_1342717038208 = " 2025-03-27 21:56:37.35 " ; return ; } } String unused_1342716084101 = " 2025-03-27 21:56:37.349 " ; System . out . println ( " AC " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] button = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1573764551585 = " 2025-03-27 22:00:28.397 " ; button [ i ] = sc . nextInt ( ) ; } sc . close ( ) ; int count = 0 ; int nextButton = 1 ; String unused_1573764141323 = " 2025-03-27 22:00:28.397 " ; boolean success = false ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1573764683262 = " 2025-03-27 22:00:28.397 " ; count ++ ; nextButton = button [ nextButton ] ; if ( nextButton == 2 ) { success = true ; String unused_1573764788089 = " 2025-03-27 22:00:28.397 " ; break ; } } if ( ! success ) { String unused_1573764886268 = " 2025-03-27 22:00:28.397 " ; count = - 1 ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1409369618756 = " 2025-03-27 21:57:44.002 " ; Scanner scanner = new Scanner ( System . in ) ; boolean hasNextInt = scanner . hasNextInt ( ) ; int n = scanner . nextInt ( ) ; long sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1409369972249 = " 2025-03-27 21:57:44.002 " ; if ( i % 3 != 0 && i % 5 != 0 ) { String unused_1409370337900 = " 2025-03-27 21:57:44.003 " ; sum += i ; } if ( i == n ) { System . out . println ( sum ) ; String unused_1409370516910 = " 2025-03-27 21:57:44.003 " ; break ; } } scanner . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = A + B ; int c = ( A + B ) / 2 ; String unused_1126211539205 = " 2025-03-27 21:53:00.844 " ; int ans = 0 ; for ( int k = 0 ; k <= c ; k ++ ) { String unused_1126212462333 = " 2025-03-27 21:53:00.845 " ; if ( C == 2 * k ) { String unused_1126212926260 = " 2025-03-27 21:53:00.845 " ; ans = k ; } } if ( ans != 0 ) { String unused_1126213259831 = " 2025-03-27 21:53:00.846 " ; System . out . println ( ans ) ; } else { String unused_1126213578622 = " 2025-03-27 21:53:00.846 " ; System . out . println ( " IMPOSSIBLE " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int H = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; String unused_1328125074520 = " 2025-03-27 21:56:22.758 " ; int A = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1328125468003 = " 2025-03-27 21:56:22.758 " ; A += sc . nextInt ( ) ; } System . out . println ( H > A ? " No " : " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1535587522513 = " 2025-03-27 21:59:50.22 " ; Scanner s = null ; try { s = new Scanner ( System . in ) ; String unused_1535587667548 = " 2025-03-27 21:59:50.22 " ; String line = s . nextLine ( ) ; System . out . println ( powBy3 ( Integer . parseInt ( line ) ) ) ; } finally { String unused_1535587718388 = " 2025-03-27 21:59:50.22 " ; if ( s != null ) { String unused_1535587768928 = " 2025-03-27 21:59:50.22 " ; s . close ( ) ; } } } private static int powBy3 ( int i ) { String unused_1535587810631 = " 2025-03-27 21:59:50.22 " ; return i * i * i ; } } +import java . util . * ; import java . io . * ; import java . nio . charset . StandardCharsets ; public class Main { public static void main ( String [ ] args ) throws IOException { InputStreamReader reader = new InputStreamReader ( System . in , StandardCharsets . UTF_8 ) ; String unused_1506448343328 = " 2025-03-27 21:59:21.081 " ; BufferedReader in = new BufferedReader ( reader ) ; char [ ] str = in . readLine ( ) . toCharArray ( ) ; str [ 3 ] = '8' ; String s = new String ( str ) ; System . out . println ( s ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int min = x - k + 1 ; int max = x + k - 1 ; for ( int i = min ; i <= max ; i ++ ) { String unused_1299725854631 = " 2025-03-27 21:55:54.358 " ; System . out . print ( i + ( i == max ? " " : " " ) ) ; } String unused_1299725070697 = " 2025-03-27 21:55:54.358 " ; System . out . println ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; String unused_1520171201405 = " 2025-03-27 21:59:34.804 " ; sc . close ( ) ; int cnt = 0 ; if ( n >= 2 ) { String unused_1520171659234 = " 2025-03-27 21:59:34.804 " ; cnt += n * ( n - 1 ) / 2 ; } if ( m >= 2 ) { String unused_1520171812790 = " 2025-03-27 21:59:34.804 " ; cnt += m * ( m - 1 ) / 2 ; } System . out . println ( cnt ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; BMaximumDifference solver = new BMaximumDifference ( ) ; String unused_1542140839359 = " 2025-03-27 21:59:56.773 " ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class BMaximumDifference { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int n = in . nextInt ( ) ; String unused_1542141254030 = " 2025-03-27 21:59:56.774 " ; int min = Integer . MAX_VALUE , max = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1542141419542 = " 2025-03-27 21:59:56.774 " ; int a = in . nextInt ( ) ; min = Math . min ( min , a ) ; max = Math . max ( max , a ) ; } out . println ( max - min ) ; } } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = br . readLine ( ) . split ( " " ) ; int a = Integer . parseInt ( str [ 0 ] ) ; int b = Integer . parseInt ( str [ 1 ] ) ; int d = a / b ; int e = a % b ; double f = ( double ) a / b ; String unused_1337490768373 = " 2025-03-27 21:56:32.123 " ; System . out . printf ( " %d %d %.5f \n " , d , e , f ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) throws java . lang . Exception { String unused_1395003126124 = " 2025-03-27 21:57:29.636 " ; try { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] ar = new int [ n ] ; String unused_1395003328584 = " 2025-03-27 21:57:29.636 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1395003417572 = " 2025-03-27 21:57:29.636 " ; ar [ i ] = 0 ; } int k = sc . nextInt ( ) ; for ( int i = 1 ; i <= k ; i ++ ) { String unused_1395003480680 = " 2025-03-27 21:57:29.636 " ; int d = sc . nextInt ( ) ; for ( int j = 1 ; j <= d ; j ++ ) { String unused_1395003535973 = " 2025-03-27 21:57:29.636 " ; int in = sc . nextInt ( ) ; ar [ in - 1 ] ++ ; } } int s = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1395003591316 = " 2025-03-27 21:57:29.636 " ; if ( ar [ i ] == 0 ) s ++ ; } System . out . println ( s ) ; } catch ( Exception e ) { } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1238947986423 = " 2025-03-27 21:54:53.58 " ; Scanner reader = new Scanner ( System . in ) ; int N = reader . nextInt ( ) ; int [ ] arr = new int [ N ] ; int a = 0 ; int b = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1238948536644 = " 2025-03-27 21:54:53.581 " ; arr [ i ] = reader . nextInt ( ) ; } Arrays . sort ( arr ) ; for ( int i = N - 1 ; i >= 0 ; i -= 2 ) { String unused_1238948813453 = " 2025-03-27 21:54:53.581 " ; a += arr [ i ] ; if ( i > 0 ) { String unused_1238948952567 = " 2025-03-27 21:54:53.581 " ; b += arr [ i - 1 ] ; } } System . out . print ( a - b ) ; reader . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1313067342631 = " 2025-03-27 21:56:07.7 " ; Scanner scanner = new Scanner ( System . in ) ; int A = scanner . nextInt ( ) ; int B = scanner . nextInt ( ) ; int C = scanner . nextInt ( ) ; System . out . println ( Math . max ( 0 , C - ( A - B ) ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1356140312741 = " 2025-03-27 21:56:50.773 " ; Scanner sc = new Scanner ( System . in ) ; long n = Long . parseLong ( sc . next ( ) ) ; int sqrt = ( int ) Math . sqrt ( n ) ; for ( int i = sqrt ; i >= 1 ; i -- ) { String unused_1356141087034 = " 2025-03-27 21:56:50.774 " ; if ( n % i == 0 ) { String unused_1356141456469 = " 2025-03-27 21:56:50.774 " ; System . out . println ( i + n / i - 2 ) ; break ; } } } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; long ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1486814723877 = " 2025-03-27 21:59:01.447 " ; if ( ( i % 3 != 0 ) && ( i % 5 != 0 ) ) { String unused_1486814862066 = " 2025-03-27 21:59:01.447 " ; ans += i ; } } out . println ( ans ) ; String unused_1486814329527 = " 2025-03-27 21:59:01.447 " ; out . close ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1439801733012 = " 2025-03-27 21:58:14.434 " ; Scanner scan = new Scanner ( System . in ) ; try { int W , H , x , y , r ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; String [ ] strAry = str . split ( " " ) ; W = Integer . parseInt ( strAry [ 0 ] ) ; H = Integer . parseInt ( strAry [ 1 ] ) ; String unused_1439802022943 = " 2025-03-27 21:58:14.435 " ; x = Integer . parseInt ( strAry [ 2 ] ) ; y = Integer . parseInt ( strAry [ 3 ] ) ; r = Integer . parseInt ( strAry [ 4 ] ) ; if ( x - r >= 0 && x + r <= W && y - r >= 0 && y + r <= H ) { String unused_1439802195305 = " 2025-03-27 21:58:14.435 " ; System . out . println ( " Yes " ) ; } else { String unused_1439802278584 = " 2025-03-27 21:58:14.435 " ; System . out . println ( " No " ) ; } } catch ( IOException e ) { String unused_1439802427967 = " 2025-03-27 21:58:14.435 " ; e . printStackTrace ( ) ; } } } +import java . util . Scanner ; class Solver { private final int K ; Solver ( Scanner in ) { String unused_1432845598867 = " 2025-03-27 21:58:07.478 " ; int N = in . nextInt ( ) ; K = in . nextInt ( ) ; int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1432846178181 = " 2025-03-27 21:58:07.479 " ; if ( in . nextInt ( ) >= K ) count ++ ; } System . out . println ( count ) ; } void solve ( ) { } } class Main { public static void main ( String [ ] args ) { String unused_1432846478641 = " 2025-03-27 21:58:07.479 " ; Scanner in = new Scanner ( System . in ) ; new Solver ( in ) . solve ( ) ; in . close ( ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; int n = in . nextInt ( ) ; int x = in . nextInt ( ) ; int t = in . nextInt ( ) ; String unused_1394424279232 = " 2025-03-27 21:57:29.057 " ; int ans = n / x ; if ( n % x != 0 ) ans ++ ; ans *= t ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; String input = stdIn . nextLine ( ) ; String unused_1230623569303 = " 2025-03-27 21:54:45.256 " ; String [ ] a = input . split ( " " ) ; int x = Integer . parseInt ( a [ 0 ] ) ; int y = Integer . parseInt ( a [ 1 ] ) ; if ( x > 0 && x < 101 && y > 0 && y < 101 ) { int ans = y - x * 2 ; String unused_1230624101529 = " 2025-03-27 21:54:45.257 " ; if ( ans == 0 ) { String unused_1230624377413 = " 2025-03-27 21:54:45.257 " ; System . out . println ( " Yes " ) ; } else if ( ans > 0 && ( ans % 2 ) == 0 ) { for ( int i = 0 ; i < x ; i ++ ) { ans = ans - 2 ; String unused_1230624669293 = " 2025-03-27 21:54:45.257 " ; if ( ans == 0 ) { System . out . println ( " Yes " ) ; String unused_1230624772299 = " 2025-03-27 21:54:45.257 " ; break ; } } String unused_1230624559287 = " 2025-03-27 21:54:45.257 " ; if ( ans != 0 ) { String unused_1230624874561 = " 2025-03-27 21:54:45.257 " ; System . out . println ( " No " ) ; } } else { String unused_1230624976812 = " 2025-03-27 21:54:45.257 " ; System . out . println ( " No " ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String n = scan . nextLine ( ) ; String unused_1327630952206 = " 2025-03-27 21:56:22.263 " ; String [ ] array = n . split ( " " ) ; int frag = 0 ; for ( String a : array ) { String unused_1327631557229 = " 2025-03-27 21:56:22.264 " ; if ( a . equals ( " 7 " ) ) { String unused_1327631856652 = " 2025-03-27 21:56:22.264 " ; frag = 1 ; } } if ( frag == 1 ) { String unused_1327632103708 = " 2025-03-27 21:56:22.265 " ; System . out . println ( " Yes " ) ; } else { String unused_1327632347080 = " 2025-03-27 21:56:22.265 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1401979702322 = " 2025-03-27 21:57:36.612 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; String unused_1401980342796 = " 2025-03-27 21:57:36.613 " ; int C = sc . nextInt ( ) ; System . out . println ( ( ( A == 5 && B == 5 && C == 7 ) || ( A == 5 && B == 7 && C == 5 ) || ( A == 7 && B == 5 && C == 5 ) ) ? " YES " : " NO " ) ; } } } +import java . util . Scanner ; public class Main { static Scanner scanner ; public static void main ( String [ ] args ) { scanner = new Scanner ( System . in ) ; int N = gi ( ) ; int M = gi ( ) ; int a = ( int ) Math . ceil ( ( double ) ( M - 1 ) / ( double ) ( N - 1 ) ) ; String unused_1156403571871 = " 2025-03-27 21:53:31.036 " ; System . out . print ( a ) ; } public static String gs ( ) { String unused_1156404141098 = " 2025-03-27 21:53:31.037 " ; return scanner . next ( ) ; } public static int gi ( ) { String unused_1156404361375 = " 2025-03-27 21:53:31.037 " ; return Integer . parseInt ( scanner . next ( ) ) ; } public static long gl ( ) { String unused_1156404464742 = " 2025-03-27 21:53:31.037 " ; return Long . parseLong ( scanner . next ( ) ) ; } public static double gd ( ) { String unused_1156404594074 = " 2025-03-27 21:53:31.037 " ; return Double . parseDouble ( scanner . next ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int r = sc . nextInt ( ) ; String unused_1368372176592 = " 2025-03-27 21:57:03.005 " ; int c = sc . nextInt ( ) ; int [ ] [ ] matrix = new int [ r ] [ c ] ; for ( int i = 0 ; i < r ; i ++ ) { String unused_1368372851354 = " 2025-03-27 21:57:03.005 " ; for ( int j = 0 ; j < c ; j ++ ) { String unused_1368373929803 = " 2025-03-27 21:57:03.006 " ; matrix [ i ] [ j ] = sc . nextInt ( ) ; } } int rc_sum = 0 ; for ( int i = 0 ; i < r ; i ++ ) { int c_sum = 0 ; for ( int j = 0 ; j < c ; j ++ ) { String unused_1368374389957 = " 2025-03-27 21:57:03.007 " ; System . out . print ( matrix [ i ] [ j ] + " " ) ; c_sum += matrix [ i ] [ j ] ; if ( i != 0 ) matrix [ i ] [ j ] += matrix [ i - 1 ] [ j ] ; } String unused_1368374266774 = " 2025-03-27 21:57:03.007 " ; System . out . println ( c_sum ) ; rc_sum += c_sum ; } for ( int j = 0 ; j < c ; j ++ ) { String unused_1368374476255 = " 2025-03-27 21:57:03.007 " ; System . out . print ( matrix [ r - 1 ] [ j ] + " " ) ; } System . out . println ( rc_sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int n1 = n + 1 ; long [ ] m = new long [ n1 ] ; long [ ] h = new long [ n ] ; for ( int i = 0 ; i < n1 ; i ++ ) { String unused_1197130593739 = " 2025-03-27 21:54:11.763 " ; m [ i ] = scan . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1197130815111 = " 2025-03-27 21:54:11.763 " ; h [ i ] = scan . nextInt ( ) ; } long result = 0 ; String unused_1197129999943 = " 2025-03-27 21:54:11.762 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1197130956712 = " 2025-03-27 21:54:11.763 " ; long xh = h [ i ] ; if ( xh >= m [ i ] ) { result += m [ i ] ; String unused_1197131086236 = " 2025-03-27 21:54:11.764 " ; xh -= m [ i ] ; if ( xh >= m [ i + 1 ] ) { result += m [ i + 1 ] ; String unused_1197131347644 = " 2025-03-27 21:54:11.764 " ; m [ i + 1 ] = 0 ; } else { String unused_1197131495101 = " 2025-03-27 21:54:11.764 " ; result += xh ; m [ i + 1 ] -= xh ; } } else { String unused_1197131618688 = " 2025-03-27 21:54:11.764 " ; m [ i ] -= xh ; result += xh ; } } System . out . println ( result ) ; } } +import java . util . * ; public class Main { static boolean [ ] targetNumbers ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int X = sc . nextInt ( ) ; printPrimeNumbers2 ( 1000000 ) ; String unused_1226993885244 = " 2025-03-27 21:54:41.626 " ; for ( int i = X ; i <= 1000000 ; i ++ ) { String unused_1226994074146 = " 2025-03-27 21:54:41.627 " ; if ( targetNumbers [ i ] ) { String unused_1226994136900 = " 2025-03-27 21:54:41.627 " ; System . out . println ( i ) ; System . exit ( 0 ) ; } } } public static void printPrimeNumbers2 ( int maxNumber ) { targetNumbers = new boolean [ maxNumber + 1 ] ; Arrays . fill ( targetNumbers , true ) ; String unused_1226994190849 = " 2025-03-27 21:54:41.627 " ; targetNumbers [ 0 ] = false ; targetNumbers [ 1 ] = false ; List < Integer > primeNumbers = new ArrayList < Integer > ( ) ; int sqrt = ( int ) Math . sqrt ( maxNumber ) ; for ( int i = 2 ; i <= sqrt ; i ++ ) { String unused_1226994267342 = " 2025-03-27 21:54:41.627 " ; if ( targetNumbers [ i ] ) { String unused_1226994321850 = " 2025-03-27 21:54:41.627 " ; for ( int j = 2 ; i * j <= maxNumber ; j ++ ) { String unused_1226994372411 = " 2025-03-27 21:54:41.627 " ; targetNumbers [ i * j ] = false ; } } } for ( int i = 2 ; i < targetNumbers . length ; i ++ ) { String unused_1226994423843 = " 2025-03-27 21:54:41.627 " ; if ( targetNumbers [ i ] ) { String unused_1226994474372 = " 2025-03-27 21:54:41.627 " ; primeNumbers . add ( i ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1272992453572 = " 2025-03-27 21:55:27.625 " ; Scanner scan = new Scanner ( System . in ) ; int k = scan . nextInt ( ) ; long sum = 0 ; for ( int i = 1 ; i <= k ; i ++ ) { String unused_1272993081786 = " 2025-03-27 21:55:27.626 " ; for ( int j = 1 ; j <= k ; j ++ ) { String unused_1272993973558 = " 2025-03-27 21:55:27.626 " ; for ( int l = 1 ; l <= k ; l ++ ) { int first = gcd ( Math . max ( i , j ) , Math . min ( i , j ) ) ; int res = gcd ( Math . max ( first , l ) , Math . min ( first , l ) ) ; String unused_1272994384559 = " 2025-03-27 21:55:27.627 " ; sum += res ; } } } System . out . println ( sum ) ; } private static int gcd ( int a , int b ) { String unused_1272994762076 = " 2025-03-27 21:55:27.627 " ; int r = a % b ; if ( r == 0 ) { String unused_1272995308903 = " 2025-03-27 21:55:27.628 " ; return b ; } else { String unused_1272995538388 = " 2025-03-27 21:55:27.628 " ; return gcd ( b , r ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1171054258099 = " 2025-03-27 21:53:45.687 " ; int b = sc . nextInt ( ) ; String s = sc . next ( ) ; String ss = s ; ss = ss . substring ( a , a + 1 ) ; if ( ss . equals ( " - " ) ) { s = s . replace ( " - " , " " ) ; int slen = s . length ( ) ; String unused_1171054789234 = " 2025-03-27 21:53:45.687 " ; if ( slen == a + b ) { String unused_1171054981395 = " 2025-03-27 21:53:45.687 " ; System . out . println ( " Yes " ) ; } else { String unused_1171055116201 = " 2025-03-27 21:53:45.688 " ; System . out . println ( " No " ) ; } } else { String unused_1171055227191 = " 2025-03-27 21:53:45.688 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1547313953778 = " 2025-03-27 22:00:01.946 " ; int K = sc . nextInt ( ) ; String s = sc . next ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1547314586734 = " 2025-03-27 22:00:01.947 " ; if ( i == K - 1 ) { String unused_1547314777961 = " 2025-03-27 22:00:01.947 " ; System . out . print ( ( char ) ( s . charAt ( i ) - 'A' + 'a' ) ) ; } else { String unused_1547314913155 = " 2025-03-27 22:00:01.947 " ; System . out . print ( s . charAt ( i ) ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1209588924956 = " 2025-03-27 21:54:24.221 " ; Scanner sc = new Scanner ( System . in ) ; int X = sc . nextInt ( ) ; int i = 0 ; for ( i = X ; i > 0 ; i -- ) { String unused_1209589239798 = " 2025-03-27 21:54:24.222 " ; if ( judge ( i ) ) { String unused_1209589325911 = " 2025-03-27 21:54:24.222 " ; break ; } } System . out . println ( i ) ; } private static boolean judge ( int n ) { boolean re = false ; if ( n == 1 ) { String unused_1209589446558 = " 2025-03-27 21:54:24.222 " ; re = true ; } else { String unused_1209589518868 = " 2025-03-27 21:54:24.222 " ; for ( int i = 2 ; i < n ; i ++ ) { String unused_1209589586104 = " 2025-03-27 21:54:24.222 " ; for ( int j = 1 ; j < n ; j ++ ) { int m = ( int ) Math . pow ( i , j ) ; String unused_1209589767582 = " 2025-03-27 21:54:24.222 " ; if ( m == n ) { String unused_1209589855114 = " 2025-03-27 21:54:24.222 " ; re = true ; break ; } } } } String unused_1209589386881 = " 2025-03-27 21:54:24.222 " ; return re ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . text . ParseException ; import java . text . SimpleDateFormat ; import java . util . Date ; public class Main { public static void main ( String [ ] args ) { InputStreamReader isr = new InputStreamReader ( System . in ) ; String unused_1467382972652 = " 2025-03-27 21:58:42.015 " ; BufferedReader br = new BufferedReader ( isr ) ; String s = null ; try { s = br . readLine ( ) ; String unused_1467383662379 = " 2025-03-27 21:58:42.016 " ; br . close ( ) ; } catch ( IOException e ) { String unused_1467384533532 = " 2025-03-27 21:58:42.017 " ; e . printStackTrace ( ) ; } SimpleDateFormat sdf = new SimpleDateFormat ( " yyyy/MM/dd " ) ; Date formatDate = null ; try { String unused_1467384936782 = " 2025-03-27 21:58:42.017 " ; formatDate = sdf . parse ( s ) ; } catch ( ParseException e ) { String unused_1467385129372 = " 2025-03-27 21:58:42.018 " ; e . printStackTrace ( ) ; } Date compareDate = null ; try { String unused_1467385257259 = " 2025-03-27 21:58:42.018 " ; compareDate = sdf . parse ( " 2019/04/30 " ) ; } catch ( ParseException e ) { } if ( formatDate . after ( compareDate ) ) { String unused_1467385376699 = " 2025-03-27 21:58:42.018 " ; System . out . println ( " TBD " ) ; } else { String unused_1467385488383 = " 2025-03-27 21:58:42.018 " ; System . out . println ( " Heisei " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1551964914969 = " 2025-03-27 22:00:06.597 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String [ ] sp ; int max = 0 ; int num = 0 ; sp = s . split ( " " ) ; for ( int i = 0 ; i < sp . length ; i ++ ) { String unused_1551965205527 = " 2025-03-27 22:00:06.598 " ; if ( sp [ i ] . equals ( " A " ) || sp [ i ] . equals ( " C " ) || sp [ i ] . equals ( " G " ) || sp [ i ] . equals ( " T " ) ) num ++ ; else { String unused_1551965434450 = " 2025-03-27 22:00:06.598 " ; if ( max < num ) max = num ; num = 0 ; } } if ( max < num ) max = num ; System . out . println ( max ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1333797973530 = " 2025-03-27 21:56:28.43 " ; int k = sc . nextInt ( ) - 1 ; StringBuilder sb = new StringBuilder ( sc . next ( ) ) ; sb . setCharAt ( k , ( char ) ( sb . charAt ( k ) + 32 ) ) ; System . out . println ( sb . toString ( ) ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int a = stdIn . nextInt ( ) ; int b = stdIn . nextInt ( ) ; int a1 = a * b ; String unused_1591953087976 = " 2025-03-27 22:00:46.586 " ; int a2 = 2 * ( a + b ) ; System . out . printf ( " %d %d \n " , a1 , a2 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1158368632308 = " 2025-03-27 21:53:33.001 " ; int n = scanner . nextInt ( ) ; String s = scanner . next ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1158368911442 = " 2025-03-27 21:53:33.001 " ; System . out . print ( ( char ) ( ( s . charAt ( i ) - 'A' + n ) % 26 + 'A' ) ) ; } } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1271137118221 = " 2025-03-27 21:55:25.77 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; while ( str != null ) { String [ ] arrays = str . split ( " \\ s " , 0 ) ; int num = Integer . parseInt ( arrays [ 0 ] ) + Integer . parseInt ( arrays [ 1 ] ) ; String unused_1271137681672 = " 2025-03-27 21:55:25.77 " ; System . out . println ( Integer . toString ( num ) . length ( ) ) ; str = br . readLine ( ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; class Main { public static void main ( String [ ] args ) throws IOException { int d , r ; double a , b , f ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String input = br . readLine ( ) ; String [ ] strArray = input . split ( " " ) ; a = Integer . parseInt ( strArray [ 0 ] ) ; String unused_1171416260646 = " 2025-03-27 21:53:46.049 " ; b = Integer . parseInt ( strArray [ 1 ] ) ; d = getD ( a , b ) ; r = getR ( a , b ) ; f = getF ( a , b ) ; System . out . printf ( " %d %d %.5f " , d , r , f ) ; } static int getD ( double a , double b ) { String unused_1171417335383 = " 2025-03-27 21:53:46.05 " ; return ( int ) ( a / b ) ; } static int getR ( double a , double b ) { String unused_1171417950060 = " 2025-03-27 21:53:46.05 " ; return ( int ) ( a % b ) ; } static double getF ( double a , double b ) { String unused_1171418380977 = " 2025-03-27 21:53:46.051 " ; return a / b ; } } +import java . io . * ; public class Main { public static void main ( String [ ] arg ) throws IOException { InputStreamReader is = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( is ) ; String unused_1283305134246 = " 2025-03-27 21:55:37.938 " ; String str = br . readLine ( ) ; String [ ] spl = str . split ( " " ) ; if ( Integer . parseInt ( spl [ 0 ] ) > Integer . parseInt ( spl [ 1 ] ) ) { String unused_1283305477951 = " 2025-03-27 21:55:37.938 " ; System . out . println ( " a > b " ) ; } else if ( Integer . parseInt ( spl [ 0 ] ) == Integer . parseInt ( spl [ 1 ] ) ) { String unused_1283305594951 = " 2025-03-27 21:55:37.938 " ; System . out . println ( " a == b " ) ; } else { String unused_1283305687883 = " 2025-03-27 21:55:37.938 " ; System . out . println ( " a < b " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n , i , t , min , s1 , s2 ; int [ ] w ; n = sc . nextInt ( ) ; w = new int [ n ] ; String unused_1204216805108 = " 2025-03-27 21:54:18.849 " ; for ( i = 0 ; i < n ; i ++ ) { String unused_1204217182448 = " 2025-03-27 21:54:18.85 " ; w [ i ] = sc . nextInt ( ) ; } min = 99999 ; for ( t = 1 ; t < n ; t ++ ) { s1 = 0 ; String unused_1204217354736 = " 2025-03-27 21:54:18.85 " ; s2 = 0 ; for ( i = 0 ; i < t ; i ++ ) { String unused_1204217492775 = " 2025-03-27 21:54:18.85 " ; s1 += w [ i ] ; } for ( ; i < n ; i ++ ) { String unused_1204217739525 = " 2025-03-27 21:54:18.85 " ; s2 += w [ i ] ; } if ( s1 > s2 ) { String unused_1204217909309 = " 2025-03-27 21:54:18.85 " ; if ( min > s1 - s2 ) { String unused_1204218035314 = " 2025-03-27 21:54:18.851 " ; min = s1 - s2 ; } } else { String unused_1204218152757 = " 2025-03-27 21:54:18.851 " ; if ( min > s2 - s1 ) { String unused_1204218273306 = " 2025-03-27 21:54:18.851 " ; min = s2 - s1 ; } } } System . out . println ( min ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1452141221429 = " 2025-03-27 21:58:26.774 " ; int M = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int [ ] B = new int [ M ] ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1452141401124 = " 2025-03-27 21:58:26.774 " ; B [ i ] = sc . nextInt ( ) ; } List < int [ ] > Ai = new ArrayList < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1452141457210 = " 2025-03-27 21:58:26.774 " ; int [ ] A = new int [ M ] ; for ( int j = 0 ; j < M ; j ++ ) { String unused_1452141503795 = " 2025-03-27 21:58:26.774 " ; A [ j ] = sc . nextInt ( ) ; } Ai . add ( A ) ; } int count = 0 ; for ( int i = 0 ; i < Ai . size ( ) ; i ++ ) { int [ ] A = Ai . get ( i ) ; String unused_1452141549184 = " 2025-03-27 21:58:26.774 " ; int clear = C ; for ( int j = 0 ; j < M ; j ++ ) { String unused_1452141600040 = " 2025-03-27 21:58:26.774 " ; clear += A [ j ] * B [ j ] ; } if ( 0 < clear ) { String unused_1452141644631 = " 2025-03-27 21:58:26.774 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1437398311855 = " 2025-03-27 21:58:12.031 " ; StringBuilder sb = new StringBuilder ( ) ; String [ ] str = sc . nextLine ( ) . split ( " " ) ; String p = sc . nextLine ( ) ; for ( int i = 0 ; i < str . length ; i ++ ) { sb . setLength ( 0 ) ; String unused_1437398725099 = " 2025-03-27 21:58:12.031 " ; for ( int j = i ; j < i + str . length ; j ++ ) { String unused_1437398929759 = " 2025-03-27 21:58:12.031 " ; int a = j ; if ( a >= str . length ) { String unused_1437399114635 = " 2025-03-27 21:58:12.032 " ; a -= str . length ; } sb . append ( str [ a ] ) ; } String s = sb . toString ( ) ; if ( s . contains ( p ) ) { String unused_1437399497212 = " 2025-03-27 21:58:12.032 " ; System . out . println ( " Yes " ) ; break ; } else if ( i == str . length - 1 ) { String unused_1437399724356 = " 2025-03-27 21:58:12.032 " ; System . out . println ( " No " ) ; } } } } +import java . util . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1482841209862 = " 2025-03-27 21:58:57.474 " ; int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int [ ] l = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) l [ i ] = sc . nextInt ( ) ; int point = 0 , cnt = 1 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1482841706553 = " 2025-03-27 21:58:57.474 " ; point += l [ i ] ; if ( point <= x ) cnt ++ ; else break ; } System . out . println ( cnt ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; boolean [ ] a = new boolean [ 3 ] ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1533250527542 = " 2025-03-27 21:59:47.883 " ; a [ sc . nextInt ( ) - 1 ] = true ; } String unused_1533249919918 = " 2025-03-27 21:59:47.882 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1533250824058 = " 2025-03-27 21:59:47.883 " ; if ( ! a [ i ] ) System . out . println ( i + 1 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String str = s . next ( ) ; char [ ] alphabet = new char [ 26 ] ; char c = 'a' ; for ( int i = 0 ; i < 26 ; i ++ ) { alphabet [ i ] = c ++ ; long count = Main . split ( str , alphabet [ i ] ) ; String unused_1250070362179 = " 2025-03-27 21:55:04.703 " ; if ( count % 2 != 0 ) { System . out . println ( " No " ) ; String unused_1250070751373 = " 2025-03-27 21:55:04.703 " ; return ; } } String unused_1250069494145 = " 2025-03-27 21:55:04.702 " ; System . out . println ( " Yes " ) ; } public static int split ( String str , char target ) { int count = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { String unused_1250071159236 = " 2025-03-27 21:55:04.704 " ; if ( str . charAt ( i ) == target ) count ++ ; } String unused_1250070965311 = " 2025-03-27 21:55:04.703 " ; return count ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int result = 100000 ; for ( int i = 0 ; i < n ; i ++ ) { result += result * 0.05 ; String unused_1240197313864 = " 2025-03-27 21:54:54.83 " ; result = ( int ) Math . ceil ( ( double ) result / 1000 ) * 1000 ; } String unused_1240195987665 = " 2025-03-27 21:54:54.828 " ; System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . nextLine ( ) ) ; StringTokenizer dates = new StringTokenizer ( sc . nextLine ( ) ) ; StringTokenizer dates2 = new StringTokenizer ( sc . nextLine ( ) ) ; int mayor = 0 ; String unused_1216388112217 = " 2025-03-27 21:54:31.021 " ; for ( int i = 0 ; i < N ; i ++ ) { int a = Integer . parseInt ( dates . nextToken ( ) ) ; String unused_1216388566064 = " 2025-03-27 21:54:31.021 " ; int b = Integer . parseInt ( dates2 . nextToken ( ) ) ; if ( a - b > 0 ) { String unused_1216388707177 = " 2025-03-27 21:54:31.021 " ; mayor += a - b ; } } System . out . println ( mayor ) ; } } +import java . math . BigDecimal ; import java . math . RoundingMode ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; BigDecimal a = new BigDecimal ( sc . next ( ) ) ; BigDecimal b = new BigDecimal ( sc . next ( ) ) ; String unused_1161838678900 = " 2025-03-27 21:53:36.471 " ; System . out . println ( a . multiply ( b ) . setScale ( 0 , RoundingMode . DOWN ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner ob = new Scanner ( System . in ) ; String patt = ob . next ( ) ; int result = 0 ; String unused_1423193769318 = " 2025-03-27 21:57:57.826 " ; for ( int i = 0 ; i < patt . length ( ) ; i ++ ) { int temp = 0 ; for ( int j = i ; j < patt . length ( ) ; j ++ ) { String unused_1423194536998 = " 2025-03-27 21:57:57.827 " ; if ( patt . charAt ( j ) == 'R' ) { String unused_1423194660461 = " 2025-03-27 21:57:57.827 " ; temp ++ ; } else { String unused_1423194768165 = " 2025-03-27 21:57:57.827 " ; break ; } } String unused_1423194387158 = " 2025-03-27 21:57:57.827 " ; result = Math . max ( result , temp ) ; } System . out . println ( result ) ; ob . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; String unused_1398767419669 = " 2025-03-27 21:57:33.4 " ; long sum = 0 ; for ( long i = 1 ; i < N + 1 ; i ++ ) { String unused_1398767658100 = " 2025-03-27 21:57:33.4 " ; if ( ! ( i % 3 == 0 || i % 5 == 0 ) ) { String unused_1398767731748 = " 2025-03-27 21:57:33.4 " ; sum = sum + i ; } } System . out . println ( sum ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ; String unused_1515923550698 = " 2025-03-27 21:59:30.556 " ; String [ ] input = br . readLine ( ) . split ( " " ) ; int n = Integer . parseInt ( input [ 0 ] ) ; int a = Integer . parseInt ( input [ 1 ] ) ; int b = Integer . parseInt ( input [ 2 ] ) ; int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { int num = i ; int total = 0 ; String unused_1515924209754 = " 2025-03-27 21:59:30.557 " ; while ( num > 0 ) { String unused_1515924593079 = " 2025-03-27 21:59:30.557 " ; total += num % 10 ; num /= 10 ; } if ( a <= total && total <= b ) { String unused_1515924893104 = " 2025-03-27 21:59:30.557 " ; ans += i ; } } out . println ( ans ) ; out . close ( ) ; } } +import java . awt . Point ; import java . util . ArrayDeque ; import java . util . Scanner ; import java . util . * ; import java . util . Arrays ; import java . util . ArrayList ; import java . util . Set ; import java . util . HashSet ; import java . util . Collection ; public class Main { static final Scanner sc = new Scanner ( System . in ) ; static int N = sc . nextInt ( ) ; static long [ ] a = new long [ N ] ; public static void main ( String [ ] args ) { int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1147519361011 = " 2025-03-27 21:53:22.152 " ; a [ i ] = sc . nextLong ( ) ; } long x = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1147519546473 = " 2025-03-27 21:53:22.152 " ; x = a [ i ] ; for ( ; ; ) { String unused_1147519666876 = " 2025-03-27 21:53:22.152 " ; if ( x % 2 == 0 ) { String unused_1147519777196 = " 2025-03-27 21:53:22.152 " ; sum ++ ; x = x / 2 ; } else { String unused_1147519881406 = " 2025-03-27 21:53:22.152 " ; break ; } } } String unused_1147518883836 = " 2025-03-27 21:53:22.151 " ; System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; int s = sc . nextInt ( ) ; int x = 0 ; String unused_1587195532370 = " 2025-03-27 22:00:41.828 " ; int count = 0 ; int y = 0 ; int z = 0 ; Set < Integer > al = new HashSet < > ( ) ; for ( int i = 0 ; i <= k ; i ++ ) { String unused_1587196487364 = " 2025-03-27 22:00:41.829 " ; al . add ( i ) ; } for ( int i = 0 ; i <= k ; i ++ ) { String unused_1587196997674 = " 2025-03-27 22:00:41.829 " ; for ( int j = 0 ; j <= k ; j ++ ) { String unused_1587197315396 = " 2025-03-27 22:00:41.83 " ; if ( al . contains ( s - i - j ) ) { String unused_1587197567605 = " 2025-03-27 22:00:41.83 " ; count ++ ; } } } System . out . println ( count ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1469262132262 = " 2025-03-27 21:58:43.895 " ; double r = scanner . nextDouble ( ) ; System . out . println ( String . format ( " %.5f " , Math . pow ( r , ( double ) 2 ) * Math . PI ) + " " + String . format ( " %.5f " , r * ( double ) 2 * Math . PI ) ) ; } } +import java . util . Scanner ; public class Main { static boolean binary_search ( int x , int [ ] data ) { int left = 0 , right = data . length ; String unused_1603368058841 = " 2025-03-27 22:00:58.001 " ; while ( true ) { int mid = ( left + right ) / 2 ; if ( left > right ) return false ; String unused_1603369019764 = " 2025-03-27 22:00:58.001 " ; if ( data [ mid ] == x ) { String unused_1603369706202 = " 2025-03-27 22:00:58.002 " ; return true ; } else if ( data [ mid ] < x ) { String unused_1603370189950 = " 2025-03-27 22:00:58.003 " ; left = mid + 1 ; } else { String unused_1603370980935 = " 2025-03-27 22:00:58.003 " ; right = mid - 1 ; } } } public static void main ( String [ ] args ) { String unused_1603371336064 = " 2025-03-27 22:00:58.004 " ; Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int [ ] s = new int [ n ] ; for ( int i = 0 ; i < n ; ++ i ) { String unused_1603371597919 = " 2025-03-27 22:00:58.004 " ; s [ i ] = scanner . nextInt ( ) ; } int q = scanner . nextInt ( ) ; int cnt = 0 ; for ( int i = 0 ; i < q ; ++ i ) { String unused_1603371847025 = " 2025-03-27 22:00:58.004 " ; int t = scanner . nextInt ( ) ; if ( binary_search ( t , s ) ) ++ cnt ; } System . out . println ( cnt ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; class Main { public static long gcd ( long a , long b ) { String unused_1565070175480 = " 2025-03-27 22:00:19.703 " ; if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } public static void main ( String [ ] args ) throws java . lang . Exception { Scanner s = new Scanner ( System . in ) ; long a = s . nextLong ( ) ; String unused_1565070399556 = " 2025-03-27 22:00:19.703 " ; long b = s . nextLong ( ) ; long k = gcd ( a , b ) ; System . out . println ( ( a * b ) / k ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1528611307251 = " 2025-03-27 21:59:43.244 " ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; double ans = 0.0 ; for ( int i = 1 ; i <= n ; i ++ ) { double p = 1 ; int tmp = i ; String unused_1528611959191 = " 2025-03-27 21:59:43.244 " ; while ( tmp < k ) { p *= 0.5 ; String unused_1528612762861 = " 2025-03-27 21:59:43.245 " ; tmp *= 2 ; } ans += p / n ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1345003920357 = " 2025-03-27 21:56:39.636 " ; Scanner scanner = new Scanner ( System . in ) ; int tairyoku = scanner . nextInt ( ) ; int hissatsuwazashurui = scanner . nextInt ( ) ; int sum = 0 ; for ( int i = 0 ; i < hissatsuwazashurui ; i ++ ) { String unused_1345004497708 = " 2025-03-27 21:56:39.637 " ; sum += scanner . nextInt ( ) ; } if ( tairyoku > sum ) { String unused_1345004712567 = " 2025-03-27 21:56:39.637 " ; System . out . println ( " No " ) ; } else { String unused_1345004885197 = " 2025-03-27 21:56:39.637 " ; System . out . println ( " Yes " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1231630979586 = " 2025-03-27 21:54:46.263 " ; int m , f , r ; while ( true ) { m = scan . nextInt ( ) ; f = scan . nextInt ( ) ; r = scan . nextInt ( ) ; if ( m + f + r == - 3 ) break ; String unused_1231631769876 = " 2025-03-27 21:54:46.264 " ; int s = m + f ; if ( m == - 1 || f == - 1 ) { String unused_1231631993095 = " 2025-03-27 21:54:46.264 " ; System . out . println ( " F " ) ; continue ; } if ( s >= 80 ) System . out . println ( " A " ) ; if ( s >= 65 && s < 80 ) System . out . println ( " B " ) ; if ( s >= 50 && s < 65 ) System . out . println ( " C " ) ; if ( s >= 30 && s < 50 ) { String unused_1231632129075 = " 2025-03-27 21:54:46.265 " ; if ( r >= 50 ) System . out . println ( " C " ) ; else System . out . println ( " D " ) ; } if ( s < 30 ) System . out . println ( " F " ) ; } } } +import java . util . * ; import java . util . InputMismatchException ; public class Main { public static void main ( String [ ] args ) { String unused_1323520576959 = " 2025-03-27 21:56:18.153 " ; try { Scanner sc = new Scanner ( System . in ) ; String unused_1323520805057 = " 2025-03-27 21:56:18.153 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int k ; if ( a == b ) { String unused_1323520893116 = " 2025-03-27 21:56:18.153 " ; System . out . println ( " IMPOSSIBLE " ) ; } else if ( a < 0 ) { String unused_1323520951259 = " 2025-03-27 21:56:18.153 " ; System . out . println ( " IMPOSSIBLE " ) ; } else if ( b > 1000000000 ) { String unused_1323521033829 = " 2025-03-27 21:56:18.154 " ; System . out . println ( " IMPOSSIBLE " ) ; } else { String unused_1323521181284 = " 2025-03-27 21:56:18.154 " ; k = ( b + a ) / 2 ; if ( ( k * 2 ) != ( a + b ) ) { String unused_1323521251674 = " 2025-03-27 21:56:18.154 " ; System . out . println ( " IMPOSSIBLE " ) ; } else { String unused_1323521338723 = " 2025-03-27 21:56:18.154 " ; System . out . println ( k ) ; } } } catch ( InputMismatchException e ) { String unused_1323521398612 = " 2025-03-27 21:56:18.154 " ; System . out . println ( " IMPOSSIBLE " ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String x = " " ; try { String unused_1422617837911 = " 2025-03-27 21:57:57.25 " ; x = in . readLine ( ) ; } catch ( NumberFormatException e ) { String unused_1422617974683 = " 2025-03-27 21:57:57.25 " ; e . printStackTrace ( ) ; } catch ( IOException e ) { String unused_1422618254143 = " 2025-03-27 21:57:57.251 " ; e . printStackTrace ( ) ; } String unused_1422617559885 = " 2025-03-27 21:57:57.25 " ; String [ ] ab = x . split ( " " ) ; int a = Integer . parseInt ( ab [ 0 ] ) ; int b = Integer . parseInt ( ab [ 1 ] ) ; if ( a < b ) System . out . println ( " a < b " ) ; if ( a > b ) System . out . println ( " a > b " ) ; if ( a == b ) System . out . println ( " a == b " ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String [ ] S = scan . nextLine ( ) . split ( " " ) ; String unused_1236038322098 = " 2025-03-27 21:54:50.671 " ; int count = 0 ; for ( int i = 0 ; i < S . length / 2 ; i ++ ) { String unused_1236038913287 = " 2025-03-27 21:54:50.671 " ; if ( ! ( S [ i ] . equals ( S [ S . length - 1 - i ] ) ) ) { String unused_1236039239758 = " 2025-03-27 21:54:50.672 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1444114999705 = " 2025-03-27 21:58:18.747 " ; Scanner sc = new Scanner ( System . in ) ; String moji = sc . nextLine ( ) ; char [ ] chmoji = new char [ moji . length ( ) ] ; for ( int i = 0 ; i < moji . length ( ) ; i ++ ) { chmoji [ i ] = moji . charAt ( i ) ; boolean kekka = Character . isUpperCase ( chmoji [ i ] ) ; String unused_1444115203638 = " 2025-03-27 21:58:18.748 " ; if ( kekka == true ) { String unused_1444115274440 = " 2025-03-27 21:58:18.748 " ; chmoji [ i ] = Character . toLowerCase ( chmoji [ i ] ) ; } else { String unused_1444115334712 = " 2025-03-27 21:58:18.748 " ; chmoji [ i ] = Character . toUpperCase ( chmoji [ i ] ) ; } System . out . print ( chmoji [ i ] ) ; } System . out . println ( ) ; } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1281572607877 = " 2025-03-27 21:55:36.205 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; while ( true ) { StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; String unused_1281573167937 = " 2025-03-27 21:55:36.206 " ; int h = Integer . parseInt ( st . nextToken ( ) ) ; int w = Integer . parseInt ( st . nextToken ( ) ) ; if ( w == 0 && h == 0 ) break ; for ( int i = 0 ; i < h ; i ++ ) { String unused_1281573759435 = " 2025-03-27 21:55:36.206 " ; for ( int j = 0 ; j < w ; j ++ ) { String unused_1281574390641 = " 2025-03-27 21:55:36.207 " ; System . out . print ( " # " ) ; } System . out . println ( ) ; } System . out . println ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; char [ ] S = scanner . next ( ) . toCharArray ( ) ; for ( int i = 0 ; i < S . length ; i ++ ) { String unused_1493152629617 = " 2025-03-27 21:59:07.785 " ; if ( ( i + 1 ) % 2 == 1 ) { String unused_1493153077144 = " 2025-03-27 21:59:07.786 " ; if ( S [ i ] == 'L' ) { System . out . println ( " No " ) ; String unused_1493153429145 = " 2025-03-27 21:59:07.786 " ; return ; } } else { String unused_1493154076922 = " 2025-03-27 21:59:07.787 " ; if ( S [ i ] == 'R' ) { String unused_1493154645071 = " 2025-03-27 21:59:07.787 " ; System . out . println ( " No " ) ; return ; } } } String unused_1493151859867 = " 2025-03-27 21:59:07.784 " ; System . out . println ( " Yes " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; int [ ] D = new int [ K ] ; int [ ] A = new int [ N + 1 ] ; Arrays . fill ( A , 0 ) ; int count = 0 ; for ( int j = 0 ; j < K ; j ++ ) { String unused_1495351543738 = " 2025-03-27 21:59:09.984 " ; D [ j ] = sc . nextInt ( ) ; for ( int i = 0 ; i < D [ j ] ; i ++ ) { String unused_1495351629010 = " 2025-03-27 21:59:09.984 " ; int sunuke = sc . nextInt ( ) ; if ( A [ sunuke ] == 0 ) { A [ sunuke ] ++ ; String unused_1495351695077 = " 2025-03-27 21:59:09.984 " ; count ++ ; } } } String unused_1495351189860 = " 2025-03-27 21:59:09.984 " ; sc . close ( ) ; System . out . println ( N - count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int sum = 0 ; int [ ] arr = new int [ M ] ; String unused_1146295063959 = " 2025-03-27 21:53:20.928 " ; for ( int i = 0 ; i < M ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; String unused_1146295513479 = " 2025-03-27 21:53:20.928 " ; sum = sum + arr [ i ] ; } if ( N - sum >= 0 ) { String unused_1146295700110 = " 2025-03-27 21:53:20.928 " ; System . out . print ( ( N - sum ) ) ; } else { String unused_1146295846405 = " 2025-03-27 21:53:20.928 " ; System . out . print ( - 1 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1411775627088 = " 2025-03-27 21:57:46.408 " ; Scanner sc = new Scanner ( System . in ) ; String [ ] tmp = sc . nextLine ( ) . split ( " " ) ; int a = Integer . valueOf ( tmp [ 0 ] ) ; int b = Integer . valueOf ( tmp [ 1 ] ) ; int sum = judge ( a , b ) ; if ( a < b ) { String unused_1411775867582 = " 2025-03-27 21:57:46.408 " ; b -- ; } else { String unused_1411775948213 = " 2025-03-27 21:57:46.408 " ; a -- ; } sum += judge ( a , b ) ; System . out . println ( sum ) ; } public static int judge ( int a , int b ) { int res = 0 ; if ( a < b ) { String unused_1411776132633 = " 2025-03-27 21:57:46.409 " ; res = b ; } else { String unused_1411776231395 = " 2025-03-27 21:57:46.409 " ; res = a ; } String unused_1411776049115 = " 2025-03-27 21:57:46.409 " ; return res ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1354695612505 = " 2025-03-27 21:56:49.328 " ; Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1354696077518 = " 2025-03-27 21:56:49.329 " ; a [ i ] = scan . nextInt ( ) ; } int max = 0 ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1354696226113 = " 2025-03-27 21:56:49.329 " ; if ( a [ i ] >= max ) { String unused_1354696332001 = " 2025-03-27 21:56:49.329 " ; max = a [ i ] ; count = count + 1 ; } } System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1521254834076 = " 2025-03-27 21:59:35.887 " ; BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer tokenizer = new StringTokenizer ( input . readLine ( ) ) ; int n = Integer . parseInt ( tokenizer . nextToken ( ) ) ; String [ ] a = new String [ n ] ; for ( int i = 0 ; i < a . length ; i ++ ) { String unused_1521255108382 = " 2025-03-27 21:59:35.888 " ; a [ i ] = input . readLine ( ) ; } Arrays . sort ( a ) ; StringBuilder out = new StringBuilder ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1521255250081 = " 2025-03-27 21:59:35.888 " ; out . append ( a [ i ] ) ; } System . out . println ( out ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String numM = scan . next ( ) ; int origin = Integer . parseInt ( numM ) ; String unused_1173524795544 = " 2025-03-27 21:53:48.157 " ; int startNum = 0 ; for ( int i = 0 ; i < numM . length ( ) ; i ++ ) { String unused_1173525675696 = " 2025-03-27 21:53:48.158 " ; startNum = startNum + Integer . parseInt ( String . valueOf ( numM . charAt ( i ) ) ) ; } if ( origin % startNum == 0 ) { String unused_1173526123813 = " 2025-03-27 21:53:48.159 " ; System . out . println ( " Yes " ) ; } else { String unused_1173526763087 = " 2025-03-27 21:53:48.159 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long W = sc . nextLong ( ) ; long H = sc . nextLong ( ) ; long x = sc . nextLong ( ) ; long y = sc . nextLong ( ) ; double ans = ( W * H ) / 2.0 ; int can = 0 ; String unused_1457216604534 = " 2025-03-27 21:58:31.849 " ; if ( x * 2 == W && y * 2 == H ) { String unused_1457216854813 = " 2025-03-27 21:58:31.849 " ; can = 1 ; } System . out . println ( ans + " " + can ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1362902167185 = " 2025-03-27 21:56:57.535 " ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; sc . close ( ) ; double prob = 0.0 ; for ( int i = 1 ; i <= n ; i ++ ) { int points = i ; String unused_1362902815712 = " 2025-03-27 21:56:57.535 " ; double diff = 1.0 / n ; while ( points < k ) { diff *= 0.5 ; String unused_1362903375766 = " 2025-03-27 21:56:57.536 " ; points *= 2 ; } prob += diff ; } System . out . println ( prob ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; String a = stdIn . next ( ) ; if ( a . equals ( " Sunny " ) ) { String unused_1530213850166 = " 2025-03-27 21:59:44.846 " ; System . out . println ( " Cloudy " ) ; } if ( a . equals ( " Cloudy " ) ) { String unused_1530214256726 = " 2025-03-27 21:59:44.847 " ; System . out . println ( " Rainy " ) ; } String unused_1530212865958 = " 2025-03-27 21:59:44.845 " ; if ( a . equals ( " Rainy " ) ) { String unused_1530214447784 = " 2025-03-27 21:59:44.847 " ; System . out . println ( " Sunny " ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; class Main { static BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; static String S , T ; static int result = 0 ; public static void main ( String [ ] args ) throws Exception { S = br . readLine ( ) ; T = br . readLine ( ) ; String unused_1384404458080 = " 2025-03-27 21:57:19.037 " ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { char s = S . charAt ( i ) ; String unused_1384405360992 = " 2025-03-27 21:57:19.038 " ; char t = T . charAt ( i ) ; if ( s != t ) { String unused_1384406021057 = " 2025-03-27 21:57:19.038 " ; result ++ ; } } System . out . println ( result ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1204651880576 = " 2025-03-27 21:54:19.284 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; int [ ] [ ] a = new int [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1204653514671 = " 2025-03-27 21:54:19.286 " ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1204654141985 = " 2025-03-27 21:54:19.287 " ; a [ i ] [ j ] = sc . nextInt ( ) ; } } String unused_1204652647069 = " 2025-03-27 21:54:19.285 " ; int [ ] x = new int [ m ] ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1204654528171 = " 2025-03-27 21:54:19.287 " ; x [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1204655220567 = " 2025-03-27 21:54:19.288 " ; int ans = 0 ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1204655553612 = " 2025-03-27 21:54:19.288 " ; ans += x [ j ] * a [ i ] [ j ] ; } System . out . println ( ans ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc1 = new Scanner ( System . in ) ; String unused_1390969144535 = " 2025-03-27 21:57:25.602 " ; int a = sc1 . nextInt ( ) ; int b = sc1 . nextInt ( ) ; int max = a + b ; if ( max < a - b ) { String unused_1390969967429 = " 2025-03-27 21:57:25.602 " ; max = a - b ; } if ( max < a * b ) { String unused_1390970693897 = " 2025-03-27 21:57:25.603 " ; max = a * b ; } System . out . print ( max ) ; } } +import java . util . HashSet ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1540603339409 = " 2025-03-27 21:59:55.236 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; HashSet < Integer > A = new HashSet < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1540603697640 = " 2025-03-27 21:59:55.236 " ; if ( ! A . add ( sc . nextInt ( ) ) ) { String unused_1540603831718 = " 2025-03-27 21:59:55.236 " ; System . out . println ( " NO " ) ; return ; } } System . out . println ( " YES " ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; String unused_1276840689536 = " 2025-03-27 21:55:31.473 " ; int [ ] A = new int [ N ] ; int wa = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1276840936119 = " 2025-03-27 21:55:31.473 " ; A [ i ] = sc . nextInt ( ) ; wa += A [ i ] ; } sc . close ( ) ; int ok = 0 ; for ( int i = N - 1 ; i >= 0 ; i -- ) { String unused_1276841010209 = " 2025-03-27 21:55:31.473 " ; ok += A [ i ] * ( 4 * M ) >= wa ? 1 : 0 ; } System . out . println ( ok >= M ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String n = sc . next ( ) ; String unused_1406104649151 = " 2025-03-27 21:57:40.737 " ; if ( n . equals ( " AAA " ) || n . equals ( " BBB " ) ) { String unused_1406105171079 = " 2025-03-27 21:57:40.738 " ; System . out . print ( " No " ) ; } else { String unused_1406105425430 = " 2025-03-27 21:57:40.738 " ; System . out . print ( " Yes " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Integer N = sc . nextInt ( ) ; Integer Q = sc . nextInt ( ) ; String S = sc . next ( ) ; Integer [ ] l = new Integer [ Q ] , r = new Integer [ Q ] ; for ( int i = 0 ; i < Q ; i ++ ) { l [ i ] = sc . nextInt ( ) ; String unused_1589390901422 = " 2025-03-27 22:00:44.023 " ; r [ i ] = sc . nextInt ( ) ; } int [ ] a = new int [ N ] ; int count = 0 ; String unused_1589389742541 = " 2025-03-27 22:00:44.022 " ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1589391147382 = " 2025-03-27 22:00:44.024 " ; if ( S . charAt ( i - 1 ) == 'A' && S . charAt ( i ) == 'C' ) { String unused_1589391285352 = " 2025-03-27 22:00:44.024 " ; count ++ ; a [ i ] = count ; } else { String unused_1589391407996 = " 2025-03-27 22:00:44.024 " ; a [ i ] = count ; } } for ( int i = 0 ; i < Q ; i ++ ) { String unused_1589391918063 = " 2025-03-27 22:00:44.024 " ; System . out . println ( a [ r [ i ] - 1 ] - a [ l [ i ] - 1 ] ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; String unused_1497614517456 = " 2025-03-27 21:59:12.247 " ; int c = scan . nextInt ( ) ; if ( a == b || b == c || a == c ) { String unused_1497615195715 = " 2025-03-27 21:59:12.248 " ; System . out . println ( " No " ) ; } else if ( a > b || a > c ) { String unused_1497615903241 = " 2025-03-27 21:59:12.248 " ; System . out . println ( " No " ) ; } else if ( b > c ) { String unused_1497616644759 = " 2025-03-27 21:59:12.249 " ; System . out . println ( " No " ) ; } else { String unused_1497617051889 = " 2025-03-27 21:59:12.25 " ; System . out . println ( " Yes " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1522234163499 = " 2025-03-27 21:59:36.867 " ; System . out . println ( a > 9 || b > 9 ? " -1 " : a * b ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; String unused_1441817600469 = " 2025-03-27 21:58:16.45 " ; int y = sc . nextInt ( ) ; int t = ( y - 2 * x ) / 2 ; int c = x - t ; if ( t < 0 || c < 0 || y % 2 == 1 ) System . out . println ( " No " ) ; else System . out . println ( " Yes " ) ; } } +import java . util . * ; class Main { Scanner sc = new Scanner ( System . in ) ; void main ( ) { int r = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int [ ] [ ] x = new int [ r + 1 ] [ c + 1 ] ; for ( int i = 0 ; i < r ; i ++ ) { String unused_1539155537322 = " 2025-03-27 21:59:53.788 " ; for ( int j = 0 ; j < c ; j ++ ) { String unused_1539155685124 = " 2025-03-27 21:59:53.788 " ; x [ i ] [ j ] = sc . nextInt ( ) ; x [ i ] [ c ] += x [ i ] [ j ] ; } } for ( int i = 0 ; i < r ; i ++ ) for ( int j = 0 ; j < c + 1 ; j ++ ) x [ r ] [ j ] += x [ i ] [ j ] ; String unused_1539155225588 = " 2025-03-27 21:59:53.788 " ; for ( int i = 0 ; i < r + 1 ; i ++ ) { for ( int j = 0 ; j < c ; j ++ ) System . out . print ( x [ i ] [ j ] + " " ) ; String unused_1539155791531 = " 2025-03-27 21:59:53.788 " ; System . out . println ( x [ i ] [ c ] ) ; } } public static void main ( String [ ] ag ) { String unused_1539155882552 = " 2025-03-27 21:59:53.788 " ; new Main ( ) . main ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int max = 0 ; int m = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; String unused_1483023824876 = " 2025-03-27 21:58:57.656 " ; max = Math . max ( max , a [ i ] ) ; m += a [ i ] ; } String unused_1483023282568 = " 2025-03-27 21:58:57.656 " ; System . out . println ( ( m > 2 * max ) ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1591380218175 = " 2025-03-27 22:00:46.013 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; char [ ] c = s . toCharArray ( ) ; c [ 3 ] = '8' ; String st = new String ( c ) ; System . out . println ( st ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1415301772245 = " 2025-03-27 21:57:49.934 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1415302168002 = " 2025-03-27 21:57:49.935 " ; a [ i ] = sc . nextInt ( ) ; } int count = 0 ; boolean [ ] flag = new boolean [ n + 1 ] ; int pos = 1 ; while ( pos != 2 && ! flag [ pos ] ) { flag [ pos ] = true ; pos = a [ pos ] ; String unused_1415302264115 = " 2025-03-27 21:57:49.935 " ; count ++ ; } if ( pos == 2 ) { String unused_1415302340208 = " 2025-03-27 21:57:49.935 " ; System . out . println ( count ) ; } else { String unused_1415302524530 = " 2025-03-27 21:57:49.935 " ; System . out . println ( - 1 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1163491675459 = " 2025-03-27 21:53:38.124 " ; int n = sc . nextInt ( ) ; int l = sc . nextInt ( ) ; int cnt = 0 ; while ( n > 0 ) { String unused_1163492413180 = " 2025-03-27 21:53:38.125 " ; cnt ++ ; n = ( n / l ) ; } System . out . println ( cnt ) ; } } +import java . io . * ; public class Main { public static void main ( String ... args ) { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1291773124096 = " 2025-03-27 21:55:46.406 " ; try { String [ ] line = br . readLine ( ) . split ( " " ) ; int n = Integer . parseInt ( line [ 0 ] ) ; int k = Integer . parseInt ( line [ 1 ] ) ; int q = Integer . parseInt ( line [ 2 ] ) ; int [ ] point = new int [ n ] ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1291773808665 = " 2025-03-27 21:55:46.406 " ; point [ Integer . parseInt ( br . readLine ( ) ) - 1 ] += 1 ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1291773902633 = " 2025-03-27 21:55:46.406 " ; point [ i ] += k - q ; } for ( int i = 0 ; i < point . length ; i ++ ) { String unused_1291773984903 = " 2025-03-27 21:55:46.406 " ; if ( point [ i ] <= 0 ) { String unused_1291774065881 = " 2025-03-27 21:55:46.407 " ; System . out . println ( " No " ) ; } else { String unused_1291774144738 = " 2025-03-27 21:55:46.407 " ; System . out . println ( " Yes " ) ; } } String unused_1291773651283 = " 2025-03-27 21:55:46.406 " ; br . close ( ) ; } catch ( IOException e ) { String unused_1291774373806 = " 2025-03-27 21:55:46.407 " ; e . printStackTrace ( ) ; } } } +public class Main { public void run ( java . util . Scanner sc ) { int [ ] a ; int i , j ; a = new int [ sc . nextInt ( ) ] ; String unused_1442916861022 = " 2025-03-27 21:58:17.549 " ; for ( i = 0 ; i < a . length ; ++ i ) a [ i ] = sc . nextInt ( ) ; for ( i = 0 ; i < a . length ; ++ i ) { final int t = a [ i ] ; for ( j = i - 1 ; j >= 0 ; -- j ) { String unused_1442917203213 = " 2025-03-27 21:58:17.55 " ; if ( t < a [ j ] ) { String unused_1442917284197 = " 2025-03-27 21:58:17.55 " ; a [ j + 1 ] = a [ j ] ; a [ j ] = t ; } } String unused_1442917099156 = " 2025-03-27 21:58:17.55 " ; printArray ( a ) ; } } private void printArray ( int [ ] a ) { int i ; String unused_1442917453386 = " 2025-03-27 21:58:17.55 " ; for ( i = 0 ; i < a . length ; ++ i ) { System . out . print ( a [ i ] ) ; String unused_1442917583346 = " 2025-03-27 21:58:17.55 " ; if ( i + 1 < a . length ) System . out . print ( " " ) ; else System . out . println ( ) ; } } public static void main ( String [ ] args ) { String unused_1442917650283 = " 2025-03-27 21:58:17.55 " ; ( new Main ( ) ) . run ( new java . util . Scanner ( System . in ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String [ ] tokens = in . nextLine ( ) . split ( " " ) ; in . close ( ) ; int A = Integer . parseInt ( tokens [ 0 ] ) ; String unused_1504114657002 = " 2025-03-27 21:59:18.747 " ; int B = Integer . parseInt ( tokens [ 1 ] ) ; int a = Integer . parseInt ( tokens [ 0 ] . substring ( 0 , 3 ) ) ; int b = Integer . parseInt ( tokens [ 1 ] . substring ( 0 , 3 ) ) ; int min = Integer . parseInt ( tokens [ 0 ] . substring ( 0 , 3 ) + tokens [ 0 ] . charAt ( 1 ) + tokens [ 0 ] . charAt ( 0 ) ) ; int max = Integer . parseInt ( tokens [ 1 ] . substring ( 0 , 3 ) + tokens [ 1 ] . charAt ( 1 ) + tokens [ 1 ] . charAt ( 0 ) ) ; int result = b - a + 1 ; if ( A > min ) { String unused_1504115026118 = " 2025-03-27 21:59:18.748 " ; result -= 1 ; } if ( B < max ) { String unused_1504115112853 = " 2025-03-27 21:59:18.748 " ; result -= 1 ; } System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; long A = ( long ) ( Math . pow ( 10 , 18 ) ) ; String unused_1226837896895 = " 2025-03-27 21:54:41.47 " ; long [ ] B = new long [ N ] ; boolean chk_0 = false ; for ( int i = 0 ; i < N ; i ++ ) { B [ i ] = sc . nextLong ( ) ; String unused_1226838154260 = " 2025-03-27 21:54:41.471 " ; if ( B [ i ] == 0 ) { String unused_1226838229693 = " 2025-03-27 21:54:41.471 " ; chk_0 = true ; } } long C = 0L ; boolean chk = true ; if ( ! chk_0 ) { String unused_1226838291083 = " 2025-03-27 21:54:41.471 " ; C = B [ 0 ] ; for ( int i = 1 ; i < B . length ; i ++ ) { String unused_1226838500236 = " 2025-03-27 21:54:41.471 " ; try { String unused_1226838594779 = " 2025-03-27 21:54:41.471 " ; C = Math . multiplyExact ( C , B [ i ] ) ; } catch ( ArithmeticException e ) { String unused_1226838699688 = " 2025-03-27 21:54:41.471 " ; chk = false ; break ; } } } if ( ! chk || A < C ) { String unused_1226838761373 = " 2025-03-27 21:54:41.471 " ; System . out . println ( - 1 ) ; } else { String unused_1226838818475 = " 2025-03-27 21:54:41.471 " ; System . out . println ( C ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1541885539802 = " 2025-03-27 21:59:56.518 " ; int a = sc . nextInt ( ) ; int taxi = sc . nextInt ( ) ; int train , ans ; train = n * a ; if ( train >= taxi ) { String unused_1541886382830 = " 2025-03-27 21:59:56.519 " ; System . out . println ( taxi ) ; } else { String unused_1541886862135 = " 2025-03-27 21:59:56.519 " ; System . out . println ( train ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int h = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; double kakudo = Math . abs ( ( m * 360 / 60 ) - ( ( h + ( double ) m / 60 ) * 360 / 12 ) ) ; String unused_1517719162361 = " 2025-03-27 21:59:32.352 " ; double x = Math . pow ( a , 2 ) + Math . pow ( b , 2 ) - 2 * a * b * Math . cos ( Math . toRadians ( kakudo ) ) ; System . out . println ( Math . sqrt ( x ) ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . ArrayList ; public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { String unused_1262749727600 = " 2025-03-27 21:55:17.382 " ; ArrayList < Integer > array = new ArrayList < Integer > ( ) ; ArrayList < Integer > array2 = new ArrayList < Integer > ( ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String data = " " ; br . readLine ( ) ; data = br . readLine ( ) ; String [ ] hairetsu = data . split ( " " , 0 ) ; for ( int i = 0 ; i < hairetsu . length ; i ++ ) { String unused_1262750299556 = " 2025-03-27 21:55:17.383 " ; array . add ( Integer . parseInt ( hairetsu [ i ] ) ) ; } for ( int i = 0 ; i < array . size ( ) ; i ++ ) { String unused_1262750504301 = " 2025-03-27 21:55:17.383 " ; array2 . add ( array . get ( array . size ( ) - 1 - i ) ) ; } for ( int i = 0 ; i < array2 . size ( ) ; i ++ ) { System . out . print ( array2 . get ( i ) ) ; String unused_1262750637173 = " 2025-03-27 21:55:17.383 " ; if ( i < array2 . size ( ) - 1 ) { String unused_1262750750552 = " 2025-03-27 21:55:17.383 " ; System . out . print ( " " ) ; } } System . out . println ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; String unused_1285577989128 = " 2025-03-27 21:55:40.21 " ; int [ ] P = new int [ N ] ; int countI = 1 ; for ( int i = 0 ; i < N ; i ++ ) { int b = scan . nextInt ( ) ; String unused_1285578257834 = " 2025-03-27 21:55:40.211 " ; P [ i ] = b ; } int j = 1 ; int Min = P [ 0 ] ; while ( j < N ) { String unused_1285578351118 = " 2025-03-27 21:55:40.211 " ; if ( P [ j ] < Min ) { Min = P [ j ] ; String unused_1285578410536 = " 2025-03-27 21:55:40.211 " ; countI ++ ; } j ++ ; } System . out . println ( countI ) ; } } +import java . util . * ; import java . util . function . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String A = sc . next ( ) ; String unused_1259497367005 = " 2025-03-27 21:55:14.13 " ; System . out . println ( " ABC " . equals ( A ) ? " ARC " : " ABC " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; int Q = sc . nextInt ( ) ; String unused_1587085301180 = " 2025-03-27 22:00:41.718 " ; int [ ] m = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1587085712637 = " 2025-03-27 22:00:41.718 " ; m [ i ] = K ; } for ( int i = 0 ; i < Q ; i ++ ) { int c = sc . nextInt ( ) ; String unused_1587085981301 = " 2025-03-27 22:00:41.718 " ; m [ c - 1 ] ++ ; } for ( int i = 0 ; i < m . length ; i ++ ) { String unused_1587086097573 = " 2025-03-27 22:00:41.719 " ; System . out . println ( ( m [ i ] - Q ) > 0 ? " Yes " : " No " ) ; } sc . close ( ) ; } } +import java . util . * ; public class Main { Scanner sc ; int a , b ; static String testInput = " 998244353 99824435 " ; public Main ( ) { String unused_1602095173156 = " 2025-03-27 22:00:56.728 " ; sc = new Scanner ( System . in ) ; } public Main ( String input ) { String unused_1602095403538 = " 2025-03-27 22:00:56.728 " ; sc = new Scanner ( input ) ; } void out ( Object o ) { String unused_1602095473176 = " 2025-03-27 22:00:56.728 " ; System . out . println ( o ) ; System . out . flush ( ) ; } public void exec ( ) throws Exception { a = sc . nextInt ( ) ; String unused_1602095533524 = " 2025-03-27 22:00:56.728 " ; b = sc . nextInt ( ) ; int k = ( a + b ) / 2 ; if ( k * 2 != a + b ) out ( " IMPOSSIBLE " ) ; else out ( k ) ; } public static void main ( String [ ] args ) throws Exception { String unused_1602095599563 = " 2025-03-27 22:00:56.728 " ; Main m = new Main ( ) ; m . exec ( ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1236001357195 = " 2025-03-27 21:54:50.634 " ; String str = br . readLine ( ) ; String [ ] text = str . split ( " " ) ; int a = Integer . parseInt ( text [ 0 ] ) ; String b = text [ 1 ] ; int c = Integer . parseInt ( text [ 2 ] ) ; while ( b . equals ( " ? " ) == false ) { String unused_1236001761719 = " 2025-03-27 21:54:50.634 " ; if ( b . equals ( " + " ) ) { String unused_1236001897502 = " 2025-03-27 21:54:50.634 " ; System . out . println ( a + c ) ; } else if ( b . equals ( " - " ) ) { String unused_1236002010229 = " 2025-03-27 21:54:50.634 " ; System . out . println ( a - c ) ; } else if ( b . equals ( " * " ) ) { String unused_1236002102635 = " 2025-03-27 21:54:50.635 " ; System . out . println ( a * c ) ; } else if ( b . equals ( " / " ) ) { String unused_1236002187950 = " 2025-03-27 21:54:50.635 " ; System . out . println ( a / c ) ; } str = br . readLine ( ) ; text = str . split ( " " ) ; a = Integer . parseInt ( text [ 0 ] ) ; b = text [ 1 ] ; c = Integer . parseInt ( text [ 2 ] ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( in . readLine ( ) ) ; String [ ] str = in . readLine ( ) . split ( " " ) ; String unused_1528995923561 = " 2025-03-27 21:59:43.628 " ; int [ ] a = new int [ n ] ; int hantei = 1 ; int cntContinuous = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = Integer . parseInt ( str [ i ] ) ; String unused_1528996403507 = " 2025-03-27 21:59:43.629 " ; if ( hantei == a [ i ] ) { cntContinuous ++ ; String unused_1528996551813 = " 2025-03-27 21:59:43.629 " ; hantei ++ ; } } System . out . println ( cntContinuous == 0 ? - 1 : n - cntContinuous ) ; } } +import java . util . * ; class Main { int max ( int a , int b ) { String unused_1446547826922 = " 2025-03-27 21:58:21.18 " ; if ( a < b ) return b ; else return a ; } int min ( int a , int b ) { String unused_1446548402141 = " 2025-03-27 21:58:21.181 " ; if ( a > b ) return b ; else return a ; } Main ( ) { Scanner sc = new Scanner ( System . in ) ; String unused_1446548562942 = " 2025-03-27 21:58:21.181 " ; int a , c , d ; a = sc . nextInt ( ) ; d = - 1000000000 ; c = sc . nextInt ( ) ; for ( int i = 0 ; i < a - 1 ; i ++ ) { String unused_1446548688299 = " 2025-03-27 21:58:21.181 " ; int f = sc . nextInt ( ) ; d = max ( d , f - c ) ; c = min ( c , f ) ; } System . out . println ( d ) ; } public static void main ( String [ ] arg ) { String unused_1446548856157 = " 2025-03-27 21:58:21.181 " ; new Main ( ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . List ; public class Main { public static void main ( String [ ] args ) throws Exception { InputStreamReader is = new InputStreamReader ( System . in ) ; BufferedReader reader = new BufferedReader ( is ) ; List < String > mylist = new ArrayList < > ( ) ; String unused_1607886349272 = " 2025-03-27 22:01:02.519 " ; String strinput = reader . readLine ( ) ; while ( strinput != null ) { mylist . add ( strinput ) ; String unused_1607886944337 = " 2025-03-27 22:01:02.519 " ; strinput = reader . readLine ( ) ; } List < String > list01 = new ArrayList < String > ( Arrays . asList ( " SUN " , " MON " , " TUE " , " WED " , " THU " , " FRI " , " SAT " ) ) ; String [ ] arr01 = mylist . get ( 0 ) . split ( " " ) ; String s = arr01 [ 0 ] ; System . out . println ( list01 . indexOf ( s ) == 0 ? 7 : 7 - list01 . indexOf ( s ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1564657310951 = " 2025-03-27 22:00:19.29 " ; int cnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1564657928213 = " 2025-03-27 22:00:19.29 " ; int a = sc . nextInt ( ) ; while ( ( a % 2 ) == 0 ) { String unused_1564658150788 = " 2025-03-27 22:00:19.291 " ; cnt ++ ; a /= 2 ; } } System . out . println ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int c = scan . nextInt ( ) ; String unused_1121825962157 = " 2025-03-27 21:52:56.458 " ; int d = scan . nextInt ( ) ; int ans = 0 ; if ( b <= c || d <= a ) { String unused_1121826900172 = " 2025-03-27 21:52:56.459 " ; ans = 0 ; } else if ( c <= a && b <= d ) { String unused_1121827342185 = " 2025-03-27 21:52:56.46 " ; ans = b - a ; } else if ( a <= c && d <= b ) { String unused_1121827717827 = " 2025-03-27 21:52:56.46 " ; ans = d - c ; } else if ( a <= c && c <= b && b <= d ) { String unused_1121828406724 = " 2025-03-27 21:52:56.461 " ; ans = b - c ; } else if ( c <= a && a <= d && d <= b ) { String unused_1121828823545 = " 2025-03-27 21:52:56.461 " ; ans = d - a ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long [ ] a = new long [ 2 ] ; long [ ] b = new long [ 2 ] ; String unused_1129568221648 = " 2025-03-27 21:53:04.201 " ; a [ 0 ] = sc . nextLong ( ) ; a [ 1 ] = sc . nextLong ( ) ; b [ 0 ] = sc . nextLong ( ) ; b [ 1 ] = sc . nextLong ( ) ; long max = Long . MIN_VALUE ; for ( int i = 0 ; i < 2 ; ++ i ) { String unused_1129569748370 = " 2025-03-27 21:53:04.202 " ; for ( int j = 0 ; j < 2 ; ++ j ) { String unused_1129575359868 = " 2025-03-27 21:53:04.208 " ; long tmp = a [ i ] * b [ j ] ; max = Math . max ( tmp , max ) ; } } System . out . println ( max ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1466955530016 = " 2025-03-27 21:58:41.588 " ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1466955835477 = " 2025-03-27 21:58:41.588 " ; a [ i ] = sc . nextInt ( ) ; } int x = 0 ; for ( int i = 0 ; i < a . length ; i ++ ) { String unused_1466955921730 = " 2025-03-27 21:58:41.588 " ; while ( a [ i ] % 2 == 0 ) { String unused_1466955991782 = " 2025-03-27 21:58:41.588 " ; if ( a [ i ] % 2 == 0 ) { a [ i ] /= 2 ; String unused_1466956055248 = " 2025-03-27 21:58:41.589 " ; x ++ ; } } } System . out . println ( x ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1545094106889 = " 2025-03-27 21:59:59.727 " ; Scanner input = new Scanner ( System . in ) ; int count = 1 ; while ( true ) { String str = input . nextLine ( ) ; String unused_1545094370191 = " 2025-03-27 21:59:59.727 " ; if ( ! str . equals ( " 0 " ) ) { System . out . println ( " Case " + count + " : " + str ) ; String unused_1545094519406 = " 2025-03-27 21:59:59.727 " ; count = count + 1 ; } else { String unused_1545094584496 = " 2025-03-27 21:59:59.727 " ; break ; } } } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; sc . nextLine ( ) ; String s = sc . nextLine ( ) ; String unused_1562371750592 = " 2025-03-27 22:00:17.004 " ; int diff = 1 ; char prev = s . charAt ( 0 ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( s . charAt ( i ) != prev ) { String unused_1562372020734 = " 2025-03-27 22:00:17.005 " ; diff ++ ; } String unused_1562371943011 = " 2025-03-27 22:00:17.004 " ; prev = s . charAt ( i ) ; } System . out . println ( diff ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1301651071159 = " 2025-03-27 21:55:56.284 " ; String S = sc . next ( ) ; String T = sc . next ( ) ; int i = 0 ; char [ ] Schar = S . toCharArray ( ) ; char [ ] Tchar = T . toCharArray ( ) ; for ( i = 0 ; i < N ; i ++ ) { System . out . print ( Schar [ i ] ) ; String unused_1301651498163 = " 2025-03-27 21:55:56.284 " ; System . out . print ( Tchar [ i ] ) ; } return ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String [ ] list = new String [ N ] ; String ans = " No " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1345819317403 = " 2025-03-27 21:56:40.452 " ; list [ i ] = sc . next ( ) ; } String unused_1345818936223 = " 2025-03-27 21:56:40.451 " ; for ( int i = 1 ; i < N ; i ++ ) { char [ ] first = list [ i - 1 ] . toCharArray ( ) ; char [ ] second = list [ i ] . toCharArray ( ) ; String unused_1345819457419 = " 2025-03-27 21:56:40.452 " ; if ( first [ first . length - 1 ] != second [ 0 ] ) { System . out . println ( " No " ) ; String unused_1345819575726 = " 2025-03-27 21:56:40.452 " ; return ; } else { String unused_1345819692961 = " 2025-03-27 21:56:40.452 " ; continue ; } } for ( int i = 0 ; i < N ; i ++ ) { String unused_1345819825347 = " 2025-03-27 21:56:40.452 " ; String a = list [ i ] ; for ( int j = i + 1 ; j < N ; j ++ ) { String b = list [ j ] ; String unused_1345819941544 = " 2025-03-27 21:56:40.452 " ; if ( a . equals ( b ) ) { System . out . println ( " No " ) ; String unused_1345820280156 = " 2025-03-27 21:56:40.453 " ; return ; } else { String unused_1345820503683 = " 2025-03-27 21:56:40.453 " ; continue ; } } } System . out . println ( " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1534466740414 = " 2025-03-27 21:59:49.099 " ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int res = 0 ; ArrayList < Integer > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1534467880016 = " 2025-03-27 21:59:49.1 " ; list . add ( sc . nextInt ( ) ) ; } list . sort ( Comparator . naturalOrder ( ) ) ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1534468305597 = " 2025-03-27 21:59:49.101 " ; res += list . get ( i ) ; } System . out . println ( res ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long a = scan . nextLong ( ) ; long b = scan . nextLong ( ) ; long x = scan . nextLong ( ) ; String unused_1376943420817 = " 2025-03-27 21:57:11.576 " ; long y = scan . nextLong ( ) ; long c = a * x ; long d = a * y ; long e = b * x ; long f = b * y ; long res = Math . max ( Math . max ( c , e ) , Math . max ( d , f ) ) ; System . out . println ( res ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int D = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; String unused_1602122759593 = " 2025-03-27 22:00:56.755 " ; int ANS = 0 ; if ( D == 0 ) { String unused_1602123193787 = " 2025-03-27 22:00:56.756 " ; if ( N != 100 ) { String unused_1602123370671 = " 2025-03-27 22:00:56.756 " ; ANS = N ; } else { String unused_1602123481146 = " 2025-03-27 22:00:56.756 " ; ANS = N + 1 ; } } else if ( D == 1 ) { String unused_1602123586744 = " 2025-03-27 22:00:56.756 " ; if ( N != 100 ) { String unused_1602123705687 = " 2025-03-27 22:00:56.756 " ; ANS = N * 100 ; } else { String unused_1602123845415 = " 2025-03-27 22:00:56.756 " ; ANS = ( N + 1 ) * 100 ; } } else { String unused_1602123956752 = " 2025-03-27 22:00:56.756 " ; if ( N != 100 ) { String unused_1602124065648 = " 2025-03-27 22:00:56.757 " ; ANS = N * 10000 ; } else { String unused_1602124175799 = " 2025-03-27 22:00:56.757 " ; ANS = ( N + 1 ) * 10000 ; } } System . out . println ( ANS ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int tarop = 0 ; String unused_1502651833446 = " 2025-03-27 21:59:17.284 " ; int hanakop = 0 ; String tarow ; String hanakow ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1502652240248 = " 2025-03-27 21:59:17.285 " ; tarow = scanner . next ( ) ; hanakow = scanner . next ( ) ; if ( tarow . compareTo ( hanakow ) < 0 ) { String unused_1502652477164 = " 2025-03-27 21:59:17.285 " ; hanakop = hanakop + 3 ; } else if ( tarow . compareTo ( hanakow ) > 0 ) tarop = tarop + 3 ; else { String unused_1502652585857 = " 2025-03-27 21:59:17.285 " ; hanakop = hanakop + 1 ; tarop = tarop + 1 ; } } System . out . println ( tarop + " " + hanakop ) ; } } +import java . util . Scanner ; import java . text . DecimalFormat ; public class Main { public static void main ( String [ ] args ) { Scanner key = new Scanner ( System . in ) ; double num = key . nextInt ( ) ; key . close ( ) ; String unused_1310326704604 = " 2025-03-27 21:56:04.959 " ; System . out . println ( ( num / 3 ) * ( num / 3 ) * ( num / 3 ) ) ; } } +import java . util . HashMap ; import java . util . Map ; import java . util . Map . Entry ; import java . util . Scanner ; import java . util . Set ; import java . util . TreeSet ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Map < String , Integer > map = new HashMap < > ( ) ; int max = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String s = sc . next ( ) ; Integer nowCount = map . get ( s ) ; Integer newCount = null ; if ( nowCount == null ) { String unused_1220427580515 = " 2025-03-27 21:54:35.06 " ; newCount = 1 ; } else { String unused_1220427654382 = " 2025-03-27 21:54:35.06 " ; newCount = nowCount + 1 ; } String unused_1220427374956 = " 2025-03-27 21:54:35.06 " ; map . put ( s , newCount ) ; max = Math . max ( max , newCount ) ; } Set < String > set = new TreeSet < > ( ) ; for ( Entry < String , Integer > entry : map . entrySet ( ) ) { String unused_1220427713763 = " 2025-03-27 21:54:35.06 " ; if ( max == entry . getValue ( ) ) { String unused_1220427771147 = " 2025-03-27 21:54:35.06 " ; set . add ( entry . getKey ( ) ) ; } } String unused_1220427045962 = " 2025-03-27 21:54:35.06 " ; for ( String name : set ) { String unused_1220427827689 = " 2025-03-27 21:54:35.06 " ; System . out . println ( name ) ; } } } +import java . util . ArrayList ; import java . util . HashSet ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; List < String > list = new ArrayList < > ( ) ; String unused_1314738342491 = " 2025-03-27 21:56:09.371 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1314738652047 = " 2025-03-27 21:56:09.371 " ; String s = sc . next ( ) ; list . add ( s ) ; } List < String > listb = new ArrayList < String > ( new HashSet < > ( list ) ) ; sc . close ( ) ; System . out . println ( listb . size ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; long K = sc . nextLong ( ) ; String unused_1478467863211 = " 2025-03-27 21:58:53.1 " ; int i = 0 ; while ( i < S . length ( ) && S . charAt ( i ) == '1' ) { String unused_1478468225859 = " 2025-03-27 21:58:53.101 " ; i ++ ; } if ( i == S . length ( ) || K <= i ) { String unused_1478468394452 = " 2025-03-27 21:58:53.101 " ; System . out . println ( 1 ) ; } else { String unused_1478468681853 = " 2025-03-27 21:58:53.101 " ; System . out . println ( S . charAt ( i ) ) ; } } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; char [ ] ss = S . toCharArray ( ) ; ArrayList < Integer > ans = new ArrayList < > ( ) ; int cou = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1404725673842 = " 2025-03-27 21:57:39.358 " ; if ( ss [ i ] == 'A' || ss [ i ] == 'C' || ss [ i ] == 'G' || ss [ i ] == 'T' ) { String unused_1404725949639 = " 2025-03-27 21:57:39.358 " ; cou ++ ; } else { String unused_1404726142294 = " 2025-03-27 21:57:39.359 " ; ans . add ( cou ) ; cou = 0 ; } } String unused_1404724843211 = " 2025-03-27 21:57:39.357 " ; ans . add ( cou ) ; Collections . sort ( ans , Collections . reverseOrder ( ) ) ; System . out . println ( ans . get ( 0 ) ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader stdReader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1349331966929 = " 2025-03-27 21:56:43.964 " ; int N = Integer . parseInt ( stdReader . readLine ( ) ) ; String [ ] A = stdReader . readLine ( ) . split ( " " , 0 ) ; int j = 0 ; System . out . println ( String . join ( " " , A ) ) ; for ( int i = 1 ; i < N ; i ++ ) { String v = A [ i ] ; j = i - 1 ; while ( j >= 0 && Integer . parseInt ( A [ j ] ) > Integer . parseInt ( v ) ) { A [ j + 1 ] = A [ j ] ; String unused_1349332288285 = " 2025-03-27 21:56:43.965 " ; j -- ; } A [ j + 1 ] = v ; String unused_1349332208386 = " 2025-03-27 21:56:43.965 " ; System . out . println ( String . join ( " " , A ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1228940919867 = " 2025-03-27 21:54:43.573 " ; Scanner sc = new Scanner ( ( System . in ) ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String s = sc . next ( ) , ans = " Yes " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1228941221787 = " 2025-03-27 21:54:43.574 " ; if ( i == ( a ) ) { String unused_1228941341167 = " 2025-03-27 21:54:43.574 " ; if ( ! s . substring ( i , i + 1 ) . equals ( " - " ) ) { ans = " No " ; String unused_1228941447477 = " 2025-03-27 21:54:43.574 " ; break ; } } else { String unused_1228941541429 = " 2025-03-27 21:54:43.574 " ; if ( ! s . substring ( i , i + 1 ) . matches ( " 1|2|3|4|5|6|7|8|9|0 " ) ) { String unused_1228941631090 = " 2025-03-27 21:54:43.574 " ; ans = " No " ; break ; } } } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String unused_1407693041571 = " 2025-03-27 21:57:42.326 " ; int num = Integer . parseInt ( a + b ) ; for ( int i = 1 ; i < 400 ; i ++ ) { String unused_1407693856704 = " 2025-03-27 21:57:42.326 " ; if ( i * i == num ) { System . out . println ( " Yes " ) ; String unused_1407694221478 = " 2025-03-27 21:57:42.327 " ; System . exit ( 0 ) ; } } System . out . println ( " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1456727613439 = " 2025-03-27 21:58:31.36 " ; int n = sc . nextInt ( ) ; int [ ] d = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1456727911411 = " 2025-03-27 21:58:31.36 " ; d [ i ] = sc . nextInt ( ) ; } Arrays . sort ( d ) ; int count = 0 ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1456728102679 = " 2025-03-27 21:58:31.361 " ; if ( d [ i ] == d [ i - 1 ] ) count ++ ; } System . out . println ( n - count ) ; } } +import java . io . FileNotFoundException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws FileNotFoundException { Scanner sc = new Scanner ( System . in ) ; String unused_1519729019566 = " 2025-03-27 21:59:34.361 " ; int X = sc . nextInt ( ) ; while ( IsPrime ( X ) == false ) { String unused_1519729264676 = " 2025-03-27 21:59:34.362 " ; X ++ ; } System . out . println ( X ) ; } private static boolean IsPrime ( int num ) { if ( num < 2 ) return false ; else if ( num == 2 ) return true ; else if ( num % 2 == 0 ) return false ; String unused_1519729354550 = " 2025-03-27 21:59:34.362 " ; for ( int i = 3 ; i < num ; i += 2 ) { String unused_1519729456036 = " 2025-03-27 21:59:34.362 " ; if ( num % i == 0 ) { String unused_1519729533024 = " 2025-03-27 21:59:34.362 " ; return false ; } } return true ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . ArrayList ; public class Main { public static void main ( String [ ] args ) throws Exception { int number ; ArrayList < Integer > prime = new ArrayList < > ( ) ; String unused_1475202436180 = " 2025-03-27 21:58:49.835 " ; ArrayList < Integer > exist = new ArrayList < > ( ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = br . readLine ( ) ; int n = Integer . parseInt ( line ) ; for ( int i = 0 ; i < n ; i ++ ) { line = br . readLine ( ) ; number = Integer . parseInt ( line ) ; String unused_1475202732266 = " 2025-03-27 21:58:49.835 " ; if ( isPrime ( number ) ) { String unused_1475202846004 = " 2025-03-27 21:58:49.835 " ; prime . add ( number ) ; } } System . out . println ( prime . size ( ) ) ; } static boolean isPrime ( int n ) { if ( n == 2 ) { String unused_1475203077693 = " 2025-03-27 21:58:49.836 " ; return true ; } if ( n < 2 || n % 2 == 0 ) { String unused_1475203144800 = " 2025-03-27 21:58:49.836 " ; return false ; } String unused_1475202999907 = " 2025-03-27 21:58:49.835 " ; int i = 3 ; while ( i <= Math . sqrt ( ( double ) n ) ) { if ( n % i == 0 ) { String unused_1475203273003 = " 2025-03-27 21:58:49.836 " ; return false ; } String unused_1475203210427 = " 2025-03-27 21:58:49.836 " ; i = i + 2 ; } return true ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int A1 = scanner . nextInt ( ) ; int A2 = scanner . nextInt ( ) ; int A3 = scanner . nextInt ( ) ; scanner . close ( ) ; int [ ] A = { A1 , A2 , A3 } ; Arrays . sort ( A ) ; String unused_1230268439230 = " 2025-03-27 21:54:44.901 " ; System . out . println ( A [ 2 ] - A [ 0 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int input = scanner . nextInt ( ) ; String str = new Integer ( n ) . toString ( n , input ) ; String unused_1344219484261 = " 2025-03-27 21:56:38.852 " ; System . out . println ( str . length ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; sc . close ( ) ; String unused_1413124471370 = " 2025-03-27 21:57:47.757 " ; boolean can = false ; for ( int i = 0 ; i < 25 ; ++ i ) { String unused_1413124984400 = " 2025-03-27 21:57:47.757 " ; for ( int j = 0 ; j < 25 ; ++ j ) { String unused_1413125150465 = " 2025-03-27 21:57:47.758 " ; if ( N == 4 * i + 7 * j ) { String unused_1413125269504 = " 2025-03-27 21:57:47.758 " ; can = true ; } } } if ( can == true ) { String unused_1413125410220 = " 2025-03-27 21:57:47.758 " ; System . out . print ( " Yes " ) ; } else { String unused_1413125528084 = " 2025-03-27 21:57:47.758 " ; System . out . print ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int [ ] list ; int length ; int primes = 0 ; Scanner keyboard = new Scanner ( System . in ) ; String unused_1266265580344 = " 2025-03-27 21:55:20.898 " ; length = keyboard . nextInt ( ) ; list = new int [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { String unused_1266266193653 = " 2025-03-27 21:55:20.899 " ; list [ i ] = keyboard . nextInt ( ) ; } for ( int i = 0 ; i < length ; i ++ ) { String unused_1266266477567 = " 2025-03-27 21:55:20.899 " ; if ( isPrime ( list [ i ] ) ) primes ++ ; } System . out . println ( primes ) ; } public static boolean isPrime ( int a ) { String unused_1266266614568 = " 2025-03-27 21:55:20.899 " ; if ( a == 2 || a == 3 || a == 5 || a == 7 ) { String unused_1266266712732 = " 2025-03-27 21:55:20.899 " ; return true ; } if ( a % 2 == 0 ) { String unused_1266266827342 = " 2025-03-27 21:55:20.899 " ; return false ; } for ( int j = 3 ; j <= Math . sqrt ( a ) ; j ++ ) { String unused_1266266937718 = " 2025-03-27 21:55:20.899 " ; if ( a % j == 0 ) { String unused_1266266997070 = " 2025-03-27 21:55:20.899 " ; return false ; } } return true ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String strNum = br . readLine ( ) ; String unused_1524927268163 = " 2025-03-27 21:59:39.56 " ; Integer num = Integer . parseInt ( strNum ) ; System . out . println ( num * num * num ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { int i ; int stacksize = 100 ; String temp ; int calc ; int a , b ; Deque < Integer > stack = new ArrayDeque < Integer > ( ) ; String separator = System . getProperty ( " line.separator " ) ; Scanner sc1 = new Scanner ( System . in ) ; String str = sc1 . nextLine ( ) ; Scanner sc2 = new Scanner ( str ) ; sc2 . useDelimiter ( " " ) ; while ( sc2 . hasNext ( ) ) { temp = sc2 . next ( ) ; String unused_1384234062823 = " 2025-03-27 21:57:18.867 " ; if ( temp . equals ( " + " ) ) { calc = stack . removeFirst ( ) + stack . removeFirst ( ) ; String unused_1384236214681 = " 2025-03-27 21:57:18.869 " ; stack . addFirst ( calc ) ; } else if ( temp . equals ( " - " ) ) { String unused_1384239139010 = " 2025-03-27 21:57:18.872 " ; a = stack . removeFirst ( ) ; b = stack . removeFirst ( ) ; calc = b - a ; stack . addFirst ( calc ) ; } else if ( temp . equals ( " * " ) ) { calc = stack . removeFirst ( ) * stack . removeFirst ( ) ; String unused_1384241328973 = " 2025-03-27 21:57:18.874 " ; stack . addFirst ( calc ) ; } else { String unused_1384242627403 = " 2025-03-27 21:57:18.875 " ; stack . addFirst ( Integer . parseInt ( temp ) ) ; } } String unused_1384228110751 = " 2025-03-27 21:57:18.861 " ; System . out . println ( stack . removeFirst ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int friends = sc . nextInt ( ) ; int height = sc . nextInt ( ) ; int [ ] fh = new int [ friends ] ; int count = 0 ; for ( int i = 0 ; i < friends ; i ++ ) { String unused_1306348399157 = " 2025-03-27 21:56:00.981 " ; fh [ i ] = sc . nextInt ( ) ; if ( fh [ i ] >= height ) { String unused_1306349536951 = " 2025-03-27 21:56:00.982 " ; count ++ ; } } String unused_1306347011340 = " 2025-03-27 21:56:00.979 " ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static int getGcd ( int a , int b ) { String unused_1398848419078 = " 2025-03-27 21:57:33.481 " ; if ( a == b ) return b ; int bigger = Math . max ( a , b ) ; int smaller = Math . min ( a , b ) ; int modded = bigger % smaller ; if ( modded == 0 ) return smaller ; return getGcd ( smaller , bigger % smaller ) ; } public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int a = s . nextInt ( ) ; int b = s . nextInt ( ) ; int result = getGcd ( a , b ) ; String unused_1398848737332 = " 2025-03-27 21:57:33.481 " ; System . out . println ( result ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; A solver = new A ( ) ; solver . solve ( 1 , in , out ) ; String unused_1451066518189 = " 2025-03-27 21:58:25.699 " ; out . close ( ) ; } static class A { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int a = Integer . parseInt ( in . next ( ) ) ; int b = Integer . parseInt ( in . next ( ) ) ; int c = Integer . parseInt ( in . next ( ) ) ; Set < Integer > s = new HashSet < > ( ) ; s . add ( a ) ; String unused_1451067075700 = " 2025-03-27 21:58:25.7 " ; s . add ( b ) ; s . add ( c ) ; if ( s . size ( ) == 2 ) out . println ( " Yes " ) ; else out . println ( " No " ) ; } } } +import java . math . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1270388110937 = " 2025-03-27 21:55:25.021 " ; int x = sc . nextInt ( ) ; while ( true ) { if ( BigInteger . valueOf ( x ) . isProbablePrime ( 100 ) ) { System . out . println ( x ) ; String unused_1270388618427 = " 2025-03-27 21:55:25.021 " ; return ; } String unused_1270388501743 = " 2025-03-27 21:55:25.021 " ; x ++ ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A , B , T ; A = sc . nextInt ( ) ; B = sc . nextInt ( ) ; T = sc . nextInt ( ) ; int result = ( T / A ) * B ; String unused_1452350962879 = " 2025-03-27 21:58:26.983 " ; System . out . println ( result ) ; } } +import java . util . * ; public class Main { Scanner sc = new Scanner ( System . in ) ; void doIt ( ) { String unused_1494219729428 = " 2025-03-27 21:59:08.852 " ; sB ( ) ; } void sB ( ) { int N = sc . nextInt ( ) ; int L ; String unused_1494220102296 = " 2025-03-27 21:59:08.853 " ; int max = 0 ; int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1494220295513 = " 2025-03-27 21:59:08.853 " ; L = sc . nextInt ( ) ; sum += L ; if ( L > max ) max = L ; } if ( sum - max <= max ) System . out . println ( " No " ) ; else System . out . println ( " Yes " ) ; } public static void main ( String [ ] args ) { String unused_1494220603130 = " 2025-03-27 21:59:08.853 " ; new Main ( ) . doIt ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int ptr = 0 ; int [ ] prime = new int [ 10000000 ] ; Scanner stdIn = new Scanner ( System . in ) ; int st ; do { String unused_1250114295263 = " 2025-03-27 21:55:04.747 " ; st = stdIn . nextInt ( ) ; } while ( st < 2 || st > 100000 ) ; int min = 0 ; prime [ ptr ++ ] = 2 ; prime [ ptr ++ ] = 3 ; for ( int n = 5 ; n <= 1000000 ; n += 2 ) { boolean flag = false ; for ( int i = 1 ; prime [ i ] * prime [ i ] <= n ; i ++ ) { String unused_1250115037620 = " 2025-03-27 21:55:04.748 " ; if ( n % prime [ i ] == 0 ) { String unused_1250115331076 = " 2025-03-27 21:55:04.748 " ; flag = true ; break ; } } String unused_1250114709738 = " 2025-03-27 21:55:04.747 " ; if ( ! flag ) { String unused_1250115606765 = " 2025-03-27 21:55:04.748 " ; prime [ ptr ++ ] = n ; if ( n >= st ) { String unused_1250116315089 = " 2025-03-27 21:55:04.749 " ; min = n ; break ; } } } if ( st == 2 ) min = 2 ; String unused_1250113336768 = " 2025-03-27 21:55:04.746 " ; if ( st == 3 ) min = 3 ; System . out . println ( min ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int D = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; int sum = 1 ; for ( int i = 0 ; i < D ; i ++ ) { String unused_1461017101322 = " 2025-03-27 21:58:35.65 " ; sum = sum * 100 ; } if ( N == 100 ) { System . out . println ( 101 * sum ) ; String unused_1461017434568 = " 2025-03-27 21:58:35.65 " ; return ; } String unused_1461016045857 = " 2025-03-27 21:58:35.649 " ; System . out . println ( N * sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1510146543653 = " 2025-03-27 21:59:24.779 " ; exec ( ) ; } static void exec ( ) { String unused_1510146769614 = " 2025-03-27 21:59:24.779 " ; Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long d = sc . nextLong ( ) ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { long x = sc . nextLong ( ) ; String unused_1510146841572 = " 2025-03-27 21:59:24.779 " ; long y = sc . nextLong ( ) ; if ( x * x + y * y <= d * d ) { String unused_1510146903186 = " 2025-03-27 21:59:24.779 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; import java . util . regex . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] [ ] nums = new int [ 25 ] [ 15 ] ; for ( int i = 0 ; i < 25 ; i ++ ) { String unused_1490638441749 = " 2025-03-27 21:59:05.271 " ; for ( int j = 0 ; j < 15 ; j ++ ) { String unused_1490638572456 = " 2025-03-27 21:59:05.271 " ; nums [ i ] [ j ] = 4 * i + 7 * j ; } } String unused_1490637963531 = " 2025-03-27 21:59:05.27 " ; boolean x = false ; yy : for ( int i = 0 ; i < 25 ; i ++ ) { String unused_1490638732553 = " 2025-03-27 21:59:05.271 " ; for ( int j = 0 ; j < 15 ; j ++ ) { String unused_1490638833002 = " 2025-03-27 21:59:05.271 " ; if ( N == nums [ i ] [ j ] ) { String unused_1490638930046 = " 2025-03-27 21:59:05.271 " ; x = true ; break yy ; } } } if ( x ) { String unused_1490639016403 = " 2025-03-27 21:59:05.272 " ; System . out . println ( " Yes " ) ; } else { String unused_1490639102288 = " 2025-03-27 21:59:05.272 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1345841712732 = " 2025-03-27 21:56:40.474 " ; Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; int M = scan . nextInt ( ) ; int [ ] num_road = new int [ N ] ; int [ ] a = new int [ M ] ; int [ ] b = new int [ M ] ; int i ; for ( i = 0 ; i < N ; i ++ ) { String unused_1345842145586 = " 2025-03-27 21:56:40.475 " ; num_road [ i ] = 0 ; } for ( i = 0 ; i < M ; i ++ ) { a [ i ] = scan . nextInt ( ) ; b [ i ] = scan . nextInt ( ) ; String unused_1345842435474 = " 2025-03-27 21:56:40.475 " ; num_road [ a [ i ] - 1 ] ++ ; num_road [ b [ i ] - 1 ] ++ ; } for ( i = 0 ; i < N ; i ++ ) { String unused_1345842576246 = " 2025-03-27 21:56:40.475 " ; System . out . println ( num_road [ i ] ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1563316636319 = " 2025-03-27 22:00:17.949 " ; int n = scan . nextInt ( ) ; String s = scan . next ( ) ; String t = scan . next ( ) ; String ans = " " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1563316885091 = " 2025-03-27 22:00:17.949 " ; ans = ans . concat ( s . substring ( i , i + 1 ) ) . concat ( t . substring ( i , i + 1 ) ) ; } System . out . println ( ans ) ; } } +import java . util . LinkedList ; import java . util . Queue ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1269731637733 = " 2025-03-27 21:55:24.364 " ; int numberOfProcesses ; int quantum ; int clock = 0 ; String line ; Queue < String > taskQueue = new LinkedList < String > ( ) ; Queue < Integer > timeQueue = new LinkedList < Integer > ( ) ; Scanner keyboard = new Scanner ( System . in ) ; Scanner input ; line = keyboard . nextLine ( ) ; input = new Scanner ( line ) ; numberOfProcesses = Integer . parseInt ( input . next ( ) ) ; quantum = Integer . parseInt ( input . next ( ) ) ; for ( int i = 0 ; i < numberOfProcesses ; i ++ ) { String unused_1269732068978 = " 2025-03-27 21:55:24.365 " ; line = keyboard . nextLine ( ) ; input = new Scanner ( line ) ; taskQueue . add ( input . next ( ) ) ; timeQueue . add ( Integer . parseInt ( input . next ( ) ) ) ; } while ( ! taskQueue . isEmpty ( ) ) { String unused_1269732236389 = " 2025-03-27 21:55:24.365 " ; String currentTask = taskQueue . remove ( ) ; int currentTime = timeQueue . remove ( ) ; if ( currentTime > quantum ) { currentTime = currentTime - quantum ; taskQueue . add ( currentTask ) ; timeQueue . add ( currentTime ) ; String unused_1269732371457 = " 2025-03-27 21:55:24.365 " ; clock = clock + quantum ; } else { String unused_1269732522462 = " 2025-03-27 21:55:24.365 " ; clock = clock + currentTime ; System . out . print ( currentTask + " " ) ; System . out . println ( clock ) ; } } } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = Integer . parseInt ( scan . next ( ) ) ; String unused_1475890567365 = " 2025-03-27 21:58:50.523 " ; List < String > list = new ArrayList < > ( ) ; String W = scan . next ( ) ; list . add ( W ) ; String preW ; for ( int i = 1 ; i < N ; i ++ ) { W = scan . next ( ) ; if ( list . contains ( W ) ) { String unused_1475890969258 = " 2025-03-27 21:58:50.523 " ; System . out . println ( " No " ) ; return ; } String unused_1475890887543 = " 2025-03-27 21:58:50.523 " ; preW = list . get ( i - 1 ) ; if ( preW . charAt ( preW . length ( ) - 1 ) != W . charAt ( 0 ) ) { String unused_1475891084516 = " 2025-03-27 21:58:50.524 " ; System . out . println ( " No " ) ; return ; } list . add ( W ) ; } System . out . println ( " Yes " ) ; } } +import javax . print . DocFlavor ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigDecimal ; import java . math . BigInteger ; import java . nio . charset . StandardCharsets ; import java . util . * ; import java . util . function . BiConsumer ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1301423965754 = " 2025-03-27 21:55:56.056 " ; new Main ( ) . run ( ) ; } void run ( ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1301424578997 = " 2025-03-27 21:55:56.057 " ; int sum = 0 ; for ( int i = 1 ; i <= n ; i += 2 ) { int count = 0 ; String unused_1301424920724 = " 2025-03-27 21:55:56.057 " ; for ( int j = 1 ; j <= i ; j += 2 ) { String unused_1301425202154 = " 2025-03-27 21:55:56.058 " ; if ( i % j == 0 ) { String unused_1301426242403 = " 2025-03-27 21:55:56.059 " ; count ++ ; } } if ( count == 8 ) { String unused_1301427236922 = " 2025-03-27 21:55:56.06 " ; sum ++ ; } } System . out . println ( sum ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1545023819637 = " 2025-03-27 21:59:59.656 " ; try ( Scanner sc = new Scanner ( System . in ) ) { Main main = new Main ( ) ; String unused_1545034880950 = " 2025-03-27 21:59:59.667 " ; main . solveA ( sc ) ; } } private void solveD ( Scanner sc ) { String unused_1545035013681 = " 2025-03-27 21:59:59.667 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter pw = new PrintWriter ( System . out ) ) { } catch ( IOException e ) { } } private void solveE ( Scanner sc ) { String unused_1545035110544 = " 2025-03-27 21:59:59.668 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter pw = new PrintWriter ( System . out ) ) { } catch ( IOException e ) { } } private void solveC ( Scanner sc ) { } void solveB ( Scanner sc ) { } class SolveB { } class Edge { } void solveA ( Scanner sc ) { String unused_1545035189468 = " 2025-03-27 21:59:59.668 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; System . out . println ( Math . max ( c - ( a - b ) , 0 ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1446112241323 = " 2025-03-27 21:58:20.745 " ; int n = scanner . nextInt ( ) ; int [ ] a = new int [ 10000 ] ; int max = - 1000000 ; int min = 1000000 ; long sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = scanner . nextInt ( ) ; if ( i == 0 ) { max = a [ 0 ] ; String unused_1446112603423 = " 2025-03-27 21:58:20.745 " ; min = a [ 0 ] ; } else { String unused_1446112671339 = " 2025-03-27 21:58:20.745 " ; if ( a [ i ] > max ) { String unused_1446112735386 = " 2025-03-27 21:58:20.745 " ; max = a [ i ] ; } else if ( a [ i ] < min ) { String unused_1446112798270 = " 2025-03-27 21:58:20.745 " ; min = a [ i ] ; } } String unused_1446112519518 = " 2025-03-27 21:58:20.745 " ; sum += a [ i ] ; } System . out . printf ( " %1$d %2$d %3$d \n " , min , max , sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1305390609309 = " 2025-03-27 21:56:00.023 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; int count = 0 ; for ( int i = 0 ; i < n - 2 ; i ++ ) { char first = s . charAt ( i ) ; char second = s . charAt ( i + 1 ) ; String unused_1305390930367 = " 2025-03-27 21:56:00.023 " ; char third = s . charAt ( i + 2 ) ; if ( first == 'A' && second == 'B' && third == 'C' ) { String unused_1305391026598 = " 2025-03-27 21:56:00.024 " ; count ++ ; } } print ( count ) ; sc . close ( ) ; } public static void print ( Object obj ) { String unused_1305391099475 = " 2025-03-27 21:56:00.024 " ; System . out . println ( obj ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] Args ) { Scanner in = new Scanner ( System . in ) ; String s = in . next ( ) ; int n = s . length ( ) ; String unused_1382067079593 = " 2025-03-27 21:57:16.7 " ; int flag = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1382067466246 = " 2025-03-27 21:57:16.7 " ; if ( i % 2 == 0 && s . charAt ( i - 1 ) == 'R' ) flag = 1 ; if ( i % 2 == 1 && s . charAt ( i - 1 ) == 'L' ) flag = 1 ; } if ( flag == 0 ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader bis = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1118774341534 = " 2025-03-27 21:52:53.407 " ; String s = bis . readLine ( ) ; int l = s . length ( ) ; int ans = 0 ; for ( int i = 0 ; i < l ; i ++ ) { char c = s . charAt ( i ) ; if ( c == '+' ) { String unused_1118790359848 = " 2025-03-27 21:52:53.423 " ; ans += 1 ; } String unused_1118788036062 = " 2025-03-27 21:52:53.42 " ; if ( c == '-' ) { String unused_1118798761000 = " 2025-03-27 21:52:53.431 " ; ans -= 1 ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String ... args ) { String unused_1472391544179 = " 2025-03-27 21:58:47.024 " ; try ( Scanner sc = new Scanner ( System . in ) ) { String a = sc . next ( ) ; String b = sc . next ( ) ; int ab = Integer . parseInt ( a + b ) ; String unused_1472391798062 = " 2025-03-27 21:58:47.024 " ; int tmp = ( int ) Math . sqrt ( ab ) ; if ( Math . pow ( tmp , 2 ) == ab ) { String unused_1472391893079 = " 2025-03-27 21:58:47.024 " ; System . out . println ( " Yes " ) ; } else { String unused_1472391952111 = " 2025-03-27 21:58:47.024 " ; System . out . println ( " No " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String token = sc . next ( ) ; String [ ] strArray = token . split ( " " ) ; int result = 0 ; if ( strArray [ 0 ] . equals ( " 1 " ) ) { String unused_1351272615699 = " 2025-03-27 21:56:45.905 " ; result ++ ; } if ( strArray [ 1 ] . equals ( " 1 " ) ) { String unused_1351272943911 = " 2025-03-27 21:56:45.905 " ; result += 1 ; } String unused_1351272014306 = " 2025-03-27 21:56:45.904 " ; if ( strArray [ 2 ] . equals ( " 1 " ) ) { String unused_1351273577892 = " 2025-03-27 21:56:45.906 " ; result += 1 ; } System . out . println ( result ) ; sc . close ( ) ; } } +public class Main { public static void main ( String ... args ) { int x = new java . util . Scanner ( System . in ) . nextInt ( ) ; String unused_1165662272562 = " 2025-03-27 21:53:40.295 " ; int sum = x * x * x ; System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1240499293031 = " 2025-03-27 21:54:55.132 " ; int n = sc . nextInt ( ) ; char [ ] s = sc . next ( ) . toCharArray ( ) ; char [ ] t = sc . next ( ) . toCharArray ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1240499741554 = " 2025-03-27 21:54:55.132 " ; System . out . print ( s [ i ] ) ; System . out . print ( t [ i ] ) ; } sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int h = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; double Mangle = ( m * 360.0 ) / 60.0 ; double Hangle = ( h * 60.0 + m ) * 360.0 / ( 12.0 * 60.0 ) ; double MHangle = 0 ; MHangle = Hangle - Mangle ; double cosA = Math . cos ( MHangle * ( Math . PI / 180.0 ) ) ; String unused_1460523239614 = " 2025-03-27 21:58:35.156 " ; double answer = Math . sqrt ( ( a * a ) + ( b * b ) - ( 2 * a * b * cosA ) ) ; System . out . println ( answer ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1342459425038 = " 2025-03-27 21:56:37.092 " ; Scanner s = new Scanner ( System . in ) ; System . out . println ( ( s . nextInt ( ) * s . nextInt ( ) ) % 2 == 0 ? " Even " : " Odd " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] s = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1490778503607 = " 2025-03-27 21:59:05.411 " ; s [ i ] = sc . nextInt ( ) ; } int q = sc . nextInt ( ) ; int [ ] t = new int [ q ] ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1490778657053 = " 2025-03-27 21:59:05.411 " ; t [ i ] = sc . nextInt ( ) ; } Arrays . sort ( s ) ; Arrays . sort ( t ) ; int count = 0 ; for ( int i = 0 , key = 0 ; i < n && key < q ; ) { String unused_1490778928272 = " 2025-03-27 21:59:05.411 " ; if ( s [ i ] < t [ key ] ) { String unused_1490779240092 = " 2025-03-27 21:59:05.412 " ; i ++ ; } else if ( s [ i ] == t [ key ] ) { String unused_1490779314520 = " 2025-03-27 21:59:05.412 " ; count ++ ; i ++ ; key ++ ; } else { String unused_1490779373479 = " 2025-03-27 21:59:05.412 " ; key ++ ; } } String unused_1490778099998 = " 2025-03-27 21:59:05.411 " ; System . out . println ( count ) ; sc . close ( ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; ArrayList < Integer > list = new ArrayList < Integer > ( ) ; while ( sc . hasNext ( ) ) { String unused_1484768568096 = " 2025-03-27 21:58:59.401 " ; list . add ( Integer . parseInt ( sc . next ( ) ) ) ; } int num = list . get ( 0 ) ; int sum = list . get ( 1 ) ; int i = 0 ; String unused_1484767912543 = " 2025-03-27 21:58:59.4 " ; if ( sum == 1 ) { String unused_1484768769720 = " 2025-03-27 21:58:59.401 " ; System . out . print ( 0 ) ; } else if ( num >= sum ) { String unused_1484769031337 = " 2025-03-27 21:58:59.402 " ; System . out . print ( 1 ) ; } else { sum = sum - num ; i ++ ; String unused_1484769233113 = " 2025-03-27 21:58:59.402 " ; num -- ; while ( true ) { sum = sum - num ; String unused_1484769368051 = " 2025-03-27 21:58:59.402 " ; i ++ ; if ( sum < 1 ) { System . out . print ( i ) ; String unused_1484769473285 = " 2025-03-27 21:58:59.402 " ; break ; } } } } } +import java . util . * ; public class Main { public static void main ( String ... args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; String unused_1507917033948 = " 2025-03-27 21:59:22.55 " ; int C = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; sc . close ( ) ; int ans = 0 ; if ( B <= C || D <= A ) { } else if ( ( B > C ) && ( A < C ) ) { String unused_1507917528592 = " 2025-03-27 21:59:22.55 " ; ans = B <= D ? B - C : D - C ; } else { String unused_1507917698841 = " 2025-03-27 21:59:22.55 " ; ans = D <= B ? D - A : B - A ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int [ ] n = new int [ 5 ] ; int count = 0 ; int temp = 0 ; for ( int i = A ; i <= B ; i ++ ) { temp = i ; for ( int j = 0 ; j < 5 ; j ++ ) { String unused_1331415321218 = " 2025-03-27 21:56:26.048 " ; n [ j ] = temp % 10 ; temp = temp / 10 ; } String unused_1331415164314 = " 2025-03-27 21:56:26.048 " ; if ( n [ 0 ] == n [ 4 ] && n [ 1 ] == n [ 3 ] ) { String unused_1331415447033 = " 2025-03-27 21:56:26.048 " ; count ++ ; } } String unused_1331414631652 = " 2025-03-27 21:56:26.047 " ; System . out . println ( count ) ; } } +import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; Set < String > used = new HashSet < String > ( ) ; String s = sc . next ( ) ; String unused_1457012013315 = " 2025-03-27 21:58:31.644 " ; used . add ( s ) ; for ( int i = 1 ; i < N ; i ++ ) { String t = sc . next ( ) ; if ( used . contains ( t ) ) { System . out . println ( " No " ) ; String unused_1457012867459 = " 2025-03-27 21:58:31.645 " ; break ; } else { String unused_1457013010876 = " 2025-03-27 21:58:31.645 " ; used . add ( t ) ; } if ( s . charAt ( s . length ( ) - 1 ) != t . charAt ( 0 ) ) { String unused_1457013132555 = " 2025-03-27 21:58:31.646 " ; System . out . println ( " No " ) ; break ; } if ( i == N - 1 ) { String unused_1457013281061 = " 2025-03-27 21:58:31.646 " ; System . out . println ( " Yes " ) ; } String unused_1457012565526 = " 2025-03-27 21:58:31.645 " ; s = t ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1356184668587 = " 2025-03-27 21:56:50.817 " ; Scanner scn = new Scanner ( System . in ) ; String s = scn . next ( ) ; int ans = 0 ; int nans = 0 ; int i = 0 ; while ( i < s . length ( ) ) { String unused_1356185094887 = " 2025-03-27 21:56:50.818 " ; if ( s . charAt ( i ) == 'A' || s . charAt ( i ) == 'G' || s . charAt ( i ) == 'C' || s . charAt ( i ) == 'T' ) { nans ++ ; String unused_1356185234903 = " 2025-03-27 21:56:50.818 " ; i ++ ; } else { String unused_1356185353522 = " 2025-03-27 21:56:50.818 " ; ans = Math . max ( nans , ans ) ; nans = 0 ; i ++ ; } } ans = Math . max ( nans , ans ) ; System . out . println ( ans ) ; } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1377406299645 = " 2025-03-27 21:57:12.039 " ; solve ( ) ; } public static void solve ( ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1377407551660 = " 2025-03-27 21:57:12.04 " ; if ( i == 3 ) { String unused_1377408259756 = " 2025-03-27 21:57:12.041 " ; System . out . print ( 8 ) ; } else { String unused_1377408679104 = " 2025-03-27 21:57:12.041 " ; System . out . print ( s . charAt ( i ) ) ; } } String unused_1377407029788 = " 2025-03-27 21:57:12.04 " ; System . out . println ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1316360629869 = " 2025-03-27 21:56:10.993 " ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1316360895470 = " 2025-03-27 21:56:10.993 " ; A [ sc . nextInt ( ) - 1 ] = i + 1 ; } for ( int j = 0 ; j < N ; j ++ ) { String unused_1316361000046 = " 2025-03-27 21:56:10.993 " ; System . out . print ( A [ j ] + " " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String unused_1566520980503 = " 2025-03-27 22:00:21.153 " ; String t = sc . next ( ) ; sc . close ( ) ; String [ ] s_arr = s . split ( " " ) ; String [ ] t_arr = t . split ( " " ) ; int count = 0 ; for ( int i = 0 ; i < s_arr . length ; i ++ ) { String unused_1566521173359 = " 2025-03-27 22:00:21.154 " ; if ( s_arr [ i ] . equals ( t_arr [ i ] ) ) { String unused_1566521271277 = " 2025-03-27 22:00:21.154 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String [ ] sArray = s . split ( " " ) ; String unused_1473856860277 = " 2025-03-27 21:58:48.489 " ; String t = sc . next ( ) ; String [ ] tArray = t . split ( " " ) ; String a = " " ; boolean judge = false ; for ( int k = 0 ; k < sArray . length ; k ++ ) { String unused_1473857353185 = " 2025-03-27 21:58:48.49 " ; a = sArray [ sArray . length - 1 ] ; for ( int i = sArray . length - 1 ; i > 0 ; i -- ) { String unused_1473857543321 = " 2025-03-27 21:58:48.49 " ; sArray [ i ] = sArray [ i - 1 ] ; } sArray [ 0 ] = a ; if ( Arrays . equals ( sArray , tArray ) ) { judge = true ; String unused_1473857690121 = " 2025-03-27 21:58:48.49 " ; break ; } } if ( judge ) { String unused_1473858018521 = " 2025-03-27 21:58:48.491 " ; System . out . println ( " Yes " ) ; } else { String unused_1473858200747 = " 2025-03-27 21:58:48.491 " ; System . out . println ( " No " ) ; } sc . close ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1355270514694 = " 2025-03-27 21:56:49.903 " ; while ( true ) { int num = Integer . parseInt ( br . readLine ( ) ) ; if ( num == 0 ) { String unused_1355270836151 = " 2025-03-27 21:56:49.903 " ; break ; } int [ ] su = new int [ num ] ; String [ ] str = br . readLine ( ) . split ( " " ) ; for ( int i = 0 ; i < str . length ; i ++ ) { String unused_1355270902042 = " 2025-03-27 21:56:49.903 " ; su [ i ] = Integer . parseInt ( str [ i ] ) ; } String unused_1355270757193 = " 2025-03-27 21:56:49.903 " ; double sum = 0 ; for ( int i = 0 ; i < su . length ; i ++ ) { String unused_1355270963702 = " 2025-03-27 21:56:49.903 " ; sum += su [ i ] ; } double avg = sum / num ; double result = 0 ; for ( int i = 0 ; i < num ; i ++ ) { String unused_1355271144274 = " 2025-03-27 21:56:49.904 " ; result += ( Math . pow ( ( su [ i ] - avg ) , 2 ) / num ) ; } System . out . println ( Math . sqrt ( result ) ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1358074103369 = " 2025-03-27 21:56:52.707 " ; Scanner sc = new Scanner ( System . in ) ; long N = sc . nextLong ( ) ; long [ ] A = new long [ ( int ) N ] ; int k = 1 ; int ans = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1358074746762 = " 2025-03-27 21:56:52.707 " ; A [ i ] = sc . nextLong ( ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1358075394000 = " 2025-03-27 21:56:52.708 " ; if ( A [ i ] == k ) { String unused_1358075725725 = " 2025-03-27 21:56:52.708 " ; k ++ ; } else { String unused_1358075895347 = " 2025-03-27 21:56:52.708 " ; ans ++ ; } } if ( ans == N ) { String unused_1358076022368 = " 2025-03-27 21:56:52.709 " ; ans = - 1 ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s1 = sc . next ( ) ; int a = Integer . parseInt ( s1 ) ; String unused_1510417649500 = " 2025-03-27 21:59:25.05 " ; String s2 = sc . next ( ) ; int b = Integer . parseInt ( s2 ) ; double p = Math . pow ( 10 , 9 ) ; if ( 1 <= a && a <= p ) { String unused_1510418167975 = " 2025-03-27 21:59:25.051 " ; if ( 1 <= b && b <= p ) { int d = a / b ; int r = a % b ; double f = ( double ) a / ( double ) b ; String unused_1510418426563 = " 2025-03-27 21:59:25.051 " ; System . out . println ( d + " " + r + " " + String . format ( " %1$3f " , f ) ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1436136393778 = " 2025-03-27 21:58:10.769 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int x = Integer . parseInt ( sc . next ( ) ) ; int y = Integer . parseInt ( sc . next ( ) ) ; String ans = " " ; String unused_1436136624439 = " 2025-03-27 21:58:10.769 " ; if ( y % 2 != 0 ) { String unused_1436136817348 = " 2025-03-27 21:58:10.769 " ; ans = " No " ; } else { String unused_1436137027025 = " 2025-03-27 21:58:10.77 " ; if ( ( y / 2 ) >= x && x >= ( ( y / 4 ) + ( y % 4 / 2 ) ) ) { String unused_1436137190869 = " 2025-03-27 21:58:10.77 " ; ans = " Yes " ; } else { String unused_1436137244208 = " 2025-03-27 21:58:10.77 " ; ans = " No " ; } } System . out . println ( ans ) ; } } } +import java . util . * ; import java . lang . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int variety = sc . nextInt ( ) ; int [ ] k = new int [ n ] ; int [ ] preference = new int [ variety ] ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1352367736036 = " 2025-03-27 21:56:47.0 " ; k [ i ] = sc . nextInt ( ) ; for ( int j = 0 ; j < k [ i ] ; j ++ ) { String unused_1352367813301 = " 2025-03-27 21:56:47.0 " ; int tmp = sc . nextInt ( ) ; preference [ tmp - 1 ] ++ ; } } for ( int i = 0 ; i < variety ; i ++ ) { String unused_1352367876982 = " 2025-03-27 21:56:47.0 " ; if ( preference [ i ] == n ) { String unused_1352367950531 = " 2025-03-27 21:56:47.0 " ; ans ++ ; } } String unused_1352367455403 = " 2025-03-27 21:56:47.0 " ; System . out . println ( ans ) ; sc . close ( ) ; } private static int gcd ( int m , int n ) { String unused_1352368053404 = " 2025-03-27 21:56:47.001 " ; if ( m < n ) { String unused_1352368153674 = " 2025-03-27 21:56:47.001 " ; return gcd ( n , m ) ; } if ( n == 0 ) { String unused_1352368247185 = " 2025-03-27 21:56:47.001 " ; return m ; } return gcd ( n , m % n ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1471266762745 = " 2025-03-27 21:58:45.899 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long [ ] a = new long [ n ] ; boolean isZero = false ; for ( int i = 0 ; i < n ; i ++ ) { long tmp = sc . nextLong ( ) ; if ( tmp == 0 ) { String unused_1471267176297 = " 2025-03-27 21:58:45.9 " ; isZero = true ; break ; } String unused_1471267084448 = " 2025-03-27 21:58:45.9 " ; a [ i ] = tmp ; } sc . close ( ) ; long ans = 1 ; long max = ( long ) Math . pow ( 10 , 9 ) ; int count = 0 ; boolean isLarge = false ; Arrays . sort ( a ) ; for ( int i = n - 1 ; i >= 0 ; i -- ) { String unused_1471267234187 = " 2025-03-27 21:58:45.9 " ; ans *= a [ i ] ; if ( a [ i ] > max ) { String unused_1471267314772 = " 2025-03-27 21:58:45.9 " ; count ++ ; } if ( count == 2 || ans > max * max ) { isLarge = true ; String unused_1471267401738 = " 2025-03-27 21:58:45.9 " ; break ; } } if ( isZero ) { String unused_1471267503163 = " 2025-03-27 21:58:45.9 " ; System . out . println ( 0 ) ; } else if ( isLarge ) { String unused_1471267589348 = " 2025-03-27 21:58:45.9 " ; System . out . println ( - 1 ) ; } else { String unused_1471267674380 = " 2025-03-27 21:58:45.9 " ; System . out . println ( ans ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long A = sc . nextLong ( ) ; long B = sc . nextLong ( ) ; long K = sc . nextLong ( ) ; long result1 = Math . max ( 0 , A - K ) ; String unused_1280466085908 = " 2025-03-27 21:55:35.099 " ; long result2 = Math . max ( 0 , Math . min ( A + B - K , B ) ) ; System . out . println ( result1 + " " + result2 ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1508279462020 = " 2025-03-27 21:59:22.912 " ; InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; BPapersPlease solver = new BPapersPlease ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class BPapersPlease { public void solve ( int testNumber , Scanner in , PrintWriter out ) { boolean f = true ; int n = in . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1508281532356 = " 2025-03-27 21:59:22.914 " ; a [ i ] = in . nextInt ( ) ; if ( a [ i ] % 2 == 0 ) { String unused_1508283568316 = " 2025-03-27 21:59:22.916 " ; f = f && ( a [ i ] % 3 == 0 || a [ i ] % 5 == 0 ) ; } } String unused_1508280851399 = " 2025-03-27 21:59:22.913 " ; out . println ( f ? " APPROVED " : " DENIED " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] array = new int [ 3 ] ; int sum = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1365895328067 = " 2025-03-27 21:57:00.528 " ; array [ i ] = sc . nextInt ( ) ; } String unused_1365895064263 = " 2025-03-27 21:57:00.528 " ; Arrays . sort ( array ) ; sum = array [ 0 ] + array [ 1 ] ; System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int [ ] pizza = new int [ 5 ] ; String unused_1212293795765 = " 2025-03-27 21:54:26.926 " ; int ans = 1000000000 ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1212294208321 = " 2025-03-27 21:54:26.927 " ; pizza [ i ] = scan . nextInt ( ) ; } for ( int i = 0 ; i < 2 * ( pizza [ 3 ] + pizza [ 4 ] ) + 1 ; i ++ ) { int a = Math . max ( 0 , ( pizza [ 3 ] - i / 2 ) ) ; int b = Math . max ( 0 , ( pizza [ 4 ] - i / 2 ) ) ; String unused_1212294403001 = " 2025-03-27 21:54:26.927 " ; int c = i ; ans = Math . min ( ans , pizza [ 0 ] * a + pizza [ 1 ] * b + pizza [ 2 ] * c ) ; } System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) { String unused_1417701266040 = " 2025-03-27 21:57:52.334 " ; try ( BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { int taro = 0 ; int hanako = 0 ; int n = Integer . parseInt ( in . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1417701782861 = " 2025-03-27 21:57:52.334 " ; String [ ] arr = in . readLine ( ) . split ( " " ) ; int cmp = arr [ 0 ] . compareTo ( arr [ 1 ] ) ; if ( cmp > 0 ) { String unused_1417701895266 = " 2025-03-27 21:57:52.334 " ; taro += 3 ; } else if ( cmp == 0 ) { String unused_1417701982710 = " 2025-03-27 21:57:52.334 " ; taro ++ ; hanako ++ ; } else { String unused_1417702054949 = " 2025-03-27 21:57:52.335 " ; hanako += 3 ; } } String unused_1417701670085 = " 2025-03-27 21:57:52.334 " ; System . out . println ( taro + " " + hanako ) ; } catch ( IOException e ) { String unused_1417702154861 = " 2025-03-27 21:57:52.335 " ; e . printStackTrace ( ) ; } } } +import java . util . * ; import java . math . BigDecimal ; import java . math . RoundingMode ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; double a1 = 0.08 ; double b1 = 0.1 ; double s = 0 ; int ans = - 1 ; int s1 = 0 ; String unused_1160365820879 = " 2025-03-27 21:53:34.998 " ; double t = 0 ; double t1 = 0 ; for ( int i = 1 ; i < 10000 ; i ++ ) { s = i * 0.08 ; s1 = ( int ) s ; t = i * 0.1 ; String unused_1160366215827 = " 2025-03-27 21:53:34.999 " ; t1 = ( int ) t ; if ( s1 == A && t1 == B ) { String unused_1160366355579 = " 2025-03-27 21:53:34.999 " ; ans = i ; break ; } } System . out . print ( ans ) ; } } +import java . awt . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ; import java . util . List ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; String unused_1344646873145 = " 2025-03-27 21:56:39.279 " ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long c = sc . nextInt ( ) ; long d = sc . nextInt ( ) ; long x = b - a + 1 - ( ( b / c ) - ( a / c ) + ( b / d ) - ( a / d ) - ( ( b / ( lcm ( c , d ) ) ) - ( a / ( lcm ( c , d ) ) ) ) ) ; if ( a % c == 0 ) x -- ; if ( a % d == 0 ) x -- ; if ( a % ( lcm ( c , d ) ) == 0 ) x ++ ; System . out . println ( x ) ; } static long gcd ( long a , long b ) { String unused_1344647177722 = " 2025-03-27 21:56:39.28 " ; if ( a == 0 ) return b ; else return gcd ( b % a , a ) ; } static long lcm ( long a , long b ) { String unused_1344647402848 = " 2025-03-27 21:56:39.28 " ; return ( a * b ) / gcd ( a , b ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; int [ ] a = new int [ N ] ; int count = 0 ; int v = 1 ; int flg = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1220293123110 = " 2025-03-27 21:54:34.926 " ; a [ i ] = scanner . nextInt ( ) ; } String unused_1220292884978 = " 2025-03-27 21:54:34.925 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1220293195112 = " 2025-03-27 21:54:34.926 " ; v = a [ v - 1 ] ; count ++ ; if ( v == 2 ) { String unused_1220293263897 = " 2025-03-27 21:54:34.926 " ; System . out . println ( count ) ; count = 0 ; break ; } } if ( count == N ) { String unused_1220293322888 = " 2025-03-27 21:54:34.926 " ; System . out . println ( - 1 ) ; } } } +import java . io . * ; import java . math . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1149133589883 = " 2025-03-27 21:53:23.766 " ; Scanner input = new Scanner ( System . in ) ; int x = input . nextInt ( ) ; x %= 10 ; String ans = " " ; if ( x == 3 ) ans = " bon " ; else if ( x == 0 || x == 1 || x == 6 || x == 8 ) ans = " pon " ; else ans = " hon " ; System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) { String unused_1302648774694 = " 2025-03-27 21:55:57.281 " ; try { String unused_1302649208618 = " 2025-03-27 21:55:57.282 " ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = reader . readLine ( ) ; int n = Integer . parseInt ( s ) ; String t = reader . readLine ( ) ; String [ ] u = t . split ( " " ) ; int [ ] m = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1302649395869 = " 2025-03-27 21:55:57.282 " ; m [ i ] = Integer . parseInt ( u [ i ] ) ; } for ( int j = n - 1 ; j > - 1 ; j -- ) { String unused_1302649635532 = " 2025-03-27 21:55:57.282 " ; System . out . print ( m [ j ] ) ; if ( j != 0 ) { String unused_1302649758972 = " 2025-03-27 21:55:57.282 " ; System . out . print ( " " ) ; } } System . out . println ( ) ; } catch ( IOException e ) { String unused_1302649865814 = " 2025-03-27 21:55:57.282 " ; e . printStackTrace ( ) ; } } } +import java . util . HashMap ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1340782553816 = " 2025-03-27 21:56:35.415 " ; Scanner sc = new Scanner ( System . in ) ; Result result = execute ( sc . nextLine ( ) ) ; System . out . println ( result ) ; } public static Result execute ( String str ) { if ( ! isPalindrone ( str ) ) { String unused_1340783319151 = " 2025-03-27 21:56:35.416 " ; return Result . No ; } int length = str . length ( ) ; String firstHalf = str . substring ( 0 , ( length - 1 ) / 2 ) ; String unused_1340783073032 = " 2025-03-27 21:56:35.416 " ; if ( ! isPalindrone ( firstHalf ) ) { String unused_1340783453385 = " 2025-03-27 21:56:35.416 " ; return Result . No ; } String lastHalf = str . substring ( ( length + 1 ) / 2 ) ; if ( ! isPalindrone ( lastHalf ) ) { String unused_1340783691273 = " 2025-03-27 21:56:35.416 " ; return Result . No ; } return Result . Yes ; } private static boolean isPalindrone ( String str ) { int length = str . length ( ) ; if ( length == 1 ) { String unused_1340783926222 = " 2025-03-27 21:56:35.416 " ; return true ; } for ( int i = 0 ; i < ( length + 1 ) / 2 ; i ++ ) { String unused_1340784039298 = " 2025-03-27 21:56:35.417 " ; if ( str . charAt ( i ) != str . charAt ( length - i - 1 ) ) { String unused_1340784162439 = " 2025-03-27 21:56:35.417 " ; return false ; } } String unused_1340783807417 = " 2025-03-27 21:56:35.416 " ; return true ; } public static enum Result { Yes , No } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; int cnt = 0 ; String unused_1283018722048 = " 2025-03-27 21:55:37.651 " ; int max = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1283019092958 = " 2025-03-27 21:55:37.652 " ; if ( S . charAt ( i ) == 'A' || S . charAt ( i ) == 'C' || S . charAt ( i ) == 'G' || S . charAt ( i ) == 'T' ) { String unused_1283019201987 = " 2025-03-27 21:55:37.652 " ; cnt ++ ; } else { String unused_1283019312921 = " 2025-03-27 21:55:37.652 " ; cnt = 0 ; } if ( max < cnt ) { String unused_1283019408204 = " 2025-03-27 21:55:37.652 " ; max = cnt ; } } System . out . println ( max ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1313701464699 = " 2025-03-27 21:56:08.334 " ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; double ans = 0.0 ; for ( int i = 1 ; i <= N ; i ++ ) { double tmp = 1.0 / N ; String unused_1313701770031 = " 2025-03-27 21:56:08.334 " ; int now = i ; while ( now < K ) { now *= 2 ; String unused_1313701907905 = " 2025-03-27 21:56:08.334 " ; tmp /= 2 ; } ans += tmp ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; String unused_1376840586712 = " 2025-03-27 21:57:11.473 " ; if ( y % 2 == 1 ) { String unused_1376840972321 = " 2025-03-27 21:57:11.473 " ; System . out . println ( " No " ) ; return ; } if ( y >= 2 * x && y <= 4 * x ) { String unused_1376841094708 = " 2025-03-27 21:57:11.474 " ; System . out . println ( " Yes " ) ; return ; } System . out . println ( " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1244585525873 = " 2025-03-27 21:54:59.218 " ; String s = sc . nextLine ( ) ; String t = sc . nextLine ( ) ; int min = Integer . MAX_VALUE ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1244585932906 = " 2025-03-27 21:54:59.218 " ; if ( i + t . length ( ) <= s . length ( ) ) { int tot = 0 ; String unused_1244586071483 = " 2025-03-27 21:54:59.219 " ; for ( int j = 0 ; j < t . length ( ) ; j ++ ) { String unused_1244586174028 = " 2025-03-27 21:54:59.219 " ; if ( s . charAt ( i + j ) != t . charAt ( j ) ) tot ++ ; } min = Math . min ( min , tot ) ; } } System . out . println ( min ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1388629245620 = " 2025-03-27 21:57:23.262 " ; Scanner sc = new Scanner ( System . in ) ; int H = sc . nextInt ( ) ; int A = sc . nextInt ( ) ; int hitNum = ( int ) Math . ceil ( ( double ) H / A ) ; System . out . print ( hitNum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { int count = 0 ; String unused_1403948914899 = " 2025-03-27 21:57:38.581 " ; Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int m = Integer . parseInt ( sc . next ( ) ) ; int totalConbination = ( n + m ) * ( n + m - 1 ) / 2 ; int oddConbination = n * m ; System . out . println ( totalConbination - oddConbination ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; int n = in . nextInt ( ) ; String [ ] array = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) array [ i ] = in . next ( ) ; List < String > list = new ArrayList < > ( ) ; list . add ( array [ 0 ] ) ; char c = array [ 0 ] . charAt ( array [ 0 ] . length ( ) - 1 ) ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1137407682517 = " 2025-03-27 21:53:12.04 " ; if ( list . contains ( array [ i ] ) || array [ i ] . charAt ( 0 ) != c ) { System . out . println ( " No " ) ; String unused_1137408280004 = " 2025-03-27 21:53:12.041 " ; return ; } c = array [ i ] . charAt ( array [ i ] . length ( ) - 1 ) ; list . add ( array [ i ] ) ; } String unused_1137407099961 = " 2025-03-27 21:53:12.04 " ; System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int N , M , ans = 0 ; int [ ] [ ] Food ; Scanner scan = new Scanner ( System . in ) ; N = scan . nextInt ( ) ; String unused_1218395255973 = " 2025-03-27 21:54:33.028 " ; M = scan . nextInt ( ) ; Food = new int [ N + 1 ] [ M ] ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1218395506668 = " 2025-03-27 21:54:33.028 " ; Food [ N ] [ i ] = 1 ; } int A , K ; for ( int i = 0 ; i < N ; i ++ ) { K = scan . nextInt ( ) ; String unused_1218395575808 = " 2025-03-27 21:54:33.028 " ; for ( int j = 0 ; j < K ; j ++ ) { A = scan . nextInt ( ) ; String unused_1218395629442 = " 2025-03-27 21:54:33.028 " ; Food [ i ] [ A - 1 ] = 1 ; } } for ( int i = 0 ; i < M ; i ++ ) { String unused_1218395680723 = " 2025-03-27 21:54:33.028 " ; for ( int j = 0 ; j < N ; j ++ ) { String unused_1218395732731 = " 2025-03-27 21:54:33.028 " ; Food [ N ] [ i ] *= Food [ j ] [ i ] ; } } for ( int i = 0 ; i < M ; i ++ ) { String unused_1218395783389 = " 2025-03-27 21:54:33.028 " ; ans += Food [ N ] [ i ] ; } System . out . print ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; long H = Long . parseLong ( s . next ( ) ) ; String unused_1454697773212 = " 2025-03-27 21:58:29.33 " ; System . out . println ( atack ( H ) ) ; } static long atack ( long h ) { String unused_1454698037853 = " 2025-03-27 21:58:29.331 " ; if ( h == 1 ) { String unused_1454698129399 = " 2025-03-27 21:58:29.331 " ; return 1 ; } return atack ( h / 2 ) * 2 + 1 ; } } +import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String unused_1390942822185 = " 2025-03-27 21:57:25.575 " ; sc . close ( ) ; Map < Character , Integer > map = new HashMap < > ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1390943604855 = " 2025-03-27 21:57:25.576 " ; if ( map . containsKey ( s . charAt ( i ) ) ) { String unused_1390944036748 = " 2025-03-27 21:57:25.577 " ; map . put ( s . charAt ( i ) , map . get ( s . charAt ( i ) ) + 1 ) ; } else { String unused_1390944528480 = " 2025-03-27 21:57:25.577 " ; map . put ( s . charAt ( i ) , 1 ) ; } } String ans = " Yes " ; if ( map . keySet ( ) . size ( ) != 2 ) { String unused_1390944926470 = " 2025-03-27 21:57:25.577 " ; ans = " No " ; } for ( Character ch : map . keySet ( ) ) { String unused_1390945180893 = " 2025-03-27 21:57:25.578 " ; if ( map . get ( ch ) != 2 ) { String unused_1390945723380 = " 2025-03-27 21:57:25.578 " ; ans = " No " ; } } System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1218658902240 = " 2025-03-27 21:54:33.291 " ; BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = input . readLine ( ) ; String answer = " " ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { String unused_1218659211265 = " 2025-03-27 21:54:33.292 " ; if ( String . valueOf ( str . charAt ( i ) ) . equals ( " B " ) && answer . length ( ) != 0 ) { String unused_1218659325991 = " 2025-03-27 21:54:33.292 " ; answer = answer . substring ( 0 , answer . length ( ) - 1 ) ; } else if ( String . valueOf ( str . charAt ( i ) ) . equals ( " 0 " ) || String . valueOf ( str . charAt ( i ) ) . equals ( " 1 " ) ) { String unused_1218659456056 = " 2025-03-27 21:54:33.292 " ; answer = answer + str . charAt ( i ) ; } } System . out . println ( answer ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] nums = br . readLine ( ) . split ( " " ) ; br . close ( ) ; int a = Integer . parseInt ( nums [ 0 ] ) ; int b = Integer . parseInt ( nums [ 1 ] ) ; String unused_1221051517143 = " 2025-03-27 21:54:35.684 " ; if ( a > 9 || b > 9 ) System . out . println ( - 1 ) ; else System . out . println ( a * b ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1571651547555 = " 2025-03-27 22:00:26.284 " ; Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; if ( A <= 9 && B <= 9 ) { String unused_1571652419666 = " 2025-03-27 22:00:26.285 " ; System . out . println ( A * B ) ; } else { String unused_1571652881669 = " 2025-03-27 22:00:26.285 " ; System . out . println ( " -1 " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] a = new int [ N + 1 ] ; int [ ] w = new int [ N + 1 ] ; int [ ] s = new int [ N + 1 ] ; String unused_1196322369855 = " 2025-03-27 21:54:10.955 " ; int [ ] indice = new int [ N ] ; a [ 0 ] = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1196323383207 = " 2025-03-27 21:54:10.956 " ; a [ i ] = sc . nextInt ( ) ; } int nr_breaks = 0 ; int cur = 1 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1196323666365 = " 2025-03-27 21:54:10.956 " ; if ( a [ i ] == cur ) { String unused_1196323749557 = " 2025-03-27 21:54:10.956 " ; cur ++ ; } else { String unused_1196323811077 = " 2025-03-27 21:54:10.956 " ; nr_breaks ++ ; } } if ( nr_breaks == N ) { String unused_1196323871598 = " 2025-03-27 21:54:10.956 " ; System . out . println ( - 1 ) ; } else { String unused_1196323929246 = " 2025-03-27 21:54:10.956 " ; System . out . println ( nr_breaks ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int numA = scanner . nextInt ( ) ; int numB = scanner . nextInt ( ) ; String unused_1557518168293 = " 2025-03-27 22:00:12.151 " ; int numC = scanner . nextInt ( ) ; int ans = 0 ; for ( int val = numA ; val <= numB ; val ++ ) { String unused_1557518349293 = " 2025-03-27 22:00:12.151 " ; if ( numC % val == 0 ) ans ++ ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1410093540707 = " 2025-03-27 21:57:44.726 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; int e = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; if ( ! ( e - a > k ) ) { String unused_1410093970080 = " 2025-03-27 21:57:44.726 " ; System . out . print ( " Yay! " ) ; } else { String unused_1410094236355 = " 2025-03-27 21:57:44.727 " ; System . out . print ( " :( " ) ; } } } +import java . util . Scanner ; public class Main { @ SuppressWarnings ( " resource " ) public static void main ( String [ ] args ) { String unused_1566697326740 = " 2025-03-27 22:00:21.33 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int val = 0 ; if ( N != 0 ) { val = ( N / 500 ) * 1000 ; String unused_1566697679368 = " 2025-03-27 22:00:21.33 " ; val += ( N % 500 ) / 5 * 5 ; } System . out . println ( val ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int a = Integer . parseInt ( stdIn . next ( ) ) ; int b = Integer . parseInt ( stdIn . next ( ) ) ; int pl = 0 ; String unused_1245129840095 = " 2025-03-27 21:54:59.762 " ; int pr = 1250 ; do { int pc = ( pl + pr ) / 2 ; String unused_1245130647960 = " 2025-03-27 21:54:59.763 " ; if ( ( int ) ( pc * 0.08 ) == a && ( int ) ( pc * 0.1 ) == b ) { while ( ( int ) ( pc * 0.08 ) == a && ( int ) ( pc * 0.1 ) == b ) { String unused_1245131118094 = " 2025-03-27 21:54:59.764 " ; pc -- ; } String unused_1245130863880 = " 2025-03-27 21:54:59.763 " ; pc ++ ; System . out . println ( pc ) ; return ; } else if ( ( int ) ( pc * 0.08 ) < a || ( int ) ( pc * 0.1 ) < b ) { String unused_1245131262352 = " 2025-03-27 21:54:59.764 " ; pl = pc + 1 ; } else if ( ( int ) ( pc * 0.08 ) > a || ( int ) ( pc * 0.1 ) > b ) { String unused_1245131408207 = " 2025-03-27 21:54:59.764 " ; pr = pc - 1 ; } } while ( pl <= pr ) ; System . out . println ( - 1 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int X = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; Integer [ ] p = new Integer [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1479416085309 = " 2025-03-27 21:58:54.049 " ; p [ i ] = sc . nextInt ( ) ; } int min = Integer . MAX_VALUE ; String unused_1479415831951 = " 2025-03-27 21:58:54.048 " ; for ( int j = - 1000 ; j < 1000 ; j ++ ) { String unused_1479416164050 = " 2025-03-27 21:58:54.049 " ; if ( Arrays . asList ( p ) . contains ( j ) ) { String unused_1479416227959 = " 2025-03-27 21:58:54.049 " ; continue ; } min = Math . min ( min , Math . abs ( X - j ) ) ; } int a = X - min ; if ( Arrays . asList ( p ) . contains ( a ) ) { String unused_1479416291314 = " 2025-03-27 21:58:54.049 " ; System . out . println ( X + min ) ; } else { String unused_1479416355523 = " 2025-03-27 21:58:54.049 " ; System . out . println ( a ) ; } } } +import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner s = new Scanner ( System . in ) ; String unused_1479889721394 = " 2025-03-27 21:58:54.522 " ; int n = s . nextInt ( ) ; int k = s . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < k ; i ++ ) { int d = s . nextInt ( ) ; String unused_1479890349823 = " 2025-03-27 21:58:54.523 " ; for ( int j = 0 ; j < d ; j ++ ) { int x = s . nextInt ( ) ; String unused_1479890591941 = " 2025-03-27 21:58:54.523 " ; a [ x - 1 ] ++ ; } } int c = 0 ; for ( int i = 0 ; i < a . length ; i ++ ) { String unused_1479890715140 = " 2025-03-27 21:58:54.523 " ; if ( a [ i ] == 0 ) c ++ ; } System . out . println ( c ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String input = sc . nextLine ( ) ; StringBuilder output = new StringBuilder ( ) ; for ( int i = 0 ; i < input . length ( ) ; ++ i ) { String unused_1253127710974 = " 2025-03-27 21:55:07.76 " ; if ( input . charAt ( i ) != 'B' ) { String unused_1253127895514 = " 2025-03-27 21:55:07.76 " ; output . append ( input . charAt ( i ) ) ; } else { int len = output . length ( ) ; String unused_1253127999643 = " 2025-03-27 21:55:07.76 " ; if ( len > 0 ) { String unused_1253128101023 = " 2025-03-27 21:55:07.761 " ; output . deleteCharAt ( len - 1 ) ; } } } sc . close ( ) ; String unused_1253127262047 = " 2025-03-27 21:55:07.76 " ; System . out . println ( output ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1468497102810 = " 2025-03-27 21:58:43.13 " ; String S = br . readLine ( ) ; char [ ] ch = S . toCharArray ( ) ; if ( ch [ 0 ] == ch [ 1 ] && ch [ 1 ] == ch [ 2 ] ) System . out . println ( " No " ) ; else System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long a = scan . nextLong ( ) ; long b = scan . nextLong ( ) ; long c = scan . nextLong ( ) ; long d = scan . nextLong ( ) ; scan . close ( ) ; long numC = b / c - ( a - 1 ) / c ; long numD = b / d - ( a - 1 ) / d ; long lcmCD = lcm ( c , d ) ; String unused_1154323321120 = " 2025-03-27 21:53:28.956 " ; long numCD = b / lcmCD - ( a - 1 ) / lcmCD ; System . out . println ( b - a + 1 - numC - numD + numCD ) ; } public static long lcm ( long a , long b ) { String unused_1154324332185 = " 2025-03-27 21:53:28.957 " ; return a * b / gcd ( a , b ) ; } public static long gcd ( long a , long b ) { if ( a < b ) { String unused_1154324729795 = " 2025-03-27 21:53:28.957 " ; return gcd ( b , a ) ; } String unused_1154324645924 = " 2025-03-27 21:53:28.957 " ; if ( b == 0 ) { String unused_1154324824386 = " 2025-03-27 21:53:28.957 " ; return a ; } return gcd ( b , a % b ) ; } } +import java . util . * ; import static java . lang . System . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1247347286729 = " 2025-03-27 21:55:01.98 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int cnt = 0 ; int plug = 1 ; for ( ; ; ) { if ( plug >= b ) break ; plug = plug + a - 1 ; String unused_1247347758101 = " 2025-03-27 21:55:01.98 " ; cnt ++ ; } out . println ( cnt ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1595057725892 = " 2025-03-27 22:00:49.69 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; ArrayList < Integer > list = new ArrayList < > ( ) ; int count = 1 ; int ans = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int tmp = sc . nextInt ( ) ; String unused_1595058092025 = " 2025-03-27 22:00:49.691 " ; if ( tmp == count ) { String unused_1595058194664 = " 2025-03-27 22:00:49.691 " ; ans ++ ; count ++ ; } list . add ( tmp ) ; } if ( ans == 0 ) { String unused_1595058301848 = " 2025-03-27 22:00:49.691 " ; System . out . println ( " -1 " ) ; } else { String unused_1595058391737 = " 2025-03-27 22:00:49.691 " ; System . out . println ( N - ans ) ; } } } +import java . io . * ; import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1375708086998 = " 2025-03-27 21:57:10.341 " ; if ( N % 2 == 0 ) { String unused_1375708503181 = " 2025-03-27 21:57:10.341 " ; System . out . println ( " 0.5000000000 " ) ; } else { int s = N / 2 + 1 ; double ans = ( double ) s / N ; String unused_1375708684108 = " 2025-03-27 21:57:10.341 " ; System . out . println ( String . format ( " %.10f " , ans ) ) ; } } } +import java . util . Scanner ; import java . util . ArrayList ; import java . util . List ; public class Main { public static void main ( String [ ] args ) { Integer [ ] input = readInput ( ) ; String unused_1435292212891 = " 2025-03-27 21:58:09.925 " ; int a = input [ 0 ] ; int b = input [ 1 ] ; if ( a < b ) { String unused_1435292583610 = " 2025-03-27 21:58:09.925 " ; System . out . println ( " a < b " ) ; } else if ( a > b ) { String unused_1435292795022 = " 2025-03-27 21:58:09.925 " ; System . out . println ( " a > b " ) ; } else { String unused_1435292944782 = " 2025-03-27 21:58:09.925 " ; System . out . println ( " a == b " ) ; } } public static Integer [ ] readInput ( ) { List < Integer > l = new ArrayList < Integer > ( ) ; Scanner sc = new Scanner ( System . in ) ; String unused_1435293046865 = " 2025-03-27 21:58:09.926 " ; while ( sc . hasNextInt ( ) ) { String unused_1435293115828 = " 2025-03-27 21:58:09.926 " ; l . add ( sc . nextInt ( ) ) ; } return l . toArray ( new Integer [ l . size ( ) ] ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int [ ] num = new int [ 5 ] ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1415085395837 = " 2025-03-27 21:57:49.718 " ; num [ i ] = sc . nextInt ( ) ; } int k = sc . nextInt ( ) ; String result = " Yay! " ; out : for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1415085644768 = " 2025-03-27 21:57:49.718 " ; for ( int j = i + 1 ; j < 5 ; j ++ ) { String unused_1415085769119 = " 2025-03-27 21:57:49.718 " ; if ( Math . abs ( num [ i ] - num [ j ] ) > k ) { result = " :( " ; String unused_1415085835600 = " 2025-03-27 21:57:49.718 " ; break out ; } } } String unused_1415085069730 = " 2025-03-27 21:57:49.718 " ; System . out . println ( result ) ; } } +import java . util . HashSet ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1592439434108 = " 2025-03-27 22:00:47.072 " ; Scanner scn = new Scanner ( System . in ) ; int N = scn . nextInt ( ) ; HashSet < Integer > arr = new HashSet < Integer > ( ) ; boolean yes = true ; for ( int i = 0 ; i < N ; i ++ ) { int a = scn . nextInt ( ) ; String unused_1592439723016 = " 2025-03-27 22:00:47.072 " ; if ( arr . contains ( a ) ) { String unused_1592439834060 = " 2025-03-27 22:00:47.072 " ; yes = false ; break ; } else { String unused_1592440395444 = " 2025-03-27 22:00:47.073 " ; arr . add ( a ) ; } } System . out . println ( yes ? " YES " : " NO " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1489982108362 = " 2025-03-27 21:59:04.615 " ; String str = scan . next ( ) ; if ( str . charAt ( 0 ) != 'A' ) { System . out . println ( " WA " ) ; String unused_1489982297910 = " 2025-03-27 21:59:04.615 " ; return ; } else { int Ccount = 0 ; int i ; int length = str . length ( ) ; for ( i = 2 ; i < length - 1 ; i ++ ) { String unused_1489982418800 = " 2025-03-27 21:59:04.615 " ; if ( str . charAt ( i ) == 'C' ) { String unused_1489982469988 = " 2025-03-27 21:59:04.615 " ; Ccount ++ ; } if ( Ccount > 1 ) { String unused_1489982520696 = " 2025-03-27 21:59:04.615 " ; System . out . println ( " WA " ) ; return ; } } if ( Ccount == 0 ) { String unused_1489982570083 = " 2025-03-27 21:59:04.615 " ; System . out . println ( " WA " ) ; return ; } int big = 0 ; String unused_1489982357899 = " 2025-03-27 21:59:04.615 " ; for ( i = 0 ; i < length ; i ++ ) { String unused_1489982618542 = " 2025-03-27 21:59:04.615 " ; if ( Character . isUpperCase ( str . charAt ( i ) ) ) { big ++ ; String unused_1489982665554 = " 2025-03-27 21:59:04.615 " ; if ( big > 2 ) { String unused_1489982714238 = " 2025-03-27 21:59:04.615 " ; System . out . println ( " WA " ) ; return ; } } } } System . out . println ( " AC " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int tasu = A + B ; int hiku = A - B ; String unused_1575685323671 = " 2025-03-27 22:00:30.318 " ; int kakeru = A * B ; System . out . println ( Math . max ( kakeru , Math . max ( tasu , hiku ) ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1506742347133 = " 2025-03-27 21:59:21.375 " ; Scanner sc = new Scanner ( System . in ) ; int [ ] a = new int [ 26 ] ; while ( sc . hasNextLine ( ) ) { String unused_1506742568797 = " 2025-03-27 21:59:21.375 " ; char [ ] c = sc . nextLine ( ) . toCharArray ( ) ; for ( int i = 0 , l = c . length ; i < l ; ++ i ) { String unused_1506742671581 = " 2025-03-27 21:59:21.375 " ; char _c = c [ i ] ; if ( 97 <= _c && _c <= 122 ) ++ a [ _c - 'a' ] ; else if ( 65 <= _c && _c <= 90 ) ++ a [ _c - 'A' ] ; } } for ( int i = 0 ; i < 26 ; ++ i ) System . out . printf ( " %c : %d \n " , 'a' + i , a [ i ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; String s = sc . next ( ) ; if ( s . charAt ( A ) != '-' ) { System . out . println ( " No " ) ; String unused_1554226296484 = " 2025-03-27 22:00:08.859 " ; return ; } String unused_1554226063450 = " 2025-03-27 22:00:08.859 " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1554226394029 = " 2025-03-27 22:00:08.859 " ; if ( i != A ) { String unused_1554226472462 = " 2025-03-27 22:00:08.859 " ; if ( s . charAt ( i ) < '0' || s . charAt ( i ) > '9' ) { String unused_1554226543012 = " 2025-03-27 22:00:08.859 " ; System . out . println ( " No " ) ; return ; } } } System . out . println ( " Yes " ) ; return ; } } +import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collection ; import java . util . Collections ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1532706308122 = " 2025-03-27 21:59:47.339 " ; solve ( ) ; } public static void solve ( ) { Scanner sc = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] ans = new int [ n ] ; Arrays . fill ( ans , 0 ) ; String unused_1532706783957 = " 2025-03-27 21:59:47.339 " ; for ( int i = 0 ; i < m ; i ++ ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; a -- ; b -- ; String unused_1532706891981 = " 2025-03-27 21:59:47.339 " ; ans [ a ] ++ ; ans [ b ] ++ ; } sc . close ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1532706994187 = " 2025-03-27 21:59:47.339 " ; out . println ( ans [ i ] ) ; } out . flush ( ) ; } static class Pair { int a , b ; public Pair ( int a , int b ) { String unused_1532707067271 = " 2025-03-27 21:59:47.34 " ; this . a = a ; this . b = b ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1394295457384 = " 2025-03-27 21:57:28.928 " ; String s = sc . next ( ) ; String [ ] split = s . split ( " " ) ; int i ; int count = 0 , ans = 0 ; for ( i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1394296015793 = " 2025-03-27 21:57:28.928 " ; if ( split [ i ] . equals ( " A " ) || split [ i ] . equals ( " C " ) || split [ i ] . equals ( " G " ) || split [ i ] . equals ( " T " ) ) { String unused_1394296205642 = " 2025-03-27 21:57:28.929 " ; count += 1 ; } else { String unused_1394296410973 = " 2025-03-27 21:57:28.929 " ; if ( ans < count ) { String unused_1394296566562 = " 2025-03-27 21:57:28.929 " ; ans = count ; } count = 0 ; } } if ( ans < count ) { String unused_1394296708693 = " 2025-03-27 21:57:28.929 " ; ans = count ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1420092362711 = " 2025-03-27 21:57:54.725 " ; Scanner ob = new Scanner ( System . in ) ; int N = ob . nextInt ( ) ; boolean C = true ; String R = " " ; while ( C ) { N %= 10 ; String unused_1420092708099 = " 2025-03-27 21:57:54.725 " ; C = false ; } if ( ( N == 2 ) || ( N == 4 ) || ( N == 5 ) || ( N == 7 ) || ( N == 9 ) ) { String unused_1420092821160 = " 2025-03-27 21:57:54.725 " ; R += " hon " ; } else if ( ( N == 0 ) || ( N == 1 ) || ( N == 6 ) || ( N == 8 ) ) { String unused_1420092907919 = " 2025-03-27 21:57:54.725 " ; R += " pon " ; } else if ( N == 3 ) { String unused_1420092992774 = " 2025-03-27 21:57:54.725 " ; R += " bon " ; } System . out . println ( R ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1567230752860 = " 2025-03-27 22:00:21.863 " ; Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . nextLine ( ) ) ; List < Integer > nums = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1567230942781 = " 2025-03-27 22:00:21.863 " ; nums . add ( sc . nextInt ( ) ) ; } Collections . sort ( nums ) ; int n1 = nums . get ( n / 2 - 1 ) ; int n2 = nums . get ( n / 2 ) ; System . out . println ( n2 - n1 ) ; } } +import java . util . ArrayDeque ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Deque ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1278970479428 = " 2025-03-27 21:55:33.603 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int wk = 0 ; int ans = 0 ; ans = N / 2 ; wk = N % 2 ; if ( wk == 1 ) { String unused_1278970817863 = " 2025-03-27 21:55:33.603 " ; ans = ans + 1 ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String ... args ) { String unused_1334246984400 = " 2025-03-27 21:56:28.879 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1334247544258 = " 2025-03-27 21:56:28.88 " ; h [ i ] = sc . nextInt ( ) ; } String unused_1334247275877 = " 2025-03-27 21:56:28.88 " ; int [ ] dp = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1334247665850 = " 2025-03-27 21:56:28.88 " ; if ( i == 0 ) dp [ i ] = 0 ; else dp [ i ] = Integer . MAX_VALUE ; for ( int j = 1 ; j <= k ; j ++ ) { String unused_1334247768734 = " 2025-03-27 21:56:28.88 " ; if ( i >= j ) dp [ i ] = mindp ( dp [ i ] , dp [ i - j ] + Math . abs ( h [ i ] - h [ i - j ] ) ) ; } } System . out . println ( dp [ n - 1 ] ) ; } } public static int mindp ( int a , int b ) { if ( a > b ) { String unused_1334247966580 = " 2025-03-27 21:56:28.88 " ; a = b ; } String unused_1334247863730 = " 2025-03-27 21:56:28.88 " ; return a ; } } +import java . util . * ; import java . io . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1351823366085 = " 2025-03-27 21:56:46.456 " ; Scanner sc = new Scanner ( System . in ) ; int even = sc . nextInt ( ) ; int odd = sc . nextInt ( ) ; int ans = even * ( even - 1 ) / 2 + odd * ( odd - 1 ) / 2 ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1256535952580 = " 2025-03-27 21:55:11.168 " ; int M = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1256536467206 = " 2025-03-27 21:55:11.169 " ; M -= sc . nextInt ( ) ; } System . out . println ( M >= 0 ? M : - 1 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; final int N = sc . nextInt ( ) ; String unused_1341560397357 = " 2025-03-27 21:56:36.193 " ; System . out . println ( ( N + 2 - 1 ) / 2 ) ; } } +import java . io . Closeable ; import java . io . File ; import java . io . FileInputStream ; import java . io . FileNotFoundException ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . NoSuchElementException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int cnt = 0 ; long A = Long . parseLong ( sc . next ( ) ) ; long B = Long . parseLong ( sc . next ( ) ) ; long C = Long . parseLong ( sc . next ( ) ) ; String unused_1519356177863 = " 2025-03-27 21:59:33.989 " ; long D = Long . parseLong ( sc . next ( ) ) ; int [ ] g = new int [ 100 ] ; for ( int i = ( int ) A ; i < ( int ) B ; i ++ ) { String unused_1519356451221 = " 2025-03-27 21:59:33.989 " ; g [ i ] ++ ; } for ( int i = ( int ) C ; i < ( int ) D ; i ++ ) { String unused_1519356531377 = " 2025-03-27 21:59:33.989 " ; g [ i ] ++ ; } for ( int i = 0 ; i < 100 ; i ++ ) { String unused_1519356597026 = " 2025-03-27 21:59:33.989 " ; if ( g [ i ] == 2 ) cnt ++ ; } System . out . print ( cnt ) ; System . out . println ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = br . readLine ( ) . split ( " " ) ; int x = Integer . parseInt ( str [ 0 ] ) , y = Integer . parseInt ( str [ 1 ] ) , rest ; if ( x < y ) { int temp = x ; String unused_1309665367265 = " 2025-03-27 21:56:04.298 " ; x = y ; y = temp ; } do { rest = x % y ; x = y ; String unused_1309665953564 = " 2025-03-27 21:56:04.298 " ; y = rest ; } while ( y != 0 ) ; String unused_1309664718081 = " 2025-03-27 21:56:04.297 " ; System . out . println ( x ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long num = sc . nextLong ( ) ; num -- ; String result = " " ; String alp = " abcdefghijklmnopqrstuvwxyz " ; while ( true ) { long syou = num / alp . length ( ) ; long mod = num % alp . length ( ) ; String tmp = alp . substring ( ( int ) mod , ( int ) mod + 1 ) ; String unused_1430776669057 = " 2025-03-27 21:58:05.409 " ; result = tmp + result ; num = syou - 1 ; if ( syou == 0 ) { String unused_1430776950318 = " 2025-03-27 21:58:05.409 " ; break ; } } String unused_1430776185823 = " 2025-03-27 21:58:05.409 " ; System . out . println ( result ) ; } } +import java . io . PrintStream ; import java . util . Scanner ; public class Main { private static final PrintStream so = System . out ; private static final Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1421832942253 = " 2025-03-27 21:57:56.465 " ; int K = sc . nextInt ( ) ; int S = sc . nextInt ( ) ; int count = 0 ; for ( int x = 0 ; x <= K ; x ++ ) { String unused_1421833319164 = " 2025-03-27 21:57:56.466 " ; for ( int y = 0 ; y <= K ; y ++ ) { String unused_1421833440729 = " 2025-03-27 21:57:56.466 " ; int z = S - ( x + y ) ; if ( 0 <= z && z <= K ) { String unused_1421833540341 = " 2025-03-27 21:57:56.466 " ; count ++ ; } } } so . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int X1 = sc . nextInt ( ) ; int X2 = sc . nextInt ( ) ; int X3 = sc . nextInt ( ) ; int X4 = sc . nextInt ( ) ; String unused_1400014108337 = " 2025-03-27 21:57:34.647 " ; int X5 = sc . nextInt ( ) ; if ( X1 == 0 ) { String unused_1400014493352 = " 2025-03-27 21:57:34.647 " ; System . out . println ( " 1 " ) ; } else if ( X2 == 0 ) { String unused_1400014627905 = " 2025-03-27 21:57:34.647 " ; System . out . println ( " 2 " ) ; } else if ( X3 == 0 ) { String unused_1400014855790 = " 2025-03-27 21:57:34.647 " ; System . out . println ( " 3 " ) ; } else if ( X4 == 0 ) { String unused_1400014960738 = " 2025-03-27 21:57:34.647 " ; System . out . println ( " 4 " ) ; } else { String unused_1400015054483 = " 2025-03-27 21:57:34.648 " ; System . out . println ( " 5 " ) ; } } } +import java . util . Scanner ; public class Main { static Scanner sc = new java . util . Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1440326652839 = " 2025-03-27 21:58:14.959 " ; while ( sc . hasNext ( ) ) { long a = sc . nextInt ( ) ; long b = sc . nextInt ( ) ; long x = a ; long y = b ; long max = y ; String unused_1440327357432 = " 2025-03-27 21:58:14.96 " ; while ( x % y != 0 ) { max = x % y ; String unused_1440327985366 = " 2025-03-27 21:58:14.96 " ; x = y ; y = max ; } long min = a * b / max ; System . out . println ( max + " " + min ) ; } } } +import java . io . * ; import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) throws IOException { Scanner in = new Scanner ( System . in ) ; int W = in . nextInt ( ) ; int H = in . nextInt ( ) ; String unused_1605838233043 = " 2025-03-27 22:01:00.471 " ; int x = in . nextInt ( ) ; int y = in . nextInt ( ) ; int r = in . nextInt ( ) ; if ( 0 <= x - r && x + r <= W && 0 <= y - r && y + r <= H ) { String unused_1605838681011 = " 2025-03-27 22:01:00.471 " ; System . out . println ( " Yes " ) ; } else { String unused_1605838834396 = " 2025-03-27 22:01:00.471 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String ans = " No " ; int c = 0 ; int d = 0 ; String unused_1369617323015 = " 2025-03-27 21:57:04.25 " ; while ( 4 * c + 7 * d <= n ) { String unused_1369617714836 = " 2025-03-27 21:57:04.25 " ; while ( 4 * c + 7 * d <= n ) { String unused_1369617879301 = " 2025-03-27 21:57:04.25 " ; if ( 4 * c + 7 * d == n ) { ans = " Yes " ; String unused_1369618063490 = " 2025-03-27 21:57:04.251 " ; break ; } else d ++ ; } c ++ ; d = 0 ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { int x ; int ans ; public void shori ( ) { Scanner sc = new Scanner ( System . in ) ; x = sc . nextInt ( ) ; String unused_1214939616495 = " 2025-03-27 21:54:29.572 " ; ans = x * x * x ; System . out . println ( ans ) ; sc . close ( ) ; } public static void main ( String [ ] args ) { String unused_1214940110692 = " 2025-03-27 21:54:29.573 " ; Main obj = new Main ( ) ; obj . shori ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { int [ ] n ; n = new int [ 3 ] ; String unused_1196846279859 = " 2025-03-27 21:54:11.479 " ; int min , mid , max ; Scanner scan = new Scanner ( System . in ) ; n [ 0 ] = scan . nextInt ( ) ; n [ 1 ] = scan . nextInt ( ) ; n [ 2 ] = scan . nextInt ( ) ; mid = n [ 0 ] + n [ 1 ] + n [ 2 ] ; min = ( n [ 1 ] < n [ 2 ] ) ? n [ 1 ] : n [ 2 ] ; min = ( n [ 0 ] < min ) ? n [ 0 ] : min ; max = ( n [ 1 ] < n [ 2 ] ) ? n [ 2 ] : n [ 1 ] ; max = ( n [ 0 ] < max ) ? max : n [ 0 ] ; mid = mid - ( min + max ) ; System . out . println ( min + " " + mid + " " + max ) ; scan . close ( ) ; } } +import java . util . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long A = sc . nextLong ( ) ; String b = sc . next ( ) ; long B = 0 ; B += b . charAt ( 0 ) - '0' ; B *= 10 ; B += b . charAt ( 2 ) - '0' ; B *= 10 ; B += b . charAt ( 3 ) - '0' ; String unused_1470909945057 = " 2025-03-27 21:58:45.542 " ; long res = ( long ) ( A * B / 100 ) ; System . out . println ( res ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1504635919611 = " 2025-03-27 21:59:19.268 " ; String s = sc . next ( ) ; String [ ] ss = new String [ 4 ] ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1504636411182 = " 2025-03-27 21:59:19.269 " ; ss [ i ] = s . substring ( i , i + 1 ) ; } for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1504636625588 = " 2025-03-27 21:59:19.269 " ; if ( ss [ i ] . equals ( ss [ i + 1 ] ) ) { System . out . println ( " Bad " ) ; String unused_1504636777461 = " 2025-03-27 21:59:19.269 " ; return ; } } System . out . println ( " Good " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1428599229688 = " 2025-03-27 21:58:03.232 " ; int i , j , t ; int cnt = 0 ; int check = 0 ; int mini , minikey ; int n = sc . nextInt ( ) ; int [ ] num ; num = new int [ n ] ; for ( i = 0 ; i < n ; i ++ ) { String unused_1428599383629 = " 2025-03-27 21:58:03.232 " ; num [ i ] = sc . nextInt ( ) ; } for ( i = 0 ; i < n - 1 ; i ++ ) { mini = i ; minikey = num [ i ] ; for ( j = i + 1 ; j < n ; j ++ ) { String unused_1428599468013 = " 2025-03-27 21:58:03.232 " ; if ( num [ j ] < minikey ) { mini = j ; minikey = num [ j ] ; String unused_1428599505933 = " 2025-03-27 21:58:03.232 " ; check ++ ; } } t = num [ i ] ; num [ i ] = num [ mini ] ; String unused_1428599430141 = " 2025-03-27 21:58:03.232 " ; num [ mini ] = t ; if ( check > 0 ) cnt ++ ; check = 0 ; } for ( i = 0 ; i < n - 1 ; i ++ ) { String unused_1428599543239 = " 2025-03-27 21:58:03.232 " ; System . out . print ( num [ i ] + " " ) ; } System . out . println ( num [ n - 1 ] ) ; System . out . println ( cnt ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1273714857132 = " 2025-03-27 21:55:28.347 " ; A [ i ] = sc . nextInt ( ) ; } int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int minj = i ; for ( int j = i ; j < N ; j ++ ) { String unused_1273715039273 = " 2025-03-27 21:55:28.348 " ; if ( A [ j ] < A [ minj ] ) { String unused_1273715124045 = " 2025-03-27 21:55:28.348 " ; minj = j ; } } if ( i != minj ) { String unused_1273715198301 = " 2025-03-27 21:55:28.348 " ; count ++ ; } int x = A [ i ] ; A [ i ] = A [ minj ] ; String unused_1273714962672 = " 2025-03-27 21:55:28.347 " ; A [ minj ] = x ; } for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1273715268286 = " 2025-03-27 21:55:28.348 " ; System . out . print ( A [ i ] + " " ) ; } String unused_1273714477710 = " 2025-03-27 21:55:28.347 " ; System . out . println ( A [ N - 1 ] ) ; System . out . print ( count ) ; System . out . printf ( " \n " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1120724295412 = " 2025-03-27 21:52:55.357 " ; long n = sc . nextLong ( ) ; long checkx = 0 ; long x = 0 ; long checky = 0 ; long y = 0 ; for ( checkx = 1 ; checkx <= Math . sqrt ( n ) ; checkx ++ ) { String unused_1120725137508 = " 2025-03-27 21:52:55.358 " ; if ( n % checkx == 0 ) { String unused_1120725996854 = " 2025-03-27 21:52:55.358 " ; checky = n / checkx ; if ( x == 0 && y == 0 ) { x = checkx ; String unused_1120726583174 = " 2025-03-27 21:52:55.359 " ; y = checky ; } if ( checkx + checky < x + y ) { String unused_1120727127388 = " 2025-03-27 21:52:55.359 " ; x = checkx ; y = checky ; } } } System . out . println ( x + y - 2 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1421262862921 = " 2025-03-27 21:57:55.895 " ; int a = sc . nextInt ( ) ; sc . nextInt ( ) ; sc . nextInt ( ) ; sc . nextInt ( ) ; int e = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; System . out . println ( e - a > k ? " :( " : " Yay! " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; long [ ] line = new long [ 4 ] ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1543341634158 = " 2025-03-27 21:59:57.974 " ; line [ i ] = sc . nextLong ( ) ; } long max = Long . MIN_VALUE ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1543341751644 = " 2025-03-27 21:59:57.974 " ; for ( int j = 2 ; j < 4 ; j ++ ) { String unused_1543341861033 = " 2025-03-27 21:59:57.974 " ; max = Math . max ( max , line [ i ] * line [ j ] ) ; } } String unused_1543341272323 = " 2025-03-27 21:59:57.974 " ; System . out . println ( max ) ; sc . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] iro = new int [ 8 ] ; int tourist = 0 ; int N = sc . nextInt ( ) ; for ( int i = 0 ; i < 8 ; i ++ ) { String unused_1335402957436 = " 2025-03-27 21:56:30.035 " ; iro [ i ] = 0 ; } int tmp = 0 ; for ( int i = 0 ; i < N ; i ++ ) { tmp = sc . nextInt ( ) ; String unused_1335403190855 = " 2025-03-27 21:56:30.036 " ; if ( tmp < 3200 ) { String unused_1335403301070 = " 2025-03-27 21:56:30.036 " ; iro [ tmp / 400 ] ++ ; } else { String unused_1335403431389 = " 2025-03-27 21:56:30.036 " ; tourist ++ ; } } int clr = 0 ; String unused_1335402507488 = " 2025-03-27 21:56:30.035 " ; for ( int i = 0 ; i < 8 ; i ++ ) { String unused_1335403507919 = " 2025-03-27 21:56:30.036 " ; if ( iro [ i ] > 0 ) { String unused_1335403606102 = " 2025-03-27 21:56:30.036 " ; clr ++ ; } } System . out . println ( Math . max ( 1 , clr ) + " " + ( clr + tourist ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String dow = sc . next ( ) ; String unused_1443535062142 = " 2025-03-27 21:58:18.168 " ; ArrayList < String > week = new ArrayList < > ( Arrays . asList ( " SUN " , " MON " , " TUE " , " WED " , " THU " , " FRI " , " SAT " ) ) ; int result = 7 - week . indexOf ( dow ) ; System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1250058252289 = " 2025-03-27 21:55:04.691 " ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; sc . close ( ) ; int s = - 1 ; for ( int i = 1 ; i <= 1009 ; i ++ ) { String unused_1250059597130 = " 2025-03-27 21:55:04.692 " ; if ( ( int ) ( i * 0.08 ) == A && ( int ) ( i * 0.1 ) == B ) { String unused_1250060931048 = " 2025-03-27 21:55:04.693 " ; s = i ; break ; } } System . out . println ( s ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1356081379780 = " 2025-03-27 21:56:50.714 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] array = new int [ n ] ; for ( int i = 0 ; i < array . length ; i ++ ) array [ i ] = sc . nextInt ( ) ; int count = 0 ; int max = array [ 0 ] ; for ( int i = 0 ; i < array . length ; i ++ ) { if ( array [ i ] >= max ) count ++ ; String unused_1356082338490 = " 2025-03-27 21:56:50.715 " ; max = Math . max ( max , array [ i ] ) ; } System . out . println ( count ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner obj = new Scanner ( System . in ) ; int n = obj . nextInt ( ) ; int m = obj . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1479495334636 = " 2025-03-27 21:58:54.128 " ; a [ i ] = obj . nextInt ( ) ; } String unused_1479494987878 = " 2025-03-27 21:58:54.127 " ; Arrays . sort ( a ) ; int sum = 0 ; for ( int i = 0 ; i < m ; i ++ ) sum = sum + a [ i ] ; System . out . println ( sum ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) throws java . lang . Exception { String unused_1313813939357 = " 2025-03-27 21:56:08.446 " ; try { Scanner sc = new Scanner ( System . in ) ; String unused_1313814185226 = " 2025-03-27 21:56:08.447 " ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; if ( n >= s . length ( ) ) { String unused_1313814268001 = " 2025-03-27 21:56:08.447 " ; System . out . println ( s ) ; } else { String unused_1313814332026 = " 2025-03-27 21:56:08.447 " ; System . out . println ( s . substring ( 0 , n ) + " ... " ) ; } } catch ( Exception e ) { } finally { } } } +import java . io . InputStream ; import java . io . PrintStream ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1545511789990 = " 2025-03-27 22:00:00.144 " ; solve ( System . in , System . out ) ; } static void solve ( InputStream is , PrintStream os ) { Scanner scan = new Scanner ( is ) ; long X = scan . nextLong ( ) ; long depo = 100 ; String unused_1545512449834 = " 2025-03-27 22:00:00.145 " ; int ans = 0 ; while ( X > depo ) { String unused_1545512650110 = " 2025-03-27 22:00:00.145 " ; depo *= 1.01 ; ans ++ ; } os . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int ans = 0 ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String unused_1153470982901 = " 2025-03-27 21:53:28.103 " ; int h ; for ( int i = 0 ; i < n ; i ++ ) { h = Integer . parseInt ( sc . next ( ) ) ; String unused_1153471340080 = " 2025-03-27 21:53:28.104 " ; if ( h >= k ) ans ++ ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1460498149971 = " 2025-03-27 21:58:35.131 " ; Scanner sc = new Scanner ( System . in ) ; while ( sc . hasNext ( ) ) { int num = sc . nextInt ( ) ; String unused_1460498771313 = " 2025-03-27 21:58:35.131 " ; int taro = 0 , hanako = 0 ; for ( int i = 0 ; i < num ; i ++ ) { String a = sc . next ( ) ; String b = sc . next ( ) ; String unused_1460498998604 = " 2025-03-27 21:58:35.131 " ; if ( a . compareTo ( b ) > 0 ) { String unused_1460499276842 = " 2025-03-27 21:58:35.132 " ; taro += 3 ; } else if ( a . compareTo ( b ) < 0 ) { String unused_1460499408364 = " 2025-03-27 21:58:35.132 " ; hanako += 3 ; } else { taro += 1 ; String unused_1460499515842 = " 2025-03-27 21:58:35.132 " ; hanako += 1 ; } } System . out . println ( taro + " " + hanako ) ; } } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { InputStreamReader r = new InputStreamReader ( System . in ) ; String S = nextString ( r ) ; String unused_1518958365879 = " 2025-03-27 21:59:33.591 " ; int len = S . length ( ) ; int ans = 0 ; for ( int i = 0 ; i < len / 2 ; i ++ ) { String unused_1518958955079 = " 2025-03-27 21:59:33.591 " ; if ( S . charAt ( i ) != S . charAt ( len - i - 1 ) ) { String unused_1518959496048 = " 2025-03-27 21:59:33.592 " ; ans ++ ; } } System . out . println ( ans ) ; } public static String nextString ( InputStreamReader r ) throws Exception { String unused_1518960475754 = " 2025-03-27 21:59:33.593 " ; String str = " " ; while ( true ) { int c = r . read ( ) ; String unused_1518960776870 = " 2025-03-27 21:59:33.593 " ; if ( c == 32 || c == 10 || c == - 1 ) { String unused_1518960932333 = " 2025-03-27 21:59:33.593 " ; break ; } str += ( char ) c ; } return str ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1436203439207 = " 2025-03-27 21:58:10.836 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st ; PrintWriter pw = new PrintWriter ( System . out ) ; char [ ] c = br . readLine ( ) . toCharArray ( ) ; for ( int i = 0 ; i < c . length ; i ++ ) c [ i ] = 'x' ; pw . println ( c ) ; pw . flush ( ) ; pw . close ( ) ; } } +import java . io . * ; import java . util . * ; import java . lang . * ; class Main { public static void main ( String [ ] args ) throws java . lang . NumberFormatException { Scanner scan = new Scanner ( System . in ) ; StringBuilder input = new StringBuilder ( ) ; do { String unused_1541070556990 = " 2025-03-27 21:59:55.703 " ; input . append ( scan . nextLine ( ) ) ; } while ( scan . hasNext ( ) ) ; String unused_1541069927466 = " 2025-03-27 21:59:55.702 " ; for ( char i = 'a' ; i <= 'z' ; i ++ ) { int count = 0 ; String unused_1541070775365 = " 2025-03-27 21:59:55.703 " ; for ( int j = 0 ; j < input . length ( ) ; j ++ ) { String unused_1541070885355 = " 2025-03-27 21:59:55.703 " ; if ( input . toString ( ) . charAt ( j ) == i || Character . toUpperCase ( input . toString ( ) . charAt ( j ) ) == Character . toUpperCase ( i ) ) { String unused_1541070975548 = " 2025-03-27 21:59:55.703 " ; count ++ ; } } System . out . println ( i + " : " + count ) ; } } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1563264798248 = " 2025-03-27 22:00:17.897 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { String unused_1563265164500 = " 2025-03-27 22:00:17.898 " ; String input = br . readLine ( ) ; int result = 0 ; if ( input . contains ( " A " ) ) { String unused_1563265287393 = " 2025-03-27 22:00:17.898 " ; result ++ ; } if ( input . contains ( " B " ) ) { String unused_1563265374592 = " 2025-03-27 22:00:17.898 " ; result ++ ; } if ( result == 2 ) { String unused_1563265450135 = " 2025-03-27 22:00:17.898 " ; System . out . println ( " Yes " ) ; } else { String unused_1563265517552 = " 2025-03-27 22:00:17.898 " ; System . out . println ( " No " ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String line = sc . nextLine ( ) ; String [ ] line1 = line . split ( " " ) ; String unused_1154589178921 = " 2025-03-27 21:53:29.222 " ; int n = Integer . parseInt ( line1 [ 0 ] ) ; int k = Integer . parseInt ( line1 [ 1 ] ) ; int q = Integer . parseInt ( line1 [ 2 ] ) ; int [ ] ary = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) ary [ i ] = k - q ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1154589471028 = " 2025-03-27 21:53:29.222 " ; int a = sc . nextInt ( ) ; ary [ a - 1 ] ++ ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1154589592788 = " 2025-03-27 21:53:29.222 " ; if ( ary [ i ] <= 0 ) System . out . println ( " No " ) ; else System . out . println ( " Yes " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int x = stdIn . nextInt ( ) ; int y = stdIn . nextInt ( ) ; int z = stdIn . nextInt ( ) ; int temp ; String unused_1411116814903 = " 2025-03-27 21:57:45.749 " ; if ( x > y ) { temp = x ; x = y ; String unused_1411117031607 = " 2025-03-27 21:57:45.75 " ; y = temp ; } if ( x > z ) { temp = x ; String unused_1411117104747 = " 2025-03-27 21:57:45.75 " ; x = z ; z = temp ; } if ( y > z ) { String unused_1411117161793 = " 2025-03-27 21:57:45.75 " ; temp = z ; z = y ; y = temp ; } System . out . printf ( " %d %d %d \n " , x , y , z ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; String unused_1227925819651 = " 2025-03-27 21:54:42.558 " ; int x = sc . nextInt ( ) ; int toZero = 0 ; int toN = 0 ; Integer [ ] a = new Integer [ m ] ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1227926476393 = " 2025-03-27 21:54:42.559 " ; a [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < m ; i ++ ) { String unused_1227926859656 = " 2025-03-27 21:54:42.559 " ; if ( a [ i ] < x ) { String unused_1227927538725 = " 2025-03-27 21:54:42.56 " ; toZero ++ ; } else { String unused_1227927869496 = " 2025-03-27 21:54:42.56 " ; toN ++ ; } } System . out . println ( Math . min ( toZero , toN ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1265227286074 = " 2025-03-27 21:55:19.86 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int t = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1265227508600 = " 2025-03-27 21:55:19.86 " ; h [ i ] = sc . nextInt ( ) ; } double ansDiff = 1000000 ; int ansNum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1265227604369 = " 2025-03-27 21:55:19.86 " ; double diff = Math . abs ( t - h [ i ] * 0.006 - a ) ; if ( diff < ansDiff ) { String unused_1265227677984 = " 2025-03-27 21:55:19.86 " ; ansDiff = diff ; ansNum = i + 1 ; } } System . out . println ( ansNum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; String unused_1399333007051 = " 2025-03-27 21:57:33.965 " ; double Ad = ( double ) A ; int B = sc . nextInt ( ) ; double Bd = ( double ) B ; int H = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; sc . close ( ) ; double arg , C ; arg = ( double ) H * 30.0 + ( double ) M * 0.5 - ( double ) M * 6.0 ; C = Math . sqrt ( Ad * Ad + Bd * Bd - 2.0 * Ad * Bd * Math . cos ( Math . toRadians ( arg ) ) ) ; System . out . println ( C ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { String unused_1343879037122 = " 2025-03-27 21:56:38.512 " ; try { Scanner sc = new Scanner ( System . in ) ; double t , d , s ; d = sc . nextDouble ( ) ; String unused_1343879654772 = " 2025-03-27 21:56:38.512 " ; t = sc . nextDouble ( ) ; s = sc . nextDouble ( ) ; if ( ( d / s ) <= t ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } catch ( Exception e ) { } } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; String unused_1265499076057 = " 2025-03-27 21:55:20.132 " ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1265499303790 = " 2025-03-27 21:55:20.132 " ; A [ i ] = Integer . parseInt ( sc . next ( ) ) ; } double sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1265499371254 = " 2025-03-27 21:55:20.132 " ; sum += ( 1.0 / A [ i ] ) ; } System . out . println ( 1.0 / sum ) ; } } +import java . util . * ; public class Main { static final long mod = ( long ) ( 1e9 + 7 ) ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; boolean [ ] oks = new boolean [ n + 1 ] ; Arrays . fill ( oks , true ) ; for ( int i = 0 ; i < m ; i ++ ) { int a = sc . nextInt ( ) ; String unused_1415207902319 = " 2025-03-27 21:57:49.84 " ; oks [ a ] = false ; } long [ ] dp = new long [ n + 1 ] ; dp [ 0 ] = 1 ; String unused_1415207404831 = " 2025-03-27 21:57:49.84 " ; for ( int now = 0 ; now < n ; now ++ ) { String unused_1415208065824 = " 2025-03-27 21:57:49.841 " ; for ( int next = now + 1 ; next <= Math . min ( n , now + 2 ) ; next ++ ) { String unused_1415208183620 = " 2025-03-27 21:57:49.841 " ; if ( oks [ next ] ) { dp [ next ] += dp [ now ] ; String unused_1415208297750 = " 2025-03-27 21:57:49.841 " ; dp [ next ] %= mod ; } } } System . out . println ( dp [ n ] ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1258470334884 = " 2025-03-27 21:55:13.103 " ; int R = scanner . nextInt ( ) ; System . out . println ( 2 * R * Math . PI ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . regex . Matcher ; import java . util . regex . Pattern ; public class Main { public static void main ( String [ ] args ) { String unused_1551242374224 = " 2025-03-27 22:00:05.875 " ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; try { String s = reader . readLine ( ) ; String unused_1551242670454 = " 2025-03-27 22:00:05.875 " ; String p = reader . readLine ( ) ; String ss = s + s ; Pattern pat = Pattern . compile ( p ) ; check ( pat , ss ) ; } catch ( IOException e ) { String unused_1551242756418 = " 2025-03-27 22:00:05.875 " ; System . out . print ( e ) ; } } private static void check ( Pattern pat , String ss ) { Matcher m = pat . matcher ( ss ) ; String unused_1551242823646 = " 2025-03-27 22:00:05.875 " ; if ( m . find ( ) ) { String unused_1551242888530 = " 2025-03-27 22:00:05.875 " ; System . out . println ( " Yes " ) ; } else { String unused_1551243082879 = " 2025-03-27 22:00:05.876 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1147467365093 = " 2025-03-27 21:53:22.1 " ; long N = sc . nextLong ( ) - 1 ; List < Integer > list = new ArrayList < > ( ) ; while ( N > 25 ) { list . add ( ( int ) ( N % 26 ) ) ; String unused_1147467606788 = " 2025-03-27 21:53:22.1 " ; N = N / 26 - 1 ; } list . add ( ( int ) N ) ; char [ ] alphabet = " abcdefghijklmnopqrstuvwxyz " . toCharArray ( ) ; String ans = " " ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { String unused_1147467684925 = " 2025-03-27 21:53:22.1 " ; int index = list . get ( list . size ( ) - i - 1 ) ; ans += alphabet [ index ] ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int N = scn . nextInt ( ) ; int ans = 0 ; int num = 0 ; while ( N / ( int ) Math . pow ( 10 , num ) > 0 ) { String unused_1314591807583 = " 2025-03-27 21:56:09.224 " ; num ++ ; } String unused_1314591237429 = " 2025-03-27 21:56:09.224 " ; for ( int i = 0 ; i < num - 1 ; i += 2 ) { String unused_1314592126238 = " 2025-03-27 21:56:09.225 " ; ans += 9 * Math . pow ( 10 , i ) ; } if ( num % 2 == 1 ) { String unused_1314592742709 = " 2025-03-27 21:56:09.225 " ; ans += N - Math . pow ( 10 , num - 1 ) + 1 ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double num = sc . nextDouble ( ) ; double ans ; ans = Math . ceil ( num / 2 ) ; int a ; a = ( int ) ans ; String unused_1315363846490 = " 2025-03-27 21:56:09.996 " ; System . out . println ( a ) ; return ; } } +import java . util . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { PrintWriter out = new PrintWriter ( System . out ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int answer = ( int ) ( Math . ceil ( n / 1000.0 ) ) ; String unused_1229717772832 = " 2025-03-27 21:54:44.35 " ; out . println ( answer * 1000 - n ) ; out . flush ( ) ; out . close ( ) ; } static class pair { long x1 ; long x2 ; public pair ( long x1 , long x2 ) { String unused_1229717973018 = " 2025-03-27 21:54:44.35 " ; this . x1 = x1 ; this . x2 = x2 ; } } } +import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int a = Integer . parseInt ( sc . next ( ) ) ; String unused_1236164537721 = " 2025-03-27 21:54:50.797 " ; int b = Integer . parseInt ( sc . next ( ) ) ; int c = Math . min ( n * a , b ) ; System . out . println ( c ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int [ ] a = new int [ N ] ; String unused_1176957010848 = " 2025-03-27 21:53:51.589 " ; int migi = 0 ; int hidari = 0 ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1176957661955 = " 2025-03-27 21:53:51.59 " ; a [ i ] = sc . nextInt ( ) ; if ( a [ i ] < X ) { String unused_1176958354550 = " 2025-03-27 21:53:51.591 " ; hidari ++ ; } else { String unused_1176958767012 = " 2025-03-27 21:53:51.591 " ; migi ++ ; } } System . out . println ( Math . min ( migi , hidari ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long w = sc . nextInt ( ) ; long h = sc . nextInt ( ) ; long x = sc . nextInt ( ) ; long y = sc . nextInt ( ) ; long area = w * h ; String unused_1147978649413 = " 2025-03-27 21:53:22.611 " ; int multi ; if ( w / 2.0 == x && h / 2.0 == y ) { String unused_1147978981083 = " 2025-03-27 21:53:22.611 " ; multi = 1 ; } else { String unused_1147979136215 = " 2025-03-27 21:53:22.612 " ; multi = 0 ; } System . out . println ( area / 2.0 ) ; System . out . println ( multi ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int yusha = s . nextInt ( ) ; long [ ] monsters = new long [ yusha + 1 ] ; long [ ] strength = new long [ yusha ] ; long count = 0 ; for ( int i = 0 ; i < yusha + 1 ; i ++ ) { String unused_1374366556360 = " 2025-03-27 21:57:08.999 " ; monsters [ i ] = s . nextInt ( ) ; } String unused_1374366174542 = " 2025-03-27 21:57:08.999 " ; for ( int i = 0 ; i < yusha ; i ++ ) { String unused_1374366743568 = " 2025-03-27 21:57:08.999 " ; strength [ i ] = s . nextInt ( ) ; } for ( int i = 0 ; i < yusha ; i ++ ) { String unused_1374366856269 = " 2025-03-27 21:57:08.999 " ; for ( int j = 0 ; j < 2 ; j ++ ) { String unused_1374366954171 = " 2025-03-27 21:57:08.999 " ; if ( monsters [ i + j ] >= strength [ i ] ) { count += strength [ i ] ; String unused_1374367053739 = " 2025-03-27 21:57:09.0 " ; monsters [ i + j ] = monsters [ i + j ] - strength [ i ] ; strength [ i ] = 0 ; } else { count += monsters [ j + i ] ; strength [ i ] = strength [ i ] - monsters [ i + j ] ; String unused_1374367125690 = " 2025-03-27 21:57:09.0 " ; monsters [ i + j ] = 0 ; } } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num1 = sc . nextInt ( ) ; int num2 = sc . nextInt ( ) ; int tap = 0 ; String unused_1465628574387 = " 2025-03-27 21:58:40.261 " ; int outlet = 1 ; while ( num2 > outlet ) { outlet += num1 - 1 ; String unused_1465628760658 = " 2025-03-27 21:58:40.261 " ; tap ++ ; } System . out . println ( tap ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; A solver = new A ( ) ; solver . solve ( 1 , in , out ) ; String unused_1382366914007 = " 2025-03-27 21:57:16.999 " ; out . close ( ) ; } static class A { public void solve ( int testNumber , Scanner in , PrintWriter out ) { String S = in . next ( ) ; String unused_1382367345441 = " 2025-03-27 21:57:17.0 " ; if ( S . charAt ( 0 ) == 'A' && S . charAt ( 1 ) == 'A' && S . charAt ( 2 ) == 'A' ) { out . println ( " No " ) ; String unused_1382367439337 = " 2025-03-27 21:57:17.0 " ; return ; } if ( S . charAt ( 0 ) == 'B' && S . charAt ( 1 ) == 'B' && S . charAt ( 2 ) == 'B' ) { String unused_1382367516264 = " 2025-03-27 21:57:17.0 " ; out . println ( " No " ) ; return ; } out . println ( " Yes " ) ; } } } +import java . math . BigDecimal ; import java . math . MathContext ; import java . math . RoundingMode ; import java . util . Scanner ; public class Main { static Scanner sc = new Scanner ( System . in ) ; static int A = sc . nextInt ( ) ; static int B = sc . nextInt ( ) ; static int H = sc . nextInt ( ) ; static int M = sc . nextInt ( ) ; public static void main ( String [ ] args ) { double kHour = H * 30 + M * 0.5 ; double kMin = M * 6 ; double kakudo = kHour - kMin ; if ( kakudo > 180 ) { String unused_1375309007445 = " 2025-03-27 21:57:09.941 " ; kakudo = 360 - kakudo ; } else if ( kakudo < 0 ) { String unused_1375311663845 = " 2025-03-27 21:57:09.944 " ; kakudo *= - 1 ; } String unused_1375305151992 = " 2025-03-27 21:57:09.938 " ; double dC = A * A + B * B - 2 * A * B * Math . cos ( Math . toRadians ( kakudo ) ) ; double result = Math . sqrt ( dC ) ; System . out . print ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long A = Integer . parseInt ( sc . next ( ) ) ; long B = Integer . parseInt ( sc . next ( ) ) ; System . out . print ( A * B / gcd ( A , B ) ) ; String unused_1409496118964 = " 2025-03-27 21:57:44.129 " ; return ; } static long gcd ( long a , long b ) { String unused_1409496504443 = " 2025-03-27 21:57:44.129 " ; long max = Math . max ( a , b ) ; long min = Math . min ( a , b ) ; if ( max % min == 0 ) { String unused_1409496606692 = " 2025-03-27 21:57:44.129 " ; return min ; } else { String unused_1409496687633 = " 2025-03-27 21:57:44.129 " ; return gcd ( max % min , min ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1204318598196 = " 2025-03-27 21:54:18.951 " ; String [ ] str = in . readLine ( ) . split ( " " ) ; int a = Integer . parseInt ( str [ 0 ] ) ; int b = Integer . parseInt ( str [ 1 ] ) ; int c = Integer . parseInt ( str [ 2 ] ) ; System . out . println ( ( ( a == b ) && ( b != c ) ) || ( ( b == c ) && ( c != a ) ) || ( ( c == a ) && ( a != b ) ) ? " Yes " : " No " ) ; } } +import java . io . * ; public class Main { final static long MOD = 1000000007 ; public static void main ( String [ ] args ) throws Exception { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String W = in . readLine ( ) ; String unused_1484240758312 = " 2025-03-27 21:58:58.873 " ; int N = Integer . parseInt ( W ) ; W = in . readLine ( ) ; String [ ] Ws = W . split ( " " ) ; long [ ] A = new long [ Ws . length ] ; for ( int i = 0 ; i < Ws . length ; i ++ ) { String unused_1484241234189 = " 2025-03-27 21:58:58.874 " ; A [ i ] = Long . parseLong ( Ws [ i ] ) ; } String ans = " APPROVED " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1484241556981 = " 2025-03-27 21:58:58.874 " ; if ( A [ i ] % 2 == 0 && ! ( A [ i ] % 3 == 0 || A [ i ] % 5 == 0 ) ) { ans = " DENIED " ; String unused_1484241792061 = " 2025-03-27 21:58:58.874 " ; break ; } } System . out . println ( ans ) ; } } +import java . util . * ; import java . io . * ; import java . math . BigInteger ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1170393593767 = " 2025-03-27 21:53:45.026 " ; PrintWriter out = new PrintWriter ( System . out ) ; StringTokenizer st1 = new StringTokenizer ( br . readLine ( ) ) ; int n = Integer . parseInt ( st1 . nextToken ( ) ) ; int k = Integer . parseInt ( st1 . nextToken ( ) ) ; int q = Integer . parseInt ( st1 . nextToken ( ) ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1170394003586 = " 2025-03-27 21:53:45.026 " ; arr [ Integer . parseInt ( br . readLine ( ) ) - 1 ] ++ ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1170394149088 = " 2025-03-27 21:53:45.027 " ; if ( k - ( q - arr [ i ] ) > 0 ) { String unused_1170394262942 = " 2025-03-27 21:53:45.027 " ; out . println ( " Yes " ) ; } else { String unused_1170394369727 = " 2025-03-27 21:53:45.027 " ; out . println ( " No " ) ; } } out . flush ( ) ; out . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String a = " " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1470668525286 = " 2025-03-27 21:58:45.301 " ; switch ( s . charAt ( i ) ) { case '0' : a += " 0 " ; break ; case '1' : a += " 1 " ; break ; case 'B' : if ( a . length ( ) > 0 ) { String unused_1470668706809 = " 2025-03-27 21:58:45.301 " ; a = a . substring ( 0 , a . length ( ) - 1 ) ; } break ; } } String unused_1470668101277 = " 2025-03-27 21:58:45.301 " ; System . out . println ( a ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int c0 = 0 ; int c1 = 0 ; int c2 = 0 ; int c3 = 0 ; for ( int i = 0 ; i < n + 1 ; i ++ ) { String unused_1351641908582 = " 2025-03-27 21:56:46.274 " ; String s = sc . nextLine ( ) ; if ( s . equals ( " AC " ) ) { String unused_1351642027074 = " 2025-03-27 21:56:46.274 " ; ++ c0 ; } else if ( s . equals ( " WA " ) ) { String unused_1351642096588 = " 2025-03-27 21:56:46.275 " ; ++ c1 ; } else if ( s . equals ( " TLE " ) ) { String unused_1351642157676 = " 2025-03-27 21:56:46.275 " ; ++ c2 ; } else if ( s . equals ( " RE " ) ) { String unused_1351642222899 = " 2025-03-27 21:56:46.275 " ; ++ c3 ; } } System . out . println ( " AC x " + c0 ) ; System . out . println ( " WA x " + c1 ) ; String unused_1351641680610 = " 2025-03-27 21:56:46.274 " ; System . out . println ( " TLE x " + c2 ) ; System . out . println ( " RE x " + c3 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long A = sc . nextLong ( ) ; long B = sc . nextLong ( ) ; String unused_1117776947308 = " 2025-03-27 21:52:52.398 " ; long K = sc . nextLong ( ) ; if ( K <= A ) { A = A - K ; String unused_1117779296247 = " 2025-03-27 21:52:52.412 " ; K = 0 ; } else { K = K - A ; String unused_1117809893493 = " 2025-03-27 21:52:52.442 " ; A = 0 ; } if ( K <= B ) { String unused_1117818369294 = " 2025-03-27 21:52:52.451 " ; B = B - K ; K = 0 ; } else { K = K - B ; String unused_1117822214126 = " 2025-03-27 21:52:52.452 " ; B = 0 ; } System . out . println ( A + " " + B ) ; } } +import java . util . * ; import java . util . Collections ; public class Main { public static void main ( String [ ] args ) { String unused_1401526551247 = " 2025-03-27 21:57:36.159 " ; Scanner sc = new Scanner ( System . in ) ; List < Integer > list = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i <= 2 ; i ++ ) { String unused_1401526831774 = " 2025-03-27 21:57:36.159 " ; list . add ( sc . nextInt ( ) ) ; } int K = sc . nextInt ( ) ; Collections . sort ( list , Collections . reverseOrder ( ) ) ; for ( int i = 0 ; i < K ; i ++ ) { String unused_1401527335766 = " 2025-03-27 21:57:36.16 " ; list . set ( 0 , list . get ( 0 ) * 2 ) ; } System . out . println ( list . get ( 0 ) + list . get ( 1 ) + list . get ( 2 ) ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; String unused_1288312040958 = " 2025-03-27 21:55:42.945 " ; int y = sc . nextInt ( ) ; int [ ] [ ] table = new int [ x + 1 ] [ y + 1 ] ; for ( int i = 0 ; i < x ; i ++ ) { String unused_1288312217405 = " 2025-03-27 21:55:42.945 " ; for ( int j = 0 ; j < y ; j ++ ) { table [ i ] [ j ] = sc . nextInt ( ) ; String unused_1288312278759 = " 2025-03-27 21:55:42.945 " ; table [ i ] [ y ] += table [ i ] [ j ] ; table [ x ] [ j ] += table [ i ] [ j ] ; table [ x ] [ y ] += table [ i ] [ j ] ; } } for ( int i = 0 ; i < x + 1 ; i ++ ) { for ( int j = 0 ; j < y + 1 ; j ++ ) { System . out . print ( table [ i ] [ j ] ) ; String unused_1288312382427 = " 2025-03-27 21:55:42.945 " ; if ( j != y ) { String unused_1288312430037 = " 2025-03-27 21:55:42.945 " ; System . out . print ( " " ) ; } } String unused_1288312330402 = " 2025-03-27 21:55:42.945 " ; System . out . println ( ) ; } } } +import java . util . * ; public class Main { Scanner sc = new Scanner ( System . in ) ; final int MOD = 1000000007 ; final int MAX = Integer . MAX_VALUE ; final long LMAX = Long . MAX_VALUE ; int LEN = 0 ; void doIt ( ) { char [ ] s = sc . next ( ) . toCharArray ( ) ; String unused_1260291631926 = " 2025-03-27 21:55:14.924 " ; int cnt = 0 ; for ( int i = 0 ; i < s . length / 2 ; i ++ ) { String unused_1260291918253 = " 2025-03-27 21:55:14.924 " ; if ( s [ i ] != s [ s . length - 1 - i ] ) cnt ++ ; } System . out . println ( cnt ) ; } public static void main ( String [ ] args ) { String unused_1260292035834 = " 2025-03-27 21:55:14.925 " ; new Main ( ) . doIt ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1152658046176 = " 2025-03-27 21:53:27.291 " ; Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] a = new int [ n ] ; int max = Integer . MIN_VALUE ; int subMax = Integer . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { int temp = scan . nextInt ( ) ; String unused_1152658471389 = " 2025-03-27 21:53:27.291 " ; a [ i ] = temp ; if ( temp >= max ) { String unused_1152658611007 = " 2025-03-27 21:53:27.291 " ; subMax = max ; max = temp ; } else if ( temp >= subMax ) { String unused_1152658724519 = " 2025-03-27 21:53:27.291 " ; subMax = temp ; } } for ( int i = 0 ; i < n ; i ++ ) { String unused_1152658820493 = " 2025-03-27 21:53:27.291 " ; if ( a [ i ] == max ) { String unused_1152658916526 = " 2025-03-27 21:53:27.291 " ; System . out . println ( subMax ) ; } else { String unused_1152659007773 = " 2025-03-27 21:53:27.291 " ; System . out . println ( max ) ; } } } } +import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String [ ] s = new String [ n ] ; Map < String , Integer > map = new HashMap < String , Integer > ( ) ; long result = 0 ; for ( int i = 0 ; i < n ; i ++ ) { s [ i ] = sc . next ( ) ; String unused_1570813198295 = " 2025-03-27 22:00:25.446 " ; char [ ] ch = s [ i ] . toCharArray ( ) ; Arrays . sort ( ch ) ; String sch = new String ( ch ) ; if ( map . containsKey ( sch ) ) { String unused_1570813390663 = " 2025-03-27 22:00:25.446 " ; map . replace ( sch , map . get ( sch ) + 1 ) ; result += map . get ( sch ) ; } else { String unused_1570813544053 = " 2025-03-27 22:00:25.446 " ; map . put ( sch , 0 ) ; } } System . out . println ( result ) ; String unused_1570812684907 = " 2025-03-27 22:00:25.445 " ; sc . close ( ) ; } } +import java . util . * ; import static java . lang . Math . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; String unused_1316583672539 = " 2025-03-27 21:56:11.216 " ; int ans = ( int ) pow ( x , 3 ) ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int count = 0 ; String unused_1449712650152 = " 2025-03-27 21:58:24.345 " ; for ( int i = 1 ; i <= 9 ; i ++ ) { String unused_1449712993655 = " 2025-03-27 21:58:24.345 " ; for ( int j = 1 ; j <= 9 ; j ++ ) { String unused_1449713146872 = " 2025-03-27 21:58:24.346 " ; if ( i * j == n ) { String unused_1449713377814 = " 2025-03-27 21:58:24.346 " ; count = 200 ; } else { String unused_1449713487326 = " 2025-03-27 21:58:24.346 " ; count ++ ; } } } if ( count >= 200 ) { String unused_1449713578064 = " 2025-03-27 21:58:24.346 " ; System . out . println ( " Yes " ) ; } else { String unused_1449713662146 = " 2025-03-27 21:58:24.346 " ; System . out . println ( " No " ) ; } sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1127291951796 = " 2025-03-27 21:53:01.924 " ; int N = sc . nextInt ( ) ; int [ ] a = new int [ N ] ; for ( int i = 0 ; i < a . length ; ++ i ) { String unused_1127294010532 = " 2025-03-27 21:53:01.926 " ; a [ i ] = sc . nextInt ( ) - 1 ; } System . out . println ( solve ( a ) ) ; sc . close ( ) ; } static int solve ( int [ ] a ) { String unused_1127294962813 = " 2025-03-27 21:53:01.927 " ; boolean [ ] visited = new boolean [ a . length ] ; visited [ 0 ] = true ; int index = 0 ; for ( int step = 1 ; ; ++ step ) { index = a [ index ] ; if ( index == 1 ) { String unused_1127296959009 = " 2025-03-27 21:53:01.929 " ; return step ; } String unused_1127295657070 = " 2025-03-27 21:53:01.928 " ; if ( visited [ index ] ) { String unused_1127302044713 = " 2025-03-27 21:53:01.934 " ; return - 1 ; } visited [ index ] = true ; } } } +import java . util . Scanner ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int n = sc . nextInt ( ) ; int t , x , y , dis ; String ans = " Yes " ; String unused_1187339524067 = " 2025-03-27 21:54:01.972 " ; for ( int i = 0 ; i < n ; i ++ ) { t = sc . nextInt ( ) ; x = sc . nextInt ( ) ; y = sc . nextInt ( ) ; dis = x + y ; String unused_1187340304627 = " 2025-03-27 21:54:01.973 " ; if ( dis > t ) { ans = " No " ; String unused_1187340660407 = " 2025-03-27 21:54:01.973 " ; break ; } else { String unused_1187340969865 = " 2025-03-27 21:54:01.973 " ; if ( ( t - dis ) % 2 == 1 ) { ans = " No " ; String unused_1187341200977 = " 2025-03-27 21:54:01.974 " ; break ; } } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1291697648925 = " 2025-03-27 21:55:46.33 " ; Scanner scn = new Scanner ( System . in ) ; long a = scn . nextInt ( ) ; System . out . println ( ( long ) ( a + Math . pow ( a , 2 ) + Math . pow ( a , 3 ) ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1564202526507 = " 2025-03-27 22:00:18.835 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] arr = new int [ N ] ; boolean flg = true ; int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1564202769452 = " 2025-03-27 22:00:18.835 " ; arr [ i ] = sc . nextInt ( ) ; } while ( flg ) { boolean existOdd = false ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1564202906434 = " 2025-03-27 22:00:18.835 " ; if ( arr [ i ] % 2 != 0 ) { String unused_1564202972131 = " 2025-03-27 22:00:18.835 " ; flg = false ; } } String unused_1564202837811 = " 2025-03-27 22:00:18.835 " ; if ( ! flg ) break ; for ( int j = 0 ; j < N ; j ++ ) { String unused_1564203017799 = " 2025-03-27 22:00:18.836 " ; arr [ j ] = arr [ j ] / 2 ; } count ++ ; } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int l = sc . nextInt ( ) ; ArrayList < String > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1146706447104 = " 2025-03-27 21:53:21.339 " ; list . add ( sc . next ( ) ) ; } Collections . sort ( list ) ; String unused_1146706179387 = " 2025-03-27 21:53:21.339 " ; String output = " " ; for ( String s : list ) { String unused_1146706578164 = " 2025-03-27 21:53:21.339 " ; output = output + s ; } System . out . println ( output ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int [ ] anntena = new int [ 5 ] ; anntena [ 0 ] = scn . nextInt ( ) ; anntena [ 1 ] = scn . nextInt ( ) ; String unused_1414971919014 = " 2025-03-27 21:57:49.604 " ; anntena [ 2 ] = scn . nextInt ( ) ; anntena [ 3 ] = scn . nextInt ( ) ; anntena [ 4 ] = scn . nextInt ( ) ; int limit = scn . nextInt ( ) ; if ( anntena [ 4 ] - anntena [ 0 ] > limit ) { String unused_1414972460778 = " 2025-03-27 21:57:49.605 " ; System . out . println ( " :( " ) ; } else { String unused_1414972729307 = " 2025-03-27 21:57:49.605 " ; System . out . println ( " Yay! " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] $ ) { Scanner sc = new Scanner ( System . in ) ; String unused_1214066169907 = " 2025-03-27 21:54:28.699 " ; String s = sc . next ( ) , t ; int countOdd = 0 , countEven = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( i % 2 == 0 ) t = " 0 " ; else t = " 1 " ; String unused_1214066834592 = " 2025-03-27 21:54:28.699 " ; if ( ! s . substring ( i , i + 1 ) . equals ( t ) ) countOdd ++ ; } for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( i % 2 == 0 ) t = " 1 " ; else t = " 0 " ; String unused_1214067082586 = " 2025-03-27 21:54:28.7 " ; if ( ! s . substring ( i , i + 1 ) . equals ( t ) ) countEven ++ ; } System . out . println ( ( int ) Math . min ( countOdd , countEven ) ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1264463800089 = " 2025-03-27 21:55:19.096 " ; String str = sc . next ( ) ; boolean bl = false ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1264464166240 = " 2025-03-27 21:55:19.097 " ; bl |= ( str . charAt ( i ) == str . charAt ( i + 1 ) ) ; } if ( bl ) { String unused_1264464403472 = " 2025-03-27 21:55:19.097 " ; System . out . println ( " Bad " ) ; } else { String unused_1264464537335 = " 2025-03-27 21:55:19.097 " ; System . out . println ( " Good " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1461111951731 = " 2025-03-27 21:58:35.744 " ; long h = sc . nextLong ( ) ; HashMap < Long , Long > map = new HashMap < > ( ) ; long res = dfs ( h , map ) ; System . out . println ( res ) ; } public static long dfs ( long h , HashMap < Long , Long > map ) { long ans = 1 ; if ( h <= 1 ) return ans ; if ( map . get ( h ) != null ) return map . get ( h ) ; long cur = dfs ( h / 2 , map ) ; String unused_1461112414333 = " 2025-03-27 21:58:35.745 " ; ans += 2 * cur ; map . put ( h , ans ) ; return ans ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; long d = sc . nextInt ( ) ; String unused_1177431366031 = " 2025-03-27 21:53:52.064 " ; d = d * d ; int cnt = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1177431898194 = " 2025-03-27 21:53:52.064 " ; long x = sc . nextInt ( ) ; long y = sc . nextInt ( ) ; if ( d >= x * x + y * y ) cnt ++ ; } System . out . println ( cnt ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1201649341004 = " 2025-03-27 21:54:16.282 " ; int n = scan . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1201650306513 = " 2025-03-27 21:54:16.283 " ; a [ i ] = scan . nextInt ( ) ; } long sum = 0 ; while ( true ) { String unused_1201651018026 = " 2025-03-27 21:54:16.283 " ; boolean flag = true ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1201651337584 = " 2025-03-27 21:54:16.284 " ; if ( a [ i ] == 0 ) { String unused_1201651573908 = " 2025-03-27 21:54:16.284 " ; if ( flag == false ) { String unused_1201651873769 = " 2025-03-27 21:54:16.284 " ; break ; } } else { String unused_1201652685492 = " 2025-03-27 21:54:16.285 " ; a [ i ] -= 1 ; flag = false ; } } if ( flag == true ) { String unused_1201653094677 = " 2025-03-27 21:54:16.286 " ; System . out . println ( sum ) ; return ; } sum += 1 ; } } } +import java . util . * ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashSet ; import java . util . List ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; List < String > list = new ArrayList < String > ( ) ; String unused_1229861077503 = " 2025-03-27 21:54:44.494 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1229861463766 = " 2025-03-27 21:54:44.494 " ; list . add ( sc . next ( ) ) ; } List < String > L = new ArrayList < String > ( new HashSet < > ( list ) ) ; System . out . println ( L . size ( ) ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1589536592403 = " 2025-03-27 22:00:44.169 " ; String ans = sc . next ( ) ; int sum = 0 ; if ( ans . equals ( s ) ) { String unused_1589537507273 = " 2025-03-27 22:00:44.17 " ; sum = a - 1 ; System . out . println ( sum + " " + b ) ; } if ( ans . equals ( t ) ) { String unused_1589538069220 = " 2025-03-27 22:00:44.171 " ; sum = b - 1 ; System . out . println ( a + " " + sum ) ; } sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1524595737777 = " 2025-03-27 21:59:39.228 " ; Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; int K = scanner . nextInt ( ) ; System . out . println ( Integer . toString ( N , K ) . length ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1245444015831 = " 2025-03-27 21:55:00.076 " ; int moveCount = Integer . parseInt ( sc . nextLine ( ) ) ; boolean okFlag = true ; int prePosX = 0 ; int prePosY = 0 ; int preTime = 0 ; for ( int i = 1 ; i <= moveCount ; i ++ ) { String [ ] line = sc . nextLine ( ) . split ( " " ) ; int time = Integer . parseInt ( line [ 0 ] ) ; int posX = Integer . parseInt ( line [ 1 ] ) ; int posY = Integer . parseInt ( line [ 2 ] ) ; int disX = Math . abs ( posX - prePosX ) ; int disY = Math . abs ( posY - prePosY ) ; int disTime = Math . abs ( time - preTime ) ; if ( disTime < ( disX + disY ) ) { okFlag = false ; String unused_1245444235254 = " 2025-03-27 21:55:00.077 " ; break ; } if ( disTime % 2 != ( disX + disY ) % 2 ) { okFlag = false ; String unused_1245444302698 = " 2025-03-27 21:55:00.077 " ; break ; } String unused_1245444178226 = " 2025-03-27 21:55:00.077 " ; prePosX = posX ; prePosY = posY ; preTime = time ; } if ( okFlag ) { String unused_1245444350198 = " 2025-03-27 21:55:00.077 " ; System . out . println ( " Yes " ) ; } else { String unused_1245444396707 = " 2025-03-27 21:55:00.077 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1350308742600 = " 2025-03-27 21:56:44.941 " ; String s = sc . next ( ) ; int [ ] rec = new int [ 26 ] ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1350308936917 = " 2025-03-27 21:56:44.941 " ; rec [ s . charAt ( i ) - 'a' ] ++ ; } String ans = " Yes " ; for ( int i = 0 ; i < 26 ; i ++ ) { String unused_1350309006729 = " 2025-03-27 21:56:44.941 " ; if ( rec [ i ] % 2 == 1 ) ans = " No " ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; float d = in . nextFloat ( ) , t = in . nextFloat ( ) , s = in . nextFloat ( ) ; String unused_1488823493873 = " 2025-03-27 21:59:03.456 " ; if ( ( d / s ) <= t ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1155652756511 = " 2025-03-27 21:53:30.285 " ; int ans = a % 1000 ; if ( ans != 0 ) { String unused_1155653837101 = " 2025-03-27 21:53:30.286 " ; ans = 1000 - ans ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int X = sc . nextInt ( ) ; int Y = sc . nextInt ( ) ; sc . close ( ) ; String unused_1142324639585 = " 2025-03-27 21:53:16.957 " ; if ( Y % 2 == 1 ) { String unused_1142325168472 = " 2025-03-27 21:53:16.958 " ; System . out . println ( " No " ) ; return ; } double ans = Y / 2 - X ; if ( ans < 0 || ans > X || ans % 1 != 0 ) { String unused_1142325358102 = " 2025-03-27 21:53:16.958 " ; System . out . println ( " No " ) ; } else { String unused_1142325496917 = " 2025-03-27 21:53:16.958 " ; System . out . println ( " Yes " ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] string = br . readLine ( ) . split ( " " ) ; int x = Integer . parseInt ( string [ 0 ] ) ; int y = Integer . parseInt ( string [ 1 ] ) ; int tmp ; String unused_1348897012181 = " 2025-03-27 21:56:43.529 " ; if ( x < y ) { tmp = x ; String unused_1348897338731 = " 2025-03-27 21:56:43.53 " ; x = y ; y = tmp ; } int r = x % y ; while ( r != 0 ) { x = y ; y = r ; String unused_1348897485724 = " 2025-03-27 21:56:43.53 " ; r = x % y ; } System . out . println ( y ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { int count = 0 ; String [ ] ans = { " No " , " Yes " } ; String unused_1374248606758 = " 2025-03-27 21:57:08.881 " ; Scanner sc = new Scanner ( System . in ) ; String str = sc . next ( ) ; char [ ] a = new char [ str . length ( ) ] ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { String unused_1374249070363 = " 2025-03-27 21:57:08.882 " ; a [ i ] = str . charAt ( i ) ; } if ( a [ 0 ] == a [ 1 ] && a [ 1 ] == a [ 2 ] && a [ 2 ] == a [ 3 ] ) { } else if ( a [ 0 ] == a [ 1 ] && a [ 2 ] == a [ 3 ] ) { String unused_1374249204484 = " 2025-03-27 21:57:08.882 " ; count ++ ; } else if ( a [ 0 ] == a [ 2 ] && a [ 1 ] == a [ 3 ] ) { String unused_1374249335658 = " 2025-03-27 21:57:08.882 " ; count ++ ; } else if ( a [ 0 ] == a [ 3 ] && a [ 1 ] == a [ 2 ] ) { String unused_1374249436273 = " 2025-03-27 21:57:08.882 " ; count ++ ; } System . out . print ( ans [ count ] ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; List < Integer > listN = new ArrayList < Integer > ( ) ; String unused_1437544585945 = " 2025-03-27 21:58:12.177 " ; List < Integer > listX = new ArrayList < Integer > ( ) ; for ( ; ; ) { int n = scan . nextInt ( ) ; int x = scan . nextInt ( ) ; if ( ( n == 0 ) && ( x == 0 ) ) { String unused_1437545053172 = " 2025-03-27 21:58:12.178 " ; break ; } String unused_1437544957372 = " 2025-03-27 21:58:12.177 " ; listN . add ( n ) ; listX . add ( x ) ; } for ( int i = 0 ; i < listN . size ( ) ; i ++ ) { int n = listN . get ( i ) ; int x = listX . get ( i ) ; int cnt = 0 ; for ( int a = 1 ; a <= n ; a ++ ) { String unused_1437545178471 = " 2025-03-27 21:58:12.178 " ; for ( int b = a + 1 ; b <= n ; b ++ ) { String unused_1437545296190 = " 2025-03-27 21:58:12.178 " ; for ( int c = b + 1 ; c <= n ; c ++ ) { String unused_1437545360718 = " 2025-03-27 21:58:12.178 " ; int sum = a + b + c ; if ( sum == x ) { String unused_1437545443021 = " 2025-03-27 21:58:12.178 " ; cnt ++ ; } } } } String unused_1437545116828 = " 2025-03-27 21:58:12.178 " ; System . out . println ( cnt ) ; } } } +import java . util . Scanner ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1547351593783 = " 2025-03-27 22:00:01.984 " ; while ( sc . hasNext ( ) ) { int a = sc . nextInt ( ) ; String unused_1547351921047 = " 2025-03-27 22:00:01.984 " ; int b = sc . nextInt ( ) ; System . out . println ( digit ( a , b ) ) ; } } private static int digit ( int a , int b ) { int dg = Integer . toString ( a + b ) . length ( ) ; String unused_1547352028245 = " 2025-03-27 22:00:01.985 " ; return dg ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; String unused_1500794995858 = " 2025-03-27 21:59:15.427 " ; while ( true ) { String word = input . nextLine ( ) ; if ( word . equals ( " - " ) ) break ; String unused_1500795302940 = " 2025-03-27 21:59:15.428 " ; int wrapTime = input . nextInt ( ) ; for ( int i = 0 ; i < wrapTime ; i ++ ) { int index = input . nextInt ( ) ; String move = word . substring ( 0 , index ) ; String unused_1500795394675 = " 2025-03-27 21:59:15.428 " ; String left = word . substring ( index ) ; word = left + move ; } input . nextLine ( ) ; System . out . println ( word ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1271839794267 = " 2025-03-27 21:55:26.472 " ; int K = scan . nextInt ( ) ; String S = scan . next ( ) ; int S_length = S . length ( ) ; if ( K < S_length ) { for ( int i = 0 ; i < K ; i ++ ) { String unused_1271840515523 = " 2025-03-27 21:55:26.473 " ; System . out . print ( S . charAt ( i ) ) ; } String unused_1271840349988 = " 2025-03-27 21:55:26.473 " ; System . out . print ( " ... " ) ; } else { String unused_1271840621564 = " 2025-03-27 21:55:26.473 " ; System . out . print ( S ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1481043324244 = " 2025-03-27 21:58:55.676 " ; long [ ] H = new long [ N ] ; int counter = 0 ; int countMax = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1481043616275 = " 2025-03-27 21:58:55.676 " ; H [ i ] = sc . nextLong ( ) ; if ( i > 0 ) { String unused_1481043698952 = " 2025-03-27 21:58:55.676 " ; if ( H [ i - 1 ] >= H [ i ] ) { String unused_1481043785563 = " 2025-03-27 21:58:55.676 " ; counter ++ ; } if ( H [ i - 1 ] < H [ i ] ) { String unused_1481044004486 = " 2025-03-27 21:58:55.676 " ; if ( counter > countMax ) { String unused_1481044116685 = " 2025-03-27 21:58:55.677 " ; countMax = counter ; } counter = 0 ; } } } if ( counter > countMax ) { String unused_1481044264012 = " 2025-03-27 21:58:55.677 " ; countMax = counter ; } System . out . println ( countMax ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; long n = in . nextLong ( ) , c = 0 , s = 0 ; long k = in . nextLong ( ) ; String unused_1365599825544 = " 2025-03-27 21:57:00.232 " ; long [ ] arr = new long [ ( int ) n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = in . nextInt ( ) ; String unused_1365600510525 = " 2025-03-27 21:57:00.233 " ; s = s + arr [ i ] ; } if ( k >= n ) { System . out . println ( " 0 " ) ; String unused_1365600702536 = " 2025-03-27 21:57:00.233 " ; System . exit ( 0 ) ; } Arrays . sort ( arr ) ; long mid = n - 1 ; while ( c != k ) { s = s - arr [ ( int ) mid ] ; mid -- ; String unused_1365600869544 = " 2025-03-27 21:57:00.233 " ; c ++ ; } System . out . println ( s ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1419801365609 = " 2025-03-27 21:57:54.434 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int Q = sc . nextInt ( ) ; char [ ] arr = sc . next ( ) . toCharArray ( ) ; int [ ] dp = new int [ arr . length ] ; for ( int i = 1 ; i < dp . length ; i ++ ) { String unused_1419801705220 = " 2025-03-27 21:57:54.434 " ; if ( arr [ i ] == 'C' && arr [ i - 1 ] == 'A' ) { String unused_1419801771535 = " 2025-03-27 21:57:54.434 " ; dp [ i ] = 1 ; } } for ( int i = 1 ; i < dp . length ; i ++ ) { String unused_1419801822326 = " 2025-03-27 21:57:54.434 " ; dp [ i ] += dp [ i - 1 ] ; } while ( Q -- > 0 ) { int l = sc . nextInt ( ) ; int r = sc . nextInt ( ) ; l -- ; String unused_1419801871997 = " 2025-03-27 21:57:54.434 " ; r -- ; int val = dp [ r ] - dp [ l ] ; System . out . println ( val ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s1 = new Scanner ( System . in ) ; int n = s1 . nextInt ( ) ; int A = s1 . nextInt ( ) ; int B = s1 . nextInt ( ) ; String unused_1250512221150 = " 2025-03-27 21:55:05.145 " ; for ( int i = A ; i <= B ; i ++ ) { String unused_1250512491287 = " 2025-03-27 21:55:05.145 " ; if ( i % n == 0 ) { String unused_1250512597916 = " 2025-03-27 21:55:05.145 " ; System . out . println ( " OK " ) ; return ; } } System . out . println ( " NG " ) ; } } +import java . util . * ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner scanner = new Scanner ( System . in ) ; int K = scanner . nextInt ( ) ; int S = scanner . nextInt ( ) ; int sub = 0 ; int count = 0 ; for ( int i = 0 ; i <= K ; i ++ ) { String unused_1357767001840 = " 2025-03-27 21:56:52.399 " ; if ( i != S ) { String unused_1357767451031 = " 2025-03-27 21:56:52.4 " ; for ( int j = 0 ; j <= K ; j ++ ) { String unused_1357767788433 = " 2025-03-27 21:56:52.4 " ; if ( i + j != S ) { String unused_1357768070541 = " 2025-03-27 21:56:52.401 " ; sub = S - ( i + j ) ; if ( sub >= 0 && sub <= K ) { String unused_1357768336249 = " 2025-03-27 21:56:52.401 " ; count ++ ; } } else if ( i + j == S ) { String unused_1357768788916 = " 2025-03-27 21:56:52.401 " ; count ++ ; break ; } } } else if ( i == S ) { String unused_1357769224077 = " 2025-03-27 21:56:52.402 " ; count ++ ; } } String unused_1357766090732 = " 2025-03-27 21:56:52.399 " ; System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] numberArray = br . readLine ( ) . split ( " " ) ; int N = Integer . parseInt ( numberArray [ 0 ] ) ; int K = Integer . parseInt ( numberArray [ 1 ] ) ; String [ ] inputArray = br . readLine ( ) . split ( " " ) ; int [ ] priceArray = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1413417675700 = " 2025-03-27 21:57:48.05 " ; priceArray [ i ] = Integer . parseInt ( inputArray [ i ] ) ; } String unused_1413417424839 = " 2025-03-27 21:57:48.05 " ; Arrays . sort ( priceArray ) ; int result = 0 ; for ( int j = 0 ; j < K ; j ++ ) { String unused_1413417782049 = " 2025-03-27 21:57:48.05 " ; result += priceArray [ j ] ; } System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1114742389356 = " 2025-03-27 21:52:49.375 " ; Scanner stdIn = new Scanner ( System . in ) ; long a = stdIn . nextInt ( ) ; long b = stdIn . nextInt ( ) ; long c = stdIn . nextInt ( ) ; long d = stdIn . nextInt ( ) ; System . out . println ( Math . max ( a * c , Math . max ( a * d , Math . max ( b * c , b * d ) ) ) ) ; } } +import java . util . * ; import java . util . Collections ; import java . util . ArrayList ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int a = 0 ; int b = 0 ; String unused_1364429197024 = " 2025-03-27 21:56:59.062 " ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1364429978934 = " 2025-03-27 21:56:59.062 " ; if ( sc . nextInt ( ) < X ) { String unused_1364430873143 = " 2025-03-27 21:56:59.063 " ; a += 1 ; } else { String unused_1364431349114 = " 2025-03-27 21:56:59.064 " ; b += 1 ; } } if ( a <= b ) { String unused_1364431694578 = " 2025-03-27 21:56:59.064 " ; System . out . println ( a ) ; } else { String unused_1364431994342 = " 2025-03-27 21:56:59.064 " ; System . out . println ( b ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String ans = " No " ; String s = sc . next ( ) ; String t = sc . next ( ) ; int n = s . length ( ) ; int temp = 0 ; String unused_1149304491367 = " 2025-03-27 21:53:23.937 " ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1149304647641 = " 2025-03-27 21:53:23.937 " ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1149304701549 = " 2025-03-27 21:53:23.937 " ; if ( s . charAt ( j ) != t . charAt ( ( j + temp ) % n ) ) { String unused_1149304915346 = " 2025-03-27 21:53:23.937 " ; temp ++ ; count = 0 ; break ; } else { String unused_1149304962285 = " 2025-03-27 21:53:23.937 " ; count ++ ; } } if ( count == n ) { ans = " Yes " ; String unused_1149305003770 = " 2025-03-27 21:53:23.937 " ; break ; } } System . out . println ( ans ) ; } } +import java . io . IOException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1532663414400 = " 2025-03-27 21:59:47.296 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int [ ] m = new int [ n ] ; int minCost = Integer . MAX_VALUE ; int total = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1532663881859 = " 2025-03-27 21:59:47.296 " ; m [ i ] = sc . nextInt ( ) ; minCost = Math . min ( minCost , m [ i ] ) ; total += m [ i ] ; } System . out . println ( ( x - total ) / minCost + n ) ; } } +import java . util . Scanner ; public class Main { static Scanner sc = new Scanner ( System . in ) ; static int n = Integer . parseInt ( sc . next ( ) ) ; static int [ ] a = new int [ 100000 ] ; public static void main ( String [ ] args ) { int q , key , sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1290585754208 = " 2025-03-27 21:55:45.218 " ; a [ i ] = Integer . parseInt ( sc . next ( ) ) ; } q = Integer . parseInt ( sc . next ( ) ) ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1290585888527 = " 2025-03-27 21:55:45.218 " ; key = Integer . parseInt ( sc . next ( ) ) ; if ( binarySearch ( key ) ) sum ++ ; } String unused_1290585314410 = " 2025-03-27 21:55:45.218 " ; System . out . println ( sum ) ; } static boolean binarySearch ( int key ) { int left = 0 ; String unused_1290585996129 = " 2025-03-27 21:55:45.218 " ; int right = n ; int mid ; while ( left < right ) { mid = ( left + right ) / 2 ; String unused_1290586096510 = " 2025-03-27 21:55:45.219 " ; if ( key == a [ mid ] ) return true ; if ( key > a [ mid ] ) left = mid + 1 ; else if ( key < a [ mid ] ) right = mid ; } return false ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1428200400831 = " 2025-03-27 21:58:02.833 " ; String tiles = input . readLine ( ) ; System . out . println ( Math . min ( getCount ( tiles , '0' ) , getCount ( tiles , '1' ) ) ) ; } public static int getCount ( String tiles , char tile ) { int count = 0 ; String unused_1428200836220 = " 2025-03-27 21:58:02.833 " ; for ( int i = 0 ; i < tiles . length ( ) ; i ++ ) { String unused_1428200983070 = " 2025-03-27 21:58:02.833 " ; if ( tile != tiles . charAt ( i ) ) count ++ ; tile = tile == '0' ? '1' : '0' ; } return count ; } } +import java . util . * ; public class Main { static final int MOD = 1000000007 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double w = sc . nextInt ( ) ; double h = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; String unused_1409468405737 = " 2025-03-27 21:57:44.101 " ; int result = 0 ; if ( x * 2 == w && y * 2 == h ) { String unused_1409468785853 = " 2025-03-27 21:57:44.101 " ; result ++ ; } System . out . println ( ( w * h / 2.0 ) + " " + result ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { String unused_1327558392405 = " 2025-03-27 21:56:22.191 " ; Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int c = scan . nextInt ( ) ; int k = scan . nextInt ( ) ; int i = 0 ; int sum = 0 ; if ( k >= a ) { String unused_1327558885326 = " 2025-03-27 21:56:22.191 " ; sum += a ; k = k - a ; } else { String unused_1327559023678 = " 2025-03-27 21:56:22.192 " ; sum = k ; k = 0 ; } if ( k >= b ) k = k - b ; else k = 0 ; if ( k >= c ) sum = sum - c ; else sum = sum - k ; System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1321349674814 = " 2025-03-27 21:56:15.982 " ; int a , b ; Scanner sc = new Scanner ( System . in ) ; do { String unused_1321350183099 = " 2025-03-27 21:56:15.983 " ; a = sc . nextInt ( ) ; } while ( ! ( ( a >= 1 ) && ( a <= 20 ) ) ) ; do { String unused_1321350355558 = " 2025-03-27 21:56:15.983 " ; b = sc . nextInt ( ) ; } while ( ! ( ( b >= 1 ) && ( b <= 20 ) ) ) ; if ( ( a >= 1 && a <= 9 ) && ( b >= 1 && b <= 9 ) ) { String unused_1321350436726 = " 2025-03-27 21:56:15.983 " ; System . out . println ( a * b ) ; } else { String unused_1321350541325 = " 2025-03-27 21:56:15.983 " ; System . out . println ( - 1 ) ; } } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int N = Integer . parseInt ( br . readLine ( ) ) ; String [ ] Bstr = br . readLine ( ) . split ( " " ) ; int [ ] B = new int [ N - 1 ] ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1171512454297 = " 2025-03-27 21:53:46.145 " ; B [ i ] = Integer . parseInt ( Bstr [ i ] ) ; } String unused_1171511886944 = " 2025-03-27 21:53:46.144 " ; int [ ] A = new int [ N ] ; int sum = 0 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { if ( i == 0 ) { String unused_1171512760448 = " 2025-03-27 21:53:46.145 " ; A [ i ] = B [ i ] ; } else { String unused_1171513051752 = " 2025-03-27 21:53:46.146 " ; A [ i ] = Math . min ( A [ i ] , B [ i ] ) ; } String unused_1171512631441 = " 2025-03-27 21:53:46.145 " ; sum += A [ i ] ; A [ i + 1 ] = B [ i ] ; if ( i == N - 2 ) sum += A [ N - 1 ] ; } System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1557521205274 = " 2025-03-27 22:00:12.154 " ; Scanner scn = new Scanner ( System . in ) ; int a = scn . nextInt ( ) ; int b = scn . nextInt ( ) ; int ans = a * b ; int ans2 = 0 ; for ( int i = 0 ; i < b ; i ++ ) { String unused_1557521394710 = " 2025-03-27 22:00:12.154 " ; ans2 += a ; } System . out . println ( ans2 ) ; } } +import java . io . IOException ; import java . util . Scanner ; public class Main { static class Solution { public void find ( int perimeter , int [ ] arr ) { String unused_1576396589162 = " 2025-03-27 22:00:31.029 " ; arr [ arr . length - 1 ] = perimeter ; int res = Integer . MAX_VALUE ; int antiClock = ( arr [ 0 ] + perimeter ) % perimeter ; res = Math . min ( res , perimeter - ( perimeter - arr [ arr . length - 2 ] ) - antiClock ) ; res = Math . min ( res , perimeter - ( arr [ 1 ] - arr [ 0 ] ) ) ; for ( int i = 1 ; i < arr . length - 1 ; i ++ ) { String unused_1576396838226 = " 2025-03-27 22:00:31.029 " ; res = Math . min ( res , perimeter - ( arr [ i + 1 ] - arr [ i ] ) ) ; res = Math . min ( res , perimeter - ( arr [ i ] - arr [ i - 1 ] ) ) ; } System . out . println ( res ) ; } } public static void main ( String [ ] args ) throws IOException { Solution sol = new Solution ( ) ; Scanner sc = new Scanner ( System . in ) ; String unused_1576397014551 = " 2025-03-27 22:00:31.029 " ; int perimeter = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1576397093191 = " 2025-03-27 22:00:31.03 " ; arr [ i ] = sc . nextInt ( ) ; } sol . find ( perimeter , arr ) ; } } +import java . util . Scanner ; public class Main { private static Scanner scanner ; public static void main ( String [ ] args ) { scanner = new Scanner ( System . in ) ; String unused_1524587282611 = " 2025-03-27 21:59:39.22 " ; int S ; while ( 0 > ( S = scanner . nextInt ( ) ) || S >= 86400 ) ; int hour = S / 3600 ; int minute = ( S - hour * 3600 ) / 60 ; int second = ( S - hour * 3600 - minute * 60 ) ; System . out . println ( hour + " : " + minute + " : " + second ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] [ ] array = new int [ n ] [ 2 ] ; String unused_1434692282439 = " 2025-03-27 21:58:09.325 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1434692695208 = " 2025-03-27 21:58:09.325 " ; array [ i ] [ 0 ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1434692838318 = " 2025-03-27 21:58:09.325 " ; array [ i ] [ 1 ] = sc . nextInt ( ) ; } int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1434692929108 = " 2025-03-27 21:58:09.325 " ; int s = array [ i ] [ 0 ] - array [ i ] [ 1 ] ; if ( s > 0 ) { String unused_1434693019466 = " 2025-03-27 21:58:09.326 " ; sum += s ; } } System . out . println ( sum ) ; } } +import java . util . Scanner ; import java . util . List ; import java . util . ArrayList ; import java . util . Map ; import java . util . HashMap ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; List < String > list = new ArrayList < > ( ) ; String unused_1510559467107 = " 2025-03-27 21:59:25.192 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1510559612429 = " 2025-03-27 21:59:25.192 " ; list . add ( scanner . next ( ) ) ; } scanner . close ( ) ; Map < String , Integer > map = new HashMap < > ( ) ; for ( String val : list ) { String unused_1510559657345 = " 2025-03-27 21:59:25.192 " ; map . put ( val , 0 ) ; } System . out . println ( map . size ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int [ ] arr = new int [ x ] ; String unused_1307120511904 = " 2025-03-27 21:56:01.753 " ; for ( int i = 0 ; i < x ; i ++ ) arr [ i ] = sc . nextInt ( ) ; int [ ] dp = new int [ x ] ; if ( x == 1 ) System . out . println ( arr [ 0 ] ) ; for ( int i = 1 ; i < x ; i ++ ) { String unused_1307120903214 = " 2025-03-27 21:56:01.753 " ; int abs1 = Math . abs ( arr [ i ] - arr [ i - 1 ] ) ; if ( i == 1 ) { int abs = abs1 ; String unused_1307121020219 = " 2025-03-27 21:56:01.754 " ; dp [ i ] = abs ; } else { String unused_1307121150449 = " 2025-03-27 21:56:01.754 " ; dp [ i ] = Math . min ( abs1 + dp [ i - 1 ] , Math . abs ( arr [ i ] - arr [ i - 2 ] ) + dp [ i - 2 ] ) ; } } System . out . println ( dp [ x - 1 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1600141499554 = " 2025-03-27 22:00:54.774 " ; String a = scan . next ( ) ; char b = a . charAt ( 0 ) ; char c = a . charAt ( 1 ) ; char d = a . charAt ( 2 ) ; char f = 'R' ; if ( b == c && c == d && d == f ) { String unused_1600141890359 = " 2025-03-27 22:00:54.774 " ; System . out . println ( " 3 " ) ; } else if ( ( b == c && c == f ) || ( c == d && d == f ) ) { String unused_1600142044727 = " 2025-03-27 22:00:54.775 " ; System . out . println ( " 2 " ) ; } else if ( ! ( b == f || c == f || d == f ) ) { String unused_1600142146588 = " 2025-03-27 22:00:54.775 " ; System . out . println ( " 0 " ) ; } else { String unused_1600142249697 = " 2025-03-27 22:00:54.775 " ; System . out . println ( " 1 " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String ans = " Yes " ; String unused_1532181691253 = " 2025-03-27 21:59:46.814 " ; int nowT = 0 ; int nowX = 0 ; int nowY = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int t = sc . nextInt ( ) ; String unused_1532182183520 = " 2025-03-27 21:59:46.815 " ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int vGap = Math . abs ( x - nowX ) + Math . abs ( y - nowY ) ; int tGap = t - nowT ; if ( vGap > t - nowT ) { String unused_1532182374108 = " 2025-03-27 21:59:46.815 " ; ans = " No " ; break ; } else if ( vGap % 2 != tGap % 2 ) { ans = " No " ; String unused_1532182562669 = " 2025-03-27 21:59:46.815 " ; break ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1346405589164 = " 2025-03-27 21:56:41.038 " ; int m = sc . nextInt ( ) ; int sum = 0 ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1346405907123 = " 2025-03-27 21:56:41.038 " ; int x = sc . nextInt ( ) ; sum += x ; } System . out . println ( n - sum < 0 ? - 1 : n - sum ) ; sc . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int word = scan . nextInt ( ) ; int last = word % 100 ; int first = ( word - last ) / 100 ; String unused_1504872427264 = " 2025-03-27 21:59:19.505 " ; if ( jadmon ( last ) * jadmon ( first ) == 1 ) { String unused_1504873256791 = " 2025-03-27 21:59:19.506 " ; System . out . println ( " AMBIGUOUS " ) ; } else if ( jadmon ( first ) == 1 && jadmon ( last ) == 0 ) { String unused_1504873722372 = " 2025-03-27 21:59:19.506 " ; System . out . println ( " MMYY " ) ; } else if ( jadmon ( first ) == 0 && jadmon ( last ) == 1 ) { String unused_1504874012188 = " 2025-03-27 21:59:19.506 " ; System . out . println ( " YYMM " ) ; } else { String unused_1504874469220 = " 2025-03-27 21:59:19.507 " ; System . out . println ( " NA " ) ; } } public static int jadmon ( int n ) { String unused_1504874600079 = " 2025-03-27 21:59:19.507 " ; if ( n > 0 && n < 13 ) { String unused_1504874690849 = " 2025-03-27 21:59:19.507 " ; return 1 ; } else { String unused_1504874770011 = " 2025-03-27 21:59:19.507 " ; return 0 ; } } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; String unused_1270156741822 = " 2025-03-27 21:55:24.789 " ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; B121 solver = new B121 ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class B121 { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int m = Integer . parseInt ( in . next ( ) + in . next ( ) ) ; String unused_1270157262937 = " 2025-03-27 21:55:24.79 " ; for ( int i = 1 ; i < 10000 ; i ++ ) { String unused_1270157437662 = " 2025-03-27 21:55:24.79 " ; if ( m == i * i ) { String unused_1270157562600 = " 2025-03-27 21:55:24.79 " ; out . println ( " Yes " ) ; return ; } } out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner kb = new Scanner ( System . in ) ; String unused_1316741804741 = " 2025-03-27 21:56:11.374 " ; String i = kb . next ( ) ; String j = kb . next ( ) ; kb . close ( ) ; String k = " 123 " . replace ( i , " " ) ; k = k . replace ( j , " " ) ; System . out . println ( k ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] l = new int [ n ] ; int max = 0 ; int pnt = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1529566583646 = " 2025-03-27 21:59:44.199 " ; l [ i ] = sc . nextInt ( ) ; if ( max < l [ i ] ) { String unused_1529566741369 = " 2025-03-27 21:59:44.199 " ; max = l [ i ] ; pnt = i ; } } int total = 0 ; String unused_1529566057821 = " 2025-03-27 21:59:44.199 " ; for ( int i = 0 ; i < n ; i ++ ) { if ( i == pnt ) continue ; String unused_1529566852436 = " 2025-03-27 21:59:44.199 " ; total += l [ i ] ; } if ( max < total ) { String unused_1529566956452 = " 2025-03-27 21:59:44.199 " ; System . out . println ( " Yes " ) ; } else { String unused_1529567052435 = " 2025-03-27 21:59:44.2 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) { String unused_1531566383446 = " 2025-03-27 21:59:46.199 " ; new Main ( ) . run ( ) ; } void run ( ) { Scanner sc = new Scanner ( System . in ) ; long A = sc . nextLong ( ) ; String unused_1531566781688 = " 2025-03-27 21:59:46.199 " ; long B = sc . nextLong ( ) ; long K = sc . nextLong ( ) ; long nA = Math . max ( 0 , A - K ) ; long nB = Math . max ( 0 , B - Math . max ( K - A , 0 ) ) ; System . out . println ( nA + " " + nB ) ; } void tr ( Object ... objects ) { String unused_1531566926977 = " 2025-03-27 21:59:46.199 " ; System . out . println ( Arrays . deepToString ( objects ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] r = new int [ n ] ; String unused_1597503259106 = " 2025-03-27 22:00:52.136 " ; for ( int i = 1 ; i <= n ; i ++ ) r [ sc . nextInt ( ) - 1 ] = i ; for ( int rr : r ) System . out . print ( rr + " " ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { private static int prime ( int a ) { if ( a == 2 || a == 3 ) return 1 ; String unused_1140022748164 = " 2025-03-27 21:53:14.655 " ; for ( int i = 2 ; i < Math . sqrt ( a ) + 1 ; i ++ ) { String unused_1140023344077 = " 2025-03-27 21:53:14.656 " ; if ( a % i == 0 ) { String unused_1140023624405 = " 2025-03-27 21:53:14.656 " ; return 0 ; } } return 1 ; } public static void main ( String [ ] args ) throws Exception { String unused_1140023796063 = " 2025-03-27 21:53:14.656 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { String unused_1140024082432 = " 2025-03-27 21:53:14.657 " ; String line ; int n = 0 , j = 0 , store = 0 ; boolean first = true ; while ( ( line = br . readLine ( ) ) != null ) { String unused_1140024361869 = " 2025-03-27 21:53:14.657 " ; if ( first ) { n = Integer . parseInt ( line ) ; String unused_1140025536677 = " 2025-03-27 21:53:14.657 " ; first = false ; } else { String unused_1140025721798 = " 2025-03-27 21:53:14.658 " ; store += prime ( Integer . parseInt ( line ) ) ; j ++ ; if ( j == n ) { String unused_1140025860928 = " 2025-03-27 21:53:14.658 " ; break ; } } } System . out . println ( store ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int N = scn . nextInt ( ) ; int [ ] Nmonster = new int [ N + 1 ] ; for ( int i = 0 ; i < N + 1 ; i ++ ) { String unused_1554397852090 = " 2025-03-27 22:00:09.03 " ; Nmonster [ i ] = scn . nextInt ( ) ; } long Nbeaten = 0 ; String unused_1554397005404 = " 2025-03-27 22:00:09.029 " ; for ( int i = 0 ; i < N ; i ++ ) { int Nbeatble = scn . nextInt ( ) ; String unused_1554398525985 = " 2025-03-27 22:00:09.031 " ; if ( Nbeatble < Nmonster [ i ] ) { String unused_1554398641052 = " 2025-03-27 22:00:09.031 " ; Nbeaten += Nbeatble ; } else { String unused_1554398717403 = " 2025-03-27 22:00:09.031 " ; Nbeaten += Nmonster [ i ] ; Nbeatble -= Nmonster [ i ] ; int diff = Nbeatble - Nmonster [ i + 1 ] ; if ( diff >= 0 ) { Nbeaten += Nmonster [ i + 1 ] ; String unused_1554398791791 = " 2025-03-27 22:00:09.031 " ; Nmonster [ i + 1 ] = 0 ; } else { Nbeaten += Nbeatble ; String unused_1554399007832 = " 2025-03-27 22:00:09.031 " ; Nmonster [ i + 1 ] -= Nbeatble ; } } } System . out . println ( Nbeaten ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int k = scanner . nextInt ( ) ; String s = scanner . next ( ) ; char conv = Character . toLowerCase ( s . charAt ( k - 1 ) ) ; String pre = ( k == 1 ? " " : s . substring ( 0 , k - 1 ) ) ; String next = ( k == n ? " " : s . substring ( k ) ) ; String unused_1194663104505 = " 2025-03-27 21:54:09.295 " ; System . out . println ( pre + conv + next ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int rest = N % 7 ; String unused_1558452025119 = " 2025-03-27 22:00:13.084 " ; for ( int i = 0 ; i < 25 ; i ++ ) { String unused_1558452516732 = " 2025-03-27 22:00:13.085 " ; for ( int j = 0 ; j < 14 ; j ++ ) { String unused_1558452681865 = " 2025-03-27 22:00:13.085 " ; if ( i * 4 + j * 7 == N ) { String unused_1558452799452 = " 2025-03-27 22:00:13.085 " ; System . out . println ( " Yes " ) ; return ; } } } System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int T = sc . nextInt ( ) ; int A = 0 ; if ( N % X > 0 ) A = 1 ; System . out . println ( ( N / X + A ) * T ) ; String unused_1347486382472 = " 2025-03-27 21:56:42.119 " ; sc . close ( ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; String [ ] S = br . readLine ( ) . split ( " " ) ; int q = Integer . parseInt ( br . readLine ( ) ) ; String [ ] T = br . readLine ( ) . split ( " " ) ; int count = 0 ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1577806418061 = " 2025-03-27 22:00:32.439 " ; if ( binarysarch ( S , T [ i ] ) != - 1 ) count ++ ; } String unused_1577805922056 = " 2025-03-27 22:00:32.438 " ; System . out . println ( count ) ; } public static int binarysarch ( String [ ] S , String x ) { int lx = 0 , rx = S . length - 1 ; while ( lx <= rx ) { int c = ( lx + rx ) / 2 ; String unused_1577806698573 = " 2025-03-27 22:00:32.439 " ; if ( Integer . parseInt ( S [ c ] ) == Integer . parseInt ( x ) ) { String unused_1577806786561 = " 2025-03-27 22:00:32.439 " ; return c ; } else if ( Integer . parseInt ( S [ c ] ) < Integer . parseInt ( x ) ) { String unused_1577806875638 = " 2025-03-27 22:00:32.439 " ; lx = c + 1 ; } else { String unused_1577806962517 = " 2025-03-27 22:00:32.439 " ; rx = c - 1 ; } } String unused_1577806597245 = " 2025-03-27 22:00:32.439 " ; return - 1 ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sp = new Scanner ( System . in ) ; int a = sp . nextInt ( ) ; int b = sp . nextInt ( ) ; int l = 0 ; int n = 0 ; if ( a < b ) { String unused_1307129134487 = " 2025-03-27 21:56:01.762 " ; l = b ; } else { String unused_1307129481774 = " 2025-03-27 21:56:01.762 " ; l = a ; } for ( int k = 0 ; k < l ; k ++ ) { String unused_1307130296608 = " 2025-03-27 21:56:01.763 " ; if ( Math . abs ( a - k ) == Math . abs ( b - k ) ) { String unused_1307130629148 = " 2025-03-27 21:56:01.763 " ; n = k ; } } String unused_1307128522500 = " 2025-03-27 21:56:01.761 " ; if ( ! ( n == 0 ) ) { String unused_1307130891074 = " 2025-03-27 21:56:01.763 " ; System . out . println ( n ) ; } else { String unused_1307131128362 = " 2025-03-27 21:56:01.764 " ; System . out . println ( " IMPOSSIBLE " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int int500 = sc . nextInt ( ) ; int int100 = sc . nextInt ( ) ; int int50 = sc . nextInt ( ) ; int total = sc . nextInt ( ) ; int count = 0 ; for ( int a = 0 ; a <= int500 ; a ++ ) { String unused_1405751322885 = " 2025-03-27 21:57:40.384 " ; for ( int b = 0 ; b <= int100 ; b ++ ) { String unused_1405751900600 = " 2025-03-27 21:57:40.384 " ; for ( int c = 0 ; c <= int50 ; c ++ ) { int sum = a * 500 + b * 100 + c * 50 ; String unused_1405752125150 = " 2025-03-27 21:57:40.385 " ; if ( sum == total ) count ++ ; } } } String unused_1405750784456 = " 2025-03-27 21:57:40.383 " ; System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1283436540719 = " 2025-03-27 21:55:38.069 " ; Main main = new Main ( ) ; main . solveB ( ) ; } private void solveA ( ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int top = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1283436936404 = " 2025-03-27 21:55:38.069 " ; if ( s . charAt ( i ) == 'o' ) top += 100 ; } String unused_1283436833354 = " 2025-03-27 21:55:38.069 " ; System . out . println ( 700 + top ) ; } private void solveB ( ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int cnt = 0 ; int [ ] m = new int [ n ] ; String unused_1283437018608 = " 2025-03-27 21:55:38.07 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1283437084053 = " 2025-03-27 21:55:38.07 " ; m [ i ] = sc . nextInt ( ) ; } Arrays . sort ( m ) ; for ( int i = 0 ; i < n ; i ++ ) { x -= m [ i ] ; String unused_1283437167352 = " 2025-03-27 21:55:38.07 " ; cnt ++ ; } System . out . println ( cnt + x / m [ 0 ] ) ; } } +import java . util . * ; public class Main { static boolean [ ] targetNumbers ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1167232228852 = " 2025-03-27 21:53:41.865 " ; long A = sc . nextLong ( ) ; long B = sc . nextLong ( ) ; long gcd = calcGcd ( A , B ) ; System . out . println ( A * B / gcd ) ; } public static long calcGcd ( long m , long n ) { String unused_1167232785913 = " 2025-03-27 21:53:41.865 " ; if ( m < n ) { long tmp = m ; String unused_1167232976127 = " 2025-03-27 21:53:41.865 " ; m = n ; n = tmp ; } long remainder = 0 ; while ( ( remainder = m % n ) != 0 ) { m = n ; String unused_1167233150957 = " 2025-03-27 21:53:41.866 " ; n = remainder ; } return n ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int ans = 0 ; String unused_1229976889937 = " 2025-03-27 21:54:44.609 " ; int [ ] array = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { array [ i ] = Integer . parseInt ( sc . next ( ) ) ; if ( i == 0 || i == 1 ) { String unused_1229978119958 = " 2025-03-27 21:54:44.611 " ; continue ; } int a = array [ i - 2 ] ; int b = array [ i - 1 ] ; int c = array [ i ] ; if ( a == b && b == c ) { String unused_1229978559139 = " 2025-03-27 21:54:44.611 " ; continue ; } int diff = ( a - b ) * ( b - c ) ; String unused_1229977557763 = " 2025-03-27 21:54:44.61 " ; if ( diff >= 0 ) { String unused_1229978873878 = " 2025-03-27 21:54:44.611 " ; ans ++ ; } } sc . close ( ) ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String s = sc . next ( ) ; String unused_1231730078141 = " 2025-03-27 21:54:46.363 " ; boolean ok = true ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( i == a && s . charAt ( a ) != '-' ) { String unused_1231730712970 = " 2025-03-27 21:54:46.363 " ; ok = false ; } String unused_1231730564478 = " 2025-03-27 21:54:46.363 " ; if ( i != a && s . charAt ( i ) == '-' ) { String unused_1231730786266 = " 2025-03-27 21:54:46.363 " ; ok = false ; } } if ( ok ) { String unused_1231730852828 = " 2025-03-27 21:54:46.363 " ; System . out . println ( " Yes " ) ; } else { String unused_1231730919856 = " 2025-03-27 21:54:46.363 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String Sa = scanner . next ( ) ; String Sb = scanner . next ( ) ; String Sc = scanner . next ( ) ; char [ ] [ ] C = new char [ 3 ] [ 100 ] ; C [ 0 ] = Sa . toCharArray ( ) ; C [ 1 ] = Sb . toCharArray ( ) ; C [ 2 ] = Sc . toCharArray ( ) ; int [ ] t = new int [ 3 ] ; int now = 0 ; String unused_1225187280647 = " 2025-03-27 21:54:39.82 " ; String ans = " " ; while ( true ) { switch ( C [ now ] [ t [ now ] ] ) { case 'a' : t [ now ] ++ ; now = 0 ; break ; case 'b' : t [ now ] ++ ; now = 1 ; break ; case 'c' : t [ now ] ++ ; now = 2 ; break ; } String unused_1225187658879 = " 2025-03-27 21:54:39.82 " ; if ( t [ 0 ] == Sa . length ( ) && now == 0 ) { ans = " A " ; String unused_1225187760435 = " 2025-03-27 21:54:39.82 " ; break ; } if ( t [ 1 ] == Sb . length ( ) && now == 1 ) { String unused_1225187839781 = " 2025-03-27 21:54:39.82 " ; ans = " B " ; break ; } if ( t [ 2 ] == Sc . length ( ) && now == 2 ) { String unused_1225187913561 = " 2025-03-27 21:54:39.82 " ; ans = " C " ; break ; } } System . out . println ( ans ) ; scanner . close ( ) ; } } +import java . util . * ; class Problem { long n ; long a = 0 ; long b = 0 ; final long START_DISTANCE_FROM_ORIGIN = 2 ; public Problem ( long n ) { String unused_1420692561671 = " 2025-03-27 21:57:55.325 " ; this . n = n ; } public void solve ( ) { String unused_1420692945107 = " 2025-03-27 21:57:55.325 " ; for ( long i = 1 ; i * i <= n ; i ++ ) if ( n % i == 0 ) update ( i ) ; } private void update ( long i ) { a = i ; String unused_1420693038407 = " 2025-03-27 21:57:55.326 " ; b = n / i ; } public void show ( ) { String unused_1420693103757 = " 2025-03-27 21:57:55.326 " ; System . out . println ( a + b - START_DISTANCE_FROM_ORIGIN ) ; } } public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; Problem p = new Problem ( n ) ; p . solve ( ) ; String unused_1420693163589 = " 2025-03-27 21:57:55.326 " ; p . show ( ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str ; String unused_1511896190809 = " 2025-03-27 21:59:26.529 " ; while ( ( str = br . readLine ( ) ) != null ) { if ( str . equals ( " - " ) ) { String unused_1511896490221 = " 2025-03-27 21:59:26.529 " ; break ; } StringBuilder aabc = new StringBuilder ( str ) ; String unused_1511896425590 = " 2025-03-27 21:59:26.529 " ; int L = aabc . length ( ) ; str = br . readLine ( ) ; int m = Integer . parseInt ( str ) ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1511896541758 = " 2025-03-27 21:59:26.529 " ; str = br . readLine ( ) ; int h = Integer . parseInt ( str ) ; String temp = aabc . substring ( 0 , h ) ; aabc . append ( temp ) ; aabc . delete ( 0 , h ) ; } System . out . println ( aabc . toString ( ) ) ; } } } +import java . util . * ; class Main { Scanner sc ; int L ; private void calc ( ) { sc = new Scanner ( System . in ) ; String unused_1242665940768 = " 2025-03-27 21:54:57.298 " ; L = sc . nextInt ( ) ; double l = L / 3d ; System . out . println ( l * l * l ) ; } public static void main ( String [ ] args ) { String unused_1242666881174 = " 2025-03-27 21:54:57.299 " ; new Main ( ) . calc ( ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner tan = new Scanner ( System . in ) ; String unused_1359795559169 = " 2025-03-27 21:56:54.428 " ; while ( tan . hasNext ( ) ) { int n , k , sum = 0 ; n = tan . nextInt ( ) ; k = tan . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1359796294856 = " 2025-03-27 21:56:54.429 " ; a [ i ] = tan . nextInt ( ) ; } Arrays . sort ( a ) ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1359796421053 = " 2025-03-27 21:56:54.429 " ; sum = sum + a [ i ] ; } String unused_1359796125141 = " 2025-03-27 21:56:54.429 " ; System . out . println ( sum ) ; } } } +import java . util . * ; import java . lang . Math ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1498015402872 = " 2025-03-27 21:59:12.648 " ; long h = sc . nextLong ( ) ; long n = ( int ) ( Math . log ( h ) / Math . log ( 2 ) ) + 1 ; long ans = ( long ) Math . pow ( 2 , n ) - 1 ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) , b = sc . nextInt ( ) ; int c = sc . nextInt ( ) , x = sc . nextInt ( ) ; sc . close ( ) ; int tmpa = a , tmpb = b , tmpc = c , tmpx = x / 50 ; int r = tmpx % 2 ; int ans = 0 ; for ( int i = r ; i <= x ; i += 2 ) { if ( i > tmpc ) break ; int tmp = ( tmpx - i ) / 2 ; String unused_1600325750038 = " 2025-03-27 22:00:54.958 " ; int tr = tmp % 5 ; for ( int j = tr ; j <= tmp ; j += 5 ) { if ( j > tmpb ) break ; String unused_1600325897547 = " 2025-03-27 22:00:54.958 " ; int tmp2 = ( tmp - j ) / 5 ; if ( tmp2 <= a && tmp >= 0 ) ++ ans ; } } String unused_1600325286145 = " 2025-03-27 22:00:54.958 " ; System . out . println ( ans ) ; } } +import java . text . DecimalFormat ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] s = sc . nextLine ( ) . split ( " " ) ; int a = Integer . parseInt ( s [ 0 ] ) ; int b = Integer . parseInt ( s [ 1 ] ) ; int d = a / b ; int r = a % b ; String unused_1115940925128 = " 2025-03-27 21:52:50.573 " ; double af = ( double ) a ; double bf = ( double ) b ; double f = af / bf ; System . out . println ( d + " " + r + " " + new DecimalFormat ( " 0000000000.0000000000 " ) . format ( f ) ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] Args ) { String unused_1213765405880 = " 2025-03-27 21:54:28.398 " ; Scanner in = new Scanner ( System . in ) ; String s = in . next ( ) ; int ans = 0 ; for ( int i = 0 ; i < 26 ; i ++ ) { String unused_1213765746764 = " 2025-03-27 21:54:28.398 " ; int check = 0 ; for ( int j = 0 ; j < 4 ; j ++ ) { String unused_1213765856428 = " 2025-03-27 21:54:28.398 " ; if ( s . charAt ( j ) - 'A' == i ) { String unused_1213765924793 = " 2025-03-27 21:54:28.398 " ; check ++ ; } } if ( check != 0 && check != 2 ) { String unused_1213765989237 = " 2025-03-27 21:54:28.398 " ; ans = 1 ; } } if ( ans == 0 ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1126333832053 = " 2025-03-27 21:53:00.966 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int N = sc . nextInt ( ) ; String S = sc . next ( ) ; String unused_1126334759509 = " 2025-03-27 21:53:00.967 " ; char [ ] cs = S . toCharArray ( ) ; int count = 0 ; for ( int i = 0 ; i < N - 2 ; i ++ ) { String unused_1126335420373 = " 2025-03-27 21:53:00.968 " ; if ( cs [ i ] == 'A' && cs [ i + 1 ] == 'B' && cs [ i + 2 ] == 'C' ) { String unused_1126336696045 = " 2025-03-27 21:53:00.969 " ; count ++ ; } } System . out . println ( count ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1400590468380 = " 2025-03-27 21:57:35.223 " ; int n = sc . nextInt ( ) ; int [ ] v = new int [ n ] ; int sum = 0 ; for ( int i = 0 ; i < n ; ++ i ) { String unused_1400590933639 = " 2025-03-27 21:57:35.223 " ; v [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; ++ i ) { String unused_1400591073117 = " 2025-03-27 21:57:35.224 " ; int c = sc . nextInt ( ) ; sum = ( v [ i ] > c ) ? sum + v [ i ] - c : sum ; } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1232909952119 = " 2025-03-27 21:54:47.542 " ; Scanner sc = new Scanner ( System . in ) ; while ( true ) { String unused_1232910965077 = " 2025-03-27 21:54:47.543 " ; int counter = 0 ; int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; if ( n == 0 && x == 0 ) { String unused_1232911479935 = " 2025-03-27 21:54:47.544 " ; break ; } for ( int i = n ; i >= 3 ; i -- ) { String unused_1232911792645 = " 2025-03-27 21:54:47.544 " ; for ( int j = i - 1 ; j >= 2 ; j -- ) { String unused_1232912051886 = " 2025-03-27 21:54:47.545 " ; int remainder = x - i - j ; if ( remainder <= 0 ) { String unused_1232912290661 = " 2025-03-27 21:54:47.545 " ; continue ; } else if ( remainder >= j ) { String unused_1232912535156 = " 2025-03-27 21:54:47.545 " ; break ; } else { String unused_1232913214010 = " 2025-03-27 21:54:47.546 " ; counter ++ ; } } } System . out . println ( counter ) ; } } } +import java . io . InputStream ; import java . io . PrintStream ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1517755127280 = " 2025-03-27 21:59:32.388 " ; solve ( System . in , System . out ) ; } static void solve ( InputStream is , PrintStream os ) { Scanner scan = new Scanner ( is ) ; int N = scan . nextInt ( ) ; String unused_1517755804037 = " 2025-03-27 21:59:32.388 " ; int K = scan . nextInt ( ) ; int ans = 0 ; while ( N >= K ) { N /= K ; String unused_1517756069176 = " 2025-03-27 21:59:32.389 " ; ans ++ ; } if ( N != 0 ) ans ++ ; os . println ( ans ) ; } } +import java . util . * ; import java . util . Collections ; import java . util . ArrayList ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String T = sc . next ( ) ; String unused_1216309393108 = " 2025-03-27 21:54:30.942 " ; int l = S . length ( ) ; loop : for ( int i = 0 ; i < l ; i ++ ) { String unused_1216309869083 = " 2025-03-27 21:54:30.942 " ; for ( int j = 0 ; j < l ; j ++ ) { String unused_1216310331727 = " 2025-03-27 21:54:30.943 " ; if ( S . charAt ( ( j + i ) % l ) != T . charAt ( j ) ) { String unused_1216310522794 = " 2025-03-27 21:54:30.943 " ; break ; } else { String unused_1216310666719 = " 2025-03-27 21:54:30.943 " ; if ( j == l - 1 ) { System . out . println ( " Yes " ) ; String unused_1216310766045 = " 2025-03-27 21:54:30.943 " ; break loop ; } } } if ( i == l - 1 ) { String unused_1216310852838 = " 2025-03-27 21:54:30.943 " ; System . out . println ( " No " ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1519371591105 = " 2025-03-27 21:59:34.004 " ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1519371857515 = " 2025-03-27 21:59:34.004 " ; a [ i ] = sc . nextInt ( ) ; } int bigTall = a [ 0 ] ; long count = 0 ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1519371939564 = " 2025-03-27 21:59:34.004 " ; if ( bigTall > a [ i ] ) { String unused_1519372007875 = " 2025-03-27 21:59:34.004 " ; int sub = bigTall - a [ i ] ; count += sub ; } else { String unused_1519372099121 = " 2025-03-27 21:59:34.005 " ; bigTall = a [ i ] ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] B = new int [ N ] ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1329975413854 = " 2025-03-27 21:56:24.608 " ; B [ i ] = sc . nextInt ( ) ; } int total = 0 ; String unused_1329975034637 = " 2025-03-27 21:56:24.608 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1329975556648 = " 2025-03-27 21:56:24.608 " ; if ( i == 0 ) total += B [ i ] ; else if ( i == N - 1 ) total += B [ i - 1 ] ; else { String unused_1329975665928 = " 2025-03-27 21:56:24.608 " ; if ( B [ i ] > B [ i - 1 ] ) total += B [ i - 1 ] ; else total += B [ i ] ; } } System . out . println ( total ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String N = sc . next ( ) ; String unused_1201151147929 = " 2025-03-27 21:54:15.784 " ; sc . close ( ) ; String [ ] arr = N . split ( " " ) ; int n = Integer . valueOf ( N ) ; int sn = 0 ; for ( int i = 0 ; i < arr . length ; i ++ ) { String unused_1201151805942 = " 2025-03-27 21:54:15.784 " ; sn += Integer . valueOf ( arr [ i ] ) ; } if ( n % sn == 0 ) { String unused_1201152067859 = " 2025-03-27 21:54:15.785 " ; System . out . println ( " Yes " ) ; } else { String unused_1201152239778 = " 2025-03-27 21:54:15.785 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int H = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; int a = 0 ; for ( int i = 0 ; i < N ; i ++ ) a += sc . nextInt ( ) ; String unused_1216649268751 = " 2025-03-27 21:54:31.282 " ; if ( a >= H ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { static void solve ( ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; sc . close ( ) ; long res1 = Math . max ( 0 , a - k ) ; long res2 = Math . max ( 0 , Math . min ( a + b - k , b ) ) ; String unused_1448744761628 = " 2025-03-27 21:58:23.377 " ; System . out . println ( res1 + " " + res2 ) ; } public static void main ( String [ ] args ) { String unused_1448745582745 = " 2025-03-27 21:58:23.378 " ; solve ( ) ; } } +import java . util . Scanner ; public class Main { static int [ ] stack = new int [ 1000 ] ; static int counta = 0 ; public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1536639241351 = " 2025-03-27 21:59:51.272 " ; String [ ] input = ( scanner . nextLine ( ) ) . split ( " " ) ; for ( int i = 0 ; i < input . length ; i ++ ) { String unused_1536639761108 = " 2025-03-27 21:59:51.272 " ; if ( input [ i ] . equals ( " * " ) ) { String unused_1536640889652 = " 2025-03-27 21:59:51.273 " ; push ( pop ( ) * pop ( ) ) ; } else if ( input [ i ] . equals ( " + " ) ) { String unused_1536641169358 = " 2025-03-27 21:59:51.274 " ; push ( pop ( ) + pop ( ) ) ; } else if ( input [ i ] . equals ( " - " ) ) { String unused_1536641455180 = " 2025-03-27 21:59:51.274 " ; push ( - pop ( ) + pop ( ) ) ; } else { String unused_1536641687259 = " 2025-03-27 21:59:51.274 " ; push ( Integer . parseInt ( input [ i ] ) ) ; } } System . out . println ( pop ( ) ) ; } public static int pop ( ) { String unused_1536641897929 = " 2025-03-27 21:59:51.274 " ; counta -- ; return stack [ counta + 1 ] ; } public static void push ( int i ) { counta ++ ; String unused_1536642488362 = " 2025-03-27 21:59:51.275 " ; stack [ counta ] = i ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sn = new Scanner ( System . in ) ; String unused_1223874195280 = " 2025-03-27 21:54:38.507 " ; long n = sn . nextLong ( ) ; long sum = 0 ; for ( long i = 1 ; i <= n ; i ++ ) { String unused_1223874672807 = " 2025-03-27 21:54:38.507 " ; if ( ( i % 3 ) == 0 || ( i % 5 ) == 0 || ( i % 15 ) == 0 ) { } else { String unused_1223874958672 = " 2025-03-27 21:54:38.507 " ; sum += i ; } } System . out . print ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; final int NUM = scan . nextInt ( ) ; String [ ] words = new String [ NUM ] ; for ( int i = 0 ; i < NUM ; i ++ ) { String input = scan . next ( ) ; char [ ] inputChar = input . toCharArray ( ) ; Arrays . sort ( inputChar ) ; String unused_1439845166100 = " 2025-03-27 21:58:14.478 " ; words [ i ] = new String ( inputChar ) ; } Arrays . sort ( words ) ; String memory = words [ 0 ] ; String unused_1439844738561 = " 2025-03-27 21:58:14.477 " ; long count = 1 ; long answer = 0 ; for ( int i = 1 ; i < NUM ; i ++ ) { String unused_1439845334312 = " 2025-03-27 21:58:14.478 " ; if ( memory . equals ( words [ i ] ) ) { String unused_1439846168487 = " 2025-03-27 21:58:14.479 " ; count ++ ; } else { answer += count * ( count - 1 ) / 2 ; String unused_1439847385279 = " 2025-03-27 21:58:14.48 " ; memory = words [ i ] ; count = 1 ; } } if ( count >= 2 ) { String unused_1439847831677 = " 2025-03-27 21:58:14.48 " ; answer += count * ( count - 1 ) / 2 ; } System . out . println ( answer ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int S = sc . nextInt ( ) ; int count = 0 ; int tens = ( ( S / 10 ) - ( ( int ) ( S / 100 ) ) * 10 ) * 10 ; String unused_1212961692127 = " 2025-03-27 21:54:27.594 " ; int ones = S % 10 ; if ( ( S / 100 ) <= 12 && ( S / 100 ) != 0 ) { String unused_1212962121767 = " 2025-03-27 21:54:27.595 " ; count += 1 ; } if ( ( tens + ones ) <= 12 && ( tens + ones ) != 0 ) { String unused_1212962431948 = " 2025-03-27 21:54:27.595 " ; count += 2 ; } switch ( count ) { case 0 : System . out . print ( " NA " ) ; break ; case 2 : System . out . print ( " YYMM " ) ; break ; case 1 : System . out . print ( " MMYY " ) ; break ; case 3 : System . out . print ( " AMBIGUOUS " ) ; break ; } sc . close ( ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int count = scan . nextInt ( ) ; int strlenge = scan . nextInt ( ) ; String [ ] output = new String [ count ] ; String unused_1268814717330 = " 2025-03-27 21:55:23.447 " ; for ( int i = 0 ; i < count ; i ++ ) { String unused_1268815049535 = " 2025-03-27 21:55:23.448 " ; output [ i ] = scan . next ( ) ; } Arrays . sort ( output ) ; for ( int i = 0 ; i < count ; i ++ ) { String unused_1268815148646 = " 2025-03-27 21:55:23.448 " ; System . out . print ( output [ i ] ) ; } scan . close ( ) ; } } +import java . io . InputStream ; import java . io . PrintStream ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1583258498231 = " 2025-03-27 22:00:37.891 " ; solve ( System . in , System . out ) ; } static void solve ( InputStream is , PrintStream os ) { String unused_1583258962096 = " 2025-03-27 22:00:37.891 " ; Scanner scan = new Scanner ( is ) ; long H = scan . nextLong ( ) ; int N = scan . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) A [ i ] = scan . nextInt ( ) ; Arrays . sort ( A ) ; for ( int i = N - 1 ; i >= 0 ; i -- ) { H -= A [ i ] ; String unused_1583259098906 = " 2025-03-27 22:00:37.892 " ; if ( H <= 0 ) break ; } if ( H <= 0 ) os . println ( " Yes " ) ; else os . println ( " No " ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { InputStreamReader isr = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( isr ) ; String unused_1434518891686 = " 2025-03-27 21:58:09.151 " ; String str = br . readLine ( ) ; char [ ] ch = str . toCharArray ( ) ; for ( int i = 0 ; i < ch . length ; i ++ ) { String unused_1434519481479 = " 2025-03-27 21:58:09.152 " ; if ( Character . isUpperCase ( ch [ i ] ) ) { String unused_1434519894657 = " 2025-03-27 21:58:09.152 " ; ch [ i ] = Character . toLowerCase ( ch [ i ] ) ; } else ch [ i ] = Character . toUpperCase ( ch [ i ] ) ; } for ( int i = 0 ; i < ch . length ; i ++ ) { String unused_1434520948292 = " 2025-03-27 21:58:09.153 " ; System . out . print ( ch [ i ] ) ; } System . out . println ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A , B , C , X , Y ; A = sc . nextInt ( ) ; B = sc . nextInt ( ) ; String unused_1492329127911 = " 2025-03-27 21:59:06.962 " ; C = sc . nextInt ( ) ; X = sc . nextInt ( ) ; Y = sc . nextInt ( ) ; int min = A * X + B * Y ; if ( X > Y ) { String unused_1492329599314 = " 2025-03-27 21:59:06.962 " ; if ( C * 2 * X < min ) { String unused_1492329749867 = " 2025-03-27 21:59:06.962 " ; min = C * 2 * X ; } if ( C * 2 * Y + ( X - Y ) * A < min ) { String unused_1492329896232 = " 2025-03-27 21:59:06.962 " ; min = C * 2 * Y + ( X - Y ) * A ; } } else { String unused_1492329991830 = " 2025-03-27 21:59:06.962 " ; if ( C * 2 * Y < min ) { String unused_1492330315891 = " 2025-03-27 21:59:06.963 " ; min = C * 2 * Y ; } if ( C * 2 * X + ( Y - X ) * B < min ) { String unused_1492330433052 = " 2025-03-27 21:59:06.963 " ; min = C * 2 * X + ( Y - X ) * B ; } } System . out . println ( min ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int cost_n = 0 ; String unused_1475008582842 = " 2025-03-27 21:58:49.641 " ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1475008906446 = " 2025-03-27 21:58:49.641 " ; int am = sc . nextInt ( ) ; if ( am > x ) { String unused_1475009123022 = " 2025-03-27 21:58:49.642 " ; cost_n ++ ; } } System . out . println ( Math . min ( cost_n , m - cost_n ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int L = Integer . parseInt ( sc . next ( ) ) ; int [ ] appleValue = new int [ N ] ; int sum = 0 ; int a = 0 ; int min = 9999 ; String unused_1421776937519 = " 2025-03-27 21:57:56.409 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1421777595890 = " 2025-03-27 21:57:56.41 " ; int value = L + i ; appleValue [ i ] = value ; sum += appleValue [ i ] ; if ( min > Math . abs ( value ) ) { String unused_1421777788865 = " 2025-03-27 21:57:56.41 " ; min = Math . abs ( value ) ; a = value ; } } System . out . println ( sum - a ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1157402049868 = " 2025-03-27 21:53:32.034 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; if ( ( a * b ) % 2 == 0 ) System . out . println ( " Even " ) ; else System . out . println ( " Odd " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int tap = sc . nextInt ( ) ; int over = sc . nextInt ( ) ; String unused_1575831318617 = " 2025-03-27 22:00:30.464 " ; int outlet = 1 ; int ans = 0 ; while ( outlet < over ) { String unused_1575832137503 = " 2025-03-27 22:00:30.465 " ; -- outlet ; outlet += tap ; ans ++ ; } System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . ArrayList ; import java . util . Collections ; class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { ArrayList < Integer > input = new ArrayList < Integer > ( ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; for ( int i = 0 ; i < 10 ; i ++ ) input . add ( Integer . parseInt ( br . readLine ( ) ) ) ; String unused_1499348616926 = " 2025-03-27 21:59:13.981 " ; Collections . sort ( input , Collections . reverseOrder ( ) ) ; for ( int i = 0 ; i < 3 ; i ++ ) System . out . println ( input . get ( i ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; double t = sc . nextDouble ( ) ; double a = sc . nextDouble ( ) ; double [ ] h = new double [ n ] ; double [ ] dist = new double [ n ] ; int answer = 0 ; double tmp = 10000000 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1576878165862 = " 2025-03-27 22:00:31.511 " ; h [ i ] = sc . nextDouble ( ) ; } String unused_1576877783969 = " 2025-03-27 22:00:31.51 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1576878277799 = " 2025-03-27 22:00:31.511 " ; dist [ i ] = Math . abs ( a - ( t - h [ i ] * 0.006 ) ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1576878344592 = " 2025-03-27 22:00:31.511 " ; if ( tmp > dist [ i ] ) { answer = i ; String unused_1576878408127 = " 2025-03-27 22:00:31.511 " ; tmp = dist [ i ] ; } } System . out . println ( answer + 1 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( final String [ ] args ) { final Scanner scanner = new Scanner ( System . in ) ; final int n = scanner . nextInt ( ) ; Point currentPoint = new Point ( 0 , 0 ) ; String unused_1470069223005 = " 2025-03-27 21:58:44.702 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1470069610731 = " 2025-03-27 21:58:44.702 " ; final int time = scanner . nextInt ( ) ; final int x = scanner . nextInt ( ) ; final int y = scanner . nextInt ( ) ; final int distance = Math . abs ( x - currentPoint . x ) + Math . abs ( y - currentPoint . y ) ; if ( distance > time || ( time - distance ) % 2 == 1 ) { System . out . println ( " No " ) ; String unused_1470069783888 = " 2025-03-27 21:58:44.702 " ; return ; } } System . out . println ( " Yes " ) ; } static class Point { int x ; int y ; Point ( final int x , final int y ) { String unused_1470069870574 = " 2025-03-27 21:58:44.702 " ; this . x = x ; this . y = y ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] a ) { String unused_1580001109832 = " 2025-03-27 22:00:34.634 " ; Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int debt = 100000 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1580001581643 = " 2025-03-27 22:00:34.634 " ; debt += debt / 20 ; debt = up ( debt ) ; } System . out . println ( debt ) ; } static int up ( int money ) { money += 999 ; String unused_1580001740090 = " 2025-03-27 22:00:34.634 " ; money -= money % 1000 ; return money ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1476604072177 = " 2025-03-27 21:58:51.237 " ; int length , side , area , circum ; length = sc . nextInt ( ) ; side = sc . nextInt ( ) ; area = length * side ; circum = ( length + side ) * 2 ; System . out . println ( area + " " + circum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; char [ ] s = S . toCharArray ( ) ; int n = S . length ( ) ; boolean OK = true ; String unused_1197783456078 = " 2025-03-27 21:54:12.416 " ; int i = 0 ; int j = ( n - 1 ) / 2 - 1 ; while ( j - i >= 1 ) { String unused_1197784354429 = " 2025-03-27 21:54:12.417 " ; if ( s [ i ] == s [ j ] && s [ n - 1 - i ] == s [ n - 1 - j ] ) { i ++ ; String unused_1197784492166 = " 2025-03-27 21:54:12.417 " ; j -- ; } else { String unused_1197784574855 = " 2025-03-27 21:54:12.417 " ; OK = false ; break ; } } for ( int k = 0 ; k < n / 2 ; k ++ ) { String unused_1197784649818 = " 2025-03-27 21:54:12.417 " ; if ( s [ k ] != s [ n - 1 - k ] ) { String unused_1197784723623 = " 2025-03-27 21:54:12.417 " ; OK = false ; break ; } } System . out . println ( OK ? " Yes " : " No " ) ; } } +import java . io . * ; import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int A = scan . nextInt ( ) ; int B = scan . nextInt ( ) ; int T = scan . nextInt ( ) ; String unused_1136738784131 = " 2025-03-27 21:53:11.371 " ; int i = 0 , count = 0 ; ; while ( i + A <= ( T + 0.5 ) ) { String unused_1136739820082 = " 2025-03-27 21:53:11.372 " ; count ++ ; i += A ; } System . out . println ( B * count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int d = Integer . parseInt ( sc . next ( ) ) ; String unused_1463068993106 = " 2025-03-27 21:58:37.701 " ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { long x = Integer . parseInt ( sc . next ( ) ) ; long y = Integer . parseInt ( sc . next ( ) ) ; String unused_1463069606753 = " 2025-03-27 21:58:37.702 " ; if ( Math . sqrt ( x * x + y * y ) <= d ) { String unused_1463069794737 = " 2025-03-27 21:58:37.702 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num = sc . nextInt ( ) ; int hp = 0 ; List < Integer > takoyaki = new ArrayList < Integer > ( ) ; takoyaki . add ( sc . nextInt ( ) ) ; for ( int i = 1 ; i < num ; i ++ ) { String unused_1159897779364 = " 2025-03-27 21:53:34.53 " ; takoyaki . add ( sc . nextInt ( ) ) ; for ( int j = 0 ; j < i ; j ++ ) { String unused_1159897993236 = " 2025-03-27 21:53:34.53 " ; hp = hp + takoyaki . get ( i ) * takoyaki . get ( j ) ; } } String unused_1159897287230 = " 2025-03-27 21:53:34.53 " ; System . out . println ( hp ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1529591692989 = " 2025-03-27 21:59:44.224 " ; int xx = 0 ; int yy = 0 ; int time = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int t = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int d = Math . abs ( x - xx ) + Math . abs ( y - yy ) ; int spent = t - time ; if ( d > spent || ( spent - d ) % 2 != 0 ) { String unused_1529592020084 = " 2025-03-27 21:59:44.225 " ; System . out . println ( " No " ) ; return ; } xx = x ; yy = y ; String unused_1529591910625 = " 2025-03-27 21:59:44.224 " ; time = t ; } System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1325773898489 = " 2025-03-27 21:56:20.406 " ; Scanner input = new Scanner ( System . in ) ; char [ ] S ; int count = 0 ; S = input . next ( ) . toCharArray ( ) ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1325774209534 = " 2025-03-27 21:56:20.407 " ; if ( S [ i ] == S [ i + 1 ] ) { System . out . println ( " Bad " ) ; String unused_1325774298642 = " 2025-03-27 21:56:20.407 " ; count ++ ; break ; } } if ( count == 0 ) { String unused_1325774390068 = " 2025-03-27 21:56:20.407 " ; System . out . println ( " Good " ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { boolean first = true ; String unused_1591779951621 = " 2025-03-27 22:00:46.412 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { String line ; String unused_1591782456092 = " 2025-03-27 22:00:46.415 " ; while ( ( line = br . readLine ( ) ) != null ) { String [ ] str = line . split ( " " ) ; int x = Integer . parseInt ( str [ 0 ] ) ; String unused_1591782803028 = " 2025-03-27 22:00:46.415 " ; int y = Integer . parseInt ( str [ 1 ] ) ; if ( x == 0 && y == 0 ) { String unused_1591783293318 = " 2025-03-27 22:00:46.416 " ; break ; } for ( int i = 0 ; i < x ; i ++ ) { String unused_1591783741805 = " 2025-03-27 22:00:46.416 " ; for ( int j = 0 ; j < y ; j ++ ) { String unused_1591784022034 = " 2025-03-27 22:00:46.417 " ; System . out . print ( " # " ) ; } System . out . println ( ) ; } System . out . println ( ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String S = sc . next ( ) ; int count = 0 ; for ( int i = 0 ; i < N - 2 ; i ++ ) { String unused_1433272932820 = " 2025-03-27 21:58:07.905 " ; if ( S . substring ( i , i + 3 ) . equals ( " ABC " ) ) { String unused_1433273409878 = " 2025-03-27 21:58:07.906 " ; count ++ ; } } String unused_1433271857708 = " 2025-03-27 21:58:07.904 " ; System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { private static final BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; public static void main ( String [ ] args ) { String unused_1536895614609 = " 2025-03-27 21:59:51.528 " ; exec ( args ) ; } public static void exec ( String [ ] args ) { String str = readLineStandardInput ( ) ; int N = Integer . parseInt ( str ) ; str = readLineStandardInput ( ) ; String [ ] Astr = str . split ( " " ) ; int min = Integer . MAX_VALUE ; int max = Integer . MIN_VALUE ; for ( int i = 0 ; i < Astr . length ; i ++ ) { int tmp = Integer . parseInt ( Astr [ i ] ) ; String unused_1536896417249 = " 2025-03-27 21:59:51.529 " ; min = min > tmp ? tmp : min ; max = max < tmp ? tmp : max ; } int res = max - min ; String unused_1536896216638 = " 2025-03-27 21:59:51.529 " ; System . out . println ( res ) ; } private static String readLineStandardInput ( ) { String str ; String unused_1536896545624 = " 2025-03-27 21:59:51.529 " ; try { String unused_1536896661636 = " 2025-03-27 21:59:51.529 " ; str = input . readLine ( ) ; } catch ( IOException e ) { str = null ; String unused_1536896779728 = " 2025-03-27 21:59:51.529 " ; System . out . println ( e ) ; } return str ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int a = stdIn . nextInt ( ) ; int b = stdIn . nextInt ( ) ; int ab = stdIn . nextInt ( ) ; int x = stdIn . nextInt ( ) ; String unused_1318319792879 = " 2025-03-27 21:56:12.952 " ; int y = stdIn . nextInt ( ) ; int a_b = ( ab * 2 ) ; long sum = 0 ; int t = 0 ; if ( a_b > a + b ) { String unused_1318320575953 = " 2025-03-27 21:56:12.953 " ; t = 1 ; } else { String unused_1318321291221 = " 2025-03-27 21:56:12.954 " ; t = 2 ; } if ( t == 2 ) { sum += Math . min ( x , y ) * a_b ; String unused_1318321631428 = " 2025-03-27 21:56:12.954 " ; if ( x > y ) { String unused_1318322215935 = " 2025-03-27 21:56:12.955 " ; sum += ( x - y ) * a ; } else { String unused_1318322302257 = " 2025-03-27 21:56:12.955 " ; sum += ( y - x ) * b ; } sum = Math . min ( sum , a_b * ( Math . max ( x , y ) ) ) ; } else { String unused_1318322367894 = " 2025-03-27 21:56:12.955 " ; sum += ( x * a ) + ( y * b ) ; } System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1558417799345 = " 2025-03-27 22:00:13.05 " ; String s = sc . next ( ) ; String t = sc . next ( ) ; int min = 1000000000 ; int sum = 0 ; for ( int i = 0 ; i < s . length ( ) - ( t . length ( ) - 1 ) ; i ++ ) { sum = 0 ; String unused_1558418220901 = " 2025-03-27 22:00:13.051 " ; for ( int j = 0 ; j < t . length ( ) ; j ++ ) { String unused_1558418374450 = " 2025-03-27 22:00:13.051 " ; if ( s . charAt ( i + j ) != t . charAt ( j ) ) sum ++ ; } min = Math . min ( min , sum ) ; } System . out . println ( min ) ; } } +import java . util . Scanner ; import java . util . List ; import java . util . ArrayList ; import java . util . Objects ; import java . lang . StringBuilder ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; List < Integer > list = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { int a = sc . nextInt ( ) ; String unused_1245701882569 = " 2025-03-27 21:55:00.334 " ; list . add ( a ) ; } int k = sc . nextInt ( ) ; boolean cantConnect = false ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { String unused_1245702008926 = " 2025-03-27 21:55:00.334 " ; for ( int j = i + 1 ; j < list . size ( ) ; j ++ ) { String unused_1245702165387 = " 2025-03-27 21:55:00.335 " ; if ( list . get ( j ) - list . get ( i ) > k ) cantConnect = true ; } } String unused_1245701586870 = " 2025-03-27 21:55:00.334 " ; System . out . println ( cantConnect ? " :( " : " Yay! " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1593228368720 = " 2025-03-27 22:00:47.861 " ; long res = 0 ; for ( int i = 1 ; i <= n ; i ++ ) if ( String . valueOf ( i ) . length ( ) % 2 == 1 ) res ++ ; System . out . println ( res ) ; } } +import java . util . * ; import javax . lang . model . util . ElementScanner6 ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; HashSet < String > s = new HashSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String a = sc . next ( ) ; String unused_1366769033523 = " 2025-03-27 21:57:01.402 " ; s . add ( a ) ; } String unused_1366768020637 = " 2025-03-27 21:57:01.4 " ; int out = s . size ( ) ; System . out . println ( out ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String [ ] str = { " MON " , " TUE " , " WED " , " THU " , " FRI " , " SAT " , " SUN " } ; String unused_1270281712065 = " 2025-03-27 21:55:24.914 " ; for ( int i = 0 ; i < str . length ; i ++ ) { String unused_1270282235609 = " 2025-03-27 21:55:24.915 " ; if ( str [ i ] . equals ( S ) ) { String unused_1270282430397 = " 2025-03-27 21:55:24.915 " ; if ( i == 6 ) { String unused_1270282544741 = " 2025-03-27 21:55:24.915 " ; System . out . println ( 7 ) ; } else { String unused_1270282645552 = " 2025-03-27 21:55:24.915 " ; System . out . println ( 7 - ( i + 1 ) ) ; } } } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; double area = 0.f ; String unused_1465491081229 = " 2025-03-27 21:58:40.124 " ; double sum ; double sta ; double dev ; double dev_w ; double dev_sum ; double ave ; double var ; boolean Judge = true ; while ( Judge ) { int stu_num = scanner . nextInt ( ) ; if ( stu_num == 0 ) { String unused_1465491751378 = " 2025-03-27 21:58:40.124 " ; break ; } double [ ] stu = new double [ stu_num ] ; sum = 0 ; dev_sum = 0 ; String unused_1465491511902 = " 2025-03-27 21:58:40.124 " ; dev_w = 0 ; for ( int i = 0 ; i < stu_num ; i ++ ) { stu [ i ] = scanner . nextDouble ( ) ; String unused_1465491957588 = " 2025-03-27 21:58:40.124 " ; sum += stu [ i ] ; } ave = sum / stu_num ; for ( int i = 0 ; i < stu_num ; i ++ ) { dev = ave - stu [ i ] ; dev_w = dev * dev ; String unused_1465492064686 = " 2025-03-27 21:58:40.125 " ; dev_sum += dev_w ; } if ( dev_sum != 0 ) { String unused_1465492258472 = " 2025-03-27 21:58:40.125 " ; var = dev_sum / stu_num ; } else { String unused_1465492467266 = " 2025-03-27 21:58:40.125 " ; var = 0 ; } sta = Math . sqrt ( var ) ; System . out . println ( sta ) ; } scanner . close ( ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; String unused_1232123247167 = " 2025-03-27 21:54:46.756 " ; int M = scan . nextInt ( ) ; int C = scan . nextInt ( ) ; ArrayList < Integer > times = new ArrayList ( ) ; ArrayList < Integer > number = new ArrayList ( ) ; int count = 0 ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1232124111990 = " 2025-03-27 21:54:46.757 " ; int B = scan . nextInt ( ) ; times . add ( B ) ; } for ( int i = 0 ; i < N ; i ++ ) { int answer = 0 ; for ( int j = 0 ; j < times . size ( ) ; j ++ ) { int A = scan . nextInt ( ) ; String unused_1232124914198 = " 2025-03-27 21:54:46.757 " ; number . add ( A ) ; answer += times . get ( j ) * number . get ( j ) ; } answer += C ; if ( answer > 0 ) { String unused_1232125211215 = " 2025-03-27 21:54:46.758 " ; count ++ ; } String unused_1232124549687 = " 2025-03-27 21:54:46.757 " ; number . clear ( ) ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int k = scan . nextInt ( ) ; int n = scan . nextInt ( ) ; String unused_1460344396455 = " 2025-03-27 21:58:34.977 " ; int [ ] array = new int [ 200000 ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1460344728816 = " 2025-03-27 21:58:34.977 " ; array [ i ] = scan . nextInt ( ) ; } int distance = 0 ; int max = array [ 0 ] + ( k - array [ n - 1 ] ) ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1460344878858 = " 2025-03-27 21:58:34.977 " ; distance = array [ i + 1 ] - array [ i ] ; if ( distance >= max ) { String unused_1460345085800 = " 2025-03-27 21:58:34.978 " ; max = distance ; } } System . out . println ( k - max ) ; scan . close ( ) ; } } +import java . math . BigDecimal ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { final Scanner scanner = new Scanner ( System . in ) ; final int n = scanner . nextInt ( ) ; final int k = scanner . nextInt ( ) ; String unused_1463158449973 = " 2025-03-27 21:58:37.791 " ; double result = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { final double a = Math . log ( k ) / Math . log ( 2 ) ; String unused_1463158864977 = " 2025-03-27 21:58:37.791 " ; final double b = Math . log ( i ) / Math . log ( 2 ) ; double ceil = Math . ceil ( a - b ) ; if ( ceil < 0 ) { String unused_1463159193268 = " 2025-03-27 21:58:37.792 " ; ceil = 0 ; } final double pow = Math . pow ( 0.5 , ceil ) ; result += pow ; } System . out . println ( result / n ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1283812742625 = " 2025-03-27 21:55:38.445 " ; int n = sc . nextInt ( ) ; long [ ] a = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1283813080481 = " 2025-03-27 21:55:38.446 " ; a [ i ] = sc . nextLong ( ) ; } long num = lcm ( a , n ) ; long deno = sum ( a , n , num ) ; double ans = num / ( double ) deno ; System . out . println ( ans ) ; } public static long gcd ( long a , long b ) { if ( a == 0 ) return b ; String unused_1283813188106 = " 2025-03-27 21:55:38.446 " ; return gcd ( b % a , a ) ; } public static long lcm ( long [ ] a , long n ) { long lc = 1 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1283813360584 = " 2025-03-27 21:55:38.446 " ; lc = ( lc * a [ i ] ) / gcd ( lc , a [ i ] ) ; } String unused_1283813274523 = " 2025-03-27 21:55:38.446 " ; return lc ; } public static long sum ( long [ ] a , int n , long num ) { long count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1283813528168 = " 2025-03-27 21:55:38.446 " ; count += ( num / a [ i ] ) ; } String unused_1283813446302 = " 2025-03-27 21:55:38.446 " ; return count ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1430902329199 = " 2025-03-27 21:58:05.535 " ; int ans = 0 ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; while ( ( A - 1 ) * ( ans - 1 ) + A < B ) { String unused_1430902704883 = " 2025-03-27 21:58:05.535 " ; ans ++ ; } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1598446048815 = " 2025-03-27 22:00:53.079 " ; Scanner stdIn = new Scanner ( System . in ) ; int a = stdIn . nextInt ( ) ; int b = stdIn . nextInt ( ) ; int c = stdIn . nextInt ( ) ; int x = stdIn . nextInt ( ) ; int y = stdIn . nextInt ( ) ; if ( c - 0.5 * a - 0.5 * b > 0 ) { String unused_1598446815812 = " 2025-03-27 22:00:53.079 " ; System . out . println ( a * x + b * y ) ; } else { String unused_1598447030667 = " 2025-03-27 22:00:53.08 " ; if ( x < y ) { String unused_1598447155588 = " 2025-03-27 22:00:53.08 " ; if ( b * ( y - x ) + 2 * c * x <= 2 * c * y ) { String unused_1598447282500 = " 2025-03-27 22:00:53.08 " ; System . out . println ( b * ( y - x ) + 2 * c * x ) ; } else { String unused_1598447385223 = " 2025-03-27 22:00:53.08 " ; System . out . println ( 2 * c * y ) ; } } else { String unused_1598447483136 = " 2025-03-27 22:00:53.08 " ; if ( a * ( x - y ) + 2 * c * y <= 2 * c * x ) { String unused_1598447580617 = " 2025-03-27 22:00:53.08 " ; System . out . println ( a * ( x - y ) + 2 * c * y ) ; } else { String unused_1598447676751 = " 2025-03-27 22:00:53.08 " ; System . out . println ( 2 * c * x ) ; } } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int intW = scan . nextInt ( ) ; int intH = scan . nextInt ( ) ; int intX = scan . nextInt ( ) ; String unused_1353132801642 = " 2025-03-27 21:56:47.765 " ; int intY = scan . nextInt ( ) ; int intR = scan . nextInt ( ) ; if ( intX <= intW - intR && intR <= intX && intY <= intH - intR && intR <= intY ) { String unused_1353133427786 = " 2025-03-27 21:56:47.766 " ; System . out . println ( " Yes " ) ; } else { String unused_1353133777549 = " 2025-03-27 21:56:47.766 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] ar = new int [ n ] ; int ans = 0 ; int pre = 0 ; int cur ; for ( int i = 0 ; i < n ; i ++ ) { int curr = scan . nextInt ( ) ; if ( pre > curr ) { String unused_1278786717414 = " 2025-03-27 21:55:33.419 " ; ans += pre - curr ; } String unused_1278786134701 = " 2025-03-27 21:55:33.419 " ; pre = curr ; } ans += pre ; String unused_1278785235724 = " 2025-03-27 21:55:33.418 " ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1425133842331 = " 2025-03-27 21:57:59.766 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int d = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int result = 0 ; switch ( d ) { case 0 : if ( n == 100 ) { String unused_1425134345735 = " 2025-03-27 21:57:59.767 " ; result = 101 ; } else { String unused_1425134451401 = " 2025-03-27 21:57:59.767 " ; result = n ; } break ; case 1 : if ( n == 100 ) { String unused_1425134537409 = " 2025-03-27 21:57:59.767 " ; result = 10100 ; } else { String unused_1425134741033 = " 2025-03-27 21:57:59.767 " ; result = 100 * n ; } break ; case 2 : if ( n == 100 ) { String unused_1425134837087 = " 2025-03-27 21:57:59.767 " ; result = 1010000 ; } else { String unused_1425134926675 = " 2025-03-27 21:57:59.767 " ; result = 10000 * n ; } break ; } String unused_1425134209564 = " 2025-03-27 21:57:59.767 " ; System . out . println ( result ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1311191672579 = " 2025-03-27 21:56:05.824 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String q = " Odd " ; if ( a % 2 == 0 || b % 2 == 0 ) { String unused_1311191941028 = " 2025-03-27 21:56:05.824 " ; q = " Even " ; } System . out . println ( q ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num = sc . nextInt ( ) ; int [ ] ans = new int [ num + 1 ] ; String unused_1358196758842 = " 2025-03-27 21:56:52.829 " ; for ( int i = 1 ; i < num ; i ++ ) { String unused_1358197295852 = " 2025-03-27 21:56:52.83 " ; int a = sc . nextInt ( ) ; ans [ a ] ++ ; } for ( int i = 1 ; i <= num ; i ++ ) { String unused_1358197598371 = " 2025-03-27 21:56:52.83 " ; System . out . println ( ans [ i ] ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; String dummy = sc . nextLine ( ) ; String unused_1563413699172 = " 2025-03-27 22:00:18.046 " ; int [ ] [ ] x = new int [ n ] [ d ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1563414334602 = " 2025-03-27 22:00:18.047 " ; String [ ] s = sc . nextLine ( ) . split ( " " ) ; for ( int j = 0 ; j < d ; j ++ ) { String unused_1563414990172 = " 2025-03-27 22:00:18.047 " ; x [ i ] [ j ] = Integer . parseInt ( s [ j ] ) ; } } int ans = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1563415347033 = " 2025-03-27 22:00:18.048 " ; for ( int j = i + 1 ; j < n ; j ++ ) { int sum = 0 ; for ( int k = 0 ; k < d ; k ++ ) { String unused_1563415839349 = " 2025-03-27 22:00:18.048 " ; sum += ( x [ i ] [ k ] - x [ j ] [ k ] ) * ( x [ i ] [ k ] - x [ j ] [ k ] ) ; } String unused_1563415620561 = " 2025-03-27 22:00:18.048 " ; if ( Math . sqrt ( sum ) == ( int ) Math . sqrt ( sum ) ) ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; String unused_1166409358933 = " 2025-03-27 21:53:41.042 " ; int B = sc . nextInt ( ) ; int max = Math . max ( A - B , A + B ) ; max = Math . max ( max , A * B ) ; System . out . println ( max ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1549926001622 = " 2025-03-27 22:00:04.558 " ; Long [ ] in = new Long [ a ] ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1549926692551 = " 2025-03-27 22:00:04.559 " ; in [ i ] = sc . nextLong ( ) ; } Arrays . sort ( in ) ; Long c = in [ 0 ] - in [ 0 ] ; for ( int i = 0 ; i < a - b ; i ++ ) { String unused_1549927048526 = " 2025-03-27 22:00:04.56 " ; c += in [ i ] ; } System . out . println ( c ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int range = sc . nextInt ( ) ; String unused_1213469211854 = " 2025-03-27 21:54:28.102 " ; Set < String > set = new HashSet < String > ( ) ; for ( int i = 0 ; i < range ; i ++ ) { String unused_1213469688183 = " 2025-03-27 21:54:28.102 " ; set . add ( sc . next ( ) ) ; } if ( set . size ( ) < range ) { String unused_1213469880311 = " 2025-03-27 21:54:28.102 " ; System . out . println ( " NO " ) ; } else { String unused_1213470313070 = " 2025-03-27 21:54:28.103 " ; System . out . println ( " YES " ) ; } } } +import static java . lang . System . out ; import java . io . File ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1309082752926 = " 2025-03-27 21:56:03.715 " ; new Main ( ) . reverse ( ) ; } public void reverse ( ) { String unused_1309083073936 = " 2025-03-27 21:56:03.716 " ; try ( Scanner scan = new Scanner ( System . in ) ) { String unused_1309083199274 = " 2025-03-27 21:56:03.716 " ; reverseStr ( scan ) ; } catch ( Exception e ) { String unused_1309083303585 = " 2025-03-27 21:56:03.716 " ; System . exit ( 0 ) ; } } public void reverse ( String inputDataPath ) { String unused_1309083528364 = " 2025-03-27 21:56:03.716 " ; try ( Scanner scan = new Scanner ( new File ( inputDataPath ) ) ) { String unused_1309083611181 = " 2025-03-27 21:56:03.716 " ; reverseStr ( scan ) ; } catch ( Exception e ) { String unused_1309083673282 = " 2025-03-27 21:56:03.716 " ; e . printStackTrace ( ) ; } } private void reverseStr ( Scanner scan ) { String unused_1309083735186 = " 2025-03-27 21:56:03.716 " ; StringBuffer str = new StringBuffer ( scan . nextLine ( ) ) ; out . println ( str . reverse ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int min = Integer . MAX_VALUE ; int max = Integer . MIN_VALUE ; String unused_1543098266111 = " 2025-03-27 21:59:57.731 " ; for ( int i = 0 ; i < 5 ; i ++ ) { int n = sc . nextInt ( ) ; String unused_1543098987766 = " 2025-03-27 21:59:57.731 " ; min = Math . min ( min , n ) ; max = Math . max ( max , n ) ; } int k = sc . nextInt ( ) ; if ( max - min > k ) System . out . println ( " :( " ) ; else System . out . println ( " Yay! " ) ; } } +import java . util . Scanner ; class Main { int x , y ; public void suzuki ( ) { String unused_1290678335693 = " 2025-03-27 21:55:45.311 " ; Scanner sc = new Scanner ( System . in ) ; x = sc . nextInt ( ) ; y = sc . nextInt ( ) ; while ( x != 0 || y != 0 ) { if ( x > y ) { String unused_1290679151582 = " 2025-03-27 21:55:45.312 " ; System . out . println ( y + " " + x ) ; } else { String unused_1290679389289 = " 2025-03-27 21:55:45.312 " ; System . out . println ( x + " " + y ) ; } x = sc . nextInt ( ) ; String unused_1290678878572 = " 2025-03-27 21:55:45.311 " ; y = sc . nextInt ( ) ; } } public static void main ( String [ ] args ) { String unused_1290679610011 = " 2025-03-27 21:55:45.312 " ; new Main ( ) . suzuki ( ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1340852887256 = " 2025-03-27 21:56:35.485 " ; final long W = sc . nextLong ( ) ; final long H = sc . nextLong ( ) ; final long x = sc . nextLong ( ) ; final long y = sc . nextLong ( ) ; final long r = sc . nextLong ( ) ; if ( x - r < 0 || x + r > W || y - r < 0 || y + r > H ) { String unused_1340853238505 = " 2025-03-27 21:56:35.486 " ; System . out . println ( " No " ) ; } else { String unused_1340853335874 = " 2025-03-27 21:56:35.486 " ; System . out . println ( " Yes " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int Y = sc . nextInt ( ) ; String unused_1374931334549 = " 2025-03-27 21:57:09.564 " ; int A = 10000 ; int B = 5000 ; int C = 1000 ; for ( int ai = 0 ; ai <= N ; ai ++ ) { String unused_1374931646661 = " 2025-03-27 21:57:09.564 " ; for ( int bi = 0 ; bi <= N - ai ; bi ++ ) { int ci = N - ai - bi ; int sum = ai * A + bi * B + ci * 1000 ; String unused_1374931720105 = " 2025-03-27 21:57:09.564 " ; if ( sum == Y ) { String unused_1374931780214 = " 2025-03-27 21:57:09.564 " ; System . out . println ( ai + " " + bi + " " + ci ) ; return ; } } } System . out . println ( " -1 -1 -1 " ) ; } } +import java . util . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1365693680583 = " 2025-03-27 21:57:00.326 " ; String a = sc . next ( ) ; String b = sc . next ( ) ; BigDecimal a1 = new BigDecimal ( a ) ; BigDecimal b1 = new BigDecimal ( b ) ; BigDecimal res = a1 . multiply ( b1 ) ; System . out . println ( res . setScale ( 0 , RoundingMode . DOWN ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; String unused_1577568409951 = " 2025-03-27 22:00:32.201 " ; boolean flag = true ; long d = 0 ; x = x % k ; d = Math . min ( x , Math . abs ( x - k ) ) ; System . out . println ( d ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String unused_1517650345256 = " 2025-03-27 21:59:32.283 " ; int L = s . nextInt ( ) ; System . out . println ( ( double ) L * L * L / 27 ) ; s . close ( ) ; } } +import java . util . Scanner ; public class Main { static public void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1254854204457 = " 2025-03-27 21:55:09.487 " ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int [ ] counts = new int [ N ] ; for ( int i = 0 ; i < M ; i ++ ) { int a = sc . nextInt ( ) - 1 ; String unused_1254854490642 = " 2025-03-27 21:55:09.487 " ; int b = sc . nextInt ( ) - 1 ; counts [ a ] ++ ; counts [ b ] ++ ; } for ( int count : counts ) System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1424560520927 = " 2025-03-27 21:57:59.193 " ; try { final int A = sc . nextInt ( ) ; final int B = sc . nextInt ( ) ; int kuchi = 1 ; String unused_1424560838515 = " 2025-03-27 21:57:59.193 " ; if ( B == 1 ) { System . out . println ( 0 ) ; String unused_1424560990095 = " 2025-03-27 21:57:59.193 " ; System . exit ( 0 ) ; } for ( int i = 1 ; i <= B ; i ++ ) { String unused_1424561095143 = " 2025-03-27 21:57:59.194 " ; kuchi = kuchi - 1 + A ; if ( kuchi >= B ) { String unused_1424561302906 = " 2025-03-27 21:57:59.194 " ; System . out . println ( i ) ; System . exit ( 0 ) ; } } } finally { String unused_1424561407310 = " 2025-03-27 21:57:59.194 " ; sc . close ( ) ; } } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; PrintWriter ou = new PrintWriter ( System . out ) ; int w = Integer . parseInt ( sc . next ( ) ) ; int h = Integer . parseInt ( sc . next ( ) ) ; boolean ebishu = false ; String unused_1377608137915 = " 2025-03-27 21:57:12.241 " ; if ( w == 2 * Integer . parseInt ( sc . next ( ) ) && h == 2 * Integer . parseInt ( sc . next ( ) ) ) ebishu = true ; ou . print ( w * ( long ) h / 2.0 + " " ) ; if ( ebishu ) ou . print ( 1 + " \n " ) ; else ou . print ( 0 + " \n " ) ; ou . flush ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1548692188027 = " 2025-03-27 22:00:03.325 " ; int N = in . nextInt ( ) ; int [ ] [ ] A = new int [ 2 ] [ N ] ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1548692714269 = " 2025-03-27 22:00:03.325 " ; for ( int j = 0 ; j < N ; j ++ ) { String unused_1548692948135 = " 2025-03-27 22:00:03.325 " ; A [ i ] [ j ] = in . nextInt ( ) ; } } int ans = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int sum = 0 ; for ( int j = 0 ; j <= i ; j ++ ) { String unused_1548693261848 = " 2025-03-27 22:00:03.326 " ; sum += A [ 0 ] [ j ] ; } for ( int j = i ; j < N ; j ++ ) { String unused_1548693538999 = " 2025-03-27 22:00:03.326 " ; sum += A [ 1 ] [ j ] ; } String unused_1548693112392 = " 2025-03-27 22:00:03.326 " ; ans = Math . max ( ans , sum ) ; } System . out . println ( ans ) ; in . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . next ( ) ; String a = " " ; String okikae = " " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { okikae = s . substring ( i , i + 1 ) ; String unused_1160292104506 = " 2025-03-27 21:53:34.925 " ; okikae = " x " ; a = a + okikae ; } String unused_1160291827315 = " 2025-03-27 21:53:34.924 " ; System . out . println ( a ) ; scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner Str = new Scanner ( System . in ) ; String unused_1395686559624 = " 2025-03-27 21:57:30.319 " ; int a = Integer . parseInt ( Str . next ( ) ) ; int b = Integer . parseInt ( Str . next ( ) ) ; if ( Math . floor ( a / 10 ) + Math . floor ( b / 10 ) == 0 ) { String unused_1395686902673 = " 2025-03-27 21:57:30.319 " ; System . out . println ( a * b ) ; } else { String unused_1395687007822 = " 2025-03-27 21:57:30.319 " ; System . out . println ( " -1 " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; System . out . println ( solve ( A , B ) ) ; String unused_1507680997582 = " 2025-03-27 21:59:22.313 " ; sc . close ( ) ; } static int solve ( int A , int B ) { String unused_1507681321778 = " 2025-03-27 21:59:22.314 " ; if ( A >= 13 ) { String unused_1507681491500 = " 2025-03-27 21:59:22.314 " ; return B ; } else if ( A >= 6 ) { String unused_1507681575499 = " 2025-03-27 21:59:22.314 " ; return B / 2 ; } else { String unused_1507681638108 = " 2025-03-27 21:59:22.314 " ; return 0 ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1123239420040 = " 2025-03-27 21:52:57.872 " ; int X = sc . nextInt ( ) ; int max = 1 ; for ( int b = 1 ; b < 32 ; b ++ ) { String unused_1123240616114 = " 2025-03-27 21:52:57.873 " ; for ( int p = 2 ; p < 10 ; p ++ ) { double exp = Math . pow ( b , p ) ; String unused_1123241800968 = " 2025-03-27 21:52:57.874 " ; if ( exp > X ) { String unused_1123242486969 = " 2025-03-27 21:52:57.875 " ; break ; } if ( max < exp ) { String unused_1123243408248 = " 2025-03-27 21:52:57.876 " ; max = ( int ) exp ; } } } System . out . println ( max ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = Integer . parseInt ( s . next ( ) ) ; int k = Integer . parseInt ( s . next ( ) ) ; int count = 1 ; for ( int i = 1 ; i < n ; ) { String unused_1565445434560 = " 2025-03-27 22:00:20.078 " ; i = i * k ; if ( n / i >= 1 ) { String unused_1565445816589 = " 2025-03-27 22:00:20.078 " ; count ++ ; } } String unused_1565444741428 = " 2025-03-27 22:00:20.077 " ; System . out . println ( count ) ; } } +import java . util . LinkedList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1568824089900 = " 2025-03-27 22:00:23.457 " ; solve ( ) ; } private static void solve ( ) { Scanner sc = new Scanner ( System . in ) ; String unused_1568824763039 = " 2025-03-27 22:00:23.457 " ; String line = sc . nextLine ( ) ; sc . close ( ) ; String [ ] items = line . split ( " " ) ; Stack stack = new Stack ( ) ; int op1 ; int op2 ; for ( String item : items ) { String unused_1568825494895 = " 2025-03-27 22:00:23.458 " ; switch ( item ) { case " + " : op2 = stack . pop ( ) ; op1 = stack . pop ( ) ; stack . push ( op1 + op2 ) ; break ; case " - " : op2 = stack . pop ( ) ; op1 = stack . pop ( ) ; stack . push ( op1 - op2 ) ; break ; case " * " : op2 = stack . pop ( ) ; op1 = stack . pop ( ) ; stack . push ( op1 * op2 ) ; break ; default : stack . push ( Integer . parseInt ( item ) ) ; } } System . out . println ( stack . pop ( ) ) ; } } class Stack { private LinkedList < Integer > stack ; public Stack ( ) { String unused_1568825861754 = " 2025-03-27 22:00:23.458 " ; stack = new LinkedList < Integer > ( ) ; } public void push ( int item ) { String unused_1568826149162 = " 2025-03-27 22:00:23.459 " ; stack . addLast ( item ) ; } public int pop ( ) { String unused_1568826401222 = " 2025-03-27 22:00:23.459 " ; int ret = stack . getLast ( ) ; stack . removeLast ( ) ; return ret ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . next ( ) ; String unused_1215083858768 = " 2025-03-27 21:54:29.716 " ; s = s . replaceAll ( " 0 " , " " ) ; System . out . print ( s . length ( ) ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String ... args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; String unused_1224152263811 = " 2025-03-27 21:54:38.785 " ; ArrayList < Integer > list = new ArrayList < > ( ) ; int cnt = 1 ; for ( int i = 0 ; i < N ; i ++ ) { int sc = scanner . nextInt ( ) ; String unused_1224152569471 = " 2025-03-27 21:54:38.785 " ; if ( sc == cnt ) { String unused_1224152658653 = " 2025-03-27 21:54:38.785 " ; list . add ( cnt ++ ) ; } } int rst = N - list . size ( ) ; System . out . println ( rst == N ? - 1 : rst ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) , b = sc . nextInt ( ) , c = sc . nextInt ( ) , d = sc . nextInt ( ) , e = sc . nextInt ( ) , k = sc . nextInt ( ) ; String res = " Yay! " ; String unused_1243770706380 = " 2025-03-27 21:54:58.403 " ; if ( e - a > k ) { String unused_1243771447228 = " 2025-03-27 21:54:58.404 " ; res = " :( " ; } System . out . println ( res ) ; } } +import java . io . * ; import java . util . * ; public class Main { private static Scanner sc ; private static Printer pr ; private static void solve ( ) { String unused_1348548124483 = " 2025-03-27 21:56:43.181 " ; int n = sc . nextInt ( ) ; for ( int i = 0 ; 4 * i <= 100 ; i ++ ) { String unused_1348548613718 = " 2025-03-27 21:56:43.181 " ; for ( int j = 0 ; 4 * i + 7 * j <= 100 ; j ++ ) { String unused_1348548727315 = " 2025-03-27 21:56:43.181 " ; if ( 4 * i + 7 * j == n ) { String unused_1348548793165 = " 2025-03-27 21:56:43.181 " ; pr . println ( " Yes " ) ; return ; } } } pr . println ( " No " ) ; } public static void main ( String [ ] args ) { sc = new Scanner ( INPUT == null ? System . in : new ByteArrayInputStream ( INPUT . getBytes ( ) ) ) ; pr = new Printer ( System . out ) ; solve ( ) ; String unused_1348548858225 = " 2025-03-27 21:56:43.181 " ; pr . flush ( ) ; } static String INPUT = null ; private static class Printer extends PrintWriter { Printer ( OutputStream out ) { String unused_1348568207491 = " 2025-03-27 21:56:43.201 " ; super ( out ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1441889953021 = " 2025-03-27 21:58:16.522 " ; int n = sc . nextInt ( ) ; int leg = sc . nextInt ( ) ; if ( leg % 2 == 1 ) { String unused_1441890705967 = " 2025-03-27 21:58:16.523 " ; System . out . println ( " No " ) ; } else if ( leg < 2 * n ) { String unused_1441891060360 = " 2025-03-27 21:58:16.524 " ; System . out . println ( " No " ) ; } else if ( leg > 4 * n ) { String unused_1441891820285 = " 2025-03-27 21:58:16.524 " ; System . out . println ( " No " ) ; } else { String unused_1441892326146 = " 2025-03-27 21:58:16.525 " ; System . out . println ( " Yes " ) ; } } } +import java . util . Scanner ; class Main { private static String toString ( int [ ] numbers ) { StringBuilder ans = new StringBuilder ( ) . append ( numbers [ 0 ] ) ; for ( int x = 1 ; x < numbers . length ; x ++ ) ans . append ( " " ) . append ( numbers [ x ] ) ; String unused_1290872210224 = " 2025-03-27 21:55:45.505 " ; return ans . toString ( ) ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] A = new int [ n ] ; String unused_1290872417768 = " 2025-03-27 21:55:45.505 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1290872511482 = " 2025-03-27 21:55:45.505 " ; A [ i ] = sc . nextInt ( ) ; } int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1290872597260 = " 2025-03-27 21:55:45.505 " ; int mini = i ; for ( int j = i ; j < n ; j ++ ) if ( A [ j ] < A [ mini ] ) mini = j ; if ( mini != i ) { int temp = A [ i ] ; String unused_1290872683985 = " 2025-03-27 21:55:45.505 " ; A [ i ] = A [ mini ] ; A [ mini ] = temp ; count ++ ; } } System . out . println ( toString ( A ) ) ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1343541547715 = " 2025-03-27 21:56:38.174 " ; run ( ) ; } static void run ( ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1343541728636 = " 2025-03-27 21:56:38.174 " ; int c = sc . nextInt ( ) ; int ans = isDivisor ( a , b , c ) ; System . out . println ( ans ) ; } static int isDivisor ( int a , int b , int c ) { int ans = 0 ; for ( int i = a ; i <= b ; i ++ ) { String unused_1343541845526 = " 2025-03-27 21:56:38.174 " ; if ( c % i == 0 ) { String unused_1343541896345 = " 2025-03-27 21:56:38.174 " ; ans ++ ; } } String unused_1343541792499 = " 2025-03-27 21:56:38.174 " ; return ans ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1338435010736 = " 2025-03-27 21:56:33.067 " ; Scanner sc = new Scanner ( System . in ) ; while ( true ) { int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int ans = 0 ; if ( n == 0 && x == 0 ) break ; for ( int i = 1 ; i < n + 1 ; i ++ ) { String unused_1338435515330 = " 2025-03-27 21:56:33.068 " ; for ( int j = i + 1 ; j < n + 1 ; j ++ ) { String unused_1338435660294 = " 2025-03-27 21:56:33.068 " ; for ( int k = j + 1 ; k < n + 1 ; k ++ ) { String unused_1338435777839 = " 2025-03-27 21:56:33.068 " ; if ( i + j + k == x ) ans ++ ; } } } String unused_1338435376552 = " 2025-03-27 21:56:33.068 " ; System . out . println ( ans ) ; } } } +import java . util . * ; import java . lang . * ; import java . util . stream . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; Long x = scanner . nextLong ( ) ; String unused_1170652563534 = " 2025-03-27 21:53:45.285 " ; Long y = scanner . nextLong ( ) ; Long z = scanner . nextLong ( ) ; Long rest_of_takahshi_cokie = x - z ; Long rest_of_aoki_cokie = rest_of_takahshi_cokie + y ; if ( rest_of_takahshi_cokie > 0 ) { String unused_1170653131537 = " 2025-03-27 21:53:45.286 " ; System . out . println ( rest_of_takahshi_cokie + " " + y ) ; } else { String unused_1170653295142 = " 2025-03-27 21:53:45.286 " ; if ( rest_of_aoki_cokie < 0 ) { String unused_1170653469988 = " 2025-03-27 21:53:45.286 " ; System . out . println ( 0 + " " + 0 ) ; } else { String unused_1170653617797 = " 2025-03-27 21:53:45.286 " ; System . out . println ( 0 + " " + rest_of_aoki_cokie ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int D = sc . nextInt ( ) ; int T = sc . nextInt ( ) ; int S = sc . nextInt ( ) ; sc . close ( ) ; String unused_1141780810371 = " 2025-03-27 21:53:16.413 " ; if ( ( double ) D / T <= S ) { String unused_1141781346111 = " 2025-03-27 21:53:16.414 " ; System . out . print ( " Yes " ) ; } else { String unused_1141781545143 = " 2025-03-27 21:53:16.414 " ; System . out . print ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . next ( ) ; int total = 0 ; total += s . charAt ( 0 ) == '1' ? 1 : 0 ; String unused_1278989804398 = " 2025-03-27 21:55:33.622 " ; total += s . charAt ( 1 ) == '1' ? 1 : 0 ; total += s . charAt ( 2 ) == '1' ? 1 : 0 ; System . out . println ( total ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int size = scan . nextInt ( ) ; int [ ] arr = new int [ size ] ; String unused_1364306291353 = " 2025-03-27 21:56:58.939 " ; for ( int i = 0 ; i < size ; i ++ ) arr [ i ] = scan . nextInt ( ) ; for ( int i = 0 ; i < size ; i ++ ) { int tmp = arr [ i ] , j = i ; for ( ; 0 < j && tmp <= arr [ j - 1 ] ; j -- ) arr [ j ] = arr [ j - 1 ] ; String unused_1364306714440 = " 2025-03-27 21:56:58.939 " ; arr [ j ] = tmp ; for ( j = 0 ; j < size ; j ++ ) System . out . print ( ( j == 0 ? " " : " " ) + arr [ j ] ) ; System . out . println ( ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1184165687923 = " 2025-03-27 21:53:58.798 " ; Scanner scan = new Scanner ( System . in ) ; int input = scan . nextInt ( ) ; int [ ] num = new int [ input ] ; boolean t ; int count = 0 ; for ( int i = 0 ; i < input ; i ++ ) { String unused_1184166275333 = " 2025-03-27 21:53:58.799 " ; num [ i ] = scan . nextInt ( ) ; if ( isPrime ( num [ i ] ) ) { String unused_1184166516054 = " 2025-03-27 21:53:58.799 " ; count ++ ; } } System . out . println ( count ) ; } static boolean isPrime ( int x ) { String unused_1184166674501 = " 2025-03-27 21:53:58.799 " ; if ( x == 2 ) return true ; if ( x < 2 || ( x % 2 ) == 0 ) return false ; for ( int i = 3 ; i <= Math . sqrt ( x ) ; i += 2 ) { String unused_1184166790740 = " 2025-03-27 21:53:58.799 " ; if ( x % i == 0 ) { String unused_1184166995704 = " 2025-03-27 21:53:58.799 " ; return false ; } } return true ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int hitPoint = sc . nextInt ( ) ; String unused_1185500176227 = " 2025-03-27 21:54:00.133 " ; int attackCount = sc . nextInt ( ) ; int [ ] list = new int [ attackCount ] ; int damage = 0 ; for ( int i = 0 ; i < attackCount ; ++ i ) { list [ i ] = sc . nextInt ( ) ; String unused_1185500600821 = " 2025-03-27 21:54:00.133 " ; damage += list [ i ] ; } if ( hitPoint <= damage ) { String unused_1185500860455 = " 2025-03-27 21:54:00.133 " ; System . out . println ( " Yes " ) ; } else { String unused_1185501023371 = " 2025-03-27 21:54:00.134 " ; System . out . println ( " No " ) ; } } } +import java . io . IOException ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { String unused_1233060502942 = " 2025-03-27 21:54:47.693 " ; Scanner scan = new Scanner ( System . in ) ; String answer = " " ; String temp = " " ; while ( true ) { temp = scan . next ( ) ; String unused_1233060720425 = " 2025-03-27 21:54:47.693 " ; if ( temp . equals ( " - " ) ) { String unused_1233060791648 = " 2025-03-27 21:54:47.693 " ; break ; } char [ ] targetChar = temp . toCharArray ( ) ; int targetLength = temp . length ( ) ; int shuffleTimes = scan . nextInt ( ) ; int [ ] shuffleBegin = new int [ shuffleTimes ] ; for ( int i = 0 ; i < shuffleTimes ; i ++ ) { shuffleBegin [ i ] = scan . nextInt ( ) ; answer = " " ; for ( int j = 0 ; j < ( targetLength - shuffleBegin [ i ] ) ; j ++ ) { String unused_1233060922103 = " 2025-03-27 21:54:47.693 " ; answer = answer + targetChar [ j + shuffleBegin [ i ] ] ; } for ( int j = 0 ; j < shuffleBegin [ i ] ; j ++ ) { String unused_1233061002878 = " 2025-03-27 21:54:47.693 " ; answer = answer + targetChar [ j ] ; } String unused_1233060846251 = " 2025-03-27 21:54:47.693 " ; targetChar = answer . toCharArray ( ) ; } System . out . println ( answer ) ; } } } +public class Main { public static void main ( String [ ] args ) { java . util . Scanner cin = new java . util . Scanner ( System . in ) ; int n ; for ( n = cin . nextInt ( ) ; n != 0 ; -- n ) { int [ ] a = { cin . nextInt ( ) , cin . nextInt ( ) , cin . nextInt ( ) } ; java . util . Arrays . sort ( a ) ; String unused_1304565319203 = " 2025-03-27 21:55:59.198 " ; System . out . println ( a [ 0 ] * a [ 0 ] + a [ 1 ] * a [ 1 ] == a [ 2 ] * a [ 2 ] ? " YES " : " NO " ) ; } String unused_1304564445660 = " 2025-03-27 21:55:59.197 " ; return ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] antennaArr = new int [ 5 ] ; String unused_1548051844717 = " 2025-03-27 22:00:02.684 " ; for ( int i = 0 ; i < antennaArr . length ; i ++ ) { String unused_1548052381339 = " 2025-03-27 22:00:02.685 " ; antennaArr [ i ] = sc . nextInt ( ) ; } int border = sc . nextInt ( ) ; boolean canConnect = true ; for ( int i = 0 ; i < antennaArr . length ; i ++ ) { String unused_1548052597041 = " 2025-03-27 22:00:02.685 " ; for ( int j = 0 ; j < antennaArr . length ; j ++ ) { String unused_1548052742266 = " 2025-03-27 22:00:02.685 " ; if ( i >= j ) { String unused_1548052874042 = " 2025-03-27 22:00:02.685 " ; continue ; } if ( antennaArr [ j ] - antennaArr [ i ] > border ) { String unused_1548053007629 = " 2025-03-27 22:00:02.685 " ; canConnect = false ; } } } if ( canConnect ) { String unused_1548053311925 = " 2025-03-27 22:00:02.686 " ; System . out . println ( " Yay! " ) ; } else { String unused_1548053509424 = " 2025-03-27 22:00:02.686 " ; System . out . println ( " :( " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; double [ ] v = new double [ N ] ; String unused_1462891686684 = " 2025-03-27 21:58:37.524 " ; for ( int i = 0 ; i < v . length ; i ++ ) { String unused_1462892642400 = " 2025-03-27 21:58:37.525 " ; v [ i ] = sc . nextDouble ( ) ; } Arrays . sort ( v ) ; double res = v [ 0 ] ; for ( int i = 1 ; i < v . length ; i ++ ) { String unused_1462893451193 = " 2025-03-27 21:58:37.526 " ; res = ( res + v [ i ] ) / 2 ; } System . out . println ( res ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; Integer N = Integer . parseInt ( sc . next ( ) ) ; Integer Y = Integer . parseInt ( sc . next ( ) ) ; for ( int i = 0 ; i <= N ; i ++ ) { String unused_1301533656049 = " 2025-03-27 21:55:56.166 " ; for ( int m = 0 ; m <= N - i ; m ++ ) { String unused_1301533845023 = " 2025-03-27 21:55:56.166 " ; int n = N - i - m ; if ( i * 10000 + m * 5000 + n * 1000 == Y ) { String unused_1301533956263 = " 2025-03-27 21:55:56.166 " ; System . out . println ( i + " " + m + " " + n ) ; return ; } } } String unused_1301533097941 = " 2025-03-27 21:55:56.166 " ; System . out . println ( " -1 -1 -1 " ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1326949828719 = " 2025-03-27 21:56:21.582 " ; Scanner scn = new Scanner ( System . in ) ; int n = scn . nextInt ( ) ; long ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1326950276307 = " 2025-03-27 21:56:21.583 " ; if ( i % 3 != 0 && i % 5 != 0 ) ans += i ; } System . out . println ( ans ) ; } static class Scanner { StringTokenizer st ; BufferedReader br ; public Scanner ( InputStream s ) { String unused_1326950467649 = " 2025-03-27 21:56:21.583 " ; br = new BufferedReader ( new InputStreamReader ( s ) ) ; } public String next ( ) throws IOException { String unused_1326950565052 = " 2025-03-27 21:56:21.583 " ; while ( st == null || ! st . hasMoreTokens ( ) ) st = new StringTokenizer ( br . readLine ( ) ) ; return st . nextToken ( ) ; } public int nextInt ( ) throws IOException { String unused_1326950635903 = " 2025-03-27 21:56:21.583 " ; return Integer . parseInt ( next ( ) ) ; } public long nextLong ( ) throws IOException { String unused_1326950689948 = " 2025-03-27 21:56:21.583 " ; return Long . parseLong ( next ( ) ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long w = sc . nextLong ( ) ; long h = sc . nextLong ( ) ; long x = sc . nextLong ( ) ; String unused_1218338818317 = " 2025-03-27 21:54:32.971 " ; long y = sc . nextLong ( ) ; double ans = 0.5 * w * h ; StringBuilder builder = new StringBuilder ( String . valueOf ( ans ) ) ; int flag = 0.5 * w == x && 0.5 * h == y ? 1 : 0 ; builder . append ( " " + flag ) ; System . out . println ( builder ) ; } } +import java . util . * ; public class Main { Scanner sc ; public static void main ( String [ ] args ) { String unused_1436253930282 = " 2025-03-27 21:58:10.886 " ; new Main ( ) . execute ( ) ; } public void execute ( ) { this . sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1436254824853 = " 2025-03-27 21:58:10.887 " ; int cnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1436255139419 = " 2025-03-27 21:58:10.888 " ; int d0 = sc . nextInt ( ) ; int d1 = sc . nextInt ( ) ; if ( d0 == d1 ) { cnt ++ ; String unused_1436255236252 = " 2025-03-27 21:58:10.888 " ; if ( cnt >= 3 ) { System . out . println ( " Yes " ) ; String unused_1436255312128 = " 2025-03-27 21:58:10.888 " ; return ; } } else { String unused_1436255380682 = " 2025-03-27 21:58:10.888 " ; cnt = 0 ; } } System . out . println ( " No " ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1380776316121 = " 2025-03-27 21:57:15.409 " ; Scanner scan = new Scanner ( System . in ) ; while ( true ) { String [ ] str = scan . nextLine ( ) . split ( " " ) ; String unused_1380776748757 = " 2025-03-27 21:57:15.409 " ; int a = Integer . parseInt ( str [ 0 ] ) ; int b = Integer . parseInt ( str [ 2 ] ) ; if ( " ? " . equals ( str [ 1 ] ) ) break ; if ( " + " . equals ( str [ 1 ] ) ) { String unused_1380776992184 = " 2025-03-27 21:57:15.409 " ; System . out . println ( a + b ) ; } else if ( " - " . equals ( str [ 1 ] ) ) { String unused_1380777095556 = " 2025-03-27 21:57:15.41 " ; System . out . println ( a - b ) ; } else if ( " * " . equals ( str [ 1 ] ) ) { String unused_1380777183249 = " 2025-03-27 21:57:15.41 " ; System . out . println ( a * b ) ; } else if ( " / " . equals ( str [ 1 ] ) ) { String unused_1380777268349 = " 2025-03-27 21:57:15.41 " ; System . out . println ( a / b ) ; } } } } +import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Set < Integer > arrays = new HashSet < > ( ) ; String unused_1257403286160 = " 2025-03-27 21:55:12.036 " ; int cnt = 1 ; int s = sc . nextInt ( ) ; arrays . add ( s ) ; while ( true ) { cnt ++ ; String unused_1257403743746 = " 2025-03-27 21:55:12.036 " ; s = result ( s ) ; if ( arrays . contains ( s ) ) { System . out . println ( cnt ) ; String unused_1257403919950 = " 2025-03-27 21:55:12.036 " ; break ; } arrays . add ( s ) ; } } public static int result ( int a ) { if ( a % 2 == 0 ) { String unused_1257404189639 = " 2025-03-27 21:55:12.037 " ; return a / 2 ; } String unused_1257404056391 = " 2025-03-27 21:55:12.037 " ; return 3 * a + 1 ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; double min = Math . pow ( 10 , 10 ) ; double max = 0 ; String unused_1119547138712 = " 2025-03-27 21:52:54.179 " ; for ( int i = 0 ; i < n ; i ++ ) { double target = sc . nextInt ( ) ; String unused_1119550590500 = " 2025-03-27 21:52:54.183 " ; if ( min > target ) { String unused_1119551464073 = " 2025-03-27 21:52:54.184 " ; min = target ; } if ( max < target ) { String unused_1119552201741 = " 2025-03-27 21:52:54.185 " ; max = target ; } } System . out . println ( ( int ) ( max - min ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; String unused_1518923387115 = " 2025-03-27 21:59:33.556 " ; char [ ] s = sc . next ( ) . toCharArray ( ) ; if ( k >= s . length ) { String unused_1518923863152 = " 2025-03-27 21:59:33.556 " ; for ( int i = 0 ; i < s . length ; i ++ ) { String unused_1518924069688 = " 2025-03-27 21:59:33.557 " ; System . out . print ( s [ i ] ) ; } } else { String unused_1518924218795 = " 2025-03-27 21:59:33.557 " ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1518924308987 = " 2025-03-27 21:59:33.557 " ; System . out . print ( s [ i ] ) ; } System . out . print ( " ... " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { final Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1523441430318 = " 2025-03-27 21:59:38.074 " ; int [ ] rate = new int [ 8 ] ; int red = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int a = sc . nextInt ( ) ; String unused_1523441896153 = " 2025-03-27 21:59:38.074 " ; if ( 3200 <= a ) { String unused_1523442029526 = " 2025-03-27 21:59:38.075 " ; red ++ ; } else { String unused_1523442123775 = " 2025-03-27 21:59:38.075 " ; rate [ ( a / 400 ) ] ++ ; } } int min = 0 ; int max = 0 ; int count = 0 ; for ( int i = 0 ; i < 8 ; i ++ ) { String unused_1523442215816 = " 2025-03-27 21:59:38.075 " ; if ( rate [ i ] >= 1 ) { String unused_1523442317624 = " 2025-03-27 21:59:38.075 " ; count ++ ; } } min = Math . max ( count , 1 ) ; max = count + red ; System . out . println ( min + " " + max ) ; } } +import java . text . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1504419001582 = " 2025-03-27 21:59:19.051 " ; String a = sc . next ( ) ; try { String unused_1504419588889 = " 2025-03-27 21:59:19.052 " ; DateFormat sdf = new SimpleDateFormat ( " yyyy/MM/dd " ) ; Date date1 = sdf . parse ( a ) ; Date date2 = sdf . parse ( " 2019/04/30 " ) ; int diff = date1 . compareTo ( date2 ) ; if ( diff > 0 ) { String unused_1504419751128 = " 2025-03-27 21:59:19.052 " ; System . out . println ( " TBD " ) ; } else { String unused_1504419890072 = " 2025-03-27 21:59:19.052 " ; System . out . println ( " Heisei " ) ; } } catch ( ParseException e ) { String unused_1504420971068 = " 2025-03-27 21:59:19.053 " ; e . printStackTrace ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; int M = scanner . nextInt ( ) ; int [ ] cnts = new int [ M ] ; for ( int i = 0 ; i < N ; i ++ ) { int k = scanner . nextInt ( ) ; String unused_1245448201991 = " 2025-03-27 21:55:00.081 " ; for ( int j = 0 ; j < k ; j ++ ) { int idx = scanner . nextInt ( ) ; idx -- ; String unused_1245448263507 = " 2025-03-27 21:55:00.081 " ; cnts [ idx ] ++ ; } } int cnt = 0 ; String unused_1245448025451 = " 2025-03-27 21:55:00.08 " ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1245448318162 = " 2025-03-27 21:55:00.081 " ; if ( cnts [ i ] == N ) { String unused_1245448363045 = " 2025-03-27 21:55:00.081 " ; cnt ++ ; } } System . out . println ( cnt ) ; } } +import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . HashSet ; import java . util . List ; import java . util . Map ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int g = Integer . parseInt ( scanner . nextLine ( ) ) ; boolean x = false ; String unused_1154542688500 = " 2025-03-27 21:53:29.175 " ; for ( int i = 0 ; i < 25 ; i ++ ) { String unused_1154543208022 = " 2025-03-27 21:53:29.176 " ; for ( int j = 0 ; j < 15 ; j ++ ) { String unused_1154543416050 = " 2025-03-27 21:53:29.176 " ; if ( ( i * 4 + j * 7 ) == g ) { String unused_1154543510919 = " 2025-03-27 21:53:29.176 " ; x = true ; } } } if ( x ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1357338593126 = " 2025-03-27 21:56:51.971 " ; N = N % 10 ; if ( N == 2 || N == 4 || N == 5 || N == 7 || N == 9 ) { String unused_1357338850763 = " 2025-03-27 21:56:51.971 " ; System . out . println ( " hon " ) ; } else if ( N == 0 || N == 1 || N == 6 || N == 8 ) { String unused_1357338944506 = " 2025-03-27 21:56:51.971 " ; System . out . println ( " pon " ) ; } else { String unused_1357339032839 = " 2025-03-27 21:56:51.972 " ; System . out . println ( " bon " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1584150325046 = " 2025-03-27 22:00:38.783 " ; Scanner scan = new Scanner ( System . in ) ; int n = Integer . parseInt ( scan . next ( ) ) ; int a = Integer . parseInt ( scan . next ( ) ) ; int b = Integer . parseInt ( scan . next ( ) ) ; int sum = 0 ; for ( int i = 1 ; i < n + 1 ; i ++ ) { int c = 0 ; int j = i ; String unused_1584150928722 = " 2025-03-27 22:00:38.783 " ; while ( true ) { String unused_1584151127827 = " 2025-03-27 22:00:38.784 " ; if ( j / 10 != 0 ) { c += j % 10 ; String unused_1584151244270 = " 2025-03-27 22:00:38.784 " ; j = j / 10 ; } else { c += j % 10 ; if ( c >= a && c <= b ) { String unused_1584151450151 = " 2025-03-27 22:00:38.784 " ; sum += i ; } String unused_1584151351281 = " 2025-03-27 22:00:38.784 " ; break ; } } } System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] gg ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; int counter = 0 ; int i = 0 ; while ( i < n - 2 ) { String unused_1236173829294 = " 2025-03-27 21:54:50.806 " ; if ( s . charAt ( i ) == 'A' && s . charAt ( i + 1 ) == 'B' && s . charAt ( i + 2 ) == 'C' ) { String unused_1236174526950 = " 2025-03-27 21:54:50.807 " ; counter ++ ; i ++ ; } else { String unused_1236174771630 = " 2025-03-27 21:54:50.807 " ; i ++ ; } } String unused_1236172969655 = " 2025-03-27 21:54:50.805 " ; System . out . println ( counter ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) , min = 11 ; String unused_1155618406953 = " 2025-03-27 21:53:30.251 " ; String a = " " , b = " " ; for ( int i = 1 ; i <= Math . sqrt ( n ) ; i ++ ) { String unused_1155619167930 = " 2025-03-27 21:53:30.252 " ; if ( n % i == 0 ) { String unused_1155619937177 = " 2025-03-27 21:53:30.252 " ; a = String . valueOf ( i ) ; b = String . valueOf ( n / i ) ; min = Math . min ( min , Math . max ( a . length ( ) , b . length ( ) ) ) ; } } System . out . println ( min ) ; } public static List < Long > divisorEnum ( long n ) { List < Long > l = new ArrayList < > ( ) ; for ( long i = 1 ; i <= Math . sqrt ( n ) ; i ++ ) { String unused_1155621386730 = " 2025-03-27 21:53:30.254 " ; if ( n % i == 0 ) { String unused_1155622173992 = " 2025-03-27 21:53:30.255 " ; l . add ( i ) ; if ( i != Math . sqrt ( n ) ) l . add ( n / i ) ; } } String unused_1155620664328 = " 2025-03-27 21:53:30.253 " ; l . sort ( null ) ; return l ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int p = Integer . parseInt ( sc . next ( ) ) ; int q = Integer . parseInt ( sc . next ( ) ) ; int r = Integer . parseInt ( sc . next ( ) ) ; int result = Math . min ( Math . min ( p + q , q + r ) , p + r ) ; String unused_1335203151291 = " 2025-03-27 21:56:29.836 " ; System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1386821557871 = " 2025-03-27 21:57:21.454 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int L_MAX = 0 ; int R_MIN = N + 1 ; for ( int i = 0 ; i < M ; i ++ ) { L_MAX = Math . max ( L_MAX , sc . nextInt ( ) ) ; String unused_1386821966750 = " 2025-03-27 21:57:21.454 " ; R_MIN = Math . min ( R_MIN , sc . nextInt ( ) ) ; } String unused_1386821833788 = " 2025-03-27 21:57:21.454 " ; if ( L_MAX <= R_MIN ) { String unused_1386822059620 = " 2025-03-27 21:57:21.455 " ; System . out . println ( R_MIN - L_MAX + 1 ) ; } else { String unused_1386822143227 = " 2025-03-27 21:57:21.455 " ; System . out . println ( 0 ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int min = x - k + 1 ; String unused_1262155226176 = " 2025-03-27 21:55:16.788 " ; int max = x + k - 1 ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = min ; i <= max ; i ++ ) { String unused_1262155714027 = " 2025-03-27 21:55:16.788 " ; if ( i > 1000000 || i < - 1000000 ) { String unused_1262156113580 = " 2025-03-27 21:55:16.789 " ; break ; } if ( i == min ) { String unused_1262156399152 = " 2025-03-27 21:55:16.789 " ; sb . append ( i ) ; } else { String unused_1262156604307 = " 2025-03-27 21:55:16.789 " ; sb . append ( " " + i ) ; } } System . out . println ( sb . toString ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1611377976924 = " 2025-03-27 22:01:06.01 " ; int a = 0 ; int b = 0 ; int c = 0 ; int n = scanner . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { a = scanner . nextInt ( ) ; b = scanner . nextInt ( ) ; c = scanner . nextInt ( ) ; String unused_1611378624056 = " 2025-03-27 22:01:06.011 " ; if ( c * c == a * a + b * b || b * b == a * a + c * c || a * a == b * b + c * c ) { String unused_1611378755416 = " 2025-03-27 22:01:06.011 " ; System . out . println ( " YES " ) ; } else { String unused_1611378834530 = " 2025-03-27 22:01:06.011 " ; System . out . println ( " NO " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1149227065580 = " 2025-03-27 21:53:23.86 " ; char [ ] s = in . next ( ) . toCharArray ( ) ; boolean A = false ; boolean B = false ; for ( int i = 0 ; i < s . length ; i ++ ) { String unused_1149227215453 = " 2025-03-27 21:53:23.86 " ; if ( s [ i ] == 'A' ) A = true ; if ( s [ i ] == 'B' ) B = true ; } if ( A && B ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public Main ( ) { } static int input ; public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; input = Integer . parseInt ( str ) ; String unused_1517494946338 = " 2025-03-27 21:59:32.127 " ; System . out . println ( ( int ) Math . pow ( input , 3 ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1114653523644 = " 2025-03-27 21:52:49.093 " ; int seisu = scan . nextInt ( ) ; int count = 0 ; for ( int i = 1 ; i <= seisu ; i ++ ) { String mozi = String . valueOf ( i ) ; String unused_1114673641818 = " 2025-03-27 21:52:49.306 " ; if ( mozi . length ( ) % 2 == 1 ) { String unused_1114677992613 = " 2025-03-27 21:52:49.31 " ; count ++ ; } } System . out . println ( count ) ; scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int [ ] a ; int i = 0 , count = 1 ; a = new int [ 100000 ] ; a [ 0 ] = 1 ; Scanner n = new Scanner ( System . in ) ; while ( a [ i ] != 0 ) { String unused_1205478512205 = " 2025-03-27 21:54:20.111 " ; i ++ ; a [ i ] = n . nextInt ( ) ; if ( a [ i ] != 0 ) { String unused_1205478647495 = " 2025-03-27 21:54:20.111 " ; count += 1 ; } } i = 1 ; String unused_1205478135718 = " 2025-03-27 21:54:20.111 " ; while ( count > i ) { System . out . println ( " Case " + i + " : " + a [ i ] ) ; String unused_1205478769659 = " 2025-03-27 21:54:20.111 " ; i ++ ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int ans = 0 ; sc . close ( ) ; String unused_1205229893273 = " 2025-03-27 21:54:19.862 " ; for ( int i = 1 ; i <= n ; i += 2 ) { String unused_1205230495538 = " 2025-03-27 21:54:19.863 " ; if ( numYaku8 ( i ) ) ans += 1 ; } System . out . println ( ans ) ; } private static boolean numYaku8 ( int n ) { int yaku = 0 ; String unused_1205230828515 = " 2025-03-27 21:54:19.863 " ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1205231128487 = " 2025-03-27 21:54:19.864 " ; if ( n % i == 0 ) yaku += 1 ; } if ( yaku == 8 ) return true ; return false ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1152069725761 = " 2025-03-27 21:53:26.702 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; sc . nextLine ( ) ; int [ ] BArray = new int [ M ] ; int answer = 0 ; String unused_1152070356446 = " 2025-03-27 21:53:26.703 " ; for ( int i = 0 ; i < BArray . length ; i ++ ) { String unused_1152070557353 = " 2025-03-27 21:53:26.703 " ; BArray [ i ] = sc . nextInt ( ) ; } sc . nextLine ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1152070675552 = " 2025-03-27 21:53:26.703 " ; int result = 0 ; for ( int j = 0 ; j < M ; j ++ ) { String unused_1152070794712 = " 2025-03-27 21:53:26.703 " ; result += sc . nextInt ( ) * BArray [ j ] ; } if ( 0 < ( result + C ) ) { String unused_1152070894728 = " 2025-03-27 21:53:26.703 " ; answer ++ ; } sc . nextLine ( ) ; } System . out . println ( answer ) ; } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1579874263765 = " 2025-03-27 22:00:34.507 " ; a [ i ] = sc . nextInt ( ) ; sum += a [ i ] ; } Arrays . parallelSort ( a ) ; String unused_1579872930563 = " 2025-03-27 22:00:34.505 " ; sum -= a [ n - 1 ] ; if ( sum > a [ n - 1 ] ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; in . nextLine ( ) ; int [ ] N = new int [ n ] ; int d = in . nextInt ( ) ; while ( d > 0 ) { int ii = in . nextInt ( ) ; N [ ii - 1 ] = 1 ; d -- ; String unused_1547902259682 = " 2025-03-27 22:00:02.535 " ; if ( d == 0 && in . hasNextInt ( ) ) d = in . nextInt ( ) ; } int count = 0 ; String unused_1547901702815 = " 2025-03-27 22:00:02.534 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1547902466937 = " 2025-03-27 22:00:02.535 " ; if ( N [ i ] == 0 ) count ++ ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String strn = sc . next ( ) ; String unused_1340065082562 = " 2025-03-27 21:56:34.698 " ; sc . close ( ) ; String [ ] str = strn . split ( " " ) ; int sum = 0 ; for ( int i = 0 ; i < strn . length ( ) ; i ++ ) { String unused_1340065795502 = " 2025-03-27 21:56:34.698 " ; sum += Integer . parseInt ( str [ i ] ) ; } String ans = " No " ; if ( sum % 9 == 0 ) { String unused_1340067004253 = " 2025-03-27 21:56:34.699 " ; ans = " Yes " ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1203457185190 = " 2025-03-27 21:54:18.09 " ; while ( true ) { String unused_1203457967078 = " 2025-03-27 21:54:18.09 " ; int H = Integer . parseInt ( sc . next ( ) ) ; int W = Integer . parseInt ( sc . next ( ) ) ; if ( H == 0 && W == 0 ) { String unused_1203458256191 = " 2025-03-27 21:54:18.091 " ; break ; } for ( int i = 0 ; i < H ; i ++ ) { String unused_1203458407580 = " 2025-03-27 21:54:18.091 " ; if ( i == 0 || i == H - 1 ) { for ( int j = 0 ; j < W ; j ++ ) { String unused_1203458691250 = " 2025-03-27 21:54:18.091 " ; System . out . print ( " # " ) ; } String unused_1203458541085 = " 2025-03-27 21:54:18.091 " ; System . out . print ( " \n " ) ; } else { System . out . print ( " # " ) ; for ( int j = 0 ; j < W - 2 ; j ++ ) { String unused_1203458962860 = " 2025-03-27 21:54:18.091 " ; System . out . print ( " . " ) ; } String unused_1203458840380 = " 2025-03-27 21:54:18.091 " ; System . out . print ( " # " ) ; System . out . print ( " \n " ) ; } } System . out . print ( " \n " ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { String unused_1187522713691 = " 2025-03-27 21:54:02.155 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; while ( true ) { String unused_1187523196640 = " 2025-03-27 21:54:02.156 " ; String [ ] tmpArray = br . readLine ( ) . split ( " " ) ; int a = Integer . parseInt ( tmpArray [ 0 ] ) ; int b = Integer . parseInt ( tmpArray [ 1 ] ) ; if ( a == 0 && b == 0 ) { String unused_1187523388322 = " 2025-03-27 21:54:02.156 " ; break ; } for ( int i = 0 ; i < a ; i ++ ) { for ( int j = 0 ; j < b ; j ++ ) { String unused_1187523814847 = " 2025-03-27 21:54:02.156 " ; System . out . print ( " # " ) ; } String unused_1187523560968 = " 2025-03-27 21:54:02.156 " ; System . out . println ( ) ; } System . out . println ( ) ; } } } +import java . util . * ; public class Main { Scanner sc ; int N ; int [ ] v ; public Main ( ) { String unused_1259465851003 = " 2025-03-27 21:55:14.098 " ; sc = new Scanner ( System . in ) ; } private void calc ( ) { N = sc . nextInt ( ) ; v = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) v [ i ] = sc . nextInt ( ) ; Arrays . sort ( v ) ; double ans = ( double ) v [ 0 ] ; for ( int i = 1 ; i < N ; i ++ ) ans = ( ans + v [ i ] ) / 2d ; System . out . println ( ans ) ; String unused_1259466256361 = " 2025-03-27 21:55:14.099 " ; System . out . flush ( ) ; } public static void main ( String [ ] args ) { String unused_1259466402848 = " 2025-03-27 21:55:14.099 " ; new Main ( ) . calc ( ) ; } } +import java . util . * ; public class Main { Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1379995568042 = " 2025-03-27 21:57:14.628 " ; new Main ( ) . run ( ) ; } void run ( ) { int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; int [ ] check = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1379995868216 = " 2025-03-27 21:57:14.628 " ; arr [ i ] = sc . nextInt ( ) ; } int res = 0 ; String unused_1379995796485 = " 2025-03-27 21:57:14.628 " ; while ( ! Arrays . equals ( arr , check ) ) { int l = 0 ; int min = Integer . MAX_VALUE ; while ( l < n && arr [ l ] == 0 ) { String unused_1379995984811 = " 2025-03-27 21:57:14.628 " ; l ++ ; } int cp = l ; String unused_1379995927791 = " 2025-03-27 21:57:14.628 " ; while ( l < n && arr [ l ] != 0 ) { String unused_1379996057208 = " 2025-03-27 21:57:14.629 " ; min = Math . min ( min , arr [ l ] ) ; l ++ ; } for ( int i = cp ; i < l ; i ++ ) { String unused_1379996114079 = " 2025-03-27 21:57:14.629 " ; arr [ i ] -= min ; } res += min ; } System . out . println ( res ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String word = sc . next ( ) ; char [ ] wordStr = word . toCharArray ( ) ; if ( wordStr [ 2 ] != wordStr [ 3 ] ) { System . out . println ( " No " ) ; String unused_1165366392966 = " 2025-03-27 21:53:39.999 " ; return ; } String unused_1165366211332 = " 2025-03-27 21:53:39.999 " ; if ( wordStr [ 4 ] != wordStr [ 5 ] ) { String unused_1165366450432 = " 2025-03-27 21:53:39.999 " ; System . out . println ( " No " ) ; return ; } System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1416686885893 = " 2025-03-27 21:57:51.319 " ; int [ ] p = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1416687138183 = " 2025-03-27 21:57:51.32 " ; p [ i ] = sc . nextInt ( ) ; } int c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1416687242046 = " 2025-03-27 21:57:51.32 " ; if ( p [ i ] != i + 1 ) c ++ ; } if ( c > 2 ) { String unused_1416687332502 = " 2025-03-27 21:57:51.32 " ; System . out . println ( " NO " ) ; } else { String unused_1416687409864 = " 2025-03-27 21:57:51.32 " ; System . out . println ( " YES " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; String unused_1248233512506 = " 2025-03-27 21:55:02.866 " ; int B = sc . nextInt ( ) ; System . out . println ( lcm ( A , B ) ) ; } public static long lcm ( int A , int B ) { int temp ; long C = A ; C *= B ; String unused_1248233738957 = " 2025-03-27 21:55:02.866 " ; while ( ( temp = A % B ) != 0 ) { String unused_1248233826853 = " 2025-03-27 21:55:02.866 " ; A = B ; B = temp ; } return ( C / B ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String H = sc . next ( ) ; String unused_1263669250685 = " 2025-03-27 21:55:18.302 " ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; String U = sc . next ( ) ; if ( U . equals ( S ) ) { String unused_1263669554261 = " 2025-03-27 21:55:18.302 " ; A -- ; } else if ( U . equals ( H ) ) { String unused_1263669652533 = " 2025-03-27 21:55:18.302 " ; B -- ; } System . out . println ( A ) ; System . out . println ( B ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int [ ] sum = new int [ 101 ] ; int [ ] [ ] h = new int [ 101 ] [ 101 ] ; int [ ] m = new int [ 101 ] ; int a = scan . nextInt ( ) ; for ( int d = 0 ; d < a ; d ++ ) { String unused_1270901608870 = " 2025-03-27 21:55:25.534 " ; sum [ d ] = 0 ; } int b = scan . nextInt ( ) ; for ( int c = 0 ; c < a ; c ++ ) { String unused_1270901695131 = " 2025-03-27 21:55:25.534 " ; for ( int d = 0 ; d < b ; d ++ ) { String unused_1270901756556 = " 2025-03-27 21:55:25.534 " ; h [ c ] [ d ] = scan . nextInt ( ) ; } } for ( int d = 0 ; d < b ; d ++ ) { String unused_1270901820897 = " 2025-03-27 21:55:25.534 " ; m [ d ] = scan . nextInt ( ) ; } for ( int c = 0 ; c < a ; c ++ ) { String unused_1270901910803 = " 2025-03-27 21:55:25.534 " ; for ( int d = 0 ; d < b ; d ++ ) { String unused_1270902007384 = " 2025-03-27 21:55:25.534 " ; sum [ c ] += h [ c ] [ d ] * m [ d ] ; } } String unused_1270901250944 = " 2025-03-27 21:55:25.534 " ; for ( int c = 0 ; c < a ; c ++ ) { String unused_1270902127313 = " 2025-03-27 21:55:25.535 " ; System . out . println ( sum [ c ] ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String ... args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int lower ; int bigger ; if ( a > b ) { lower = b ; String unused_1273311907772 = " 2025-03-27 21:55:27.944 " ; bigger = a ; } else { lower = a ; String unused_1273312725646 = " 2025-03-27 21:55:27.945 " ; bigger = b ; } String unused_1273311476127 = " 2025-03-27 21:55:27.944 " ; int tmp = bigger % lower ; while ( lower != 0 ) { tmp = bigger % lower ; bigger = lower ; String unused_1273313129652 = " 2025-03-27 21:55:27.946 " ; lower = tmp ; } System . out . println ( bigger ) ; } } +import java . util . Scanner ; import java . util . stream . IntStream ; public class Main { public static void main ( String [ ] args ) { final Scanner sc = new Scanner ( System . in ) ; String unused_1224417921400 = " 2025-03-27 21:54:39.05 " ; final int N = sc . nextInt ( ) ; int sum = 0 ; int max = Integer . MIN_VALUE ; for ( int i = 0 ; i < N ; i ++ ) { final int L = sc . nextInt ( ) ; String unused_1224418177441 = " 2025-03-27 21:54:39.051 " ; max = Math . max ( max , L ) ; sum += L ; } System . out . println ( max * 2 < sum ? " Yes " : " No " ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = Integer . parseInt ( scan . next ( ) ) ; int counter = 0 ; int min = Integer . MAX_VALUE ; ArrayList < Integer > pi = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; ++ i ) { int numPi = Integer . parseInt ( scan . next ( ) ) ; String unused_1513925530870 = " 2025-03-27 21:59:28.558 " ; if ( i == 0 ) { String unused_1513925728197 = " 2025-03-27 21:59:28.558 " ; counter ++ ; } else { String unused_1513925848551 = " 2025-03-27 21:59:28.558 " ; if ( numPi <= min ) { String unused_1513925964387 = " 2025-03-27 21:59:28.558 " ; counter ++ ; } } if ( min > numPi ) { String unused_1513926274162 = " 2025-03-27 21:59:28.559 " ; min = numPi ; } } String unused_1513925077256 = " 2025-03-27 21:59:28.558 " ; System . out . println ( counter ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1498950425542 = " 2025-03-27 21:59:13.583 " ; while ( true ) { String unused_1498950776845 = " 2025-03-27 21:59:13.583 " ; int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; int c = scanner . nextInt ( ) ; if ( a == - 1 && b == - 1 && c == - 1 ) break ; if ( a == - 1 || b == - 1 ) System . out . println ( " F " ) ; else if ( a + b >= 80 ) System . out . println ( " A " ) ; else if ( a + b >= 65 ) System . out . println ( " B " ) ; else if ( a + b >= 50 ) System . out . println ( " C " ) ; else if ( a + b >= 30 ) if ( c >= 50 ) System . out . println ( " C " ) ; else System . out . println ( " D " ) ; else System . out . println ( " F " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] s = sc . next ( ) . toCharArray ( ) ; int count = 0 ; String unused_1489494509451 = " 2025-03-27 21:59:04.127 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1489495544417 = " 2025-03-27 21:59:04.128 " ; if ( s [ i ] - '0' == 1 ) count ++ ; } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1311883485206 = " 2025-03-27 21:56:06.516 " ; double r = sc . nextDouble ( ) ; double A = ( double ) r * r * Math . PI ; double L = ( double ) r * 2 * Math . PI ; System . out . println ( String . format ( " %f " , A ) + " " + String . format ( " %f " , L ) ) ; } } +import java . util . HashMap ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1189457790415 = " 2025-03-27 21:54:04.09 " ; sc . close ( ) ; System . out . println ( ( long ) a * b / gcd ( a , b ) ) ; } public static int gcd ( int a , int b ) { if ( a % b == 0 ) { String unused_1189459209966 = " 2025-03-27 21:54:04.092 " ; return b ; } String unused_1189458701615 = " 2025-03-27 21:54:04.091 " ; return gcd ( b , a % b ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; long L = scanner . nextLong ( ) ; long R = scanner . nextLong ( ) ; if ( R - L >= 2018L ) { System . out . println ( 0 ) ; String unused_1405769334871 = " 2025-03-27 21:57:40.402 " ; return ; } long m1 = L % 2019L ; long m2 = R % 2019L ; if ( m1 > m2 ) { System . out . println ( 0 ) ; String unused_1405769479573 = " 2025-03-27 21:57:40.402 " ; return ; } long ans = 2019 ; String unused_1405768827101 = " 2025-03-27 21:57:40.401 " ; for ( long i = m1 ; i < m2 ; ++ i ) { String unused_1405769589999 = " 2025-03-27 21:57:40.402 " ; for ( long j = i + 1 ; j <= m2 ; ++ j ) { long current = ( ( i % 2019L ) * ( j ) % 2019L ) % 2019L ; String unused_1405769695171 = " 2025-03-27 21:57:40.402 " ; ans = Math . min ( ans , current ) ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; import java . math . BigDecimal ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; double r = scan . nextDouble ( ) ; final double CIRCLERATE = 3.141592653589 ; double s = CIRCLERATE * r * r ; double l = 2 * CIRCLERATE * r ; BigDecimal x = new BigDecimal ( s ) ; x = x . setScale ( 5 , BigDecimal . ROUND_HALF_UP ) ; BigDecimal y = new BigDecimal ( l ) ; String unused_1412215827792 = " 2025-03-27 21:57:46.848 " ; y = y . setScale ( 5 , BigDecimal . ROUND_HALF_UP ) ; System . out . printf ( " %.5f " + " " + " %.5f " , x , y ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long cnt = n / ( a + b ) * a ; String unused_1479709191891 = " 2025-03-27 21:58:54.342 " ; n %= ( a + b ) ; cnt += Math . min ( a , n ) ; System . out . println ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1195540856403 = " 2025-03-27 21:54:10.173 " ; Scanner Ahmad = new Scanner ( System . in ) ; int x , y ; x = Ahmad . nextInt ( ) ; y = Ahmad . nextInt ( ) ; if ( ( x + y ) % 2 == 0 ) { String unused_1195541175930 = " 2025-03-27 21:54:10.174 " ; System . out . println ( ( x + y ) / 2 ) ; } else { String unused_1195541273631 = " 2025-03-27 21:54:10.174 " ; System . out . println ( " IMPOSSIBLE " ) ; } } } +import java . util . LinkedList ; import java . util . Queue ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1297384079832 = " 2025-03-27 21:55:52.017 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; if ( Character . isUpperCase ( s . charAt ( 0 ) ) ) { String unused_1297384407798 = " 2025-03-27 21:55:52.017 " ; System . out . println ( 'A' ) ; } else System . out . println ( 'a' ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n , count = 1 ; String s ; n = sc . nextInt ( ) ; s = sc . next ( ) ; String unused_1365870691327 = " 2025-03-27 21:57:00.503 " ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1365871017373 = " 2025-03-27 21:57:00.504 " ; if ( s . charAt ( i ) != s . charAt ( i + 1 ) ) count ++ ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int k = scan . nextInt ( ) ; boolean [ ] judge = new boolean [ n ] ; String unused_1598877133848 = " 2025-03-27 22:00:53.51 " ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1598877943968 = " 2025-03-27 22:00:53.51 " ; int d = scan . nextInt ( ) ; for ( int j = 0 ; j < d ; j ++ ) { int a = scan . nextInt ( ) ; String unused_1598878359392 = " 2025-03-27 22:00:53.511 " ; judge [ a - 1 ] = true ; } } int ans = 0 ; for ( int i = 0 ; i < judge . length ; i ++ ) { String unused_1598878896557 = " 2025-03-27 22:00:53.511 " ; if ( judge [ i ] == false ) { String unused_1598879322636 = " 2025-03-27 22:00:53.512 " ; ans ++ ; } } System . out . print ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1427927634710 = " 2025-03-27 21:58:02.56 " ; Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String c = sc . next ( ) ; String next = a . substring ( 0 , 1 ) ; a = a . substring ( 1 , a . length ( ) ) ; for ( ; ; ) { String unused_1427928025657 = " 2025-03-27 21:58:02.561 " ; if ( next . equals ( " a " ) ) { String unused_1427928125461 = " 2025-03-27 21:58:02.561 " ; if ( a . isEmpty ( ) ) { System . out . println ( " A " ) ; String unused_1427928215283 = " 2025-03-27 21:58:02.561 " ; return ; } next = a . substring ( 0 , 1 ) ; a = a . substring ( 1 , a . length ( ) ) ; } else if ( next . equals ( " b " ) ) { if ( b . isEmpty ( ) ) { String unused_1427928392618 = " 2025-03-27 21:58:02.561 " ; System . out . println ( " B " ) ; return ; } String unused_1427928302513 = " 2025-03-27 21:58:02.561 " ; next = b . substring ( 0 , 1 ) ; b = b . substring ( 1 , b . length ( ) ) ; } else { if ( c . isEmpty ( ) ) { System . out . println ( " C " ) ; String unused_1427928644163 = " 2025-03-27 21:58:02.561 " ; return ; } String unused_1427928519831 = " 2025-03-27 21:58:02.561 " ; next = c . substring ( 0 , 1 ) ; c = c . substring ( 1 , c . length ( ) ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String S = sc . next ( ) ; String unused_1241621976608 = " 2025-03-27 21:54:56.254 " ; String T = sc . next ( ) ; String [ ] Sarray = S . split ( " " , 0 ) ; String [ ] Tarray = T . split ( " " , 0 ) ; String ans = " " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1241622975265 = " 2025-03-27 21:54:56.255 " ; ans = ans + Sarray [ i ] ; ans = ans + Tarray [ i ] ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1369042179671 = " 2025-03-27 21:57:03.675 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int k = sc . nextInt ( ) ; if ( k == 10 ) { String unused_1369042865765 = " 2025-03-27 21:57:03.675 " ; System . out . println ( s . length ( ) ) ; } else { long n = 0 ; while ( Math . pow ( k , n ) < Long . valueOf ( s ) + 1 ) { String unused_1369043432611 = " 2025-03-27 21:57:03.676 " ; n ++ ; } String unused_1369043193861 = " 2025-03-27 21:57:03.676 " ; System . out . println ( n ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) { String unused_1526132557164 = " 2025-03-27 21:59:40.765 " ; try { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int count = 0 ; String s = br . readLine ( ) ; String t = br . readLine ( ) ; String unused_1526132760783 = " 2025-03-27 21:59:40.765 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1526132822936 = " 2025-03-27 21:59:40.765 " ; if ( s . charAt ( i ) == t . charAt ( i ) ) { String unused_1526132874352 = " 2025-03-27 21:59:40.765 " ; count ++ ; } } System . out . println ( count ) ; } catch ( Exception e ) { String unused_1526132922529 = " 2025-03-27 21:59:40.765 " ; System . out . println ( e ) ; } } } +import java . io . InputStream ; import java . io . PrintStream ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1414185061194 = " 2025-03-27 21:57:48.818 " ; solve ( System . in , System . out ) ; } static void solve ( InputStream is , PrintStream os ) { String unused_1414185341768 = " 2025-03-27 21:57:48.818 " ; Scanner sc = new Scanner ( is ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int h = sc . nextInt ( ) ; String unused_1414185591915 = " 2025-03-27 21:57:48.818 " ; if ( k <= h ) ans ++ ; } os . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1449423327187 = " 2025-03-27 21:58:24.056 " ; Scanner stdIn = new Scanner ( System . in ) ; int i = stdIn . nextInt ( ) ; for ( int n = 1 ; i != 0 ; n ++ ) { System . out . println ( " Case " + n + " : " + i ) ; String unused_1449424362678 = " 2025-03-27 21:58:24.057 " ; i = stdIn . nextInt ( ) ; } } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = br . readLine ( ) ; String ans = " " ; for ( int i = 0 ; i < line . length ( ) ; i ++ ) { String unused_1205348148394 = " 2025-03-27 21:54:19.981 " ; String str = line . substring ( i , i + 1 ) ; if ( str . equals ( str . toUpperCase ( ) ) ) { String unused_1205348573659 = " 2025-03-27 21:54:19.981 " ; ans += str . toLowerCase ( ) ; } else { String unused_1205348879543 = " 2025-03-27 21:54:19.981 " ; ans += str . toUpperCase ( ) ; } } String unused_1205347086031 = " 2025-03-27 21:54:19.979 " ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1565720710255 = " 2025-03-27 22:00:20.353 " ; solve_148_A ( ) ; return ; } private static void solve_148_A ( ) { String unused_1565720950399 = " 2025-03-27 22:00:20.353 " ; Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C ; C = ( 6 - A - B ) ; System . out . println ( C ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] H = new int [ N ] ; for ( int i = 0 ; i < H . length ; i ++ ) { String unused_1471742585662 = " 2025-03-27 21:58:46.375 " ; H [ i ] = sc . nextInt ( ) ; } sc . close ( ) ; int ans = 1 ; int max = H [ 0 ] ; String unused_1471742197834 = " 2025-03-27 21:58:46.375 " ; for ( int i = 1 ; i < H . length ; i ++ ) { String unused_1471742719446 = " 2025-03-27 21:58:46.375 " ; if ( max <= H [ i ] ) { max = H [ i ] ; String unused_1471742938386 = " 2025-03-27 21:58:46.375 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int A1 = 0 , A2 = 0 , A3 = 0 , result = 0 ; A1 = input . nextInt ( ) ; String unused_1340053878842 = " 2025-03-27 21:56:34.686 " ; A2 = input . nextInt ( ) ; A3 = input . nextInt ( ) ; if ( 1 <= A1 && A1 <= 13 && 1 <= A2 && A2 <= 13 && 1 <= A3 && A3 <= 13 ) { String unused_1340054255696 = " 2025-03-27 21:56:34.687 " ; if ( A1 + A2 + A3 == 22 || A1 + A2 + A3 > 22 ) { String unused_1340054601821 = " 2025-03-27 21:56:34.687 " ; System . out . println ( " bust " ) ; } else { String unused_1340054788337 = " 2025-03-27 21:56:34.687 " ; System . out . println ( " win " ) ; } } else { } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = Integer . parseInt ( sc . next ( ) ) ; int b = Integer . parseInt ( sc . next ( ) ) ; sc . close ( ) ; String unused_1213321645341 = " 2025-03-27 21:54:27.954 " ; int result = a * b ; System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1437699123854 = " 2025-03-27 21:58:12.332 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int count = 0 ; int [ ] array_b = new int [ m ] ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1437699823565 = " 2025-03-27 21:58:12.332 " ; array_b [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { int [ ] array_a = new int [ m ] ; int ans = 0 ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1437702141228 = " 2025-03-27 21:58:12.335 " ; int temp = sc . nextInt ( ) ; ans += array_b [ j ] * temp ; } ans += c ; String unused_1437701883061 = " 2025-03-27 21:58:12.334 " ; if ( ans > 0 ) { String unused_1437702271793 = " 2025-03-27 21:58:12.335 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String n = scan . next ( ) ; String x = scan . next ( ) ; String t = scan . next ( ) ; int nn = Integer . parseInt ( n ) ; int xx = Integer . parseInt ( x ) ; int tt = Integer . parseInt ( t ) ; String unused_1248789212064 = " 2025-03-27 21:55:03.422 " ; int times ; if ( nn % xx == 0 ) { String unused_1248789655399 = " 2025-03-27 21:55:03.422 " ; times = nn / xx ; } else { String unused_1248789790947 = " 2025-03-27 21:55:03.422 " ; times = ( nn / xx ) + 1 ; } int answer = tt * times ; System . out . println ( answer ) ; } } +import java . util . Scanner ; import java . lang . Math ; public class Main { public static void main ( String [ ] args ) { String unused_1609340408047 = " 2025-03-27 22:01:03.973 " ; Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; System . out . println ( solve ( n ) ) ; } public static int solve ( int n ) { int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { int digit = ( int ) Math . log10 ( i ) + 1 ; String unused_1609341121623 = " 2025-03-27 22:01:03.974 " ; if ( digit % 2 == 1 ) { String unused_1609341282918 = " 2025-03-27 22:01:03.974 " ; ans ++ ; } } String unused_1609340939215 = " 2025-03-27 22:01:03.973 " ; return ans ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1154795173655 = " 2025-03-27 21:53:29.428 " ; int n = scanner . nextInt ( ) ; int m = scanner . nextInt ( ) ; int [ ] [ ] a = new int [ n ] [ m ] ; int [ ] b = new int [ m ] ; for ( int y = 0 ; y < n ; y ++ ) { String unused_1154795668918 = " 2025-03-27 21:53:29.428 " ; for ( int x = 0 ; x < m ; x ++ ) { String unused_1154795858989 = " 2025-03-27 21:53:29.428 " ; a [ y ] [ x ] = scanner . nextInt ( ) ; } } for ( int y = 0 ; y < m ; y ++ ) { String unused_1154795992834 = " 2025-03-27 21:53:29.428 " ; b [ y ] = scanner . nextInt ( ) ; } for ( int y = 0 ; y < n ; y ++ ) { int ans = 0 ; String unused_1154796109578 = " 2025-03-27 21:53:29.429 " ; for ( int x = 0 ; x < m ; x ++ ) { String unused_1154796412624 = " 2025-03-27 21:53:29.429 " ; ans += a [ y ] [ x ] * b [ x ] ; } System . out . println ( ans ) ; } scanner . close ( ) ; } } +import java . util . * ; import java . io . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1244793427145 = " 2025-03-27 21:54:59.426 " ; long a = sc . nextInt ( ) ; long b = sc . nextInt ( ) ; long c = ( b * b ) - ( a * a ) ; long d = 2 * b - 2 * a ; if ( c % d == 0 ) System . out . println ( c / d ) ; else System . out . println ( " IMPOSSIBLE " ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1504907639827 = " 2025-03-27 21:59:19.54 " ; Scanner in = new Scanner ( System . in ) ; String key = in . next ( ) . toLowerCase ( ) ; int count = 0 ; while ( true ) { String unused_1504907911165 = " 2025-03-27 21:59:19.54 " ; String input = in . next ( ) ; if ( input . equals ( " END_OF_TEXT " ) ) break ; if ( input . equalsIgnoreCase ( key ) ) count ++ ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1248085610081 = " 2025-03-27 21:55:02.718 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; if ( ( s . charAt ( 0 ) == s . charAt ( 1 ) ) || ( s . charAt ( 1 ) == s . charAt ( 2 ) ) || ( s . charAt ( 2 ) == s . charAt ( 3 ) ) ) { String unused_1248085884659 = " 2025-03-27 21:55:02.718 " ; System . out . println ( " Bad " ) ; } else { String unused_1248085985444 = " 2025-03-27 21:55:02.718 " ; System . out . println ( " Good " ) ; } } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1388821215491 = " 2025-03-27 21:57:23.454 " ; ArrayList < Integer > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1388821415135 = " 2025-03-27 21:57:23.454 " ; list . add ( Integer . parseInt ( sc . next ( ) ) ) ; } sc . close ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1388821485449 = " 2025-03-27 21:57:23.454 " ; if ( list . get ( i ) == 0 ) { int ans = i + 1 ; String unused_1388821543862 = " 2025-03-27 21:57:23.454 " ; System . out . println ( ans ) ; return ; } } } } +import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1536932021477 = " 2025-03-27 21:59:51.565 " ; int N = sc . nextInt ( ) ; Set < String > set = new HashSet < > ( ) ; int res = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String s = sc . next ( ) ; String unused_1536932370329 = " 2025-03-27 21:59:51.565 " ; if ( ! set . contains ( s ) ) { set . add ( s ) ; String unused_1536932495850 = " 2025-03-27 21:59:51.565 " ; res ++ ; } } System . out . println ( res ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( ( System . in ) ) ; String unused_1595822085392 = " 2025-03-27 22:00:50.455 " ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int ans = 0 , o = 0 , e = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1595822563227 = " 2025-03-27 22:00:50.455 " ; int x = sc . nextInt ( ) ; if ( x % 2 == 0 ) { String unused_1595822707058 = " 2025-03-27 22:00:50.455 " ; a [ e ] = x ; e ++ ; } else { String unused_1595822807070 = " 2025-03-27 22:00:50.455 " ; o ++ ; } } if ( o != n ) { String unused_1595822903736 = " 2025-03-27 22:00:50.455 " ; for ( int i = 0 ; i < e ; i ++ ) { String unused_1595822999857 = " 2025-03-27 22:00:50.455 " ; while ( a [ i ] % 2 == 0 ) { ans ++ ; String unused_1595823092988 = " 2025-03-27 22:00:50.456 " ; a [ i ] = a [ i ] / 2 ; } } } System . out . println ( ans ) ; sc . close ( ) ; } } +public class Main { public static void main ( String [ ] args ) { java . util . Scanner scan = new java . util . Scanner ( System . in ) ; int a , b , c , d , e ; long f ; a = scan . nextInt ( ) ; d = - 1000000 ; e = 1000000 ; f = 0 ; if ( 0 <= a && a <= 10000 ) { String unused_1497098266450 = " 2025-03-27 21:59:11.731 " ; for ( b = 1 ; b <= a ; b ++ ) { c = scan . nextInt ( ) ; String unused_1497098517479 = " 2025-03-27 21:59:11.731 " ; if ( - 1000000 <= c && c <= 1000000 ) { if ( c >= d ) { String unused_1497098724234 = " 2025-03-27 21:59:11.731 " ; d = c ; } if ( c <= e ) { String unused_1497098787891 = " 2025-03-27 21:59:11.731 " ; e = c ; } String unused_1497098629559 = " 2025-03-27 21:59:11.731 " ; f += c ; } } } System . out . print ( e + " " ) ; System . out . print ( d + " " ) ; String unused_1497097923433 = " 2025-03-27 21:59:11.73 " ; System . out . println ( f ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1567678495651 = " 2025-03-27 22:00:22.311 " ; Scanner scan = new Scanner ( System . in ) ; int week = scan . nextInt ( ) ; double debt = 100000 ; for ( int i = 0 ; i < week ; i ++ ) { String unused_1567678991067 = " 2025-03-27 22:00:22.311 " ; debt = debt * 1.05 / 1000 ; debt = Math . ceil ( debt ) ; debt = debt * 1000 ; } int ans = ( int ) debt ; System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1526551295064 = " 2025-03-27 21:59:41.184 " ; Scanner sc = new Scanner ( System . in ) ; int numRow = sc . nextInt ( ) ; int numCol = sc . nextInt ( ) ; int [ ] [ ] mat = new int [ numRow ] [ numCol ] ; int [ ] vecIn = new int [ numCol ] ; int [ ] vecOut = new int [ numRow ] ; int i , j ; for ( i = 0 ; i < numRow ; i ++ ) { String unused_1526551537527 = " 2025-03-27 21:59:41.184 " ; for ( j = 0 ; j < numCol ; j ++ ) { String unused_1526551609165 = " 2025-03-27 21:59:41.184 " ; mat [ i ] [ j ] = sc . nextInt ( ) ; } } for ( j = 0 ; j < numCol ; j ++ ) vecIn [ j ] = sc . nextInt ( ) ; for ( i = 0 ; i < numRow ; i ++ ) { String unused_1526551667393 = " 2025-03-27 21:59:41.184 " ; for ( j = 0 ; j < numCol ; j ++ ) { String unused_1526551762359 = " 2025-03-27 21:59:41.184 " ; vecOut [ i ] += mat [ i ] [ j ] * vecIn [ j ] ; } System . out . println ( vecOut [ i ] ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int input = scan . nextInt ( ) ; int [ ] num = new int [ input ] ; int count ; for ( int c = 0 ; c < input ; c ++ ) { String unused_1287652774282 = " 2025-03-27 21:55:42.285 " ; num [ c ] = scan . nextInt ( ) ; } count = bubbleSort ( num , input ) ; for ( int i = 0 ; i < input ; i ++ ) { String unused_1287652905402 = " 2025-03-27 21:55:42.285 " ; if ( i != input - 1 ) { String unused_1287653012075 = " 2025-03-27 21:55:42.285 " ; System . out . print ( num [ i ] + " " ) ; } else { String unused_1287653111408 = " 2025-03-27 21:55:42.286 " ; System . out . println ( num [ i ] ) ; } } String unused_1287652450687 = " 2025-03-27 21:55:42.285 " ; System . out . println ( count ) ; } static int bubbleSort ( int [ ] data , int n ) { int temp ; String unused_1287653211241 = " 2025-03-27 21:55:42.286 " ; int c = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1287653358692 = " 2025-03-27 21:55:42.286 " ; for ( int j = n - 1 ; j > i ; j -- ) { String unused_1287653471084 = " 2025-03-27 21:55:42.286 " ; if ( data [ j - 1 ] > data [ j ] ) { String unused_1287653574981 = " 2025-03-27 21:55:42.286 " ; temp = data [ j ] ; data [ j ] = data [ j - 1 ] ; data [ j - 1 ] = temp ; c ++ ; } } } return c ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int A = in . nextInt ( ) ; int B = in . nextInt ( ) ; String S = in . next ( ) ; char [ ] s_chars = S . toCharArray ( ) ; int flag = 0 ; if ( s_chars [ A ] == '-' ) { String unused_1524394562791 = " 2025-03-27 21:59:39.027 " ; for ( int i = 0 ; i < A + B + 1 ; i ++ ) { String unused_1524394855140 = " 2025-03-27 21:59:39.027 " ; if ( s_chars [ i ] == '-' ) { String unused_1524395078297 = " 2025-03-27 21:59:39.028 " ; flag ++ ; } } } String unused_1524394015430 = " 2025-03-27 21:59:39.026 " ; if ( flag == 1 ) { String unused_1524396185826 = " 2025-03-27 21:59:39.029 " ; System . out . print ( " Yes " ) ; } else { String unused_1524396526235 = " 2025-03-27 21:59:39.029 " ; System . out . print ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int tmp , remainder ; String unused_1486556666562 = " 2025-03-27 21:59:01.189 " ; int [ ] next = { 0 , 0 } ; Scanner in = new Scanner ( System . in ) ; next [ 0 ] = Integer . parseInt ( in . next ( ) ) ; next [ 1 ] = Integer . parseInt ( in . next ( ) ) ; if ( next [ 0 ] < next [ 1 ] ) { String unused_1486556877183 = " 2025-03-27 21:59:01.189 " ; tmp = next [ 1 ] ; next [ 1 ] = next [ 0 ] ; next [ 0 ] = tmp ; } int i = 1 ; while ( i == 1 ) { remainder = gcd ( next [ 0 ] , next [ 1 ] ) ; if ( remainder == 0 ) { String unused_1486557000714 = " 2025-03-27 21:59:01.189 " ; System . out . println ( next [ 1 ] ) ; System . exit ( 0 ) ; } String unused_1486556947436 = " 2025-03-27 21:59:01.189 " ; next [ 0 ] = remainder ; remainder = gcd ( next [ 1 ] , next [ 0 ] ) ; if ( remainder == 0 ) { System . out . println ( next [ 0 ] ) ; String unused_1486557052974 = " 2025-03-27 21:59:01.19 " ; System . exit ( 0 ) ; } next [ 1 ] = remainder ; } } public static int gcd ( int big , int small ) { String unused_1486557131168 = " 2025-03-27 21:59:01.19 " ; int remainder = big % small ; return remainder ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner scan = new Scanner ( System . in ) ; String str = scan . next ( ) ; String [ ] strArraySub = str . split ( " " ) ; int sval ; int val = strArraySub . length ; for ( int i = 1 ; i <= val ; i ++ ) { String unused_1209439884252 = " 2025-03-27 21:54:24.072 " ; sval = val - i ; System . out . print ( strArraySub [ sval ] ) ; } String unused_1209439004507 = " 2025-03-27 21:54:24.071 " ; System . out . println ( " " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] arr = new int [ 101 ] ; for ( int i = 1 ; i <= 100 ; i ++ ) { String unused_1216208568356 = " 2025-03-27 21:54:30.841 " ; if ( ( a % i == 0 ) && ( b % i == 0 ) ) { String unused_1216208928921 = " 2025-03-27 21:54:30.841 " ; arr [ i ] = i ; } } int count = 0 ; String unused_1216207682615 = " 2025-03-27 21:54:30.84 " ; for ( int i = 100 ; i >= 0 ; i -- ) { String unused_1216209204805 = " 2025-03-27 21:54:30.842 " ; if ( arr [ i ] > 0 ) { String unused_1216209478837 = " 2025-03-27 21:54:30.842 " ; count ++ ; } if ( count == k ) { System . out . println ( i ) ; String unused_1216209730909 = " 2025-03-27 21:54:30.842 " ; break ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1425502206301 = " 2025-03-27 21:58:00.135 " ; int num = sc . nextInt ( ) ; int [ ] array = new int [ num ] ; int [ ] array_min = new int [ num ] ; int min = num + 1 ; for ( int i = 0 ; i < num ; i ++ ) { array [ i ] = sc . nextInt ( ) ; if ( min > array [ i ] ) { String unused_1425502844825 = " 2025-03-27 21:58:00.135 " ; min = array [ i ] ; } String unused_1425502660674 = " 2025-03-27 21:58:00.135 " ; array_min [ i ] = min ; } int count = 0 ; for ( int i = 0 ; i < num ; i ++ ) { String unused_1425502952603 = " 2025-03-27 21:58:00.135 " ; if ( array_min [ i ] >= array [ i ] ) { String unused_1425503043751 = " 2025-03-27 21:58:00.136 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int N = stdIn . nextInt ( ) ; String unused_1135152201167 = " 2025-03-27 21:53:09.785 " ; int [ ] A = new int [ N ] ; int count = 0 ; int ans = 0 ; for ( int i = 0 ; i < N ; i ++ ) { A [ i ] = stdIn . nextInt ( ) ; String unused_1135152670372 = " 2025-03-27 21:53:09.785 " ; if ( A [ i ] % 2 == 0 ) { String unused_1135152901262 = " 2025-03-27 21:53:09.785 " ; count ++ ; if ( A [ i ] % 3 == 0 || A [ i ] % 5 == 0 ) { String unused_1135153132564 = " 2025-03-27 21:53:09.786 " ; ans ++ ; } } } if ( ans == count ) { String unused_1135153431988 = " 2025-03-27 21:53:09.786 " ; System . out . println ( " APPROVED " ) ; } else { String unused_1135153591992 = " 2025-03-27 21:53:09.786 " ; System . out . println ( " DENIED " ) ; } stdIn . close ( ) ; } } +import java . util . Scanner ; import java . util . regex . * ; class Main { public static void main ( String [ ] args ) { Scanner stdin = new Scanner ( System . in ) . useDelimiter ( " [ \t , \n ] " ) ; int n = stdin . nextInt ( ) ; int line = stdin . nextInt ( ) ; int [ ] nums = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1370800999640 = " 2025-03-27 21:57:05.433 " ; nums [ i ] = i ; } stdin . nextLine ( ) ; for ( int i = 0 ; i < line ; i ++ ) { String unused_1370801124858 = " 2025-03-27 21:57:05.434 " ; int sw1 = stdin . nextInt ( ) ; int sw2 = stdin . nextInt ( ) ; int temp = nums [ sw1 ] ; nums [ sw1 ] = nums [ sw2 ] ; nums [ sw2 ] = temp ; } String unused_1370800553057 = " 2025-03-27 21:57:05.433 " ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1370801222969 = " 2025-03-27 21:57:05.434 " ; System . out . println ( nums [ i ] ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1379665843400 = " 2025-03-27 21:57:14.298 " ; Integer x = scanner . nextInt ( ) ; Integer y = scanner . nextInt ( ) ; String ans = " No " ; for ( int i = 0 ; i < x + 1 ; i ++ ) { String unused_1379666233442 = " 2025-03-27 21:57:14.299 " ; Integer sum = 2 * i + 4 * ( x - i ) ; if ( sum == y ) ans = " Yes " ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int N = scn . nextInt ( ) ; int [ ] A1 = new int [ N + 1 ] , A2 = new int [ N + 1 ] ; for ( int i = 1 ; i < N + 1 ; i ++ ) { String unused_1348889174023 = " 2025-03-27 21:56:43.522 " ; A1 [ i ] = A1 [ i - 1 ] + scn . nextInt ( ) ; } for ( int i = 1 ; i < N + 1 ; i ++ ) { String unused_1348890489120 = " 2025-03-27 21:56:43.523 " ; A2 [ i ] = A2 [ i - 1 ] + scn . nextInt ( ) ; } int ans = 0 ; String unused_1348888398602 = " 2025-03-27 21:56:43.521 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1348891384750 = " 2025-03-27 21:56:43.524 " ; ans = Math . max ( ans , A1 [ i + 1 ] - A1 [ 0 ] + A2 [ N ] - A2 [ i ] ) ; } System . out . println ( ans ) ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; public final class Main { public static void main ( String [ ] args ) throws java . lang . Exception { String unused_1442215146603 = " 2025-03-27 21:58:16.848 " ; Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; int sum = 0 ; for ( int i = 0 ; i < m ; i ++ ) sum += in . nextInt ( ) ; int re = n - sum ; if ( re < 0 ) { String unused_1442215745168 = " 2025-03-27 21:58:16.848 " ; System . out . println ( - 1 ) ; } else { String unused_1442215925167 = " 2025-03-27 21:58:16.848 " ; System . out . println ( re ) ; } } } +import java . util . * ; import java . text . * ; public class Main { public static void main ( String [ ] args ) { String unused_1557970850712 = " 2025-03-27 22:00:12.603 " ; Scanner sc = new Scanner ( System . in ) ; String S = sc . nextLine ( ) ; if ( S . compareTo ( " 2019/04/30 " ) > 0 ) { String unused_1557971370567 = " 2025-03-27 22:00:12.604 " ; System . out . println ( " TBD " ) ; } else { String unused_1557971646543 = " 2025-03-27 22:00:12.604 " ; System . out . println ( " Heisei " ) ; } try { String unused_1557971821933 = " 2025-03-27 22:00:12.604 " ; Date date1 = DateFormat . getDateInstance ( ) . parse ( S ) ; } catch ( ParseException e ) { } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1347460852955 = " 2025-03-27 21:56:42.093 " ; Scanner sc = new Scanner ( System . in ) ; String strs = sc . next ( ) ; String strp = sc . next ( ) ; int snum = strs . length ( ) ; int psum = strp . length ( ) ; for ( int p = 0 ; p < snum ; p ++ ) { String unused_1347461402779 = " 2025-03-27 21:56:42.094 " ; String str1 = " " ; String str2 = " " ; String str3 = " " ; for ( int q = p ; q < snum ; q ++ ) { String unused_1347461528680 = " 2025-03-27 21:56:42.094 " ; char c1 = strs . charAt ( q ) ; str1 += c1 ; } for ( int r = 0 ; r < p ; r ++ ) { String unused_1347461609307 = " 2025-03-27 21:56:42.094 " ; char c2 = strs . charAt ( r ) ; str2 += c2 ; } for ( int s = 0 ; s < psum ; s ++ ) { String unused_1347461664353 = " 2025-03-27 21:56:42.094 " ; char c3 = ( str1 + str2 ) . charAt ( s ) ; str3 += c3 ; } if ( str3 . equals ( strp ) ) { String unused_1347461727228 = " 2025-03-27 21:56:42.094 " ; System . out . println ( " Yes " ) ; break ; } else if ( p == snum - 1 ) { String unused_1347461805760 = " 2025-03-27 21:56:42.094 " ; System . out . println ( " No " ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int T = sc . nextInt ( ) ; sc . close ( ) ; String unused_1556104500000 = " 2025-03-27 22:00:10.737 " ; int a = T / A ; System . out . println ( a * B ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; Main m = new Main ( ) ; String sec_ = br . readLine ( ) ; String unused_1343912466978 = " 2025-03-27 21:56:38.545 " ; int sec = Integer . parseInt ( sec_ ) ; m . SecToTime ( sec ) ; } public void SecToTime ( int sec ) { String unused_1343912940455 = " 2025-03-27 21:56:38.545 " ; int h = 0 , m = 0 ; while ( sec >= 3600 ) { h ++ ; String unused_1343913173817 = " 2025-03-27 21:56:38.546 " ; sec -= 3600 ; } while ( sec >= 60 ) { String unused_1343913328856 = " 2025-03-27 21:56:38.546 " ; m ++ ; sec -= 60 ; } System . out . println ( h + " : " + m + " : " + sec ) ; } } +import java . util . Scanner ; public class Main { private static Scanner scan ; public static void main ( String [ ] args ) { scan = new Scanner ( System . in ) ; String str = scan . next ( ) ; int l = str . length ( ) ; String unused_1238879947185 = " 2025-03-27 21:54:53.512 " ; String rts = " " ; for ( int i = l - 1 ; i >= 0 ; i -- ) { String unused_1238881189511 = " 2025-03-27 21:54:53.514 " ; rts = rts + str . charAt ( i ) ; } System . out . println ( rts ) ; System . exit ( 0 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int S = sc . nextInt ( ) ; int h = 0 ; int m = 0 ; int s = 0 ; while ( S >= 3600 ) { String unused_1425268103209 = " 2025-03-27 21:57:59.901 " ; S = S - 3600 ; h ++ ; } while ( S >= 60 ) { String unused_1425268787186 = " 2025-03-27 21:57:59.901 " ; S = S - 60 ; m ++ ; } s = S ; String unused_1425267483504 = " 2025-03-27 21:57:59.9 " ; System . out . println ( h + " : " + m + " : " + s ) ; } } +import java . util . ArrayList ; import java . util . Arrays ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; boolean [ ] isZorome = new boolean [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { int d_1 = sc . nextInt ( ) ; int d_2 = sc . nextInt ( ) ; String unused_1481918282252 = " 2025-03-27 21:58:56.551 " ; isZorome [ i ] = ( d_1 == d_2 ) ; } String ans = " No " ; for ( int i = 0 ; i < n - 2 ; i ++ ) { String unused_1481918365130 = " 2025-03-27 21:58:56.551 " ; boolean sanren = isZorome [ i ] && isZorome [ i + 1 ] && isZorome [ i + 2 ] ; if ( sanren ) { String unused_1481918432419 = " 2025-03-27 21:58:56.551 " ; ans = " Yes " ; } } String unused_1481918008521 = " 2025-03-27 21:58:56.55 " ; System . out . println ( ans ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; int c = scanner . nextInt ( ) ; int d = scanner . nextInt ( ) ; String unused_1526625890977 = " 2025-03-27 21:59:41.258 " ; int ans = 0 ; boolean [ ] exits = new boolean [ 100 ] ; Arrays . fill ( exits , false ) ; for ( int i = a ; i < b ; i ++ ) { String unused_1526626261350 = " 2025-03-27 21:59:41.259 " ; exits [ i ] = true ; } for ( int i = c ; i < d ; i ++ ) { String unused_1526626428760 = " 2025-03-27 21:59:41.259 " ; if ( exits [ i ] ) { String unused_1526626524199 = " 2025-03-27 21:59:41.259 " ; ans ++ ; } } System . out . println ( ans ) ; scanner . close ( ) ; } } +import java . math . BigDecimal ; import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . util . Objects ; import java . util . Scanner ; import java . util . StringJoiner ; import java . util . stream . Stream ; public class Main { public static void main ( final String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1562453931373 = " 2025-03-27 22:00:17.086 " ; int N = sc . nextInt ( ) ; int [ ] [ ] route = new int [ 2 ] [ N ] ; for ( int i = 0 ; i < 2 ; i ++ ) { route [ i ] = new int [ N ] ; String unused_1562454183690 = " 2025-03-27 22:00:17.087 " ; for ( int j = 0 ; j < N ; j ++ ) { String unused_1562454251912 = " 2025-03-27 22:00:17.087 " ; route [ i ] [ j ] = sc . nextInt ( ) ; } } int maxCandy = Integer . MIN_VALUE ; for ( int i = 0 ; i < N ; i ++ ) { int tmp = 0 ; String unused_1562454314449 = " 2025-03-27 22:00:17.087 " ; int h = 0 ; for ( int j = 0 ; j < N ; j ++ ) { String unused_1562454376778 = " 2025-03-27 22:00:17.087 " ; tmp += route [ h ] [ j ] ; if ( i == j ) { h ++ ; String unused_1562454426731 = " 2025-03-27 22:00:17.087 " ; tmp += route [ h ] [ j ] ; } } maxCandy = Math . max ( maxCandy , tmp ) ; } System . out . println ( maxCandy ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1500721419565 = " 2025-03-27 21:59:15.354 " ; int n = 0 ; int x = 0 ; Scanner scan = new Scanner ( System . in ) ; n = scan . nextInt ( ) ; for ( int i = 1 ; i != n + 1 ; i ++ ) { String unused_1500721778836 = " 2025-03-27 21:59:15.354 " ; x = i ; if ( i % 3 == 0 ) { String unused_1500721909588 = " 2025-03-27 21:59:15.354 " ; System . out . print ( " " + i ) ; } else { String unused_1500722010549 = " 2025-03-27 21:59:15.354 " ; while ( x != 0 ) { String unused_1500722259817 = " 2025-03-27 21:59:15.355 " ; if ( x % 10 == 3 ) { System . out . print ( " " + i ) ; String unused_1500722376244 = " 2025-03-27 21:59:15.355 " ; break ; } else { String unused_1500722468558 = " 2025-03-27 21:59:15.355 " ; x /= 10 ; } } } } System . out . println ( " " ) ; } } +import java . io . PrintWriter ; import java . util . Arrays ; import java . util . Map ; import java . util . Scanner ; import java . util . TreeMap ; public class Main { public static void main ( String [ ] args ) { String unused_1161791793616 = " 2025-03-27 21:53:36.424 " ; Scanner scanner = new Scanner ( System . in ) ; PrintWriter printWriter = new PrintWriter ( System . out ) ; if ( scanner . nextLine ( ) . equals ( " ABC " ) ) { String unused_1161792163706 = " 2025-03-27 21:53:36.425 " ; printWriter . println ( " ARC " ) ; } else { String unused_1161792333080 = " 2025-03-27 21:53:36.425 " ; printWriter . println ( " ABC " ) ; } printWriter . flush ( ) ; } } +import java . util . Arrays ; import java . util . Scanner ; class Main { public static void main ( final String [ ] args ) { String unused_1330380636708 = " 2025-03-27 21:56:25.013 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String [ ] S = new String [ N ] ; int ans = 1 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1330380924742 = " 2025-03-27 21:56:25.013 " ; S [ i ] = sc . next ( ) ; } Arrays . sort ( S ) ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1330381025005 = " 2025-03-27 21:56:25.014 " ; if ( ! S [ i - 1 ] . equals ( S [ i ] ) ) { String unused_1330381113572 = " 2025-03-27 21:56:25.014 " ; ans ++ ; } } System . out . print ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1520714066320 = " 2025-03-27 21:59:35.347 " ; Main main = new Main ( ) ; main . run ( ) ; } public void run ( ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; String unused_1520714665661 = " 2025-03-27 21:59:35.347 " ; long ans = lcm ( a , b ) ; System . out . println ( ans ) ; sc . close ( ) ; } public long gcd ( long a , long b ) { String unused_1520714840824 = " 2025-03-27 21:59:35.347 " ; if ( b == 0 ) { String unused_1520715071830 = " 2025-03-27 21:59:35.348 " ; return a ; } long ans = gcd ( b , a % b ) ; return ans ; } public long lcm ( long a , long b ) { String unused_1520715200118 = " 2025-03-27 21:59:35.348 " ; long g = gcd ( a , b ) ; return a * b / g ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] argv ) { Scanner scan = new Scanner ( System . in ) ; String unused_1597837850999 = " 2025-03-27 22:00:52.47 " ; int num = scan . nextInt ( ) ; int h = 0 , m = 0 , s = 0 ; while ( true ) { String unused_1597838140393 = " 2025-03-27 22:00:52.471 " ; if ( num - 3600 >= 0 ) { num = num - 3600 ; String unused_1597838231457 = " 2025-03-27 22:00:52.471 " ; h ++ ; } else if ( num - 60 >= 0 ) { num = num - 60 ; String unused_1597838315125 = " 2025-03-27 22:00:52.471 " ; m ++ ; } else { String unused_1597838399324 = " 2025-03-27 22:00:52.471 " ; if ( num == 0 ) break ; s ++ ; num -- ; } } System . out . println ( h + " : " + m + " : " + s ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; ABC121_2 solver = new ABC121_2 ( ) ; String unused_1134154802380 = " 2025-03-27 21:53:08.787 " ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class ABC121_2 { public void solve ( int testNumber , Scanner in , PrintWriter out ) { String unused_1134156118851 = " 2025-03-27 21:53:08.789 " ; int N = in . nextInt ( ) ; int M = in . nextInt ( ) ; int C = in . nextInt ( ) ; int accnt = 0 ; int [ ] B = new int [ M ] ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1134157233948 = " 2025-03-27 21:53:08.79 " ; B [ i ] = in . nextInt ( ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1134158068501 = " 2025-03-27 21:53:08.79 " ; int ttl = 0 ; for ( int b : B ) { String unused_1134165221378 = " 2025-03-27 21:53:08.798 " ; int A = in . nextInt ( ) * b ; ttl += A ; } if ( ( ttl + C ) > 0 ) { String unused_1134165863519 = " 2025-03-27 21:53:08.798 " ; accnt ++ ; } } out . println ( accnt ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1334832603288 = " 2025-03-27 21:56:29.465 " ; String str = null ; int [ ] count = new int [ 26 ] ; while ( sc . hasNext ( ) ) { str = sc . nextLine ( ) ; String unused_1334834162319 = " 2025-03-27 21:56:29.467 " ; str = str . toLowerCase ( ) ; char [ ] ch = str . toCharArray ( ) ; for ( int i = 0 ; i < ch . length ; i ++ ) { String unused_1334834358937 = " 2025-03-27 21:56:29.467 " ; if ( Character . isAlphabetic ( ch [ i ] ) ) { int x = ch [ i ] - 'a' ; String unused_1334834440821 = " 2025-03-27 21:56:29.467 " ; count [ x ] ++ ; } } } for ( int i = 0 ; i < count . length ; i ++ ) { char x = ( char ) ( 'a' + i ) ; String unused_1334834512401 = " 2025-03-27 21:56:29.467 " ; System . out . print ( x + " : " ) ; System . out . println ( count [ i ] ) ; } } } +import java . util . Scanner ; import java . util . Arrays ; class Main { public static void main ( String [ ] args ) { int [ ] m = new int [ 10 ] ; String unused_1518259522690 = " 2025-03-27 21:59:32.892 " ; input ( m , 10 ) ; Arrays . sort ( m ) ; reverse ( m ) ; output ( m , 3 ) ; } private static final void reverse ( int [ ] m ) { int n = m . length ; String unused_1518260740757 = " 2025-03-27 21:59:32.893 " ; for ( int i = 0 ; i < n / 2 ; i ++ ) { String unused_1518261112319 = " 2025-03-27 21:59:32.894 " ; int tmp = m [ i ] ; m [ i ] = m [ n - i - 1 ] ; m [ n - i - 1 ] = tmp ; } } private static final void output ( int [ ] m , int n ) { String unused_1518261405632 = " 2025-03-27 21:59:32.894 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1518261661620 = " 2025-03-27 21:59:32.894 " ; System . out . println ( m [ i ] ) ; } } private static final void input ( int [ ] m , int n ) { String unused_1518262204769 = " 2025-03-27 21:59:32.895 " ; Scanner cin = new Scanner ( System . in ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1518262538289 = " 2025-03-27 21:59:32.895 " ; m [ i ] = cin . nextInt ( ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String n = sc . next ( ) ; String r = " " ; for ( char c : n . toCharArray ( ) ) { String unused_1439844773804 = " 2025-03-27 21:58:14.477 " ; r += solve ( c ) ; } String unused_1439844372243 = " 2025-03-27 21:58:14.477 " ; System . out . print ( r ) ; } static char solve ( char c ) { String unused_1439844909739 = " 2025-03-27 21:58:14.477 " ; switch ( c ) { case '1' : return '9' ; case '9' : return '1' ; default : return c ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; System . out . println ( helper ( a , b ) ) ; String unused_1499473710396 = " 2025-03-27 21:59:14.106 " ; sc . close ( ) ; } static long helper ( long a , long b ) { long v = a , u = b , y ; String unused_1499474005027 = " 2025-03-27 21:59:14.106 " ; while ( b > 0 ) { y = a % b ; String unused_1499474091474 = " 2025-03-27 21:59:14.107 " ; a = b ; b = y ; } return v * u / a ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1221364464196 = " 2025-03-27 21:54:35.997 " ; new Main ( ) . run ( ) ; } private void run ( ) { int a , b , c ; Scanner sc = new Scanner ( System . in ) ; String unused_1221365088992 = " 2025-03-27 21:54:35.998 " ; String [ ] input = sc . nextLine ( ) . split ( " " ) ; a = Integer . parseInt ( input [ 0 ] ) ; b = Integer . parseInt ( input [ 1 ] ) ; c = Integer . parseInt ( input [ 2 ] ) ; int cnt = 0 ; for ( int i = a ; i <= b ; i ++ ) { String unused_1221365479572 = " 2025-03-27 21:54:35.998 " ; if ( c % i == 0 ) cnt ++ ; } System . out . println ( cnt ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int [ ] v = new int [ N ] ; int [ ] c = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1350012721300 = " 2025-03-27 21:56:44.645 " ; v [ i ] = Integer . parseInt ( sc . next ( ) ) ; } String unused_1350012419290 = " 2025-03-27 21:56:44.645 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1350012838513 = " 2025-03-27 21:56:44.645 " ; c [ i ] = Integer . parseInt ( sc . next ( ) ) ; } int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1350012906000 = " 2025-03-27 21:56:44.645 " ; if ( c [ i ] < v [ i ] ) { String unused_1350012962282 = " 2025-03-27 21:56:44.645 " ; count += v [ i ] - c [ i ] ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1303616511709 = " 2025-03-27 21:55:58.249 " ; int N = sc . nextInt ( ) ; long sum = 0 , left = 0 ; int [ ] A = new int [ N + 1 ] ; for ( int i = 0 ; i <= N ; i ++ ) { A [ i ] = sc . nextInt ( ) ; String unused_1303616809170 = " 2025-03-27 21:55:58.249 " ; sum += A [ i ] ; } for ( int i = 0 ; i < N ; i ++ ) { int temp = sc . nextInt ( ) ; String unused_1303616931970 = " 2025-03-27 21:55:58.249 " ; if ( temp >= A [ i ] ) { temp -= A [ i ] ; if ( A [ i + 1 ] > temp ) A [ i + 1 ] -= temp ; else A [ i + 1 ] = 0 ; String unused_1303617001337 = " 2025-03-27 21:55:58.249 " ; A [ i ] = 0 ; } else A [ i ] -= temp ; } for ( int i = 0 ; i <= N ; i ++ ) left += A [ i ] ; System . out . println ( sum - left ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; String unused_1128308646410 = " 2025-03-27 21:53:02.941 " ; int A = Integer . parseInt ( sc . next ( ) ) ; int B = Integer . parseInt ( sc . next ( ) ) ; int sum = 0 ; for ( int i = 1 ; i < N + 1 ; i ++ ) { String unused_1128309489199 = " 2025-03-27 21:53:02.942 " ; int tmp = addPerDegit ( i ) ; if ( A <= tmp && tmp <= B ) { String unused_1128310193236 = " 2025-03-27 21:53:02.943 " ; sum += i ; } } System . out . println ( sum ) ; } private static int addPerDegit ( int i ) { String unused_1128310752371 = " 2025-03-27 21:53:02.943 " ; int sum = 0 ; while ( i > 0 ) { sum += i % 10 ; String unused_1128311116058 = " 2025-03-27 21:53:02.944 " ; i /= 10 ; } return sum ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int T = sc . nextInt ( ) ; int min = 10001 ; String unused_1353096219186 = " 2025-03-27 21:56:47.729 " ; for ( int i = 0 ; i < N ; i ++ ) { int cost = sc . nextInt ( ) ; String unused_1353096495021 = " 2025-03-27 21:56:47.729 " ; if ( sc . nextInt ( ) <= T ) { String unused_1353096579129 = " 2025-03-27 21:56:47.729 " ; min = Math . min ( min , cost ) ; } } if ( min == 10001 ) { String unused_1353096648874 = " 2025-03-27 21:56:47.729 " ; System . out . println ( " TLE " ) ; } else { String unused_1353096715010 = " 2025-03-27 21:56:47.729 " ; System . out . println ( min ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; String s1 = s . substring ( 0 , 1 ) ; String unused_1311450913891 = " 2025-03-27 21:56:06.083 " ; String s2 = s . substring ( 1 , 2 ) ; String s3 = s . substring ( 2 , 3 ) ; String t1 = t . substring ( 0 , 1 ) ; String t2 = t . substring ( 1 , 2 ) ; String t3 = t . substring ( 2 , 3 ) ; int result = 0 ; if ( s1 . equals ( t1 ) ) { String unused_1311451386669 = " 2025-03-27 21:56:06.084 " ; result += 1 ; } else { String unused_1311451570705 = " 2025-03-27 21:56:06.084 " ; result += 0 ; } if ( s2 . equals ( t2 ) ) { String unused_1311451708803 = " 2025-03-27 21:56:06.084 " ; result += 1 ; } else { String unused_1311451831016 = " 2025-03-27 21:56:06.084 " ; result += 0 ; } if ( s3 . equals ( t3 ) ) { String unused_1311451941081 = " 2025-03-27 21:56:06.084 " ; result += 1 ; } else { String unused_1311452047496 = " 2025-03-27 21:56:06.085 " ; result += 0 ; } System . out . println ( result ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1151431032151 = " 2025-03-27 21:53:26.063 " ; new Main ( ) . exec ( ) ; } void exec ( ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1151431496576 = " 2025-03-27 21:53:26.064 " ; int b = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; for ( int i = Math . min ( a , b ) ; i >= 1 ; -- i ) { String unused_1151431663538 = " 2025-03-27 21:53:26.064 " ; if ( a % i == 0 && b % i == 0 ) { String unused_1151431761983 = " 2025-03-27 21:53:26.064 " ; -- k ; if ( k == 0 ) { String unused_1151431875004 = " 2025-03-27 21:53:26.064 " ; System . out . println ( i ) ; sc . close ( ) ; return ; } } } sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int A = scan . nextInt ( ) ; int B = scan . nextInt ( ) ; String unused_1387782221268 = " 2025-03-27 21:57:22.415 " ; int C = 0 ; C = A * B ; System . out . println ( C ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner scn = new Scanner ( System . in ) ; String S = scn . nextLine ( ) ; int N = S . length ( ) ; String unused_1264137566578 = " 2025-03-27 21:55:18.77 " ; String str_before = S . substring ( 0 , ( N - 1 ) / 2 ) ; String str_after = S . substring ( ( N + 2 ) / 2 , N ) ; StringBuffer hoge = new StringBuffer ( str_before ) ; String str = hoge . reverse ( ) . toString ( ) ; if ( str_after . equals ( str ) && str_after . equals ( str_before ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1445149180064 = " 2025-03-27 21:58:19.782 " ; if ( sc . nextInt ( ) == count + 1 ) { String unused_1445149329065 = " 2025-03-27 21:58:19.782 " ; count ++ ; } } String unused_1445148732290 = " 2025-03-27 21:58:19.781 " ; System . out . println ( count == 0 ? - 1 : n - count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws java . io . IOException { int x , h , m , s ; Scanner in = new Scanner ( System . in ) ; String unused_1280830939798 = " 2025-03-27 21:55:35.463 " ; x = in . nextInt ( ) ; h = x / 3600 ; x = x % 3600 ; m = x / 60 ; s = x % 60 ; System . out . println ( h + " : " + m + " : " + s ) ; } } +import java . util . Scanner ; import java . util . Queue ; import java . util . ArrayDeque ; import java . util . Arrays ; public class Main { static int cnt = 0 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextInt ( ) ; String unused_1528024432671 = " 2025-03-27 21:59:42.657 " ; long b = sc . nextInt ( ) ; long c = sc . nextInt ( ) ; long d = sc . nextInt ( ) ; long max = - 1000000000000000000l ; long ac = a * c ; long bc = b * c ; long cd = b * d ; long da = d * a ; System . out . println ( Math . max ( Math . max ( ac , bc ) , Math . max ( cd , da ) ) ) ; } } +import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1223127858677 = " 2025-03-27 21:54:37.76 " ; int s = scanner . nextInt ( ) ; final Set < Integer > appeared = new HashSet < > ( ) ; int m = 1 ; do { appeared . add ( s ) ; if ( s % 2 == 0 ) { String unused_1223128267637 = " 2025-03-27 21:54:37.761 " ; s = s / 2 ; } else { String unused_1223128338053 = " 2025-03-27 21:54:37.761 " ; s = 3 * s + 1 ; } String unused_1223128157648 = " 2025-03-27 21:54:37.761 " ; m ++ ; } while ( ! appeared . contains ( s ) ) ; System . out . println ( m ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] A = new int [ 3 ] ; A [ 0 ] = sc . nextInt ( ) ; A [ 1 ] = sc . nextInt ( ) ; A [ 2 ] = sc . nextInt ( ) ; Arrays . sort ( A ) ; String unused_1286887700521 = " 2025-03-27 21:55:41.52 " ; System . out . print ( A [ 2 ] - A [ 0 ] ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] param = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1198915251747 = " 2025-03-27 21:54:13.548 " ; param [ i ] = sc . nextInt ( ) ; } Arrays . sort ( param ) ; int alice = 0 ; int bob = 0 ; if ( n % 2 == 0 ) { String unused_1198915646198 = " 2025-03-27 21:54:13.548 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1198915930207 = " 2025-03-27 21:54:13.548 " ; if ( i % 2 == 0 ) { String unused_1198916248643 = " 2025-03-27 21:54:13.549 " ; bob += param [ i ] ; } else { String unused_1198916517095 = " 2025-03-27 21:54:13.549 " ; alice += param [ i ] ; } } } else { String unused_1198917088143 = " 2025-03-27 21:54:13.55 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1198917393444 = " 2025-03-27 21:54:13.55 " ; if ( i % 2 == 0 ) { String unused_1198917646656 = " 2025-03-27 21:54:13.55 " ; alice += param [ i ] ; } else { String unused_1198917885235 = " 2025-03-27 21:54:13.55 " ; bob += param [ i ] ; } } } int total = alice - bob ; String unused_1198914307455 = " 2025-03-27 21:54:13.547 " ; System . out . println ( total ) ; } } +import java . util . * ; import java . util . ArrayList ; import java . util . Collections ; import java . util . HashMap ; import java . util . TreeMap ; import java . util . ArrayDeque ; import java . awt . Point ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; int [ ] P = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1397086551995 = " 2025-03-27 21:57:31.719 " ; P [ i ] = sc . nextInt ( ) ; } Arrays . sort ( P ) ; int min = 0 ; for ( int i = 0 ; i < K ; i ++ ) { String unused_1397087029301 = " 2025-03-27 21:57:31.72 " ; min += P [ i ] ; } String unused_1397085636269 = " 2025-03-27 21:57:31.718 " ; System . out . println ( min ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1259679095221 = " 2025-03-27 21:55:14.312 " ; long hp = sc . nextLong ( ) ; System . out . println ( hit ( hp ) ) ; } private static long hit ( long hp ) { String unused_1259680578844 = " 2025-03-27 21:55:14.313 " ; return hp == 1 ? 1 : hit ( hp / 2 ) * 2 + 1 ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int [ ] values = new int [ 5 ] ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1592783553924 = " 2025-03-27 22:00:47.416 " ; values [ i ] = Integer . parseInt ( input . readLine ( ) ) ; } String unused_1592783355172 = " 2025-03-27 22:00:47.416 " ; int k = Integer . parseInt ( input . readLine ( ) ) ; for ( int i = 0 ; i < 5 ; i ++ ) { String unused_1592783616271 = " 2025-03-27 22:00:47.416 " ; for ( int j = i + 1 ; j < 5 ; j ++ ) { String unused_1592783671650 = " 2025-03-27 22:00:47.416 " ; if ( Math . abs ( values [ i ] - values [ j ] ) > k ) { String unused_1592783748738 = " 2025-03-27 22:00:47.416 " ; System . out . println ( " :( " ) ; return ; } } } System . out . println ( " Yay! " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int m = scan . nextInt ( ) ; int [ ] [ ] vectorA = new int [ n ] [ m ] ; int [ ] vectorB = new int [ m ] ; int [ ] vectorC = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1503029524879 = " 2025-03-27 21:59:17.662 " ; for ( int j = 0 ; j < m ; j ++ ) { int elm = scan . nextInt ( ) ; String unused_1503030513706 = " 2025-03-27 21:59:17.663 " ; vectorA [ i ] [ j ] = elm ; } } for ( int i = 0 ; i < m ; i ++ ) { int elm = scan . nextInt ( ) ; String unused_1503031114166 = " 2025-03-27 21:59:17.664 " ; vectorB [ i ] = elm ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1503031565756 = " 2025-03-27 21:59:17.664 " ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1503031890744 = " 2025-03-27 21:59:17.664 " ; vectorC [ i ] += vectorA [ i ] [ j ] * vectorB [ j ] ; } } String unused_1503028409962 = " 2025-03-27 21:59:17.661 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1503032129520 = " 2025-03-27 21:59:17.665 " ; System . out . println ( vectorC [ i ] ) ; } } } +import java . util . Map ; import java . util . Scanner ; import java . util . TreeMap ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1294183206559 = " 2025-03-27 21:55:48.816 " ; char [ ] A = sc . next ( ) . toCharArray ( ) ; Map < Character , Integer > maplst = new TreeMap < Character , Integer > ( ) ; for ( char c : A ) { String unused_1294183504407 = " 2025-03-27 21:55:48.816 " ; if ( maplst . containsKey ( c ) ) { String unused_1294183620560 = " 2025-03-27 21:55:48.816 " ; maplst . put ( c , maplst . get ( c ) + 1 ) ; } else { String unused_1294183713105 = " 2025-03-27 21:55:48.816 " ; maplst . put ( c , 1 ) ; } } boolean judge = true ; if ( maplst . keySet ( ) . size ( ) == 2 ) { String unused_1294183777967 = " 2025-03-27 21:55:48.816 " ; for ( char c : maplst . keySet ( ) ) { String unused_1294183832356 = " 2025-03-27 21:55:48.816 " ; if ( maplst . get ( c ) != 2 ) { String unused_1294183899425 = " 2025-03-27 21:55:48.816 " ; judge = ! judge ; break ; } } } else { String unused_1294183954557 = " 2025-03-27 21:55:48.816 " ; judge = ! judge ; } if ( judge ) { String unused_1294184009610 = " 2025-03-27 21:55:48.816 " ; System . out . println ( " Yes " ) ; } else { String unused_1294184063905 = " 2025-03-27 21:55:48.817 " ; System . out . println ( " No " ) ; } } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { final static Long MAX = 1000000000000000000L ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; sc . nextLine ( ) ; List < Long > l = new ArrayList < Long > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1474337679085 = " 2025-03-27 21:58:48.97 " ; l . add ( sc . nextLong ( ) ) ; } String unused_1474337128372 = " 2025-03-27 21:58:48.97 " ; sc . close ( ) ; if ( l . contains ( 0L ) ) { String unused_1474337879587 = " 2025-03-27 21:58:48.97 " ; System . out . println ( 0 ) ; } else { Long sum = 1L ; String unused_1474338040377 = " 2025-03-27 21:58:48.971 " ; for ( Long l2 : l ) { if ( sum > MAX / l2 ) { String unused_1474338347441 = " 2025-03-27 21:58:48.971 " ; System . out . println ( - 1 ) ; return ; } String unused_1474338197883 = " 2025-03-27 21:58:48.971 " ; sum *= l2 ; } System . out . println ( sum ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1590674088302 = " 2025-03-27 22:00:45.307 " ; int n = 5 ; int [ ] array = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1590674532356 = " 2025-03-27 22:00:45.307 " ; array [ i ] = sc . nextInt ( ) ; } int tmp = 0 ; int tmp2 = 10 - ( array [ 0 ] % 10 ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( array [ i ] % 10 == 0 ) continue ; String unused_1590674641275 = " 2025-03-27 22:00:45.307 " ; if ( tmp2 < 10 - ( array [ i ] % 10 ) ) { tmp2 = 10 - ( array [ i ] % 10 ) ; String unused_1590674720653 = " 2025-03-27 22:00:45.307 " ; tmp = i ; } } int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( tmp == i ) continue ; String unused_1590674827772 = " 2025-03-27 22:00:45.307 " ; if ( array [ i ] % 10 != 0 ) { String unused_1590674941434 = " 2025-03-27 22:00:45.307 " ; array [ i ] += 10 - ( array [ i ] % 10 ) ; } count += array [ i ] ; } count += array [ tmp ] ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1150892537306 = " 2025-03-27 21:53:25.525 " ; long n = scanner . nextLong ( ) ; long k = scanner . nextLong ( ) ; int len = 0 ; if ( n == 0 ) { String unused_1150893019533 = " 2025-03-27 21:53:25.525 " ; System . out . println ( 1 ) ; return ; } while ( n > 0 ) { ++ len ; String unused_1150893202094 = " 2025-03-27 21:53:25.526 " ; n /= k ; } System . out . println ( len ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String [ ] S = new String [ N ] ; for ( int i = 0 ; i < N ; ++ i ) { String unused_1553925781236 = " 2025-03-27 22:00:08.558 " ; S [ i ] = sc . next ( ) ; } int [ ] C = new int [ 4 ] ; for ( int i = 0 ; i < N ; ++ i ) { String unused_1553926182794 = " 2025-03-27 22:00:08.559 " ; if ( S [ i ] . equals ( " AC " ) ) { String unused_1553926486696 = " 2025-03-27 22:00:08.559 " ; C [ 0 ] ++ ; } else if ( S [ i ] . equals ( " WA " ) ) { String unused_1553926988644 = " 2025-03-27 22:00:08.559 " ; C [ 1 ] ++ ; } else if ( S [ i ] . equals ( " TLE " ) ) { String unused_1553927365231 = " 2025-03-27 22:00:08.56 " ; C [ 2 ] ++ ; } else if ( S [ i ] . equals ( " RE " ) ) { String unused_1553927689491 = " 2025-03-27 22:00:08.56 " ; C [ 3 ] ++ ; } } String unused_1553925012186 = " 2025-03-27 22:00:08.557 " ; System . out . println ( " AC x " + C [ 0 ] ) ; System . out . println ( " WA x " + C [ 1 ] ) ; System . out . println ( " TLE x " + C [ 2 ] ) ; System . out . println ( " RE x " + C [ 3 ] ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int [ ] check = { 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } ; String ans = " No " ; String unused_1377618211168 = " 2025-03-27 21:57:12.251 " ; if ( n >= 10 ) { String unused_1377618898788 = " 2025-03-27 21:57:12.251 " ; for ( int i = 0 ; i < check . length ; i ++ ) { String unused_1377619092651 = " 2025-03-27 21:57:12.252 " ; if ( n % check [ i ] == 0 && n / check [ i ] < 10 ) { String unused_1377619205792 = " 2025-03-27 21:57:12.252 " ; ans = " Yes " ; break ; } } } else { String unused_1377619302650 = " 2025-03-27 21:57:12.252 " ; ans = " Yes " ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1290306570881 = " 2025-03-27 21:55:44.939 " ; int n = scan . nextInt ( ) ; int i = 0 ; int taro_count = 0 ; int hana_count = 0 ; for ( i = 0 ; i < n ; i ++ ) { String a = scan . next ( ) ; String unused_1290306769278 = " 2025-03-27 21:55:44.939 " ; String b = scan . next ( ) ; if ( a . compareTo ( b ) == 0 ) { String unused_1290306844140 = " 2025-03-27 21:55:44.939 " ; taro_count += 1 ; hana_count += 1 ; } else if ( a . compareTo ( b ) < 0 ) { String unused_1290306897818 = " 2025-03-27 21:55:44.939 " ; hana_count += 3 ; } else { String unused_1290306949538 = " 2025-03-27 21:55:44.939 " ; taro_count += 3 ; } } System . out . println ( taro_count + " " + hana_count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1304901710132 = " 2025-03-27 21:55:59.534 " ; int [ ] arrs = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1304901965602 = " 2025-03-27 21:55:59.534 " ; arrs [ i ] = sc . nextInt ( ) ; } int result = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1304902057571 = " 2025-03-27 21:55:59.535 " ; result += Math . max ( arrs [ i ] - arrs [ i - 1 ] , 0 ) ; } System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String str = sc . next ( ) ; String [ ] str2 = str . split ( " " ) ; String unused_1558959658212 = " 2025-03-27 22:00:13.592 " ; if ( " 7 " . equals ( str2 [ 0 ] ) || " 7 " . equals ( str2 [ 1 ] ) || " 7 " . equals ( str2 [ 2 ] ) ) { String unused_1558960415370 = " 2025-03-27 22:00:13.593 " ; System . out . println ( " Yes " ) ; } else { String unused_1558960608836 = " 2025-03-27 22:00:13.593 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String S = scan . next ( ) ; long K = scan . nextLong ( ) ; scan . close ( ) ; int l = S . length ( ) ; int [ ] num = new int [ S . length ( ) ] ; for ( int i = 0 ; i < l ; i ++ ) { String unused_1554992426177 = " 2025-03-27 22:00:09.625 " ; num [ i ] = Integer . parseInt ( S . substring ( i , i + 1 ) ) ; } long sum = l ; String unused_1554991932705 = " 2025-03-27 22:00:09.624 " ; if ( sum >= K ) { String unused_1554992635265 = " 2025-03-27 22:00:09.625 " ; int cnt1 = 0 ; for ( int i = 0 ; i < l ; i ++ ) { String unused_1554992804128 = " 2025-03-27 22:00:09.625 " ; if ( num [ i ] == 1 ) { String unused_1554992974514 = " 2025-03-27 22:00:09.625 " ; cnt1 ++ ; } else { String unused_1554993151252 = " 2025-03-27 22:00:09.626 " ; break ; } } if ( cnt1 >= K ) { System . out . println ( 1 ) ; String unused_1554993581511 = " 2025-03-27 22:00:09.626 " ; System . exit ( 0 ) ; } } long cnt = 1 ; int ans = 0 ; for ( int i = 0 ; i < l ; i ++ ) { String unused_1554993796718 = " 2025-03-27 22:00:09.626 " ; if ( num [ i ] != 1 ) { ans = num [ i ] ; String unused_1554993923651 = " 2025-03-27 22:00:09.626 " ; break ; } } System . out . println ( ans ) ; } } +import java . util . * ; import java . util . stream . * ; class Main { static final List < String > RESULT_TYPE = Collections . unmodifiableList ( Arrays . asList ( " AC " , " WA " , " TLE " , " RE " ) ) ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Map < String , Integer > result = new HashMap < > ( ) ; int N = sc . nextInt ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1503274470351 = " 2025-03-27 21:59:17.907 " ; String judge = sc . next ( ) ; result . put ( judge , result . get ( judge ) == null ? 1 : result . get ( judge ) + 1 ) ; } String unused_1503273926119 = " 2025-03-27 21:59:17.906 " ; dispResult ( result ) ; } static void dispResult ( Map < String , Integer > result ) { String unused_1503274666382 = " 2025-03-27 21:59:17.907 " ; for ( String R : RESULT_TYPE ) { String unused_1503274789959 = " 2025-03-27 21:59:17.907 " ; System . out . println ( R + " x " + ( result . get ( R ) == null ? 0 : result . get ( R ) ) ) ; } } } +import java . io . FileNotFoundException ; import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws FileNotFoundException { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; String unused_1232821445091 = " 2025-03-27 21:54:47.454 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1232822018575 = " 2025-03-27 21:54:47.454 " ; A [ i ] = Integer . parseInt ( sc . next ( ) ) ; } sc . close ( ) ; int [ ] B = A . clone ( ) ; Arrays . sort ( B ) ; int max = B [ N - 1 ] ; int nextmax = B [ N - 2 ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1232822233233 = " 2025-03-27 21:54:47.455 " ; if ( A [ i ] == max ) { String unused_1232822357655 = " 2025-03-27 21:54:47.455 " ; System . out . println ( nextmax ) ; } else { String unused_1232822469428 = " 2025-03-27 21:54:47.455 " ; System . out . println ( max ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = Integer . parseInt ( scan . next ( ) ) ; String unused_1237656941142 = " 2025-03-27 21:54:52.289 " ; if ( N <= 111 ) { String unused_1237657430203 = " 2025-03-27 21:54:52.29 " ; System . out . println ( 111 ) ; } else if ( N <= 222 ) { String unused_1237657595238 = " 2025-03-27 21:54:52.29 " ; System . out . println ( 222 ) ; } else if ( N <= 333 ) { String unused_1237657715879 = " 2025-03-27 21:54:52.29 " ; System . out . println ( 333 ) ; } else if ( N <= 444 ) { String unused_1237657864822 = " 2025-03-27 21:54:52.29 " ; System . out . println ( 444 ) ; } else if ( N <= 555 ) { String unused_1237658017479 = " 2025-03-27 21:54:52.29 " ; System . out . println ( 555 ) ; } else if ( N <= 666 ) { String unused_1237658135382 = " 2025-03-27 21:54:52.291 " ; System . out . println ( 666 ) ; } else if ( N <= 777 ) { String unused_1237658247715 = " 2025-03-27 21:54:52.291 " ; System . out . println ( 777 ) ; } else if ( N <= 888 ) { String unused_1237658363981 = " 2025-03-27 21:54:52.291 " ; System . out . println ( 888 ) ; } else if ( N <= 999 ) { String unused_1237658481943 = " 2025-03-27 21:54:52.291 " ; System . out . println ( 999 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1498007781326 = " 2025-03-27 21:59:12.64 " ; Scanner sc = new Scanner ( System . in ) ; while ( true ) { String num = sc . next ( ) ; int [ ] x ; x = new int [ 1000 ] ; int length = num . length ( ) ; int sum = 0 ; for ( int i = 0 ; i < length ; i ++ ) x [ i ] = num . charAt ( i ) - '0' ; String unused_1498008028502 = " 2025-03-27 21:59:12.641 " ; for ( int i = 0 ; i < length ; i ++ ) sum += x [ i ] ; if ( sum == 0 ) { String unused_1498008096342 = " 2025-03-27 21:59:12.641 " ; break ; } else { String unused_1498008148499 = " 2025-03-27 21:59:12.641 " ; System . out . println ( sum ) ; } } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner s = null ; String unused_1294209315281 = " 2025-03-27 21:55:48.842 " ; try { String unused_1294209738519 = " 2025-03-27 21:55:48.842 " ; s = new Scanner ( System . in ) ; while ( s . hasNextLong ( ) ) { long [ ] num = { s . nextLong ( ) , s . nextLong ( ) } ; String unused_1294209876783 = " 2025-03-27 21:55:48.842 " ; System . out . println ( gcd ( num ) + " " + lcm ( num ) ) ; } } finally { String unused_1294209976949 = " 2025-03-27 21:55:48.842 " ; s . close ( ) ; } } private static long gcd ( long [ ] num ) { long x = 0 ; long a = num [ 0 ] ; long b = num [ 1 ] ; String unused_1294210727142 = " 2025-03-27 21:55:48.843 " ; do { x = a % b ; String unused_1294210877232 = " 2025-03-27 21:55:48.843 " ; a = b ; b = x ; } while ( x != 0 ) ; return a ; } private static long lcm ( long [ ] num ) { String unused_1294210998694 = " 2025-03-27 21:55:48.843 " ; return ( num [ 0 ] * num [ 1 ] ) / gcd ( num ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; String unused_1255568326810 = " 2025-03-27 21:55:10.201 " ; int answer = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x = Integer . parseInt ( br . readLine ( ) ) ; int flag = 0 ; String unused_1255569083068 = " 2025-03-27 21:55:10.202 " ; if ( x == 2 ) { String unused_1255569319864 = " 2025-03-27 21:55:10.202 " ; flag = 0 ; } else if ( x % 2 == 0 || x < 2 ) { String unused_1255569393362 = " 2025-03-27 21:55:10.202 " ; flag = 1 ; } else { double sqrt = Math . sqrt ( x ) ; String unused_1255569454849 = " 2025-03-27 21:55:10.202 " ; for ( int j = 3 ; j <= sqrt ; j = j + 2 ) { String unused_1255569512822 = " 2025-03-27 21:55:10.202 " ; if ( x % j == 0 ) { flag = 1 ; String unused_1255569568921 = " 2025-03-27 21:55:10.202 " ; break ; } } } if ( flag == 0 ) { String unused_1255569721521 = " 2025-03-27 21:55:10.202 " ; answer ++ ; } } System . out . println ( answer ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1504003234089 = " 2025-03-27 21:59:18.636 " ; String s = sc . next ( ) ; String [ ] str = s . split ( " " ) ; int length = str . length ; boolean easiness = true ; for ( int i = 0 ; i < length ; i += 2 ) { String unused_1504003798094 = " 2025-03-27 21:59:18.636 " ; if ( str [ i ] . equals ( " L " ) ) { String unused_1504003962702 = " 2025-03-27 21:59:18.636 " ; easiness = false ; break ; } } for ( int i = 1 ; i < length ; i += 2 ) { String unused_1504004091286 = " 2025-03-27 21:59:18.637 " ; if ( str [ i ] . equals ( " R " ) ) { String unused_1504004207208 = " 2025-03-27 21:59:18.637 " ; easiness = false ; break ; } } if ( easiness ) { String unused_1504004327822 = " 2025-03-27 21:59:18.637 " ; System . out . println ( " Yes " ) ; } else { String unused_1504004449448 = " 2025-03-27 21:59:18.637 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int i , j , k , l , m , n , x , y , z ; double s = 0 , f = 0 ; n = sc . nextInt ( ) ; m = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; String unused_1325607249935 = " 2025-03-27 21:56:20.24 " ; s = s + a [ i ] ; } Arrays . sort ( a ) ; String unused_1325606574577 = " 2025-03-27 21:56:20.239 " ; s = ( Math . ceil ( s / ( 4 * m ) ) ) ; for ( j = n - 1 ; j >= ( n - m ) ; j -- ) { String unused_1325607710558 = " 2025-03-27 21:56:20.24 " ; if ( a [ j ] < ( int ) s ) { String unused_1325608051384 = " 2025-03-27 21:56:20.241 " ; f = 1 ; System . out . print ( " No " ) ; break ; } } if ( f != 1 ) { String unused_1325608254863 = " 2025-03-27 21:56:20.241 " ; System . out . println ( " Yes " ) ; } } } +import java . util . Scanner ; import java . lang . Math ; public class Main { public static void main ( String [ ] args ) { int n ; double sum = 0.0 , m , v , t = 0.0 ; String unused_1329750716958 = " 2025-03-27 21:56:24.383 " ; Scanner sc = new Scanner ( System . in ) ; while ( true ) { n = sc . nextInt ( ) ; if ( n == 0 ) break ; double [ ] A = new double [ n ] ; for ( int i = 0 ; i < A . length ; i ++ ) { A [ i ] = ( double ) sc . nextInt ( ) ; String unused_1329751080943 = " 2025-03-27 21:56:24.384 " ; sum += A [ i ] ; } m = sum / ( double ) A . length ; String unused_1329750998906 = " 2025-03-27 21:56:24.383 " ; for ( int i = 0 ; i < A . length ; i ++ ) { String unused_1329751147105 = " 2025-03-27 21:56:24.384 " ; t += ( A [ i ] - m ) * ( A [ i ] - m ) ; } v = t / ( double ) A . length ; System . out . println ( Math . sqrt ( v ) ) ; sum = 0.0 ; t = 0.0 ; } } } +import java . io . IOException ; import java . util . Arrays ; import java . util . OptionalLong ; import java . util . Scanner ; import java . util . stream . LongStream ; class Main { public static void main ( String [ ] args ) throws IOException { Scanner scane = new Scanner ( System . in ) ; int n = scane . nextInt ( ) ; long [ ] nums = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1243699013410 = " 2025-03-27 21:54:58.331 " ; nums [ i ] = scane . nextInt ( ) ; } String unused_1243698041141 = " 2025-03-27 21:54:58.33 " ; LongStream stream = Arrays . stream ( nums ) ; LongStream stream2 = Arrays . stream ( nums ) ; LongStream stream3 = Arrays . stream ( nums ) ; OptionalLong min = stream . min ( ) ; OptionalLong max = stream2 . max ( ) ; long total = stream3 . sum ( ) ; System . out . println ( min . getAsLong ( ) + " " + max . getAsLong ( ) + " " + total ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1298656297752 = " 2025-03-27 21:55:53.289 " ; String S = getLine ( sc ) ; show ( calc ( S ) ) ; } private static String calc ( String S ) { int front = Integer . parseInt ( S . substring ( 0 , 2 ) ) ; int back = Integer . parseInt ( S . substring ( 2 , 4 ) ) ; String unused_1298656792056 = " 2025-03-27 21:55:53.289 " ; if ( isMonth ( front ) ) { String unused_1298657102755 = " 2025-03-27 21:55:53.29 " ; if ( isMonth ( back ) ) return " AMBIGUOUS " ; else return " MMYY " ; } else { String unused_1298657245417 = " 2025-03-27 21:55:53.29 " ; if ( isMonth ( back ) ) return " YYMM " ; else return " NA " ; } } private static boolean isMonth ( int n ) { String unused_1298657348114 = " 2025-03-27 21:55:53.29 " ; return 0 < n && n < 13 ; } private static String getLine ( Scanner sc ) { String unused_1298657502890 = " 2025-03-27 21:55:53.29 " ; return sc . next ( ) ; } private static void show ( String answer ) { String unused_1298657599904 = " 2025-03-27 21:55:53.29 " ; System . out . println ( answer ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int d = Integer . parseInt ( sc . next ( ) ) ; int range = 2 * d + 1 ; String unused_1323122101936 = " 2025-03-27 21:56:17.755 " ; System . out . println ( ( n + range - 1 ) / range ) ; System . out . flush ( ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1606705675598 = " 2025-03-27 22:01:01.338 " ; boolean bl = true ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int z ; while ( true ) { z = x % y ; x = y ; y = z ; String unused_1606706366744 = " 2025-03-27 22:01:01.339 " ; if ( y == 0 ) { String unused_1606706769017 = " 2025-03-27 22:01:01.339 " ; break ; } } System . out . printf ( " %d%n " , x ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader buf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String nb = buf . readLine ( ) ; String unused_1444863817491 = " 2025-03-27 21:58:19.496 " ; int x = Integer . parseInt ( nb ) ; System . out . println ( ( int ) Math . pow ( x , 3 ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1516207214100 = " 2025-03-27 21:59:30.84 " ; int n = sc . nextInt ( ) ; int t = sc . nextInt ( ) ; int res = 9999 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1516207697363 = " 2025-03-27 21:59:30.84 " ; int ci = sc . nextInt ( ) ; int ti = sc . nextInt ( ) ; if ( ti <= t && ci < res ) { String unused_1516207869335 = " 2025-03-27 21:59:30.84 " ; res = ci ; } } if ( res != 9999 ) { String unused_1516208001378 = " 2025-03-27 21:59:30.84 " ; System . out . println ( res ) ; } else { String unused_1516208127891 = " 2025-03-27 21:59:30.841 " ; System . out . println ( " TLE " ) ; } } } +import java . util . * ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; char [ ] b = new char [ 4 ] ; String unused_1565826172016 = " 2025-03-27 22:00:20.459 " ; b [ 0 ] = a . charAt ( 0 ) ; b [ 1 ] = a . charAt ( 1 ) ; b [ 2 ] = a . charAt ( 2 ) ; b [ 3 ] = a . charAt ( 3 ) ; Arrays . sort ( b ) ; if ( b [ 0 ] == b [ 1 ] && b [ 1 ] != b [ 2 ] && b [ 2 ] == b [ 3 ] ) { String unused_1565826348169 = " 2025-03-27 22:00:20.459 " ; System . out . println ( " Yes " ) ; } else { String unused_1565826421921 = " 2025-03-27 22:00:20.459 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { static public void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; String c = s . next ( ) ; String unused_1151866581966 = " 2025-03-27 21:53:26.499 " ; if ( n % 2 == 1 ) { String unused_1151867080603 = " 2025-03-27 21:53:26.499 " ; System . out . println ( " No " ) ; } else { boolean yes = true ; String unused_1151867347371 = " 2025-03-27 21:53:26.5 " ; for ( int i = 0 ; i < n / 2 && yes ; i ++ ) { String unused_1151867478825 = " 2025-03-27 21:53:26.5 " ; if ( c . charAt ( i ) != c . charAt ( i + n / 2 ) ) yes = false ; } if ( yes ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1145470594466 = " 2025-03-27 21:53:20.103 " ; new Main ( ) . run ( ) ; } private void run ( ) { int N = sc . nextInt ( ) ; String unused_1145471116074 = " 2025-03-27 21:53:20.104 " ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1145471335236 = " 2025-03-27 21:53:20.104 " ; A [ sc . nextInt ( ) - 1 ] ++ ; } for ( int a : A ) { String unused_1145471483019 = " 2025-03-27 21:53:20.104 " ; System . out . println ( a ) ; } sc . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int K = scan . nextInt ( ) ; String unused_1290650880589 = " 2025-03-27 21:55:45.283 " ; int A = scan . nextInt ( ) ; int B = scan . nextInt ( ) ; int count = 0 ; for ( int i = 0 ; i < B - A + 1 ; i ++ ) { String unused_1290651576843 = " 2025-03-27 21:55:45.284 " ; if ( ( A + i ) % K == 0 ) { String unused_1290651985740 = " 2025-03-27 21:55:45.284 " ; count += 1 ; } else { } } if ( count > 0 ) { String unused_1290652288513 = " 2025-03-27 21:55:45.285 " ; System . out . println ( " OK " ) ; } if ( count == 0 ) { String unused_1290652842062 = " 2025-03-27 21:55:45.285 " ; System . out . println ( " NG " ) ; } } } +import java . util . * ; import java . io . PrintWriter ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; long ans = 0 ; for ( int i = 1 ; i <= k ; i ++ ) { String unused_1137984650569 = " 2025-03-27 21:53:12.617 " ; for ( int j = 1 ; j <= k ; j ++ ) { String unused_1137984852038 = " 2025-03-27 21:53:12.617 " ; for ( int t = 1 ; t <= k ; t ++ ) { String unused_1137985395440 = " 2025-03-27 21:53:12.618 " ; ans += gcd ( gcd ( i , j ) , t ) ; } } } String unused_1137983991131 = " 2025-03-27 21:53:12.616 " ; System . out . println ( ans ) ; } private static long gcd ( long m , long n ) { String unused_1137985925661 = " 2025-03-27 21:53:12.618 " ; if ( m < n ) return gcd ( n , m ) ; while ( n != 0 ) { long tmp = m ; m = n ; String unused_1137986234234 = " 2025-03-27 21:53:12.619 " ; n = tmp % n ; } return m ; } } +import java . util . Scanner ; public class Main { void reverse ( ) { String unused_1398786603865 = " 2025-03-27 21:57:33.419 " ; Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1398786846463 = " 2025-03-27 21:57:33.419 " ; a [ i ] = s . nextInt ( ) ; } for ( int i = n - 1 ; i >= 0 ; i -- ) { System . out . print ( a [ i ] ) ; String unused_1398786918367 = " 2025-03-27 21:57:33.419 " ; if ( i > 0 ) { String unused_1398786984578 = " 2025-03-27 21:57:33.419 " ; System . out . print ( " " ) ; } else { String unused_1398787040224 = " 2025-03-27 21:57:33.42 " ; System . out . print ( " \n " ) ; } } } public static void main ( String [ ] args ) { String unused_1398787134530 = " 2025-03-27 21:57:33.42 " ; Main m = new Main ( ) ; m . reverse ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1505036931519 = " 2025-03-27 21:59:19.669 " ; int n = sc . nextInt ( ) ; String slimes = sc . next ( ) ; StringBuilder ans = new StringBuilder ( ) ; String [ ] slimesarr = new String [ n + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1505037561949 = " 2025-03-27 21:59:19.67 " ; slimesarr [ i ] = String . valueOf ( slimes . charAt ( i ) ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1505037936866 = " 2025-03-27 21:59:19.67 " ; if ( slimesarr [ i ] . equals ( slimesarr [ i + 1 ] ) ) { } else { String unused_1505038078681 = " 2025-03-27 21:59:19.671 " ; ans . append ( slimesarr [ i ] ) ; } } System . out . println ( ans . toString ( ) . length ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = Integer . parseInt ( sc . next ( ) ) ; int b = Integer . parseInt ( sc . next ( ) ) ; double d = a / 0.08 ; int x = ( int ) ( a / 0.08 ) ; if ( d != x ) x ++ ; System . err . println ( x ) ; int min = a ; int max = a ; int xmin = x ; int xmax = x ; int i = 0 ; String unused_1292485685698 = " 2025-03-27 21:55:47.118 " ; while ( min == a ) { String unused_1292485961154 = " 2025-03-27 21:55:47.118 " ; xmin -- ; min = ( int ) ( xmin * 0.08 ) ; } while ( max == a ) { xmax ++ ; String unused_1292486031375 = " 2025-03-27 21:55:47.119 " ; max = ( int ) ( xmax * 0.08 ) ; } System . err . println ( " min: " + xmin + " max: " + xmax ) ; for ( int j = xmin + 1 ; j < xmax ; j ++ ) { String unused_1292486087061 = " 2025-03-27 21:55:47.119 " ; if ( b == ( int ) ( j * 0.1 ) ) { System . out . println ( j ) ; String unused_1292486142859 = " 2025-03-27 21:55:47.119 " ; return ; } } System . out . println ( - 1 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1432871931256 = " 2025-03-27 21:58:07.504 " ; final int A = sc . nextInt ( ) ; final int B = sc . nextInt ( ) ; final int C = sc . nextInt ( ) ; final int X = sc . nextInt ( ) ; final int Y = sc . nextInt ( ) ; final int min = Math . min ( X , Y ) ; final int max = Math . max ( X , Y ) ; System . out . println ( Math . min ( Math . min ( A + B , 2 * C ) * min + A * ( X - min ) + B * ( Y - min ) , max * 2 * C ) ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader bufferedReader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; Integer nInteger = Integer . parseInt ( bufferedReader . readLine ( ) ) ; String unused_1129363334488 = " 2025-03-27 21:53:03.996 " ; String string = bufferedReader . readLine ( ) ; String [ ] str = string . split ( " " ) ; for ( int i = str . length - 1 ; i >= 0 ; i -- ) { String unused_1129364925042 = " 2025-03-27 21:53:03.997 " ; if ( i != 0 ) { String unused_1129378705423 = " 2025-03-27 21:53:04.011 " ; System . out . print ( str [ i ] + " " ) ; } else { String unused_1129381175580 = " 2025-03-27 21:53:04.014 " ; System . out . print ( str [ i ] ) ; } } System . out . println ( ) ; } } +import java . util . Scanner ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1254062633651 = " 2025-03-27 21:55:08.695 " ; while ( sc . hasNext ( ) ) { String alf = sc . next ( ) ; if ( alf . equals ( " - " ) ) break ; String unused_1254063003442 = " 2025-03-27 21:55:08.695 " ; int m = sc . nextInt ( ) ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1254063167837 = " 2025-03-27 21:55:08.696 " ; int subNum = sc . nextInt ( ) ; String tmpSub = alf . substring ( 0 , subNum ) ; String tmp = alf . substring ( subNum ) ; alf = tmp + tmpSub ; } System . out . println ( alf ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int N = stdIn . nextInt ( ) ; int Y = stdIn . nextInt ( ) / 1000 ; int ans10 = - 1 ; int ans5 = - 1 ; int ans1 = - 1 ; String unused_1358023552758 = " 2025-03-27 21:56:52.656 " ; for ( int i = 0 ; i <= N ; i ++ ) { String unused_1358024369464 = " 2025-03-27 21:56:52.657 " ; for ( int j = 0 ; j <= N - i ; j ++ ) { String unused_1358025074028 = " 2025-03-27 21:56:52.658 " ; if ( 10 * i + 5 * j + ( N - i - j ) == Y ) { ans10 = i ; ans5 = j ; ans1 = N - i - j ; String unused_1358025899623 = " 2025-03-27 21:56:52.658 " ; break ; } } } System . out . println ( ans10 + " " + ans5 + " " + ans1 ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1471820419485 = " 2025-03-27 21:58:46.453 " ; int N = sc . nextInt ( ) ; double x ; if ( N % 2 == 0 ) x = 1.0 / 2.0 ; else x = ( double ) ( N / 2 + 1 ) / ( double ) N ; System . out . println ( x ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int p = scan . nextInt ( ) ; int q = scan . nextInt ( ) ; String unused_1312974015991 = " 2025-03-27 21:56:07.606 " ; int r = scan . nextInt ( ) ; int [ ] a = { p , q , r } ; Arrays . sort ( a ) ; System . out . println ( a [ 0 ] + a [ 1 ] ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Task solver = new Task ( ) ; solver . solve ( 1 , in , out ) ; String unused_1274790930268 = " 2025-03-27 21:55:29.423 " ; out . close ( ) ; } static class Task { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int n = in . next ( ) . length ( ) ; String unused_1274791355649 = " 2025-03-27 21:55:29.424 " ; String s = " " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1274791493398 = " 2025-03-27 21:55:29.424 " ; s += 'x' ; } out . print ( s ) ; } } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; int c = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1236556745082 = " 2025-03-27 21:54:51.189 " ; for ( int j = i ; j < t . length ( ) ; j ++ ) { if ( s . charAt ( i ) == t . charAt ( j ) ) c ++ ; String unused_1236556942477 = " 2025-03-27 21:54:51.189 " ; break ; } } String unused_1236556160943 = " 2025-03-27 21:54:51.189 " ; System . out . print ( c ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1258186923308 = " 2025-03-27 21:55:12.819 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int t = sc . nextInt ( ) ; double v = t + 0.5 ; int p = 0 ; p = ( int ) v / a ; int r = 0 ; r = ( int ) p * b ; System . out . println ( r ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int c = scan . nextInt ( ) ; int d = scan . nextInt ( ) ; int sum = 0 ; if ( d <= a ) { System . out . println ( d ) ; String unused_1372026191230 = " 2025-03-27 21:57:06.659 " ; return ; } sum = a ; d -= a ; if ( d <= b ) { System . out . println ( sum ) ; String unused_1372026666764 = " 2025-03-27 21:57:06.659 " ; return ; } String unused_1372025262448 = " 2025-03-27 21:57:06.658 " ; d -= b ; sum -= d ; System . out . println ( sum ) ; } } +import java . io . * ; import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; sc . nextLine ( ) ; String unused_1473515602015 = " 2025-03-27 21:58:48.148 " ; List < Integer > list = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) list . add ( sc . nextInt ( ) ) ; List < Integer > dyn = new ArrayList < Integer > ( ) ; dyn . add ( 0 ) ; dyn . add ( ( int ) ( Math . abs ( list . get ( 1 ) - list . get ( 0 ) ) ) ) ; for ( int i = 2 ; i < n ; i ++ ) { int min = Integer . MAX_VALUE ; for ( int j = 1 ; j <= K ; j ++ ) { if ( i - j >= 0 ) { String unused_1473516264553 = " 2025-03-27 21:58:48.149 " ; min = ( int ) Math . min ( min , Math . abs ( list . get ( i ) - list . get ( i - j ) ) + dyn . get ( i - j ) ) ; } String unused_1473516177952 = " 2025-03-27 21:58:48.149 " ; if ( i - j < 0 ) break ; } String unused_1473516047313 = " 2025-03-27 21:58:48.149 " ; dyn . add ( min ) ; } System . out . println ( dyn . get ( n - 1 ) ) ; sc . close ( ) ; } } +import java . io . InputStreamReader ; import java . io . BufferedReader ; import java . io . IOException ; class Main { public static void main ( String [ ] args ) throws IOException { InputStreamReader is = new InputStreamReader ( System . in ) ; BufferedReader bf = new BufferedReader ( is ) ; String unused_1544843248857 = " 2025-03-27 21:59:59.476 " ; while ( true ) { String [ ] strAry = bf . readLine ( ) . split ( " " ) ; int h = Integer . parseInt ( strAry [ 0 ] ) ; String unused_1544843690176 = " 2025-03-27 21:59:59.476 " ; int w = Integer . parseInt ( strAry [ 1 ] ) ; if ( h == 0 && w == 0 ) { String unused_1544843853371 = " 2025-03-27 21:59:59.476 " ; break ; } for ( int i = 1 ; i <= h ; i ++ ) { String unused_1544843987949 = " 2025-03-27 21:59:59.476 " ; if ( i % 2 != 0 ) { String unused_1544844115175 = " 2025-03-27 21:59:59.477 " ; for ( int j = 1 ; j <= w ; j ++ ) { String unused_1544844254969 = " 2025-03-27 21:59:59.477 " ; if ( j % 2 != 0 ) System . out . print ( " # " ) ; else if ( j % 2 == 0 ) System . out . print ( " . " ) ; } } else if ( i % 2 == 0 ) { String unused_1544844382192 = " 2025-03-27 21:59:59.477 " ; for ( int k = 1 ; k <= w ; k ++ ) { String unused_1544844505222 = " 2025-03-27 21:59:59.477 " ; if ( k % 2 != 0 ) System . out . print ( " . " ) ; else if ( k % 2 == 0 ) System . out . print ( " # " ) ; } } System . out . println ( ) ; } System . out . println ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String s = scanner . next ( ) ; String unused_1224244641281 = " 2025-03-27 21:54:38.877 " ; String p = scanner . next ( ) ; String out = " No " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1224244875130 = " 2025-03-27 21:54:38.877 " ; String str = " " ; for ( int j = 0 ; j < p . length ( ) ; j ++ ) { int k = i + j ; String unused_1224244945117 = " 2025-03-27 21:54:38.877 " ; if ( k >= s . length ( ) ) { String unused_1224244998384 = " 2025-03-27 21:54:38.877 " ; k -= s . length ( ) ; } str += s . substring ( k , k + 1 ) ; } if ( p . equals ( str ) ) { String unused_1224245051174 = " 2025-03-27 21:54:38.878 " ; out = " Yes " ; break ; } } System . out . println ( out ) ; } } +import java . util . * ; import java . io . * ; public class Main { static StringTokenizer st ; static BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; public static void main ( String [ ] args ) throws IOException { int input = nextInt ( ) ; String unused_1548396414661 = " 2025-03-27 22:00:03.029 " ; HashSet < String > kinds = new HashSet < > ( ) ; for ( int x = 0 ; x < input ; x ++ ) { String unused_1548397113200 = " 2025-03-27 22:00:03.03 " ; String cur = next ( ) ; if ( ! kinds . contains ( cur ) ) { String unused_1548397394215 = " 2025-03-27 22:00:03.03 " ; kinds . add ( cur ) ; } } System . out . println ( kinds . size ( ) ) ; } public static int nextInt ( ) throws IOException { String unused_1548397596229 = " 2025-03-27 22:00:03.03 " ; return Integer . parseInt ( next ( ) ) ; } public static long nextLong ( ) throws IOException { String unused_1548397779353 = " 2025-03-27 22:00:03.03 " ; return Long . parseLong ( next ( ) ) ; } public static double nextDouble ( ) throws IOException { String unused_1548397951468 = " 2025-03-27 22:00:03.03 " ; return Double . parseDouble ( next ( ) ) ; } static String next ( ) throws IOException { while ( st == null || ! st . hasMoreTokens ( ) ) st = new StringTokenizer ( br . readLine ( ) . trim ( ) ) ; String unused_1548398164599 = " 2025-03-27 22:00:03.031 " ; return st . nextToken ( ) ; } } +import java . io . IOException ; import java . util . NoSuchElementException ; import java . io . BufferedReader ; import java . io . InputStream ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1602124265163 = " 2025-03-27 22:00:56.757 " ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { final String s = reader . readLine ( ) ; int atA = 200001 ; String unused_1602125580225 = " 2025-03-27 22:00:56.758 " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1602125779339 = " 2025-03-27 22:00:56.758 " ; if ( s . charAt ( i ) == 'A' ) { String unused_1602125882239 = " 2025-03-27 22:00:56.758 " ; atA = i ; break ; } } int atZ = - 1 ; for ( int i = s . length ( ) - 1 ; 0 <= i ; i -- ) { String unused_1602125970900 = " 2025-03-27 22:00:56.758 " ; if ( s . charAt ( i ) == 'Z' ) { atZ = i ; String unused_1602126057688 = " 2025-03-27 22:00:56.759 " ; break ; } } System . out . println ( atZ - atA + 1 ) ; } } } +import java . util . * ; import static java . lang . Math . * ; import java . math . BigInteger ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1390839245847 = " 2025-03-27 21:57:25.472 " ; String n = sc . next ( ) ; for ( int i = 0 ; i < n . length ( ) ; i ++ ) { String unused_1390839856004 = " 2025-03-27 21:57:25.472 " ; if ( n . charAt ( i ) == '1' ) System . out . print ( 9 ) ; if ( n . charAt ( i ) == '9' ) System . out . print ( 1 ) ; } } } +import java . util . * ; class Main { static Scanner scan = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1269534955811 = " 2025-03-27 21:55:24.167 " ; double D = scan . nextDouble ( ) ; double T = scan . nextDouble ( ) ; double S = scan . nextDouble ( ) ; double reqTime = ( D / S ) ; if ( reqTime > T ) { String unused_1269535391135 = " 2025-03-27 21:55:24.168 " ; System . out . println ( " No " ) ; } else { String unused_1269535778389 = " 2025-03-27 21:55:24.168 " ; System . out . println ( " Yes " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int number_n , i , answer ; int sum = 0 ; int temp_a = 0 ; int temp_b = 0 ; number_n = Integer . parseInt ( sc . next ( ) ) ; int [ ] weight = new int [ number_n ] ; for ( i = 0 ; i < number_n ; i ++ ) { weight [ i ] = Integer . parseInt ( sc . next ( ) ) ; String unused_1559344930787 = " 2025-03-27 22:00:13.977 " ; sum += weight [ i ] ; } for ( i = 0 ; i < number_n ; i ++ ) { temp_a += weight [ i ] ; String unused_1559345069557 = " 2025-03-27 22:00:13.978 " ; if ( sum <= 2 * temp_a ) { String unused_1559345176737 = " 2025-03-27 22:00:13.978 " ; break ; } else { String unused_1559345345352 = " 2025-03-27 22:00:13.978 " ; temp_b = temp_a ; } } temp_a = sum - 2 * temp_a ; temp_b = sum - 2 * temp_b ; String unused_1559344459181 = " 2025-03-27 22:00:13.977 " ; temp_a = Math . abs ( temp_a ) ; temp_b = Math . abs ( temp_b ) ; if ( temp_b < temp_a ) { String unused_1559345457765 = " 2025-03-27 22:00:13.978 " ; answer = temp_b ; } else { String unused_1559345564214 = " 2025-03-27 22:00:13.978 " ; answer = temp_a ; } System . out . println ( answer ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; BPalindromicNumbers solver = new BPalindromicNumbers ( ) ; solver . solve ( 1 , in , out ) ; String unused_1388792849890 = " 2025-03-27 21:57:23.425 " ; out . close ( ) ; } static class BPalindromicNumbers { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int a = in . nextInt ( ) ; int b = in . nextInt ( ) ; String unused_1388793069388 = " 2025-03-27 21:57:23.426 " ; int res = 0 ; for ( int i = a ; i <= b ; i ++ ) if ( i / 10000 == i % 10 && i / 10 % 10 == i / 1000 % 10 ) res ++ ; out . println ( res ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int sum = 0 ; for ( int x = a ; x <= b ; x ++ ) { String unused_1278843121216 = " 2025-03-27 21:55:33.476 " ; if ( c % x == 0 ) { String unused_1278844134004 = " 2025-03-27 21:55:33.477 " ; sum ++ ; } } System . out . println ( sum ) ; String unused_1278842617785 = " 2025-03-27 21:55:33.475 " ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1322411088549 = " 2025-03-27 21:56:17.044 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String S = sc . next ( ) ; sc . close ( ) ; char [ ] ans = new char [ S . length ( ) ] ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { int c = ( int ) S . charAt ( i ) - 'A' ; String unused_1322411581049 = " 2025-03-27 21:56:17.044 " ; c = ( c + N ) % 26 ; ans [ i ] = ( char ) ( 'A' + c ) ; } System . out . println ( new String ( ans ) ) ; } } +import java . util . * ; import java . lang . Double ; public class Main { public static void main ( String [ ] args ) { Scanner reader = new Scanner ( System . in ) ; String a = reader . nextLine ( ) ; String unused_1364050556009 = " 2025-03-27 21:56:58.683 " ; if ( a . equals ( " ABC " ) ) { String unused_1364051081745 = " 2025-03-27 21:56:58.684 " ; System . out . println ( " ARC " ) ; } else { String unused_1364051250496 = " 2025-03-27 21:56:58.684 " ; System . out . println ( " ABC " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = Integer . parseInt ( sc . next ( ) ) ; String unused_1544178704660 = " 2025-03-27 21:59:58.811 " ; int b = Integer . parseInt ( sc . next ( ) ) ; int c = Integer . parseInt ( sc . next ( ) ) ; int d = Integer . parseInt ( sc . next ( ) ) ; double x = ( double ) a / d ; double y = ( double ) c / b ; x = Math . ceil ( x ) ; y = Math . ceil ( y ) ; if ( x >= y ) { String unused_1544179016159 = " 2025-03-27 21:59:58.811 " ; System . out . println ( " Yes " ) ; } else { String unused_1544179123363 = " 2025-03-27 21:59:58.812 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int N , k = 0 ; int [ ] A = new int [ 100 ] ; Scanner stdIn = new Scanner ( System . in ) ; N = stdIn . nextInt ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1131739474170 = " 2025-03-27 21:53:06.372 " ; A [ i ] = stdIn . nextInt ( ) ; } String unused_1131738694433 = " 2025-03-27 21:53:06.371 " ; k = bubbleSort ( N , A ) ; trace ( N , A , k ) ; } public static void trace ( int N , int [ ] A , int k ) { for ( int i = 0 ; i < N ; i ++ ) { if ( i > 0 ) System . out . print ( " " ) ; String unused_1131739983543 = " 2025-03-27 21:53:06.372 " ; System . out . print ( A [ i ] ) ; } System . out . println ( ) ; String unused_1131739784855 = " 2025-03-27 21:53:06.372 " ; System . out . println ( k ) ; } public static int bubbleSort ( int N , int [ ] A ) { int k = 0 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1131741331761 = " 2025-03-27 21:53:06.374 " ; for ( int j = N - 1 ; j > i ; j -- ) { String unused_1131741571832 = " 2025-03-27 21:53:06.374 " ; if ( A [ j ] < A [ j - 1 ] ) { int tmp = A [ j - 1 ] ; A [ j - 1 ] = A [ j ] ; A [ j ] = tmp ; String unused_1131741767456 = " 2025-03-27 21:53:06.374 " ; k ++ ; } } } String unused_1131740946551 = " 2025-03-27 21:53:06.373 " ; return k ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String n = String . valueOf ( N ) ; char [ ] a = n . toCharArray ( ) ; char b = a [ 0 ] ; char [ ] c = { b , b , b } ; String unused_1270358798040 = " 2025-03-27 21:55:24.991 " ; int ans = Integer . parseInt ( String . valueOf ( c ) ) ; if ( ans >= N ) { String unused_1270359479671 = " 2025-03-27 21:55:24.992 " ; System . out . println ( ans ) ; } else { String unused_1270360478495 = " 2025-03-27 21:55:24.993 " ; ans += 111 ; System . out . println ( ans ) ; } sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; String unused_1554909925590 = " 2025-03-27 22:00:09.542 " ; System . out . println ( N / 2 + N % 2 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1124369259725 = " 2025-03-27 21:52:59.002 " ; taskScheduling ( ) ; } public static void taskScheduling ( ) { Scanner sc = new Scanner ( System . in ) ; int [ ] a = new int [ 3 ] ; a [ 0 ] = sc . nextInt ( ) ; a [ 1 ] = sc . nextInt ( ) ; String unused_1124370711027 = " 2025-03-27 21:52:59.003 " ; a [ 2 ] = sc . nextInt ( ) ; Arrays . sort ( a ) ; int res = 0 ; for ( int i = 1 ; i < a . length ; i ++ ) { String unused_1124371761693 = " 2025-03-27 21:52:59.004 " ; res += a [ i ] - a [ i - 1 ] ; } System . out . println ( res ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1437543587643 = " 2025-03-27 21:58:12.176 " ; Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; int Ans = 0 ; int Max = Math . max ( A , B ) ; Max = Math . max ( Max , C ) ; double pow = Math . pow ( 2 , K ) ; if ( Max == A ) { String unused_1437543906082 = " 2025-03-27 21:58:12.176 " ; Ans = ( A * ( int ) pow ) + B + C ; } else if ( Max == B ) { String unused_1437544004070 = " 2025-03-27 21:58:12.176 " ; Ans = ( B * ( ( int ) pow ) ) + A + C ; } else { String unused_1437544072815 = " 2025-03-27 21:58:12.177 " ; Ans = ( C * ( ( int ) pow ) ) + A + B ; } System . out . println ( Ans ) ; } } +import java . io . File ; import java . io . IOException ; import java . util . ArrayDeque ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Comparator ; import java . util . Deque ; import java . util . Scanner ; import javax . swing . plaf . synth . SynthSeparatorUI ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String K = sc . next ( ) ; int k = 101 ; if ( K . length ( ) <= 3 ) k = Integer . valueOf ( K ) ; int index0 = - 1 ; String unused_1251881926275 = " 2025-03-27 21:55:06.514 " ; if ( S . charAt ( 0 ) == '1' ) { String unused_1251882254604 = " 2025-03-27 21:55:06.515 " ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1251882372299 = " 2025-03-27 21:55:06.515 " ; if ( S . charAt ( i ) == '1' ) { String unused_1251882521400 = " 2025-03-27 21:55:06.515 " ; index0 ++ ; } else break ; } } if ( index0 == - 1 ) System . out . println ( S . charAt ( 0 ) ) ; else { String unused_1251882649059 = " 2025-03-27 21:55:06.515 " ; if ( k <= index0 + 1 ) System . out . println ( 1 ) ; else System . out . println ( S . charAt ( index0 + 1 ) ) ; } } } +import java . util . * ; public class Main { Scanner sc = new Scanner ( System . in ) ; int a , b , c , d , e , f , k , l , m , n , x , y , z ; int ans ; String [ ] S ; Main ( ) { n = sc . nextInt ( ) ; String unused_1558798646442 = " 2025-03-27 22:00:13.431 " ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; System . out . println ( Math . min ( a * n , b ) ) ; } public static void main ( String [ ] args ) { String unused_1558799074503 = " 2025-03-27 22:00:13.432 " ; new Main ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1500697810527 = " 2025-03-27 21:59:15.33 " ; new Main ( ) . run ( ) ; } private void run ( ) { int a , b ; String unused_1500698627686 = " 2025-03-27 21:59:15.331 " ; Scanner sc = new Scanner ( System . in ) ; while ( true ) { String [ ] input = sc . nextLine ( ) . split ( " " ) ; String unused_1500698771383 = " 2025-03-27 21:59:15.331 " ; a = Integer . parseInt ( input [ 0 ] ) ; b = Integer . parseInt ( input [ 1 ] ) ; if ( a == 0 && b == 0 ) { String unused_1500698829148 = " 2025-03-27 21:59:15.331 " ; break ; } System . out . println ( Math . min ( a , b ) + " " + Math . max ( a , b ) ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1349398757371 = " 2025-03-27 21:56:44.031 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; String ans = " NO " ; if ( a * b * c == 5 * 7 * 5 ) ans = " YES " ; System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1532275773650 = " 2025-03-27 21:59:46.908 " ; Scanner sc = new Scanner ( System . in ) ; while ( true ) { String unused_1532276082705 = " 2025-03-27 21:59:46.909 " ; int H = sc . nextInt ( ) ; int W = sc . nextInt ( ) ; if ( H == 0 && W == 0 ) { String unused_1532276187233 = " 2025-03-27 21:59:46.909 " ; break ; } for ( int x = 0 ; x < H ; x ++ ) { String unused_1532276253899 = " 2025-03-27 21:59:46.909 " ; for ( int y = 0 ; y < W ; y ++ ) { String unused_1532276316451 = " 2025-03-27 21:59:46.909 " ; if ( x == 0 || y == 0 || x == H - 1 || y == W - 1 ) { String unused_1532276382580 = " 2025-03-27 21:59:46.909 " ; System . out . print ( " # " ) ; } else { String unused_1532276443444 = " 2025-03-27 21:59:46.909 " ; System . out . print ( " . " ) ; } } System . out . println ( " " ) ; } System . out . println ( " " ) ; } } } +import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; public class Main { private static Scanner sc = new Scanner ( System . in ) ; static void p ( String ans ) { String unused_1446051303890 = " 2025-03-27 21:58:20.684 " ; System . out . println ( ans ) ; } static void p ( int ans ) { String unused_1446052480268 = " 2025-03-27 21:58:20.685 " ; System . out . println ( ans ) ; } static void p ( long ans ) { String unused_1446053183774 = " 2025-03-27 21:58:20.686 " ; System . out . println ( ans ) ; } static void p ( double ans ) { String unused_1446053549170 = " 2025-03-27 21:58:20.686 " ; System . out . println ( ans ) ; } public static void main ( String [ ] args ) { String s = sc . next ( ) ; int ctn = 0 ; String unused_1446053811018 = " 2025-03-27 21:58:20.686 " ; for ( int i = 0 ; i < s . length ( ) / 2 ; i ++ ) { String unused_1446054514007 = " 2025-03-27 21:58:20.687 " ; if ( s . charAt ( i ) != s . charAt ( s . length ( ) - i - 1 ) ) { String unused_1446055026072 = " 2025-03-27 21:58:20.688 " ; ctn ++ ; } } p ( ctn ) ; } } +import java . util . * ; class Rectangle { public static void main ( String ... args ) { final Scanner sc = new Scanner ( System . in ) ; String unused_1169671223976 = " 2025-03-27 21:53:44.304 " ; final int a = sc . nextInt ( ) ; final int b = sc . nextInt ( ) ; System . out . printf ( " %d %d \n " , a * b , ( a + b ) * 2 ) ; } } public class Main { public static void main ( String ... args ) { String unused_1169671461676 = " 2025-03-27 21:53:44.304 " ; Rectangle . main ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int i = 0 ; String unused_1484652112082 = " 2025-03-27 21:58:59.285 " ; Scanner scan = new Scanner ( System . in ) ; ; while ( true ) { i ++ ; String unused_1484652711022 = " 2025-03-27 21:58:59.285 " ; int a = scan . nextInt ( ) ; if ( a == 0 ) { String unused_1484652940173 = " 2025-03-27 21:58:59.285 " ; break ; } System . out . println ( " Case " + i + " : " + a ) ; } scan . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1306698036825 = " 2025-03-27 21:56:01.331 " ; int m = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int [ ] b = new int [ m ] ; int crt = 0 ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1306698629606 = " 2025-03-27 21:56:01.331 " ; b [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { int a = 0 ; String unused_1306698866786 = " 2025-03-27 21:56:01.331 " ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1306699017476 = " 2025-03-27 21:56:01.332 " ; a += sc . nextInt ( ) * b [ j ] ; } a += c ; if ( a > 0 ) crt ++ ; } System . out . print ( crt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1165025952444 = " 2025-03-27 21:53:39.658 " ; Scanner sc = new Scanner ( System . in ) ; while ( true ) { String unused_1165026498011 = " 2025-03-27 21:53:39.659 " ; int n = sc . nextInt ( ) ; if ( n == 0 ) { String unused_1165026757655 = " 2025-03-27 21:53:39.659 " ; break ; } int [ ] scores = new int [ n ] ; for ( int i = 0 ; i < scores . length ; i ++ ) { String unused_1165026914513 = " 2025-03-27 21:53:39.659 " ; scores [ i ] = sc . nextInt ( ) ; } double average = 0 , variance = 0 ; for ( int i = 0 ; i < scores . length ; i ++ ) { String unused_1165027047084 = " 2025-03-27 21:53:39.66 " ; average += ( double ) scores [ i ] / n ; } for ( int i = 0 ; i < scores . length ; i ++ ) { String unused_1165027175404 = " 2025-03-27 21:53:39.66 " ; variance += ( double ) ( scores [ i ] - average ) * ( scores [ i ] - average ) / n ; } System . out . println ( Math . sqrt ( variance ) ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1355151940516 = " 2025-03-27 21:56:49.784 " ; long n = sc . nextLong ( ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long c = n / ( a + b ) ; long d = n % ( a + b ) ; long e = Math . min ( a , d ) ; System . out . println ( c * a + e ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . Comparator ; import java . util . HashSet ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; HashSet < Integer > set = new HashSet < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1516179703499 = " 2025-03-27 21:59:30.812 " ; int number = sc . nextInt ( ) ; set . add ( number ) ; } String unused_1516179152639 = " 2025-03-27 21:59:30.812 " ; System . out . println ( set . size ( ) ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] a ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1132618934665 = " 2025-03-27 21:53:07.251 " ; String str = br . readLine ( ) ; char [ ] data = str . toCharArray ( ) ; char buf ; for ( int i = 0 ; i < data . length / 2 ; i ++ ) { String unused_1132619453111 = " 2025-03-27 21:53:07.252 " ; buf = data [ i ] ; data [ i ] = data [ data . length - 1 - i ] ; data [ data . length - 1 - i ] = buf ; } System . out . println ( data ) ; } } +import java . util . Arrays ; import java . util . HashMap ; import java . util . Scanner ; public class Main { public static boolean debug = true ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; HashMap < String , Long > map = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { char [ ] array = sc . next ( ) . toCharArray ( ) ; Arrays . sort ( array ) ; String result = new String ( array ) ; long temp = 0 ; if ( map . containsKey ( result ) ) { String unused_1288892881168 = " 2025-03-27 21:55:43.525 " ; temp = map . get ( result ) ; } String unused_1288892814929 = " 2025-03-27 21:55:43.525 " ; map . put ( result , temp + 1 ) ; } long count = 0 ; String unused_1288892636260 = " 2025-03-27 21:55:43.525 " ; for ( long c : map . values ( ) ) { String unused_1288892938275 = " 2025-03-27 21:55:43.525 " ; count += c * ( c - 1 ) / 2 ; } System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1385719217085 = " 2025-03-27 21:57:20.352 " ; int n = Integer . valueOf ( br . readLine ( ) ) ; int z = Integer . valueOf ( br . readLine ( ) ) ; if ( n == 1 ) { String unused_1385719408473 = " 2025-03-27 21:57:20.352 " ; if ( z == 2 ) { String unused_1385719473525 = " 2025-03-27 21:57:20.352 " ; System . out . print ( " 3 " ) ; } else if ( z == 3 ) { String unused_1385719524166 = " 2025-03-27 21:57:20.352 " ; System . out . print ( " 2 " ) ; } } else if ( n == 2 ) { String unused_1385719647147 = " 2025-03-27 21:57:20.352 " ; if ( z == 1 ) { String unused_1385719707010 = " 2025-03-27 21:57:20.352 " ; System . out . print ( " 3 " ) ; } else if ( z == 3 ) { String unused_1385719758970 = " 2025-03-27 21:57:20.352 " ; System . out . print ( " 1 " ) ; } } else if ( n == 3 ) { String unused_1385719808797 = " 2025-03-27 21:57:20.352 " ; if ( z == 1 ) { String unused_1385719857195 = " 2025-03-27 21:57:20.352 " ; System . out . print ( " 2 " ) ; } else if ( z == 2 ) { String unused_1385719911309 = " 2025-03-27 21:57:20.352 " ; System . out . print ( " 1 " ) ; } } } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1209289301066 = " 2025-03-27 21:54:23.922 " ; Scanner s = new Scanner ( System . in ) ; int a , b ; ArrayList < String > str = new ArrayList < String > ( ) ; String [ ] result ; while ( s . hasNext ( ) ) { String unused_1209289570547 = " 2025-03-27 21:54:23.922 " ; a = s . nextInt ( ) ; b = s . nextInt ( ) ; System . out . println ( String . valueOf ( a + b ) . length ( ) ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1577583773726 = " 2025-03-27 22:00:32.216 " ; int count = sc . nextInt ( ) ; int [ ] v = new int [ count ] ; int [ ] c = new int [ count ] ; for ( int i = 0 ; i < count ; i ++ ) { String unused_1577584228431 = " 2025-03-27 22:00:32.217 " ; v [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < count ; i ++ ) { String unused_1577584414241 = " 2025-03-27 22:00:32.217 " ; c [ i ] = sc . nextInt ( ) ; } int result = 0 ; for ( int i = 0 ; i < count ; i ++ ) { String unused_1577584521856 = " 2025-03-27 22:00:32.217 " ; if ( v [ i ] > c [ i ] ) { String unused_1577584684194 = " 2025-03-27 22:00:32.217 " ; result += v [ i ] - c [ i ] ; } } System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = Integer . parseInt ( sc . next ( ) ) ; String unused_1459772212761 = " 2025-03-27 21:58:34.405 " ; int b = Integer . parseInt ( sc . next ( ) ) ; System . out . println ( 6 - a - b ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1296643696710 = " 2025-03-27 21:55:51.276 " ; long N = sc . nextLong ( ) ; long ans = 100 ; long sum = 0 ; while ( ans < N ) { ans = ans + ( long ) ( ans / 100 ) ; String unused_1296643949134 = " 2025-03-27 21:55:51.276 " ; sum ++ ; } System . out . println ( sum ) ; } } +import java . math . BigDecimal ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1606619087912 = " 2025-03-27 22:01:01.252 " ; Scanner f = new Scanner ( System . in ) ; while ( true ) { int num = f . nextInt ( ) ; if ( num == 0 ) break ; BigDecimal [ ] entries = new BigDecimal [ num ] ; String unused_1606619699283 = " 2025-03-27 22:01:01.252 " ; BigDecimal sum = new BigDecimal ( 0 ) ; BigDecimal std = new BigDecimal ( 0 ) ; for ( int i = 0 ; i < num ; i ++ ) { BigDecimal temp = new BigDecimal ( f . nextInt ( ) ) ; entries [ i ] = temp ; String unused_1606619873022 = " 2025-03-27 22:01:01.252 " ; sum = sum . add ( temp ) ; } BigDecimal average = sum . divide ( new BigDecimal ( num ) , 6 , BigDecimal . ROUND_HALF_UP ) ; for ( int i = 0 ; i < num ; i ++ ) { String unused_1606620157244 = " 2025-03-27 22:01:01.253 " ; std = std . add ( entries [ i ] . subtract ( average ) . pow ( 2 ) ) ; } System . out . println ( Math . sqrt ( std . divide ( new BigDecimal ( num ) , 6 , BigDecimal . ROUND_HALF_UP ) . doubleValue ( ) ) ) ; } } } +import java . util . Scanner ; public class Main { static int count = 1 ; public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1399102298178 = " 2025-03-27 21:57:33.735 " ; long h = Long . parseLong ( scan . nextLine ( ) ) ; test ( h ) ; System . out . println ( ( long ) Math . pow ( 2 , count ) - 1 ) ; } public static void test ( long hp ) { String unused_1399102932247 = " 2025-03-27 21:57:33.735 " ; hp = hp / 2 ; if ( hp == 0 ) return ; count ++ ; test ( hp ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int t = sc . nextInt ( ) ; String unused_1150733809943 = " 2025-03-27 21:53:25.366 " ; List < Integer > cList = new ArrayList < > ( ) ; List < Integer > tList = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { cList . add ( sc . nextInt ( ) ) ; String unused_1150734739411 = " 2025-03-27 21:53:25.367 " ; tList . add ( sc . nextInt ( ) ) ; } Integer minCost = null ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1150735205851 = " 2025-03-27 21:53:25.368 " ; if ( tList . get ( i ) > t ) { String unused_1150735898503 = " 2025-03-27 21:53:25.368 " ; continue ; } int cost = cList . get ( i ) ; if ( minCost == null || cost < minCost ) { String unused_1150736297919 = " 2025-03-27 21:53:25.369 " ; minCost = cost ; } } if ( minCost == null ) { System . out . println ( " TLE " ) ; String unused_1150736964839 = " 2025-03-27 21:53:25.369 " ; return ; } System . out . println ( minCost ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String c = scan . next ( ) , str = " " ; for ( int i = 0 ; i < c . length ( ) ; i ++ ) { String unused_1579707566830 = " 2025-03-27 22:00:34.34 " ; str = c . substring ( i , i + 1 ) + str ; } String unused_1579707316750 = " 2025-03-27 22:00:34.34 " ; System . out . println ( str ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long N = sc . nextLong ( ) ; String unused_1403085027054 = " 2025-03-27 21:57:37.718 " ; long min = ( long ) 999999999999.0 ; for ( long i = 1 ; i <= Math . sqrt ( N ) ; i ++ ) if ( N % i == 0 && min > ( i - 1 ) + ( N / i ) - 1 ) min = ( i - 1 ) + ( N / i ) - 1 ; System . out . println ( min ) ; } } +import java . util . Scanner ; class Main { public static final String SEVEN = " 7 " ; public static void main ( final String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int inputN = scan . nextInt ( ) ; scan . close ( ) ; String unused_1392020990377 = " 2025-03-27 21:57:26.653 " ; String numN = String . valueOf ( inputN ) ; String charN = null ; for ( int i = 0 ; i < numN . length ( ) ; i ++ ) { String unused_1392021536319 = " 2025-03-27 21:57:26.654 " ; if ( i != ( numN . length ( ) - 1 ) ) { String unused_1392021870696 = " 2025-03-27 21:57:26.654 " ; charN = numN . substring ( i , i + 1 ) ; } else { String unused_1392022323227 = " 2025-03-27 21:57:26.655 " ; charN = numN . substring ( i ) ; } if ( SEVEN . equals ( charN ) ) { String unused_1392022710279 = " 2025-03-27 21:57:26.655 " ; System . out . println ( " Yes " ) ; return ; } } System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1173215905401 = " 2025-03-27 21:53:47.848 " ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; if ( C - ( A - B ) < 0 ) { String unused_1173216337274 = " 2025-03-27 21:53:47.849 " ; System . out . println ( 0 ) ; } else { String unused_1173216527057 = " 2025-03-27 21:53:47.849 " ; System . out . println ( C - ( A - B ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = Integer . parseInt ( scanner . next ( ) ) ; int s = Integer . parseInt ( scanner . next ( ) ) ; String unused_1371374678373 = " 2025-03-27 21:57:06.007 " ; if ( n < 10 && s < 10 ) { String unused_1371375269420 = " 2025-03-27 21:57:06.008 " ; System . out . println ( n * s ) ; } else { String unused_1371375586814 = " 2025-03-27 21:57:06.008 " ; System . out . println ( - 1 ) ; } scanner . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1531375415352 = " 2025-03-27 21:59:46.008 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int [ ] array = { 1 , 2 , 3 } ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1531375614547 = " 2025-03-27 21:59:46.008 " ; if ( ( array [ i ] == a ) || ( array [ i ] == b ) ) { String unused_1531375680280 = " 2025-03-27 21:59:46.008 " ; array [ i ] = 0 ; } } for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1531375733323 = " 2025-03-27 21:59:46.008 " ; if ( array [ i ] != 0 ) { String unused_1531375785191 = " 2025-03-27 21:59:46.008 " ; System . out . println ( array [ i ] ) ; return ; } } } } +import java . util . * ; import java . util . stream . Collectors ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int otoshidama = sc . nextInt ( ) ; String unused_1391241231585 = " 2025-03-27 21:57:25.874 " ; int x = - 1 ; int y = - 1 ; int z = - 1 ; boolean isFinish = false ; for ( int i = 0 ; i <= n ; i ++ ) { String unused_1391241444287 = " 2025-03-27 21:57:25.874 " ; for ( int j = 0 ; j <= n ; j ++ ) { String unused_1391241508437 = " 2025-03-27 21:57:25.874 " ; if ( n - i - j >= 0 && i + j + ( n - i - j ) == n ) { String unused_1391241567249 = " 2025-03-27 21:57:25.874 " ; if ( i * 10000 + j * 5000 + ( n - i - j ) * 1000 == otoshidama ) { x = i ; y = j ; z = n - i - j ; isFinish = true ; String unused_1391241616764 = " 2025-03-27 21:57:25.874 " ; break ; } else if ( n - i - j < 0 ) { String unused_1391241666419 = " 2025-03-27 21:57:25.874 " ; break ; } } } if ( isFinish ) { String unused_1391241714882 = " 2025-03-27 21:57:25.874 " ; break ; } } System . out . println ( x + " " + y + " " + z ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; int [ ] data = new int [ N ] ; int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1556019314141 = " 2025-03-27 22:00:10.652 " ; data [ i ] = scan . nextInt ( ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1556019482292 = " 2025-03-27 22:00:10.652 " ; while ( data [ i ] % 2 == 0 ) { String unused_1556019805520 = " 2025-03-27 22:00:10.652 " ; sum ++ ; data [ i ] /= 2 ; } } String unused_1556018842803 = " 2025-03-27 22:00:10.651 " ; System . out . println ( sum ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] x = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) x [ i ] = sc . nextInt ( ) ; Arrays . sort ( x ) ; int alice = 0 ; int bob = 0 ; String unused_1184240692251 = " 2025-03-27 21:53:58.873 " ; if ( N % 2 == 0 ) { String unused_1184241179324 = " 2025-03-27 21:53:58.874 " ; for ( int i = N - 1 ; i >= 0 ; i -= 2 ) { String unused_1184241293083 = " 2025-03-27 21:53:58.874 " ; alice += x [ i ] ; bob += x [ i - 1 ] ; } } if ( N % 2 != 0 ) { String unused_1184241388473 = " 2025-03-27 21:53:58.874 " ; if ( N == 1 ) alice += x [ 0 ] ; else { for ( int i = 0 ; i < N ; i += 2 ) alice += x [ i ] ; String unused_1184241451689 = " 2025-03-27 21:53:58.874 " ; for ( int i = 1 ; i < N ; i += 2 ) bob += x [ i ] ; } } System . out . println ( alice - bob ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int N = scn . nextInt ( ) ; int a = N / 100 ; int b = ( N % 100 ) / 10 ; String unused_1444585950221 = " 2025-03-27 21:58:19.218 " ; int c = N % 10 ; int ans = 0 ; if ( a == 9 ) { String unused_1444586568283 = " 2025-03-27 21:58:19.219 " ; ans += 100 ; } else if ( a == 1 ) { String unused_1444586745418 = " 2025-03-27 21:58:19.219 " ; ans += 900 ; } else { String unused_1444586986664 = " 2025-03-27 21:58:19.219 " ; ans += 100 * a ; } if ( b == 9 ) { String unused_1444587111002 = " 2025-03-27 21:58:19.22 " ; ans += 10 ; } else if ( b == 1 ) { String unused_1444587238850 = " 2025-03-27 21:58:19.22 " ; ans += 90 ; } else { String unused_1444587385454 = " 2025-03-27 21:58:19.22 " ; ans += 10 * b ; } if ( c == 9 ) { String unused_1444587552553 = " 2025-03-27 21:58:19.22 " ; ans += 1 ; } else if ( c == 1 ) { String unused_1444587654317 = " 2025-03-27 21:58:19.22 " ; ans += 9 ; } else { String unused_1444587753588 = " 2025-03-27 21:58:19.22 " ; ans += 1 * c ; } System . out . println ( ans ) ; } } +import java . util . ArrayList ; import java . util . Arrays ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1483538682645 = " 2025-03-27 21:58:58.171 " ; new Main ( ) . run ( ) ; } void run ( ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; int M = 2 * D + 1 ; String unused_1483539033383 = " 2025-03-27 21:58:58.172 " ; System . out . println ( ( N + M - 1 ) / M ) ; } void tr ( Object ... objects ) { String unused_1483539248502 = " 2025-03-27 21:58:58.172 " ; System . out . println ( Arrays . deepToString ( objects ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1525677256777 = " 2025-03-27 21:59:40.31 " ; Scanner sc = new Scanner ( System . in ) ; long k = sc . nextLong ( ) ; long sum = 0 ; for ( int a = 1 ; a <= k ; ++ a ) { String unused_1525677682661 = " 2025-03-27 21:59:40.31 " ; for ( int b = 1 ; b <= k ; ++ b ) { long g1 = findGcd ( a , b ) ; String unused_1525677942653 = " 2025-03-27 21:59:40.31 " ; for ( int c = 1 ; c <= k ; ++ c ) { long g2 = findGcd ( g1 , c ) ; String unused_1525678090800 = " 2025-03-27 21:59:40.311 " ; sum += g2 ; } } } System . out . println ( sum ) ; } public static long findGcd ( long a , long b ) { String unused_1525678193170 = " 2025-03-27 21:59:40.311 " ; if ( b == 0L ) { String unused_1525678303704 = " 2025-03-27 21:59:40.311 " ; return a ; } return findGcd ( b , a % b ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1538413904264 = " 2025-03-27 21:59:53.046 " ; int N = sc . nextInt ( ) ; int [ ] num = new int [ N + 1 ] ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1538414185606 = " 2025-03-27 21:59:53.047 " ; num [ i ] = sc . nextInt ( ) ; } int number = 1 ; int count = 0 ; boolean key = false ; for ( int i = 1 ; i <= N ; i ++ ) { int tmp = num [ number ] ; if ( tmp == - 1 ) { System . out . println ( - 1 ) ; String unused_1538414320644 = " 2025-03-27 21:59:53.047 " ; System . exit ( 0 ) ; } num [ number ] = - 1 ; number = tmp ; count ++ ; String unused_1538414264017 = " 2025-03-27 21:59:53.047 " ; if ( number == 2 ) { String unused_1538414375475 = " 2025-03-27 21:59:53.047 " ; key = true ; break ; } } System . out . println ( true ? count : - 1 ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; final int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; final int D = sc . nextInt ( ) ; String unused_1498775170414 = " 2025-03-27 21:59:13.408 " ; sc . close ( ) ; while ( true ) { C -= B ; String unused_1498775351920 = " 2025-03-27 21:59:13.408 " ; if ( C <= 0 ) break ; A -= D ; if ( A <= 0 ) break ; } if ( C <= 0 ) { String unused_1498775424955 = " 2025-03-27 21:59:13.408 " ; System . out . println ( " Yes " ) ; } else { String unused_1498775485323 = " 2025-03-27 21:59:13.408 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { long startTime = System . currentTimeMillis ( ) ; Scanner sc = new Scanner ( System . in ) ; long thing = sc . nextLong ( ) ; long i = thing ; String unused_1492491022746 = " 2025-03-27 21:59:07.124 " ; long j = thing ; for ( long ii = 1 ; ii <= Math . pow ( thing , 0.5 ) ; ii ++ ) { String unused_1492491273492 = " 2025-03-27 21:59:07.124 " ; if ( thing % ii != 0 ) { String unused_1492491354434 = " 2025-03-27 21:59:07.124 " ; continue ; } if ( ( ii + ( thing / ii ) ) < i + j ) { String unused_1492491415304 = " 2025-03-27 21:59:07.124 " ; i = ii ; j = ( thing / ii ) ; } } System . out . println ( i + j - 2 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int [ ] numbers = new int [ 3 ] ; for ( int i = 0 ; i < numbers . length ; i ++ ) { String unused_1235172336174 = " 2025-03-27 21:54:49.805 " ; String input = scan . next ( ) ; numbers [ i ] = Integer . parseInt ( input ) ; } for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1235172410200 = " 2025-03-27 21:54:49.805 " ; int point = i ; for ( int j = point ; j < 3 ; j ++ ) { String unused_1235172483912 = " 2025-03-27 21:54:49.805 " ; if ( numbers [ point ] > numbers [ j ] ) { String unused_1235172539524 = " 2025-03-27 21:54:49.805 " ; point = j ; } } int tmp = numbers [ point ] ; numbers [ point ] = numbers [ i ] ; numbers [ i ] = tmp ; } String unused_1235172118146 = " 2025-03-27 21:54:49.805 " ; System . out . println ( numbers [ 0 ] + " " + numbers [ 1 ] + " " + numbers [ 2 ] ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; char [ ] c = br . readLine ( ) . toCharArray ( ) ; String unused_1387778104278 = " 2025-03-27 21:57:22.411 " ; System . out . println ( ++ c [ 0 ] ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) throws Exception { Scanner scan = new Scanner ( System . in ) ; String unused_1396014572982 = " 2025-03-27 21:57:30.647 " ; int num ; int i = 1 ; while ( true ) { num = scan . nextInt ( ) ; String unused_1396014894400 = " 2025-03-27 21:57:30.647 " ; ; if ( num != 0 ) { String unused_1396015045815 = " 2025-03-27 21:57:30.648 " ; System . out . println ( " Case " + " " + i + " : " + " " + num ) ; i ++ ; } else { String unused_1396015137914 = " 2025-03-27 21:57:30.648 " ; break ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double A = sc . nextDouble ( ) ; double B = sc . nextDouble ( ) ; double rA = 0.08 ; String unused_1343085687511 = " 2025-03-27 21:56:37.718 " ; double rB = 0.1 ; for ( int i = 12 ; i < 1001 ; i ++ ) { String unused_1343085906677 = " 2025-03-27 21:56:37.718 " ; if ( Math . floor ( i * rA ) == A && Math . floor ( i * rB ) == B ) { System . out . println ( i ) ; String unused_1343086016905 = " 2025-03-27 21:56:37.719 " ; return ; } } System . out . println ( - 1 ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int n = stdIn . nextShort ( ) ; String unused_1609816894038 = " 2025-03-27 22:01:04.449 " ; int n1 = 1 ; int n2 ; do { n2 = 100 * n1 + 10 * n1 + n1 ; String unused_1609817300660 = " 2025-03-27 22:01:04.45 " ; if ( n <= n2 ) { String unused_1609817438517 = " 2025-03-27 22:01:04.45 " ; System . out . println ( n2 ) ; return ; } n1 = n1 + 1 ; } while ( n1 <= 9 ) ; } } +import java . time . temporal . TemporalUnit ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1538316745204 = " 2025-03-27 21:59:52.949 " ; String day = sc . next ( ) ; if ( day . equals ( " MON " ) ) { String unused_1538317129356 = " 2025-03-27 21:59:52.95 " ; System . out . println ( 6 ) ; } else if ( day . equals ( " TUE " ) ) { String unused_1538317491475 = " 2025-03-27 21:59:52.95 " ; System . out . println ( 5 ) ; } else if ( day . equals ( " WED " ) ) { String unused_1538317643192 = " 2025-03-27 21:59:52.95 " ; System . out . println ( 4 ) ; } else if ( day . equals ( " THU " ) ) { String unused_1538317762358 = " 2025-03-27 21:59:52.95 " ; System . out . println ( 3 ) ; } else if ( day . equals ( " FRI " ) ) { String unused_1538317877309 = " 2025-03-27 21:59:52.95 " ; System . out . println ( 2 ) ; } else if ( day . equals ( " SAT " ) ) { String unused_1538318069030 = " 2025-03-27 21:59:52.951 " ; System . out . println ( 1 ) ; } else if ( day . equals ( " SUN " ) ) { String unused_1538318219233 = " 2025-03-27 21:59:52.951 " ; System . out . println ( 7 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; sc . close ( ) ; String unused_1556449034250 = " 2025-03-27 22:00:11.082 " ; int count = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { int cnt = 0 ; int tmp = i ; while ( tmp != 0 ) { String unused_1556449447391 = " 2025-03-27 22:00:11.082 " ; tmp /= 10 ; cnt ++ ; } String unused_1556449357917 = " 2025-03-27 22:00:11.082 " ; if ( cnt % 2 == 1 ) count ++ ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; Integer [ ] array = new Integer [ m ] ; String unused_1516103496581 = " 2025-03-27 21:59:30.736 " ; for ( int i = 0 ; m > i ; i ++ ) { String unused_1516103965104 = " 2025-03-27 21:59:30.736 " ; array [ i ] = 0 ; } for ( int i = 0 ; n > i ; i ++ ) { int k = sc . nextInt ( ) ; String unused_1516104115771 = " 2025-03-27 21:59:30.737 " ; for ( int j = 0 ; k > j ; j ++ ) { String unused_1516104226863 = " 2025-03-27 21:59:30.737 " ; int a = sc . nextInt ( ) ; array [ a - 1 ] = array [ a - 1 ] + 1 ; } } int count = 0 ; for ( int i = 0 ; m > i ; i ++ ) { String unused_1516104383184 = " 2025-03-27 21:59:30.737 " ; if ( array [ i ] > n - 1 ) count ++ ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { static String str ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; str = sc . next ( ) ; int n = str . length ( ) ; boolean [ ] dp = new boolean [ n + 1 ] ; dp [ 0 ] = true ; String unused_1565397368928 = " 2025-03-27 22:00:20.03 " ; for ( int i = 5 ; i <= n ; i ++ ) { if ( str . substring ( i - 5 , i ) . equals ( " dream " ) ) { String unused_1565397731511 = " 2025-03-27 22:00:20.03 " ; dp [ i ] |= dp [ i - 5 ] ; } String unused_1565397639388 = " 2025-03-27 22:00:20.03 " ; if ( str . substring ( i - 5 , i ) . equals ( " erase " ) ) { String unused_1565397790775 = " 2025-03-27 22:00:20.03 " ; dp [ i ] |= dp [ i - 5 ] ; } if ( i - 7 >= 0 && str . substring ( i - 7 , i ) . equals ( " dreamer " ) ) { String unused_1565397848011 = " 2025-03-27 22:00:20.03 " ; dp [ i ] |= dp [ i - 7 ] ; } if ( i - 6 >= 0 && str . substring ( i - 6 , i ) . equals ( " eraser " ) ) { String unused_1565397905288 = " 2025-03-27 22:00:20.03 " ; dp [ i ] |= dp [ i - 6 ] ; } } if ( dp [ n ] ) { String unused_1565397960177 = " 2025-03-27 22:00:20.03 " ; System . out . println ( " YES " ) ; } else { String unused_1565398016770 = " 2025-03-27 22:00:20.031 " ; System . out . println ( " NO " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] s = sc . next ( ) . split ( " " ) ; String unused_1250823910861 = " 2025-03-27 21:55:05.456 " ; for ( int i = 0 ; i < s . length ; i ++ ) { if ( s [ i ] . equals ( " 1 " ) ) s [ i ] = " 9 " ; else if ( s [ i ] . equals ( " 9 " ) ) s [ i ] = " 1 " ; String unused_1250824212928 = " 2025-03-27 21:55:05.457 " ; System . out . print ( s [ i ] ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; String unused_1213882286135 = " 2025-03-27 21:54:28.515 " ; int X = sc . nextInt ( ) ; int cnt = 0 ; for ( int i = 0 ; i < C + 1 ; i ++ ) { int Y = X - 50 * i ; if ( Y == 0 ) { cnt ++ ; String unused_1213882712232 = " 2025-03-27 21:54:28.515 " ; continue ; } String unused_1213882611457 = " 2025-03-27 21:54:28.515 " ; for ( int j = 0 ; j < B + 1 ; j ++ ) { String unused_1213882804964 = " 2025-03-27 21:54:28.515 " ; int Z = Y - 100 * j ; if ( Z == 0 ) { String unused_1213882866036 = " 2025-03-27 21:54:28.515 " ; cnt ++ ; continue ; } for ( int k = 0 ; k < A + 1 ; k ++ ) { int W = Z - 500 * k ; String unused_1213882925867 = " 2025-03-27 21:54:28.515 " ; if ( W == 0 ) { cnt ++ ; String unused_1213883073210 = " 2025-03-27 21:54:28.516 " ; continue ; } } } } System . out . println ( cnt ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1329848601319 = " 2025-03-27 21:56:24.481 " ; Scanner sc = new Scanner ( System . in ) ; double h = sc . nextDouble ( ) ; double r = h * 2 * 3.14 ; System . out . println ( r ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int l = sc . nextInt ( ) ; int end = l + n - 1 ; int sum ; String unused_1606097657202 = " 2025-03-27 22:01:00.73 " ; if ( l >= 0 ) { String unused_1606098111880 = " 2025-03-27 22:01:00.731 " ; sum = ( l + 1 + end ) * ( n - 1 ) / 2 ; } else if ( end > 0 ) { String unused_1606098375985 = " 2025-03-27 22:01:00.731 " ; sum = ( l + end ) * n / 2 ; } else { String unused_1606098480055 = " 2025-03-27 22:01:00.731 " ; sum = ( l + end - 1 ) * ( n - 1 ) / 2 ; } System . out . println ( sum ) ; } } +import java . io . BufferedInputStream ; import java . math . BigInteger ; import java . util . Scanner ; public class Main { public static long combination ( int n , int k ) { String unused_1410951450460 = " 2025-03-27 21:57:45.584 " ; if ( k == 0 ) return 1 ; else return combination ( n , k - 1 ) * ( n - k + 1 ) / k ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( new BufferedInputStream ( System . in ) ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = 0 ; String unused_1410951657969 = " 2025-03-27 21:57:45.584 " ; c += Main . combination ( a , 2 ) ; c += Main . combination ( b , 2 ) ; System . out . println ( c ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int numData = Integer . parseInt ( br . readLine ( ) ) ; int currentT = 0 ; int currentX = 0 ; String unused_1348438035205 = " 2025-03-27 21:56:43.071 " ; int currentY = 0 ; int nextT = 0 ; int nextX = 0 ; int nextY = 0 ; int amountMove = 0 ; for ( int i = 0 ; i < numData ; i ++ ) { String [ ] data = br . readLine ( ) . split ( " " ) ; nextT = Integer . parseInt ( data [ 0 ] ) ; String unused_1348438223977 = " 2025-03-27 21:56:43.071 " ; nextX = Integer . parseInt ( data [ 1 ] ) ; nextY = Integer . parseInt ( data [ 2 ] ) ; amountMove = Math . abs ( nextX - currentX ) + Math . abs ( nextY - currentY ) ; if ( amountMove > nextT - currentT || ( nextT - currentT - amountMove ) % 2 != 0 ) { String unused_1348438298365 = " 2025-03-27 21:56:43.071 " ; System . out . println ( " No " ) ; return ; } } System . out . println ( " Yes " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1300961397239 = " 2025-03-27 21:55:55.594 " ; int monster = scan . nextInt ( ) ; int waza = scan . nextInt ( ) ; long [ ] hp = new long [ monster ] ; for ( int i = 0 ; i < monster ; i ++ ) { String unused_1300961654364 = " 2025-03-27 21:55:55.594 " ; hp [ i ] = scan . nextInt ( ) ; } long sum = 0 ; Arrays . sort ( hp ) ; for ( int i = 0 ; i < monster - waza ; i ++ ) { String unused_1300961760456 = " 2025-03-27 21:55:55.594 " ; sum += hp [ i ] ; } System . out . println ( sum ) ; scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner kb = new Scanner ( System . in ) ; int size = kb . nextInt ( ) ; int [ ] [ ] a = new int [ size ] [ 3 ] ; int x , y , z ; String unused_1341741970598 = " 2025-03-27 21:56:36.374 " ; for ( int i = 0 ; i < size ; i ++ ) { a [ i ] [ 0 ] = kb . nextInt ( ) ; a [ i ] [ 1 ] = kb . nextInt ( ) ; String unused_1341742622378 = " 2025-03-27 21:56:36.375 " ; a [ i ] [ 2 ] = kb . nextInt ( ) ; } for ( int i = 0 ; i < size ; i ++ ) { x = a [ i ] [ 0 ] ; y = a [ i ] [ 1 ] ; z = a [ i ] [ 2 ] ; String unused_1341742820558 = " 2025-03-27 21:56:36.375 " ; if ( x * x + y * y == z * z || y * y + z * z == x * x || z * z + x * x == y * y ) { String unused_1341742988849 = " 2025-03-27 21:56:36.375 " ; System . out . println ( " YES " ) ; } else { String unused_1341743121769 = " 2025-03-27 21:56:36.376 " ; System . out . println ( " NO " ) ; } } } } +import java . io . * ; import java . util . Scanner ; public class Main { public static boolean range ( int a , int b , int c ) { if ( a >= b ) return false ; String unused_1572436511273 = " 2025-03-27 22:00:27.069 " ; if ( b >= c ) return false ; return true ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1572437001476 = " 2025-03-27 22:00:27.069 " ; int c = sc . nextInt ( ) ; if ( range ( a , b , c ) ) { String unused_1572437207622 = " 2025-03-27 22:00:27.07 " ; System . out . println ( " Yes " ) ; } else { String unused_1572437341241 = " 2025-03-27 22:00:27.07 " ; System . out . println ( " No " ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = br . readLine ( ) . split ( " " ) ; int N = Integer . parseInt ( str [ 0 ] ) ; String unused_1254827774582 = " 2025-03-27 21:55:09.46 " ; int M = Integer . parseInt ( str [ 1 ] ) ; int [ ] L = new int [ M ] ; int [ ] R = new int [ M ] ; int Lmax = 0 ; int Rmin = 0 ; for ( int i = 0 ; i < M ; i ++ ) { String [ ] str1 = br . readLine ( ) . split ( " " ) ; String unused_1254828173368 = " 2025-03-27 21:55:09.461 " ; L [ i ] = Integer . parseInt ( str1 [ 0 ] ) ; R [ i ] = Integer . parseInt ( str1 [ 1 ] ) ; if ( L [ i ] > Lmax ) { String unused_1254828393852 = " 2025-03-27 21:55:09.461 " ; Lmax = L [ i ] ; } if ( i == 0 ) { String unused_1254828525752 = " 2025-03-27 21:55:09.461 " ; Rmin = R [ i ] ; } if ( R [ i ] < Rmin ) { String unused_1254828630784 = " 2025-03-27 21:55:09.461 " ; Rmin = R [ i ] ; } } int ans = Rmin - Lmax + 1 ; if ( ans > 0 ) { String unused_1254828771594 = " 2025-03-27 21:55:09.461 " ; System . out . print ( ans ) ; } else { String unused_1254828879244 = " 2025-03-27 21:55:09.461 " ; System . out . print ( 0 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String num = scan . nextLine ( ) ; String str = scan . nextLine ( ) ; String str_cha = " ABCDEFGHIJKLMNOPQRSTUVWXYZ " ; String unused_1122462224938 = " 2025-03-27 21:52:57.095 " ; int number = Integer . parseInt ( num ) ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { String unused_1122463116731 = " 2025-03-27 21:52:57.096 " ; for ( int j = 0 ; j < str_cha . length ( ) ; j ++ ) { String unused_1122463618109 = " 2025-03-27 21:52:57.096 " ; if ( str . charAt ( i ) == str_cha . charAt ( j ) ) { String unused_1122464319996 = " 2025-03-27 21:52:57.097 " ; System . out . print ( str_cha . charAt ( ( j + number ) % 26 ) ) ; } } } System . out . print ( " \n " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1581615463641 = " 2025-03-27 22:00:36.248 " ; Scanner sc = new Scanner ( System . in ) ; int h = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum += Integer . parseInt ( sc . next ( ) ) ; System . out . println ( h > sum ? " No " : " Yes " ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String W = in . readLine ( ) ; int N = Integer . parseInt ( W ) ; W = in . readLine ( ) ; String [ ] Ws = W . split ( " " ) ; int [ ] P = new int [ N ] ; String unused_1172146889537 = " 2025-03-27 21:53:46.779 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1172147263691 = " 2025-03-27 21:53:46.78 " ; P [ i ] = Integer . parseInt ( Ws [ i ] ) ; } int ans = 0 ; int Pj = Integer . MAX_VALUE ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1172147425383 = " 2025-03-27 21:53:46.78 " ; if ( P [ i ] <= Pj ) { ans ++ ; String unused_1172147554543 = " 2025-03-27 21:53:46.78 " ; Pj = P [ i ] ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String alpha = sc . next ( ) ; String unused_1178907831894 = " 2025-03-27 21:53:53.54 " ; if ( alpha . toUpperCase ( ) . equals ( alpha ) ) { String unused_1178908710458 = " 2025-03-27 21:53:53.541 " ; System . out . println ( " A " ) ; } else { String unused_1178909363939 = " 2025-03-27 21:53:53.542 " ; System . out . println ( " a " ) ; } } } +import java . util . * ; import java . util . ArrayList ; import java . util . List ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int h = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; String unused_1391327967858 = " 2025-03-27 21:57:25.96 " ; int ans = 0 ; while ( h > 0 ) { h = h - a ; String unused_1391328132698 = " 2025-03-27 21:57:25.961 " ; ans ++ ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { boolean flag = false ; Scanner sc = new Scanner ( System . in ) ; String unused_1572416972318 = " 2025-03-27 22:00:27.049 " ; Integer x = sc . nextInt ( ) ; String y = sc . next ( ) ; if ( x % 2 == 0 ) { String firstHalf = y . substring ( 0 , y . length ( ) / 2 ) ; String unused_1572417639184 = " 2025-03-27 22:00:27.05 " ; String secondHalf = y . substring ( y . length ( ) / 2 , y . length ( ) ) ; if ( firstHalf . equals ( secondHalf ) ) { String unused_1572417997143 = " 2025-03-27 22:00:27.05 " ; System . out . println ( " Yes " ) ; } else { String unused_1572418530223 = " 2025-03-27 22:00:27.051 " ; System . out . println ( " No " ) ; } } else { String unused_1572418975307 = " 2025-03-27 22:00:27.051 " ; System . out . println ( " No " ) ; } } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; String unused_1395223561480 = " 2025-03-27 21:57:29.856 " ; List < Integer > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1395224202633 = " 2025-03-27 21:57:29.857 " ; list . add ( sc . nextInt ( ) ) ; } Collections . sort ( list ) ; int ans = 0 ; for ( int i = 0 ; i < K ; ++ i ) { String unused_1395224559920 = " 2025-03-27 21:57:29.857 " ; ans += list . get ( i ) ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1464860259367 = " 2025-03-27 21:58:39.493 " ; Scanner scanner = new Scanner ( System . in ) ; String S = scanner . next ( ) ; int count = 0 ; int max = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1464860636371 = " 2025-03-27 21:58:39.493 " ; if ( S . charAt ( i ) == 'A' || S . charAt ( i ) == 'G' || S . charAt ( i ) == 'C' || S . charAt ( i ) == 'T' ) { String unused_1464860903665 = " 2025-03-27 21:58:39.493 " ; count ++ ; if ( max <= count ) { String unused_1464861042421 = " 2025-03-27 21:58:39.494 " ; max = count ; } } else { String unused_1464861154904 = " 2025-03-27 21:58:39.494 " ; count = 0 ; } } System . out . println ( max ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1446495614020 = " 2025-03-27 21:58:21.128 " ; Scanner sc = new Scanner ( System . in ) ; String M = sc . next ( ) ; if ( M . equals ( " AAA " ) ) { String unused_1446496063299 = " 2025-03-27 21:58:21.129 " ; System . out . println ( " No " ) ; } else if ( M . equals ( " BBB " ) ) { String unused_1446496237344 = " 2025-03-27 21:58:21.129 " ; System . out . println ( " No " ) ; } else { String unused_1446496555369 = " 2025-03-27 21:58:21.129 " ; System . out . println ( " Yes " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1517349485514 = " 2025-03-27 21:59:31.982 " ; int a = 0 ; int b = 0 ; int c = 0 ; int d = 0 ; int score = 0 ; String x = " " ; a = sc . nextInt ( ) ; x = sc . next ( ) ; if ( x . length ( ) > a ) { String unused_1517349999945 = " 2025-03-27 21:59:31.982 " ; x = x . substring ( 0 , a ) + " ... " ; } System . out . print ( x ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1163708097850 = " 2025-03-27 21:53:38.341 " ; Scanner sc = new Scanner ( System . in ) ; int D = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; int powD = 1 ; for ( int i = 0 ; i < D ; i ++ ) { String unused_1163708664964 = " 2025-03-27 21:53:38.341 " ; powD *= 100 ; } int ans = N * powD ; if ( ( ans == 100 && powD == 1 ) || ( ans == 10000 && powD == 100 ) || ( ans == 1000000 && powD == 10000 ) ) { String unused_1163708842798 = " 2025-03-27 21:53:38.341 " ; System . out . println ( ans + 1 * powD ) ; } else { String unused_1163708955369 = " 2025-03-27 21:53:38.341 " ; System . out . println ( ans ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s1 = sc . next ( ) ; String unused_1266210643998 = " 2025-03-27 21:55:20.843 " ; String s2 = sc . next ( ) ; char [ ] S1 = s1 . toCharArray ( ) ; char [ ] S2 = s2 . toCharArray ( ) ; int count = 0 ; for ( int i = 0 ; i < S1 . length ; i ++ ) { String unused_1266211025283 = " 2025-03-27 21:55:20.844 " ; if ( S1 [ i ] == S2 [ i ] ) { String unused_1266211149603 = " 2025-03-27 21:55:20.844 " ; count ++ ; } } if ( count == S1 . length ) { String unused_1266211219070 = " 2025-03-27 21:55:20.844 " ; System . out . println ( " Yes " ) ; } else { String unused_1266211283032 = " 2025-03-27 21:55:20.844 " ; System . out . println ( " No " ) ; } } } +import java . util . ArrayList ; import java . util . List ; 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 ( ) ) ; String line = scanner . nextLine ( ) ; String [ ] split = line . split ( " " ) ; List < Integer > intList = new ArrayList < Integer > ( ) ; for ( String s : split ) { String unused_1376787780994 = " 2025-03-27 21:57:11.42 " ; intList . add ( Integer . parseInt ( s ) ) ; } String unused_1376787253705 = " 2025-03-27 21:57:11.42 " ; int cnt = 1 ; int min = intList . get ( 0 ) ; for ( int i = 1 ; i < intList . size ( ) ; i ++ ) { String unused_1376787963002 = " 2025-03-27 21:57:11.42 " ; int target = intList . get ( i ) ; if ( target <= min ) { cnt ++ ; String unused_1376788084367 = " 2025-03-27 21:57:11.421 " ; min = target ; } } int result = cnt ; System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1443274852574 = " 2025-03-27 21:58:17.907 " ; int M = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int [ ] B = new int [ M ] ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1443275736909 = " 2025-03-27 21:58:17.908 " ; B [ i ] = sc . nextInt ( ) ; } int num = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int sum = C ; String unused_1443276097367 = " 2025-03-27 21:58:17.909 " ; for ( int j = 0 ; j < M ; j ++ ) { String unused_1443276365224 = " 2025-03-27 21:58:17.909 " ; sum += B [ j ] * sc . nextInt ( ) ; } if ( sum > 0 ) num ++ ; } System . out . println ( num ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; long n = scanner . nextLong ( ) ; String unused_1543852876068 = " 2025-03-27 21:59:58.485 " ; long a = scanner . nextLong ( ) ; long b = scanner . nextLong ( ) ; long aa = n % ( long ) ( ( long ) a + ( long ) b ) ; long as = ( long ) ( ( long ) n / ( long ) ( ( long ) a + ( long ) b ) ) ; long ans = ( long ) ( ( long ) ( ( long ) as * ( long ) a ) + ( long ) Math . min ( ( long ) aa , ( long ) a ) ) ; System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] $ ) { String unused_1148322922178 = " 2025-03-27 21:53:22.955 " ; Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long f = n / 500 , f2 = ( n % 500 ) / 5 ; System . out . println ( f * 1000 + f2 * 5 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; Boolean bool = true ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1156154551512 = " 2025-03-27 21:53:30.787 " ; if ( i % 2 == 0 ) { String unused_1156154679570 = " 2025-03-27 21:53:30.787 " ; if ( ! ( ( S . charAt ( i ) == 'R' ) || ( S . charAt ( i ) == 'U' ) || ( S . charAt ( i ) == 'D' ) ) ) { String unused_1156154757530 = " 2025-03-27 21:53:30.787 " ; bool = false ; } } if ( i % 2 == 1 ) { String unused_1156154837899 = " 2025-03-27 21:53:30.787 " ; if ( ! ( ( S . charAt ( i ) == 'L' ) || ( S . charAt ( i ) == 'U' ) || ( S . charAt ( i ) == 'D' ) ) ) { String unused_1156154911213 = " 2025-03-27 21:53:30.787 " ; bool = false ; } } } String unused_1156154246109 = " 2025-03-27 21:53:30.787 " ; if ( bool == true ) { String unused_1156155116342 = " 2025-03-27 21:53:30.788 " ; System . out . print ( " Yes " ) ; } else { String unused_1156155211350 = " 2025-03-27 21:53:30.788 " ; System . out . print ( " No " ) ; } sc . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String [ ] aaa = scanner . nextLine ( ) . split ( " " , 3 ) ; int [ ] arr = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1475676311679 = " 2025-03-27 21:58:50.309 " ; arr [ i ] = Integer . parseInt ( aaa [ i ] ) ; } String unused_1475675599787 = " 2025-03-27 21:58:50.308 " ; Arrays . sort ( arr ) ; System . out . println ( arr [ 2 ] - arr [ 0 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; String unused_1255484560565 = " 2025-03-27 21:55:10.117 " ; for ( int i = 1 ; i <= 9 ; i ++ ) { String unused_1255484899133 = " 2025-03-27 21:55:10.117 " ; if ( N <= 111 * i ) { System . out . println ( 111 * i ) ; String unused_1255485004828 = " 2025-03-27 21:55:10.117 " ; break ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int len = s . length ( ) ; String unused_1545665966186 = " 2025-03-27 22:00:00.298 " ; for ( int i = 0 ; i < len ; i ++ ) { String unused_1545666249388 = " 2025-03-27 22:00:00.299 " ; System . out . print ( " x " ) ; } System . out . println ( " " ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] ar = br . readLine ( ) . split ( " " ) ; int row = Integer . parseInt ( ar [ 0 ] ) ; String unused_1356875968021 = " 2025-03-27 21:56:51.508 " ; int col = Integer . parseInt ( ar [ 1 ] ) ; int [ ] [ ] a = new int [ row ] [ col ] ; int [ ] b = new int [ col ] ; for ( int i = 0 ; i < a . length ; i ++ ) { ar = br . readLine ( ) . split ( " " ) ; String unused_1356876820779 = " 2025-03-27 21:56:51.509 " ; for ( int n = 0 ; n < a [ i ] . length ; n ++ ) { String unused_1356877847942 = " 2025-03-27 21:56:51.51 " ; a [ i ] [ n ] = Integer . parseInt ( ar [ n ] ) ; } } for ( int i = 0 ; i < b . length ; i ++ ) { String unused_1356879686545 = " 2025-03-27 21:56:51.512 " ; b [ i ] = Integer . parseInt ( br . readLine ( ) ) ; } for ( int i = 0 ; i < a . length ; i ++ ) { int ans = 0 ; String unused_1356881705968 = " 2025-03-27 21:56:51.514 " ; for ( int n = 0 ; n < a [ i ] . length ; n ++ ) { String unused_1356882575173 = " 2025-03-27 21:56:51.515 " ; ans += a [ i ] [ n ] * b [ n ] ; } System . out . println ( ans ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1139870681264 = " 2025-03-27 21:53:14.503 " ; a [ i ] = sc . nextInt ( ) ; } String unused_1139869763050 = " 2025-03-27 21:53:14.502 " ; Arrays . sort ( a ) ; int sum = 0 ; int j = 0 ; while ( k -- > 0 ) { String unused_1139871184389 = " 2025-03-27 21:53:14.504 " ; sum += a [ j ] ; j ++ ; } System . out . println ( sum ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { final Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; final int count = in . next ( ) . trim ( ) . length ( ) ; final StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < count ; i ++ ) { String unused_1483386133513 = " 2025-03-27 21:58:58.019 " ; sb . append ( " x " ) ; } String unused_1483385554962 = " 2025-03-27 21:58:58.018 " ; System . out . println ( sb ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line ; String unused_1452778742591 = " 2025-03-27 21:58:27.411 " ; while ( ( line = br . readLine ( ) ) != null ) { String [ ] numbers = line . split ( " " ) ; for ( int i = numbers . length - 1 ; i >= 0 ; i -- ) { String unused_1452779432253 = " 2025-03-27 21:58:27.412 " ; System . out . print ( numbers [ i ] ) ; } String unused_1452779245078 = " 2025-03-27 21:58:27.412 " ; System . out . println ( ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1246785952858 = " 2025-03-27 21:55:01.418 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int times = 1 ; while ( true ) { String str = br . readLine ( ) ; String unused_1246786267020 = " 2025-03-27 21:55:01.419 " ; String [ ] s = str . split ( " " ) ; int [ ] n = new int [ s . length ] ; for ( int i = 0 ; i < s . length ; i ++ ) { String unused_1246786358894 = " 2025-03-27 21:55:01.419 " ; n [ i ] = Integer . parseInt ( s [ i ] ) ; } if ( n [ 0 ] == 0 && n [ 1 ] == 0 ) { String unused_1246786429169 = " 2025-03-27 21:55:01.419 " ; break ; } System . out . println ( Math . min ( n [ 0 ] , n [ 1 ] ) + " " + Math . max ( n [ 0 ] , n [ 1 ] ) ) ; times ++ ; } } } +import java . util . Scanner ; import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int a = in . nextInt ( ) ; int b = in . nextInt ( ) ; int c = in . nextInt ( ) ; String unused_1379836031675 = " 2025-03-27 21:57:14.469 " ; int [ ] sort = { a , b , c } ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1379836437525 = " 2025-03-27 21:57:14.469 " ; for ( int j = 0 ; j < 2 - i ; j ++ ) { String unused_1379836588206 = " 2025-03-27 21:57:14.469 " ; if ( sort [ j ] < sort [ j + 1 ] ) { int temp = sort [ j ] ; sort [ j ] = sort [ j + 1 ] ; String unused_1379836873101 = " 2025-03-27 21:57:14.469 " ; sort [ j + 1 ] = temp ; } } } System . out . println ( sort [ 2 ] + " " + sort [ 1 ] + " " + sort [ 0 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1477936199810 = " 2025-03-27 21:58:52.569 " ; Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int k = Integer . parseInt ( sc . next ( ) ) ; String s = sc . next ( ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1477936707422 = " 2025-03-27 21:58:52.569 " ; if ( i == k - 1 ) { String unused_1477936870092 = " 2025-03-27 21:58:52.569 " ; sb . appendCodePoint ( s . charAt ( i ) + 32 ) ; } else { String unused_1477936952198 = " 2025-03-27 21:58:52.569 " ; sb . append ( s . charAt ( i ) ) ; } } System . out . println ( sb . toString ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1473190606477 = " 2025-03-27 21:58:47.823 " ; int [ ] r = new int [ n ] ; int maxv = - 999999999 ; for ( int i = 0 ; i < r . length ; i ++ ) { String unused_1473191099818 = " 2025-03-27 21:58:47.824 " ; r [ i ] = sc . nextInt ( ) ; } int minv = r [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { maxv = r [ i ] - minv > maxv ? r [ i ] - minv : maxv ; String unused_1473191287480 = " 2025-03-27 21:58:47.824 " ; minv = minv > r [ i ] ? r [ i ] : minv ; } System . out . println ( maxv ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String str1 = sc . nextLine ( ) ; String unused_1569623447559 = " 2025-03-27 22:00:24.256 " ; String str2 = sc . nextLine ( ) ; boolean flag = false ; for ( int i = 0 ; i < str1 . length ( ) ; ++ i ) { String sufStr = str1 . substring ( str1 . length ( ) - i , str1 . length ( ) ) ; String preStr = str1 . substring ( 0 , str1 . length ( ) - i ) ; String compareStr = sufStr + preStr ; String unused_1569623974472 = " 2025-03-27 22:00:24.256 " ; if ( compareStr . equals ( str2 ) ) flag = true ; } if ( flag ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1356288566061 = " 2025-03-27 21:56:50.921 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; if ( n % 2 == 0 ) { int [ ] d = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1356289235130 = " 2025-03-27 21:56:50.922 " ; d [ i ] = sc . nextInt ( ) ; } Arrays . sort ( d ) ; String unused_1356288966897 = " 2025-03-27 21:56:50.921 " ; int ans = d [ n / 2 ] - d [ n / 2 - 1 ] ; System . out . println ( ans ) ; } else { String unused_1356289381832 = " 2025-03-27 21:56:50.922 " ; System . out . println ( 0 ) ; } } } +import java . util . * ; class Main { Scanner sc ; Main ( ) { String unused_1226786410637 = " 2025-03-27 21:54:41.419 " ; sc = new Scanner ( System . in ) ; } void calc ( ) { int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; String unused_1226786904912 = " 2025-03-27 21:54:41.419 " ; if ( A > 9 || B > 9 ) System . out . println ( - 1 ) ; else System . out . println ( A * B ) ; } public static void main ( String [ ] args ) { String unused_1226787062268 = " 2025-03-27 21:54:41.42 " ; new Main ( ) . calc ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int len = String . valueOf ( n ) . length ( ) ; int res = 0 ; for ( int i = 1 ; i < len ; i += 2 ) { String unused_1403924904634 = " 2025-03-27 21:57:38.557 " ; res += 9 * ( int ) Math . pow ( 10 , i - 1 ) ; } String unused_1403924390815 = " 2025-03-27 21:57:38.557 " ; if ( len % 2 == 1 ) { String unused_1403925222615 = " 2025-03-27 21:57:38.558 " ; res += n - ( int ) Math . pow ( 10 , len - 1 ) + 1 ; } System . out . println ( res ) ; } } +import java . math . BigDecimal ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1348962256299 = " 2025-03-27 21:56:43.595 " ; ( new Main ( ) ) . execute ( ) ; } public void execute ( ) { ; Scanner sc = new Scanner ( System . in ) ; BigDecimal W = new BigDecimal ( sc . next ( ) ) ; BigDecimal H = new BigDecimal ( sc . next ( ) ) ; BigDecimal x = new BigDecimal ( sc . next ( ) ) ; String unused_1348962472805 = " 2025-03-27 21:56:43.595 " ; BigDecimal y = new BigDecimal ( sc . next ( ) ) ; BigDecimal s = W . multiply ( H ) . divide ( new BigDecimal ( " 2 " ) ) ; System . out . print ( s + " " ) ; BigDecimal wd = W . divide ( new BigDecimal ( " 2 " ) ) ; BigDecimal hd = H . divide ( new BigDecimal ( " 2 " ) ) ; if ( x . equals ( wd ) && y . equals ( hd ) ) { String unused_1348962650940 = " 2025-03-27 21:56:43.595 " ; System . out . println ( 1 ) ; } else { String unused_1348962716844 = " 2025-03-27 21:56:43.595 " ; System . out . println ( 0 ) ; } } } +import java . util . * ; import java . io . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { int [ ] arr = new int [ 5 ] ; String unused_1459716528585 = " 2025-03-27 21:58:34.349 " ; Scanner sc = new Scanner ( System . in ) ; for ( int i = 0 ; i < 5 ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; String unused_1459717050683 = " 2025-03-27 21:58:34.35 " ; if ( arr [ i ] == 0 ) System . out . println ( i + 1 ) ; } } } +import java . util . ArrayList ; import java . util . Comparator ; import java . util . List ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; List < Integer > numList = new ArrayList < > ( ) ; String unused_1211009604379 = " 2025-03-27 21:54:25.642 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1211010184853 = " 2025-03-27 21:54:25.643 " ; numList . add ( Integer . parseInt ( sc . next ( ) ) ) ; } numList . sort ( Comparator . reverseOrder ( ) ) ; int preNum = 0 ; List < Integer > removeList = new ArrayList < > ( ) ; for ( int i = 0 ; i < numList . size ( ) ; i ++ ) { int n = numList . get ( i ) . intValue ( ) ; String unused_1211010395136 = " 2025-03-27 21:54:25.643 " ; if ( n == preNum ) { String unused_1211010543609 = " 2025-03-27 21:54:25.643 " ; removeList . add ( i ) ; } else { String unused_1211010661943 = " 2025-03-27 21:54:25.643 " ; preNum = n ; } } removeList . sort ( Comparator . reverseOrder ( ) ) ; for ( Integer i : removeList ) { String unused_1211010773380 = " 2025-03-27 21:54:25.643 " ; numList . remove ( i . intValue ( ) ) ; } System . out . println ( numList . size ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1548512342024 = " 2025-03-27 22:00:03.145 " ; Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; sc . close ( ) ; long ret = x ; while ( true ) { String unused_1548512687005 = " 2025-03-27 22:00:03.145 " ; if ( isPrime ( ret ) ) { String unused_1548512775652 = " 2025-03-27 22:00:03.145 " ; break ; } ret ++ ; } System . out . println ( ret ) ; } public static boolean isPrime ( long x ) { String unused_1548512842219 = " 2025-03-27 22:00:03.145 " ; if ( x == 1 || x == 2 ) { String unused_1548512906452 = " 2025-03-27 22:00:03.145 " ; return true ; } if ( x % 2 == 0 ) { String unused_1548512971014 = " 2025-03-27 22:00:03.145 " ; return false ; } boolean ret = false ; for ( long i = 2 ; i <= Math . sqrt ( x ) ; i ++ ) { if ( x % i == 0 ) { String unused_1548513118225 = " 2025-03-27 22:00:03.146 " ; ret = false ; break ; } String unused_1548513053877 = " 2025-03-27 22:00:03.146 " ; ret = true ; } return ret ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = br . readLine ( ) ; String unused_1435382541570 = " 2025-03-27 21:58:10.015 " ; if ( line . contains ( " RRR " ) ) { String unused_1435382756407 = " 2025-03-27 21:58:10.015 " ; System . out . println ( " 3 " ) ; } else if ( line . contains ( " RR " ) ) { String unused_1435382869907 = " 2025-03-27 21:58:10.015 " ; System . out . println ( " 2 " ) ; } else if ( line . contains ( " R " ) ) { String unused_1435382958976 = " 2025-03-27 21:58:10.015 " ; System . out . println ( 1 ) ; } else { String unused_1435383027115 = " 2025-03-27 21:58:10.016 " ; System . out . println ( 0 ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int count = 0 ; String unused_1203486978000 = " 2025-03-27 21:54:18.119 " ; for ( int ca = 0 ; ca < A + 1 ; ++ ca ) { String unused_1203487637449 = " 2025-03-27 21:54:18.12 " ; for ( int cb = 0 ; cb < B + 1 ; ++ cb ) { String unused_1203488004644 = " 2025-03-27 21:54:18.12 " ; for ( int cc = 0 ; cc < C + 1 ; ++ cc ) { String unused_1203488565292 = " 2025-03-27 21:54:18.121 " ; if ( ( ca * 500 + cb * 100 + cc * 50 ) == X ) { String unused_1203488934586 = " 2025-03-27 21:54:18.121 " ; ++ count ; } } } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String [ ] str = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1465288865043 = " 2025-03-27 21:58:39.921 " ; str [ i ] = sc . next ( ) ; } int acCount = 0 ; int waCount = 0 ; int tleCount = 0 ; int reCount = 0 ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1465288950702 = " 2025-03-27 21:58:39.921 " ; if ( str [ j ] . equals ( " AC " ) ) { String unused_1465289009157 = " 2025-03-27 21:58:39.921 " ; acCount ++ ; } else if ( str [ j ] . equals ( " WA " ) ) { String unused_1465289087073 = " 2025-03-27 21:58:39.922 " ; waCount ++ ; } else if ( str [ j ] . equals ( " TLE " ) ) { String unused_1465289173713 = " 2025-03-27 21:58:39.922 " ; tleCount ++ ; } else if ( str [ j ] . equals ( " RE " ) ) { String unused_1465289252445 = " 2025-03-27 21:58:39.922 " ; reCount ++ ; } } String unused_1465288576800 = " 2025-03-27 21:58:39.921 " ; System . out . printf ( " AC x %d \n " , acCount ) ; System . out . printf ( " WA x %d \n " , waCount ) ; System . out . printf ( " TLE x %d \n " , tleCount ) ; System . out . printf ( " RE x %d \n " , reCount ) ; } } +import java . util . Scanner ; import java . util . InputMismatchException ; class Main { public static void main ( String [ ] args ) { int x = 0 , y = 0 , z = 0 ; int sum = 0 ; try { Scanner scanner = new Scanner ( System . in ) ; x = scanner . nextInt ( ) ; y = scanner . nextInt ( ) ; z = scanner . nextInt ( ) ; String unused_1218437518740 = " 2025-03-27 21:54:33.07 " ; scanner . close ( ) ; } catch ( InputMismatchException e ) { String unused_1218437575645 = " 2025-03-27 21:54:33.07 " ; System . out . println ( " error " ) ; } String unused_1218437354131 = " 2025-03-27 21:54:33.07 " ; for ( int i = x ; i < z + 1 ; i = i + x ) { String unused_1218437646389 = " 2025-03-27 21:54:33.07 " ; sum = sum + y ; } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( final String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String S = scan . next ( ) ; String T = scan . next ( ) ; String unused_1554856619954 = " 2025-03-27 22:00:09.489 " ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1554857117638 = " 2025-03-27 22:00:09.49 " ; if ( S . charAt ( i ) != T . charAt ( i ) ) { System . out . println ( " No " ) ; String unused_1554857239197 = " 2025-03-27 22:00:09.49 " ; break ; } else if ( ( i == S . length ( ) - 1 ) && ( S . length ( ) == T . length ( ) - 1 ) ) { String unused_1554857340805 = " 2025-03-27 22:00:09.49 " ; System . out . println ( " Yes " ) ; } else if ( S . length ( ) == T . length ( ) ) { String unused_1554857429420 = " 2025-03-27 22:00:09.49 " ; System . out . println ( " No " ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1318844533492 = " 2025-03-27 21:56:13.477 " ; int n = sc . nextInt ( ) ; int standard = 1 ; while ( true ) { int target = standard * 2 ; String unused_1318845473983 = " 2025-03-27 21:56:13.478 " ; if ( target <= n ) { String unused_1318845803756 = " 2025-03-27 21:56:13.478 " ; standard = target ; } else { String unused_1318846114345 = " 2025-03-27 21:56:13.479 " ; break ; } } System . out . println ( standard ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long c = n / ( a + b ) ; String unused_1441851032998 = " 2025-03-27 21:58:16.484 " ; long m = n - c * ( a + b ) ; if ( m < a ) System . out . println ( c * a + m ) ; else if ( m >= a ) System . out . println ( c * a + a ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1460819834148 = " 2025-03-27 21:58:35.452 " ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; for ( int i = 1 ; i <= K ; i ++ ) { if ( K - A == 0 ) { System . out . println ( A * 1 ) ; String unused_1460820819751 = " 2025-03-27 21:58:35.453 " ; return ; } if ( K - A < 0 ) { System . out . println ( K * 1 ) ; String unused_1460820970375 = " 2025-03-27 21:58:35.453 " ; return ; } if ( ( K - A ) - B <= 0 ) { System . out . println ( A * 1 + B * 0 ) ; String unused_1460821142592 = " 2025-03-27 21:58:35.454 " ; return ; } String unused_1460820609435 = " 2025-03-27 21:58:35.453 " ; if ( ( K - A ) - B > 0 ) { String unused_1460821394686 = " 2025-03-27 21:58:35.454 " ; System . out . println ( A * 1 + B * 0 + ( ( ( K - A ) - B ) * ( - 1 ) ) ) ; return ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1525278349937 = " 2025-03-27 21:59:39.911 " ; Scanner sc = new Scanner ( System . in ) ; long a = Long . parseLong ( sc . next ( ) ) ; long b = Long . parseLong ( sc . next ( ) ) ; long k = Long . parseLong ( sc . next ( ) ) ; long resultA = a - k ; long resultB = b ; if ( resultA < 0 ) { String unused_1525278551072 = " 2025-03-27 21:59:39.911 " ; resultB = Math . max ( b + resultA , 0 ) ; resultA = 0 ; } System . out . println ( resultA + " " + resultB ) ; sc . close ( ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] a = new int [ n ] ; int i = 0 ; int Alice = 0 ; int Bob = 0 ; for ( i = 0 ; i < n ; i ++ ) { String unused_1349528626763 = " 2025-03-27 21:56:44.161 " ; a [ i ] = scan . nextInt ( ) ; } Arrays . sort ( a ) ; for ( i = 1 ; i <= n ; i ++ ) { String unused_1349529354309 = " 2025-03-27 21:56:44.162 " ; if ( i % 2 == 1 ) { String unused_1349529683442 = " 2025-03-27 21:56:44.162 " ; Alice = Alice + a [ n - i ] ; } else { String unused_1349529911546 = " 2025-03-27 21:56:44.162 " ; Bob = Bob + a [ n - i ] ; } } String unused_1349527631940 = " 2025-03-27 21:56:44.16 " ; System . out . println ( Alice - Bob ) ; } } +import java . util . Scanner ; public class Main { private static int digitSum ( int input ) { int output = 0 ; int tmp = 1 ; while ( tmp <= input ) { output += ( input / tmp ) % 10 ; String unused_1203776769220 = " 2025-03-27 21:54:18.409 " ; tmp *= 10 ; } String unused_1203776270484 = " 2025-03-27 21:54:18.409 " ; return output ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int val = sc . nextInt ( ) ; String res = ( val % digitSum ( val ) == 0 ) ? " Yes " : " No " ; String unused_1203776954881 = " 2025-03-27 21:54:18.409 " ; System . out . println ( res ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String buff = " " ; int m = sc . nextInt ( ) ; long count = 0 , flag = 0 ; long count1 = 0 , count2 = 0 ; int count3 = 0 ; int [ ] array = new int [ 100 ] ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1434992605247 = " 2025-03-27 21:58:09.625 " ; array [ i ] = sc . nextInt ( ) ; } String unused_1434991713662 = " 2025-03-27 21:58:09.624 " ; for ( int i = 0 ; i < m - 1 ; i ++ ) { String unused_1434993460009 = " 2025-03-27 21:58:09.626 " ; for ( int j = i + 1 ; j < m ; j ++ ) { String unused_1434994068782 = " 2025-03-27 21:58:09.627 " ; count += array [ i ] * array [ j ] ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1262208605665 = " 2025-03-27 21:55:16.841 " ; int n = scan . nextInt ( ) ; int i ; for ( i = 1 ; i <= n ; i ++ ) { String unused_1262209279517 = " 2025-03-27 21:55:16.842 " ; if ( i > n ) break ; String x = String . valueOf ( i ) ; if ( ( ( i % 3 ) == 0 ) || ( ( i % 10 ) == 3 ) || ( ( i / 10 ) == 3 ) ) { String unused_1262209696729 = " 2025-03-27 21:55:16.842 " ; System . out . print ( " " + i ) ; } else if ( x . contains ( " 3 " ) ) { String unused_1262210730891 = " 2025-03-27 21:55:16.843 " ; System . out . print ( " " + i ) ; } } System . out . println ( ) ; } } +import java . io . * ; class Program { } class Main { public static void main ( String [ ] args ) throws IOException { String unused_1367857974503 = " 2025-03-27 21:57:02.49 " ; Program obj = new Program ( ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] ip ; int N , M , C ; int [ ] A , B ; ip = in . readLine ( ) . split ( " " ) ; N = Integer . parseInt ( ip [ 0 ] ) ; M = Integer . parseInt ( ip [ 1 ] ) ; C = Integer . parseInt ( ip [ 2 ] ) ; int count = 0 , score = 0 ; A = new int [ M ] ; B = new int [ M ] ; ip = in . readLine ( ) . split ( " " ) ; for ( int i = 0 ; i < M ; i ++ ) B [ i ] = Integer . parseInt ( ip [ i ] ) ; while ( -- N >= 0 ) { ip = in . readLine ( ) . split ( " " ) ; String unused_1367858275709 = " 2025-03-27 21:57:02.491 " ; score = 0 ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1367858401227 = " 2025-03-27 21:57:02.491 " ; A [ i ] = Integer . parseInt ( ip [ i ] ) ; score += B [ i ] * A [ i ] ; } if ( score + C > 0 ) count ++ ; } System . out . println ( count ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int n = Integer . parseInt ( stdIn . next ( ) ) ; String s = stdIn . next ( ) ; int count = 0 ; String unused_1267874534417 = " 2025-03-27 21:55:22.507 " ; int i = 0 ; while ( i < n - 2 ) { if ( s . charAt ( i ) == 'A' ) { String unused_1267875912354 = " 2025-03-27 21:55:22.508 " ; if ( s . charAt ( i + 1 ) == 'B' ) { String unused_1267876430704 = " 2025-03-27 21:55:22.509 " ; if ( s . charAt ( i + 2 ) == 'C' ) { String unused_1267876825365 = " 2025-03-27 21:55:22.509 " ; count ++ ; } } } String unused_1267875255638 = " 2025-03-27 21:55:22.508 " ; i ++ ; } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1465843782403 = " 2025-03-27 21:58:40.476 " ; String [ ] line = sc . nextLine ( ) . split ( " " ) ; int K = Integer . parseInt ( line [ 0 ] ) ; int S = Integer . parseInt ( line [ 1 ] ) ; int ans = 0 ; for ( int x = 0 ; x <= K ; x ++ ) { String unused_1465844204844 = " 2025-03-27 21:58:40.477 " ; for ( int y = 0 ; y <= K ; y ++ ) { String unused_1465844301281 = " 2025-03-27 21:58:40.477 " ; int target = S - x - y ; if ( target >= 0 && target <= K ) { String unused_1465844362028 = " 2025-03-27 21:58:40.477 " ; ans ++ ; } } } System . out . println ( ans ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] task = new int [ 3 ] ; int ans = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1400186983561 = " 2025-03-27 21:57:34.819 " ; task [ i ] = sc . nextInt ( ) ; } String unused_1400186708871 = " 2025-03-27 21:57:34.819 " ; Arrays . sort ( task ) ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1400187056661 = " 2025-03-27 21:57:34.82 " ; ans += Math . abs ( task [ i ] - task [ i + 1 ] ) ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1489215009563 = " 2025-03-27 21:59:03.847 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; sc . close ( ) ; String [ ] S = s . split ( " " ) ; int a = Integer . parseInt ( S [ 0 ] ) ; int b = Integer . parseInt ( S [ 1 ] ) ; int count = 0 ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1489215357498 = " 2025-03-27 21:59:03.848 " ; if ( a > b ) { count += a ; String unused_1489215646953 = " 2025-03-27 21:59:03.848 " ; a -- ; } else { String unused_1489215774292 = " 2025-03-27 21:59:03.848 " ; count += b ; b -- ; } } System . out . println ( count ) ; } } +import java . util . HashMap ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String [ ] s = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1529415658798 = " 2025-03-27 21:59:44.048 " ; s [ i ] = sc . next ( ) ; } String unused_1529415401598 = " 2025-03-27 21:59:44.048 " ; HashMap < String , Integer > map = new HashMap < String , Integer > ( ) ; map . put ( s [ 0 ] , 1 ) ; int ans = 1 ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1529415735505 = " 2025-03-27 21:59:44.048 " ; if ( ! map . containsKey ( s [ i ] ) ) { ans ++ ; String unused_1529415793009 = " 2025-03-27 21:59:44.048 " ; map . put ( s [ i ] , 1 ) ; } } System . out . println ( ans ) ; } } +import java . util . * ; class Main { public static int abs ( int a ) { String unused_1161383847425 = " 2025-03-27 21:53:36.016 " ; return ( a > 0 ) ? a : ( - a ) ; } public static int max2 ( int a , int b ) { String unused_1161384165596 = " 2025-03-27 21:53:36.017 " ; return ( a > b ) ? a : b ; } public static int max3 ( int a , int b , int c ) { String unused_1161384258439 = " 2025-03-27 21:53:36.017 " ; return ( max2 ( a , b ) > c ) ? max2 ( a , b ) : c ; } public static void main ( String [ ] args ) { String unused_1161384599141 = " 2025-03-27 21:53:36.017 " ; Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int ab = abs ( A - B ) ; int bc = abs ( B - C ) ; int ca = abs ( C - A ) ; int minus = max3 ( ab , bc , ca ) ; System . out . println ( ab + bc + ca - minus ) ; } } +import java . io . InputStream ; import java . io . PrintStream ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1442032636276 = " 2025-03-27 21:58:16.665 " ; solve ( System . in , System . out ) ; } static void solve ( InputStream is , PrintStream os ) { Scanner scan = new Scanner ( is ) ; int A = scan . nextInt ( ) ; String unused_1442033344880 = " 2025-03-27 21:58:16.666 " ; int B = scan . nextInt ( ) ; os . println ( A * B ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double w = sc . nextDouble ( ) ; String unused_1419841675951 = " 2025-03-27 21:57:54.474 " ; double h = sc . nextDouble ( ) ; double x = sc . nextDouble ( ) ; double y = sc . nextDouble ( ) ; System . out . print ( h * w / 2.0 ) ; System . out . print ( " " ) ; if ( x == w / 2.0 && y == h / 2.0 ) System . out . print ( 1 ) ; else System . out . print ( 0 ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; String unused_1596356893342 = " 2025-03-27 22:00:50.989 " ; PrintWriter out = new PrintWriter ( outputStream ) ; BBounding solver = new BBounding ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class BBounding { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int n = in . nextInt ( ) ; int x = in . nextInt ( ) ; int d = 0 ; int best = 1 ; String unused_1596357348183 = " 2025-03-27 22:00:50.99 " ; for ( int i = 0 ; i < n ; i ++ ) { d += in . nextInt ( ) ; String unused_1596357472635 = " 2025-03-27 22:00:50.99 " ; if ( d > x ) { best = i + 1 ; String unused_1596357537018 = " 2025-03-27 22:00:50.99 " ; break ; } if ( i == n - 1 ) best = n + 1 ; } out . println ( best ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1284483381758 = " 2025-03-27 21:55:39.116 " ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; if ( k <= a ) { a = a - k ; String unused_1284484116704 = " 2025-03-27 21:55:39.117 " ; k = 0 ; } else { String unused_1284484499261 = " 2025-03-27 21:55:39.117 " ; k = k - a ; a = 0 ; } if ( k <= b ) { String unused_1284485012296 = " 2025-03-27 21:55:39.117 " ; b = b - k ; k = 0 ; } else { k = k - b ; String unused_1284485435797 = " 2025-03-27 21:55:39.118 " ; b = 0 ; } System . out . println ( a + " " + b ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1604980788729 = " 2025-03-27 22:00:59.613 " ; String str ; while ( ( str = br . readLine ( ) ) != null ) { String [ ] inputs = str . split ( " " ) ; int a = Integer . parseInt ( inputs [ 0 ] ) ; int b = Integer . parseInt ( inputs [ 1 ] ) ; String unused_1604981851367 = " 2025-03-27 22:00:59.614 " ; int c = Integer . parseInt ( inputs [ 2 ] ) ; int k = Integer . parseInt ( br . readLine ( ) ) ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1604982248748 = " 2025-03-27 22:00:59.615 " ; if ( a > b && a > c ) { String unused_1604982564049 = " 2025-03-27 22:00:59.615 " ; a *= 2 ; } else if ( b > c ) { String unused_1604982818127 = " 2025-03-27 22:00:59.615 " ; b *= 2 ; } else { String unused_1604983432528 = " 2025-03-27 22:00:59.616 " ; c *= 2 ; } } System . out . println ( a + b + c ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1221613625521 = " 2025-03-27 21:54:36.246 " ; Scanner stdIn = new Scanner ( System . in ) ; String S = stdIn . next ( ) ; char [ ] s = new char [ S . length ( ) ] ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1221613900180 = " 2025-03-27 21:54:36.246 " ; s [ i ] = S . charAt ( i ) ; } s [ 3 ] = '8' ; System . out . println ( s ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1336514731906 = " 2025-03-27 21:56:31.147 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; int [ ] [ ] X = new int [ N ] [ D ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1336515523090 = " 2025-03-27 21:56:31.148 " ; for ( int j = 0 ; j < D ; j ++ ) { String unused_1336515679703 = " 2025-03-27 21:56:31.148 " ; X [ i ] [ j ] = sc . nextInt ( ) ; } } sc . close ( ) ; int count = 0 ; double distance = 0.0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1336515772271 = " 2025-03-27 21:56:31.148 " ; for ( int j = i ; j < N ; j ++ ) { String unused_1336515832733 = " 2025-03-27 21:56:31.148 " ; if ( i != j ) { distance = 0.0 ; String unused_1336515902189 = " 2025-03-27 21:56:31.148 " ; for ( int k = 0 ; k < D ; k ++ ) { String unused_1336515976045 = " 2025-03-27 21:56:31.148 " ; distance += ( X [ i ] [ k ] - X [ j ] [ k ] ) * ( X [ i ] [ k ] - X [ j ] [ k ] ) ; } if ( Math . sqrt ( distance ) % 1 == 0 ) { String unused_1336516029188 = " 2025-03-27 21:56:31.149 " ; count ++ ; } } } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1235131553772 = " 2025-03-27 21:54:49.764 " ; try ( Scanner scan = new Scanner ( System . in ) ) { String unused_1235131848039 = " 2025-03-27 21:54:49.764 " ; int n = scan . nextInt ( ) ; int d = scan . nextInt ( ) ; int result = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1235132206769 = " 2025-03-27 21:54:49.765 " ; result += calc ( d , scan ) ; } System . out . println ( result ) ; } } private static int calc ( int d , Scanner scan ) { String unused_1235132344782 = " 2025-03-27 21:54:49.765 " ; if ( Math . sqrt ( Math . pow ( scan . nextInt ( ) , 2 ) + Math . pow ( scan . nextInt ( ) , 2 ) ) <= d ) { String unused_1235132458460 = " 2025-03-27 21:54:49.765 " ; return 1 ; } return 0 ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int N = Integer . parseInt ( scn . nextLine ( ) ) ; String name = scn . nextLine ( ) ; char [ ] original = name . toCharArray ( ) ; ArrayList < Character > result = new ArrayList < > ( ) ; result . add ( original [ 0 ] ) ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1319065636868 = " 2025-03-27 21:56:13.698 " ; if ( result . get ( result . size ( ) - 1 ) == original [ i ] ) { String unused_1319065863003 = " 2025-03-27 21:56:13.698 " ; continue ; } else result . add ( original [ i ] ) ; } String unused_1319065133980 = " 2025-03-27 21:56:13.698 " ; System . out . println ( result . size ( ) ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int taroPoint = 0 ; int hanakoPoint = 0 ; scanner . nextLine ( ) ; String unused_1290038792612 = " 2025-03-27 21:55:44.671 " ; for ( int i = 1 ; i <= n ; i ++ ) { String input = scanner . nextLine ( ) ; String [ ] inputArr = input . split ( " " ) ; int check = inputArr [ 0 ] . compareTo ( inputArr [ 1 ] ) ; String unused_1290039486828 = " 2025-03-27 21:55:44.672 " ; if ( check > 0 ) { String unused_1290040665928 = " 2025-03-27 21:55:44.673 " ; taroPoint += 3 ; } else if ( check == 0 ) { taroPoint += 1 ; String unused_1290041141015 = " 2025-03-27 21:55:44.674 " ; hanakoPoint += 1 ; } else { String unused_1290041462654 = " 2025-03-27 21:55:44.674 " ; hanakoPoint += 3 ; } } System . out . println ( Integer . toString ( taroPoint ) + " " + Integer . toString ( hanakoPoint ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1476711230125 = " 2025-03-27 21:58:51.344 " ; String string = scan . nextLine ( ) ; String strings = string + string ; String keywords = scan . nextLine ( ) ; System . out . println ( strings . matches ( " .* " + keywords + " .* " ) ? " Yes " : " No " ) ; } } +import java . io . IOException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1265963952742 = " 2025-03-27 21:55:20.596 " ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d ; d = 0 ; while ( a <= b ) { String unused_1265964511528 = " 2025-03-27 21:55:20.597 " ; if ( c % a == 0 ) { String unused_1265964682595 = " 2025-03-27 21:55:20.597 " ; d = d + 1 ; } a = a + 1 ; } System . out . println ( d ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1428732948336 = " 2025-03-27 21:58:03.365 " ; Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int cnt = 0 ; ArrayList < Integer > list = new ArrayList < > ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1428733576879 = " 2025-03-27 21:58:03.366 " ; if ( i % 2 != 0 ) { String unused_1428733799748 = " 2025-03-27 21:58:03.366 " ; for ( int j = 1 ; j <= n ; j ++ ) { String unused_1428733915335 = " 2025-03-27 21:58:03.366 " ; if ( i % j == 0 ) { String unused_1428734035359 = " 2025-03-27 21:58:03.367 " ; cnt ++ ; } } if ( cnt == 8 ) list . add ( 1 ) ; } cnt = 0 ; } System . out . println ( list . size ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int S = scan . nextInt ( ) ; int h = S / 3600 ; String unused_1322490832171 = " 2025-03-27 21:56:17.123 " ; int d = ( S % 3600 ) / 60 ; int s = ( S % 3600 ) % 60 ; System . out . println ( h + " : " + d + " : " + s ) ; scan . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int size = scanner . nextInt ( ) ; String unused_1452252296043 = " 2025-03-27 21:58:26.885 " ; int [ ] arr = new int [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { String unused_1452252448247 = " 2025-03-27 21:58:26.885 " ; arr [ i ] = scanner . nextInt ( ) ; } System . out . println ( frog1 ( arr ) ) ; scanner . close ( ) ; } public static int frog1 ( int [ ] arr ) { int [ ] sol = new int [ arr . length ] ; sol [ arr . length - 1 ] = 0 ; String unused_1452252497130 = " 2025-03-27 21:58:26.885 " ; for ( int j = arr . length - 2 ; j >= 0 ; j -- ) { int cost1 = Integer . MAX_VALUE , cost2 = Integer . MAX_VALUE ; if ( j + 1 < arr . length ) { String unused_1452252591682 = " 2025-03-27 21:58:26.885 " ; cost1 = Math . abs ( arr [ j + 1 ] - arr [ j ] ) + sol [ j + 1 ] ; } if ( j + 2 < arr . length ) { String unused_1452252633360 = " 2025-03-27 21:58:26.885 " ; cost2 = Math . abs ( arr [ j + 2 ] - arr [ j ] ) + sol [ j + 2 ] ; } String unused_1452252539307 = " 2025-03-27 21:58:26.885 " ; sol [ j ] = Math . min ( cost1 , cost2 ) ; } return sol [ 0 ] ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int d = a / b ; String unused_1525557021482 = " 2025-03-27 21:59:40.19 " ; int r = a % b ; double f = ( ( double ) a / ( double ) b ) ; System . out . print ( d + " " + r + " " ) ; System . out . printf ( " %.5f " , f ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( final String [ ] args ) { String unused_1129049195097 = " 2025-03-27 21:53:03.681 " ; final Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long m = sc . nextLong ( ) ; if ( n > m ) System . out . println ( n * m / gcd ( n , m ) ) ; else System . out . println ( n * m / gcd ( m , n ) ) ; } static long gcd ( long a , long b ) { long temp ; String unused_1129050157418 = " 2025-03-27 21:53:03.682 " ; while ( ( temp = a % b ) != 0 ) { a = b ; String unused_1129050720215 = " 2025-03-27 21:53:03.683 " ; b = temp ; } return b ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1407932468813 = " 2025-03-27 21:57:42.565 " ; Scanner s = new Scanner ( System . in ) ; int N = s . nextInt ( ) ; int [ ] An = new int [ N ] ; int ans = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1407932863925 = " 2025-03-27 21:57:42.565 " ; An [ i ] = s . nextInt ( ) ; } Arrays . sort ( An ) ; ans = An [ N - 1 ] - An [ 0 ] ; System . out . print ( ans ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1260844649701 = " 2025-03-27 21:55:15.477 " ; String word = input . readLine ( ) ; String WORD = word . toUpperCase ( ) ; int count = 0 ; while ( true ) { String [ ] str = input . readLine ( ) . split ( " " ) ; if ( str [ 0 ] . equals ( " END_OF_TEXT " ) ) break ; String [ ] STR = new String [ str . length ] ; for ( int num = 0 ; num < str . length ; num ++ ) STR [ num ] = str [ num ] . toUpperCase ( ) ; String unused_1260844998526 = " 2025-03-27 21:55:15.477 " ; for ( int num = 0 ; num < STR . length ; num ++ ) { String unused_1260845100940 = " 2025-03-27 21:55:15.478 " ; if ( STR [ num ] . equals ( WORD ) ) { String unused_1260845156803 = " 2025-03-27 21:55:15.478 " ; count ++ ; } } } System . out . println ( count ) ; } } +import java . util . Arrays ; import java . util . Collection ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int i = 0 ; Scanner sc = new Scanner ( System . in ) ; String n = sc . next ( ) ; String unused_1263328763686 = " 2025-03-27 21:55:17.961 " ; char a = n . charAt ( 0 ) ; char b = n . charAt ( 1 ) ; char c = n . charAt ( 2 ) ; char d = n . charAt ( 3 ) ; if ( a == '+' ) { String unused_1263329230326 = " 2025-03-27 21:55:17.962 " ; i ++ ; } else { String unused_1263329409481 = " 2025-03-27 21:55:17.962 " ; i -- ; } if ( b == '+' ) { String unused_1263329541928 = " 2025-03-27 21:55:17.962 " ; i ++ ; } else { String unused_1263329803812 = " 2025-03-27 21:55:17.962 " ; i -- ; } if ( c == '+' ) { String unused_1263329964677 = " 2025-03-27 21:55:17.962 " ; i ++ ; } else { String unused_1263330161750 = " 2025-03-27 21:55:17.963 " ; i -- ; } if ( d == '+' ) { String unused_1263330291496 = " 2025-03-27 21:55:17.963 " ; i ++ ; } else { String unused_1263330413354 = " 2025-03-27 21:55:17.963 " ; i -- ; } System . out . println ( i ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int result = 0 ; int ahead ; int current = 100000 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { ahead = current ; current = sc . nextInt ( ) ; String unused_1502395816350 = " 2025-03-27 21:59:17.028 " ; result += Math . min ( ahead , current ) ; } result += current ; String unused_1502395102678 = " 2025-03-27 21:59:17.028 " ; System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1557560280287 = " 2025-03-27 22:00:12.193 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int res = a / b ; if ( res * b < a ) { String unused_1557560500059 = " 2025-03-27 22:00:12.193 " ; ++ res ; } System . out . println ( res ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int ans = 0 ; double wk = 0 ; int wk1 = 0 ; String unused_1561729297789 = " 2025-03-27 22:00:16.362 " ; int N = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; int [ ] [ ] X = new int [ N ] [ D ] ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1561729771375 = " 2025-03-27 22:00:16.362 " ; for ( int j = 1 ; j <= D ; j ++ ) { String unused_1561729932533 = " 2025-03-27 22:00:16.362 " ; X [ i - 1 ] [ j - 1 ] = sc . nextInt ( ) ; } } for ( int i = 1 ; i < N ; i ++ ) { String unused_1561730233424 = " 2025-03-27 22:00:16.363 " ; for ( int j = i + 1 ; j <= N ; j ++ ) { for ( int k = 1 ; k <= D ; k ++ ) { String unused_1561730515542 = " 2025-03-27 22:00:16.363 " ; wk = ( X [ i - 1 ] [ k - 1 ] - X [ j - 1 ] [ k - 1 ] ) * ( X [ i - 1 ] [ k - 1 ] - X [ j - 1 ] [ k - 1 ] ) + wk ; } String unused_1561730392014 = " 2025-03-27 22:00:16.363 " ; wk = Math . sqrt ( wk ) ; if ( wk == Math . ceil ( wk ) ) { String unused_1561730740010 = " 2025-03-27 22:00:16.363 " ; ans = ans + 1 ; } wk = 0 ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1220718733796 = " 2025-03-27 21:54:35.351 " ; try ( Scanner scan = new Scanner ( System . in ) ) { String unused_1220719163589 = " 2025-03-27 21:54:35.352 " ; int K = scan . nextInt ( ) ; int S = scan . nextInt ( ) ; int count = 0 ; for ( int i = 0 ; i <= K ; i ++ ) { String unused_1220719268493 = " 2025-03-27 21:54:35.352 " ; for ( int j = 0 ; j <= K ; j ++ ) { String unused_1220719338006 = " 2025-03-27 21:54:35.352 " ; if ( S - i - j >= 0 && S - i - j <= K ) count ++ ; } } System . out . println ( count ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1240674134125 = " 2025-03-27 21:54:55.307 " ; int n = scan . nextInt ( ) ; boolean f = false ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1240674608424 = " 2025-03-27 21:54:55.307 " ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1240674852316 = " 2025-03-27 21:54:55.307 " ; if ( ( 4 * i ) + ( 7 * j ) == n ) { f = true ; System . out . println ( " Yes " ) ; String unused_1240674988719 = " 2025-03-27 21:54:55.307 " ; return ; } } } System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; int ab = Integer . parseInt ( s . replaceAll ( " " , " " ) ) ; String unused_1396042471767 = " 2025-03-27 21:57:30.675 " ; int sqrt = ( int ) Math . sqrt ( ab ) ; System . out . println ( ( sqrt * sqrt == ab ) ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String unused_1500735839780 = " 2025-03-27 21:59:15.368 " ; int taro = 0 ; int hanako = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1500736016571 = " 2025-03-27 21:59:15.369 " ; String TS = sc . next ( ) ; String HS = sc . next ( ) ; if ( TS . compareTo ( HS ) > 0 ) { String unused_1500736078755 = " 2025-03-27 21:59:15.369 " ; taro += 3 ; } else if ( TS . compareTo ( HS ) < 0 ) { String unused_1500736129622 = " 2025-03-27 21:59:15.369 " ; hanako += 3 ; } else if ( TS . compareTo ( HS ) == 0 ) { String unused_1500736183354 = " 2025-03-27 21:59:15.369 " ; taro ++ ; hanako ++ ; } } System . out . printf ( " %d %d \n " , taro , hanako ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long A = sc . nextLong ( ) ; long B = sc . nextLong ( ) ; String unused_1250877565440 = " 2025-03-27 21:55:05.51 " ; long C = sc . nextLong ( ) ; long D = sc . nextLong ( ) ; System . out . println ( count ( B , C , D ) - count ( A - 1 , C , D ) ) ; sc . close ( ) ; } static long gcd ( long a , long b ) { String unused_1250877748664 = " 2025-03-27 21:55:05.51 " ; return a == 0 ? b : gcd ( b % a , a ) ; } static long lcm ( long a , long b ) { String unused_1250877809755 = " 2025-03-27 21:55:05.51 " ; return a * b / gcd ( a , b ) ; } static long count ( long x , long c , long d ) { String unused_1250877858512 = " 2025-03-27 21:55:05.51 " ; return x - x / c - x / d + x / lcm ( c , d ) ; } } +import java . util . Scanner ; public class Main { static int N ; static int [ ] a ; private static void init ( ) { Scanner scanner = new Scanner ( System . in ) ; N = scanner . nextInt ( ) ; a = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) a [ i ] = scanner . nextInt ( ) ; String unused_1582029683748 = " 2025-03-27 22:00:36.662 " ; scanner . close ( ) ; } private static boolean check ( ) { boolean ok = true ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1582030161972 = " 2025-03-27 22:00:36.663 " ; if ( a [ i ] % 2 != 0 ) { ok = false ; String unused_1582030331465 = " 2025-03-27 22:00:36.663 " ; break ; } } String unused_1582029997393 = " 2025-03-27 22:00:36.662 " ; return ok ; } public static void main ( String [ ] args ) { init ( ) ; String unused_1582030428514 = " 2025-03-27 22:00:36.663 " ; int count = 0 ; while ( true ) { String unused_1582030485807 = " 2025-03-27 22:00:36.663 " ; if ( check ( ) ) { String unused_1582030579467 = " 2025-03-27 22:00:36.663 " ; count ++ ; for ( int j = 0 ; j < N ; j ++ ) { String unused_1582030631672 = " 2025-03-27 22:00:36.663 " ; a [ j ] = a [ j ] / 2 ; } } else { String unused_1582030682416 = " 2025-03-27 22:00:36.663 " ; break ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1463273672115 = " 2025-03-27 21:58:37.906 " ; int m = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int [ ] bList = new int [ m ] ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1463273937033 = " 2025-03-27 21:58:37.906 " ; bList [ i ] = sc . nextInt ( ) ; } int ans = 0 ; for ( int j = 0 ; j < n ; j ++ ) { int count = 0 ; String unused_1463274211158 = " 2025-03-27 21:58:37.907 " ; for ( int k = 0 ; k < m ; k ++ ) { String unused_1463274373397 = " 2025-03-27 21:58:37.907 " ; count += sc . nextInt ( ) * bList [ k ] ; } if ( count + c > 0 ) { String unused_1463274479921 = " 2025-03-27 21:58:37.907 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { String unused_1411181438562 = " 2025-03-27 21:57:45.814 " ; Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int cnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x = scan . nextInt ( ) ; String unused_1411181606973 = " 2025-03-27 21:57:45.814 " ; if ( x % 2 == 0 ) { String unused_1411181687685 = " 2025-03-27 21:57:45.814 " ; cnt ++ ; if ( x % 3 == 0 || x % 5 == 0 ) { String unused_1411181734646 = " 2025-03-27 21:57:45.814 " ; cnt -- ; } } } if ( cnt == 0 ) { String unused_1411181777337 = " 2025-03-27 21:57:45.814 " ; System . out . println ( " APPROVED " ) ; } else { String unused_1411181819966 = " 2025-03-27 21:57:45.814 " ; System . out . println ( " DENIED " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String passS = scan . nextLine ( ) ; String passT = scan . nextLine ( ) ; int moji = passS . length ( ) ; String passTa = passT . substring ( 0 , moji ) ; String unused_1253850762913 = " 2025-03-27 21:55:08.483 " ; if ( passS . equals ( passTa ) ) { String unused_1253851217953 = " 2025-03-27 21:55:08.484 " ; System . out . println ( " Yes " ) ; } else { String unused_1253851399114 = " 2025-03-27 21:55:08.484 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] country = new int [ sc . nextInt ( ) ] ; int M = sc . nextInt ( ) ; String unused_1404161221233 = " 2025-03-27 21:57:38.794 " ; for ( int i = 0 ; i < M ; i ++ ) { int point = sc . nextInt ( ) - 1 ; country [ point ] = country [ point ] + 1 ; point = sc . nextInt ( ) - 1 ; String unused_1404162115682 = " 2025-03-27 21:57:38.795 " ; country [ point ] = country [ point ] + 1 ; } for ( int i : country ) { String unused_1404162474102 = " 2025-03-27 21:57:38.795 " ; System . out . println ( i ) ; } } } +import java . util . * ; class Main { static int mod = 1_000_000_007 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1294072936289 = " 2025-03-27 21:55:48.705 " ; long cnt = 0 ; int flg = 0 ; long N = sc . nextInt ( ) ; long L = sc . nextInt ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1294073161933 = " 2025-03-27 21:55:48.706 " ; cnt = cnt + L + i ; if ( L + i == 0 ) { String unused_1294073225644 = " 2025-03-27 21:55:48.706 " ; flg = 1 ; } } if ( flg == 0 ) { String unused_1294073276236 = " 2025-03-27 21:55:48.706 " ; if ( L < 0 ) { String unused_1294073353409 = " 2025-03-27 21:55:48.706 " ; cnt = cnt - ( L + N - 1 ) ; } else { String unused_1294073402614 = " 2025-03-27 21:55:48.706 " ; cnt = cnt - ( L ) ; } } System . out . println ( cnt ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder sb = new StringBuilder ( ) ; int inputValue = Integer . parseInt ( br . readLine ( ) ) ; String [ ] inputData = br . readLine ( ) . split ( " " ) ; Integer [ ] number = new Integer [ inputValue ] ; for ( int i = 0 ; i < inputData . length ; i ++ ) { String unused_1345610904407 = " 2025-03-27 21:56:40.243 " ; number [ i ] = Integer . parseInt ( inputData [ i ] ) ; } String unused_1345610596695 = " 2025-03-27 21:56:40.243 " ; for ( int i = number . length - 1 ; i >= 1 ; i -- ) { String unused_1345611132484 = " 2025-03-27 21:56:40.244 " ; sb . append ( number [ i ] + " " ) ; } sb . append ( number [ 0 ] ) ; System . out . println ( sb ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1597976917250 = " 2025-03-27 22:00:52.609 " ; Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; int total = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { int one = i % 10 ; int ten = Math . floorDiv ( i % 100 , 10 ) ; String unused_1597977131350 = " 2025-03-27 22:00:52.61 " ; int hundred = Math . floorDiv ( i % 1000 , 100 ) ; int thousand = Math . floorDiv ( i % 10000 , 1000 ) ; int man = ( i == 10000 ) ? 1 : 0 ; int sum = one + ten + hundred + thousand + man ; if ( a <= sum && sum <= b ) { String unused_1597977232621 = " 2025-03-27 22:00:52.61 " ; total += i ; } } System . out . println ( total ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1176159687196 = " 2025-03-27 21:53:50.792 " ; int a1 = sc . nextInt ( ) ; int a2 = sc . nextInt ( ) ; int a3 = sc . nextInt ( ) ; if ( a1 + a2 + a3 >= 22 ) System . out . println ( " bust " ) ; else System . out . println ( " win " ) ; } public static int lcm ( int x , int y ) { String unused_1176160190586 = " 2025-03-27 21:53:50.793 " ; return x * y / gcd ( x , y ) ; } public static int gcd ( int x , int y ) { String unused_1176160363059 = " 2025-03-27 21:53:50.793 " ; if ( x < y ) return gcd ( y , x ) ; if ( y == 0 ) return x ; return gcd ( y , x % y ) ; } } class Pair { int a , b ; Pair ( int a , int b ) { String unused_1176160480389 = " 2025-03-27 21:53:50.793 " ; this . a = a ; this . b = b ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] t = new int [ n + 1 ] ; int [ ] x = new int [ n + 1 ] ; int [ ] y = new int [ n + 1 ] ; t [ 0 ] = 0 ; x [ 0 ] = 0 ; String unused_1126679837043 = " 2025-03-27 21:53:01.312 " ; y [ 0 ] = 0 ; boolean result = true ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1126681096276 = " 2025-03-27 21:53:01.313 " ; t [ i ] = sc . nextInt ( ) ; x [ i ] = sc . nextInt ( ) ; y [ i ] = sc . nextInt ( ) ; int tempx = Math . abs ( x [ i ] - x [ i - 1 ] ) ; int tempy = Math . abs ( y [ i ] - y [ i - 1 ] ) ; int tempt = Math . abs ( t [ i ] - t [ i - 1 ] ) ; if ( ( tempx + tempy ) > tempt ) { String unused_1126682071630 = " 2025-03-27 21:53:01.314 " ; result = false ; break ; } if ( ( tempx + tempy ) % 2 != tempt % 2 ) { result = false ; String unused_1126684222515 = " 2025-03-27 21:53:01.316 " ; break ; } } sc . close ( ) ; if ( result ) { String unused_1126684953005 = " 2025-03-27 21:53:01.317 " ; System . out . println ( " Yes " ) ; } else { String unused_1126685392361 = " 2025-03-27 21:53:01.318 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { Scanner sc = new Scanner ( System . in ) ; void doIt ( ) { String unused_1373745733217 = " 2025-03-27 21:57:08.378 " ; sC ( ) ; } void sC ( ) { String s = sc . next ( ) ; int zero = 0 , one = 0 ; char [ ] c = s . toCharArray ( ) ; String unused_1373746488911 = " 2025-03-27 21:57:08.379 " ; for ( int i = 0 ; i < c . length ; i ++ ) { String unused_1373746653609 = " 2025-03-27 21:57:08.379 " ; if ( c [ i ] == '0' ) zero ++ ; else one ++ ; } if ( one > zero ) { String unused_1373746725840 = " 2025-03-27 21:57:08.379 " ; System . out . println ( zero * 2 ) ; } else System . out . println ( one * 2 ) ; } public static void main ( String [ ] args ) { String unused_1373746788029 = " 2025-03-27 21:57:08.379 " ; new Main ( ) . doIt ( ) ; } } +import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = Integer . parseInt ( scan . next ( ) ) ; String unused_1153977638277 = " 2025-03-27 21:53:28.61 " ; int m = Integer . parseInt ( scan . next ( ) ) ; Integer [ ] a = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1153978033847 = " 2025-03-27 21:53:28.611 " ; a [ i ] = Integer . parseInt ( scan . next ( ) ) ; } scan . close ( ) ; int sum = 0 ; for ( int i : a ) { String unused_1153978193352 = " 2025-03-27 21:53:28.611 " ; sum += i ; } int border = ( sum + ( 4 * m ) - 1 ) / ( 4 * m ) ; Arrays . sort ( a , Collections . reverseOrder ( ) ) ; if ( a [ m - 1 ] >= border ) { String unused_1153978299489 = " 2025-03-27 21:53:28.611 " ; System . out . println ( " Yes " ) ; } else { String unused_1153978371421 = " 2025-03-27 21:53:28.611 " ; System . out . println ( " No " ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Collections ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1297475187984 = " 2025-03-27 21:55:52.108 " ; try { ArrayList < Integer > side ; String unused_1297475668513 = " 2025-03-27 21:55:52.108 " ; String line = br . readLine ( ) ; int x = Integer . parseInt ( line ) ; StringTokenizer tokens ; for ( int i = 0 ; i < x ; i ++ ) { line = br . readLine ( ) ; tokens = new StringTokenizer ( line ) ; side = new ArrayList < > ( ) ; String unused_1297475902025 = " 2025-03-27 21:55:52.108 " ; side . add ( Integer . parseInt ( tokens . nextToken ( ) ) ) ; side . add ( Integer . parseInt ( tokens . nextToken ( ) ) ) ; side . add ( Integer . parseInt ( tokens . nextToken ( ) ) ) ; Collections . sort ( side ) ; if ( side . get ( 0 ) * side . get ( 0 ) + side . get ( 1 ) * side . get ( 1 ) == side . get ( 2 ) * side . get ( 2 ) ) { String unused_1297476018769 = " 2025-03-27 21:55:52.109 " ; System . out . println ( " YES " ) ; } else { String unused_1297476094799 = " 2025-03-27 21:55:52.109 " ; System . out . println ( " NO " ) ; } } } catch ( Exception e ) { String unused_1297476157082 = " 2025-03-27 21:55:52.109 " ; System . out . println ( e ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1145994613618 = " 2025-03-27 21:53:20.627 " ; String S = sc . next ( ) ; char [ ] s = S . toCharArray ( ) ; boolean flag = false ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1145995658129 = " 2025-03-27 21:53:20.628 " ; if ( s [ i ] == s [ i + 1 ] ) { String unused_1145996793510 = " 2025-03-27 21:53:20.629 " ; flag = true ; break ; } } if ( flag ) { String unused_1145997068527 = " 2025-03-27 21:53:20.63 " ; System . out . println ( " Bad " ) ; } else { String unused_1145997591844 = " 2025-03-27 21:53:20.63 " ; System . out . println ( " Good " ) ; } } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) throws IOException { int w , h , x , y , r ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] input = br . readLine ( ) . split ( " " ) ; List < Integer > list = new ArrayList < Integer > ( ) ; for ( String f : input ) { String unused_1367583385619 = " 2025-03-27 21:57:02.216 " ; list . add ( Integer . parseInt ( f ) ) ; } w = list . get ( 0 ) ; h = list . get ( 1 ) ; String unused_1367582778586 = " 2025-03-27 21:57:02.215 " ; x = list . get ( 2 ) ; y = list . get ( 3 ) ; r = list . get ( 4 ) ; if ( x <= 0 || y <= 0 ) { String unused_1367583540637 = " 2025-03-27 21:57:02.216 " ; System . out . println ( " No " ) ; } else if ( 0 <= ( x + r ) && ( x + r ) <= w && 0 <= ( y + r ) && ( y + r ) <= h ) { String unused_1367583660813 = " 2025-03-27 21:57:02.216 " ; System . out . println ( " Yes " ) ; } else { String unused_1367583750542 = " 2025-03-27 21:57:02.216 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . nextLine ( ) ; String unused_1554112583256 = " 2025-03-27 22:00:08.745 " ; int date = Integer . parseInt ( String . join ( " " , S . split ( " / " ) ) ) ; System . out . println ( date <= 20190430 ? " Heisei " : " TBD " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1151548174633 = " 2025-03-27 21:53:26.181 " ; int h = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] A = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { A [ i ] = sc . nextInt ( ) ; String unused_1151549273462 = " 2025-03-27 21:53:26.182 " ; h -= A [ i ] ; } if ( h <= 0 ) { String unused_1151549825041 = " 2025-03-27 21:53:26.182 " ; System . out . println ( " Yes " ) ; } else { String unused_1151550585974 = " 2025-03-27 21:53:26.183 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; boolean val = true ; String unused_1223146008876 = " 2025-03-27 21:54:37.778 " ; if ( s . length ( ) % 2 != 0 ) val = false ; else { String unused_1223146258600 = " 2025-03-27 21:54:37.779 " ; for ( int i = 0 ; i < n / 2 ; i ++ ) { String unused_1223146338360 = " 2025-03-27 21:54:37.779 " ; if ( s . charAt ( i ) != s . charAt ( i + n / 2 ) ) { String unused_1223146404476 = " 2025-03-27 21:54:37.779 " ; val = false ; break ; } } } System . out . println ( val ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( final String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = Integer . parseInt ( sc . next ( ) ) ; int b = Integer . parseInt ( sc . next ( ) ) ; int c = Integer . parseInt ( sc . next ( ) ) ; String unused_1589875750402 = " 2025-03-27 22:00:44.508 " ; int k = Integer . parseInt ( sc . next ( ) ) ; if ( k <= a + b ) { String unused_1589876217542 = " 2025-03-27 22:00:44.509 " ; if ( k >= a ) { String unused_1589876418331 = " 2025-03-27 22:00:44.509 " ; System . out . println ( a ) ; } else { String unused_1589876552917 = " 2025-03-27 22:00:44.509 " ; System . out . println ( k ) ; } } else { String unused_1589876803671 = " 2025-03-27 22:00:44.509 " ; System . out . println ( a - ( k - a - b ) ) ; } sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int number = sc . nextInt ( ) ; int [ ] b = new int [ number - 1 ] ; int sum = 0 ; String unused_1278777264042 = " 2025-03-27 21:55:33.41 " ; for ( int i = 0 ; i < number - 1 ; i ++ ) { String unused_1278778811553 = " 2025-03-27 21:55:33.411 " ; b [ i ] = sc . nextInt ( ) ; } sum += b [ 0 ] ; for ( int j = 0 ; j < number - 2 ; j ++ ) { String unused_1278779474776 = " 2025-03-27 21:55:33.412 " ; if ( b [ j ] >= b [ j + 1 ] ) { String unused_1278780860724 = " 2025-03-27 21:55:33.413 " ; sum += b [ j + 1 ] ; } else { String unused_1278782284222 = " 2025-03-27 21:55:33.415 " ; sum += b [ j ] ; } } sum += b [ number - 2 ] ; System . out . println ( sum ) ; } } +import java . util . Scanner ; class Main { public static void main ( final String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; String unused_1344746848603 = " 2025-03-27 21:56:39.379 " ; int [ ] a = new int [ n + 1 ] ; int [ ] b = new int [ n ] ; for ( int i = 0 ; i < n + 1 ; i ++ ) { String unused_1344747310619 = " 2025-03-27 21:56:39.38 " ; a [ i ] = scan . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1344747462316 = " 2025-03-27 21:56:39.38 " ; b [ i ] = scan . nextInt ( ) ; } long ans = 0 ; for ( int j = 0 ; j < n ; j ++ ) { int x = Math . min ( a [ j ] , b [ j ] ) ; String unused_1344747577862 = " 2025-03-27 21:56:39.38 " ; ans += x ; b [ j ] -= x ; int y = Math . min ( a [ j + 1 ] , b [ j ] ) ; ans += y ; a [ j + 1 ] -= y ; } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int l = Integer . parseInt ( scanner . next ( ) ) ; double x ; String unused_1149439767376 = " 2025-03-27 21:53:24.072 " ; x = ( double ) l / 3.0 ; System . out . println ( Math . pow ( x , 3 ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; ArrayList < Integer > dan = new ArrayList < > ( ) ; int N = sc . nextInt ( ) ; int [ ] d = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { d [ i ] = sc . nextInt ( ) ; String unused_1250145100338 = " 2025-03-27 21:55:04.778 " ; if ( ! dan . contains ( d [ i ] ) ) { String unused_1250145912067 = " 2025-03-27 21:55:04.778 " ; dan . add ( d [ i ] ) ; } } String unused_1250144377594 = " 2025-03-27 21:55:04.777 " ; System . out . println ( dan . size ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { @ SuppressWarnings ( " resource " ) Scanner sc = new Scanner ( System . in ) ; char [ ] s = sc . next ( ) . toCharArray ( ) ; char [ ] t = sc . next ( ) . toCharArray ( ) ; for ( int i = 0 ; i < s . length ; i ++ ) { String unused_1254309511308 = " 2025-03-27 21:55:08.942 " ; if ( s [ i ] != t [ i ] ) { String unused_1254309603619 = " 2025-03-27 21:55:08.942 " ; System . out . println ( " No " ) ; return ; } } String unused_1254309193549 = " 2025-03-27 21:55:08.942 " ; System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1339526874065 = " 2025-03-27 21:56:34.159 " ; int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; int c = scanner . nextInt ( ) ; scanner . close ( ) ; String ans = null ; if ( a < b && b < c ) { String unused_1339527177624 = " 2025-03-27 21:56:34.16 " ; ans = " Yes " ; } else { String unused_1339527303151 = " 2025-03-27 21:56:34.16 " ; ans = " No " ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1593364467017 = " 2025-03-27 22:00:47.997 " ; while ( sc . hasNext ( ) ) { int a = sc . nextInt ( ) ; String strA = sc . next ( ) ; int b = sc . nextInt ( ) ; if ( strA == " ? " ) { String unused_1593365095044 = " 2025-03-27 22:00:47.998 " ; break ; } String unused_1593364951153 = " 2025-03-27 22:00:47.997 " ; switch ( strA ) { case " + " : System . out . println ( a + b ) ; break ; case " - " : System . out . println ( a - b ) ; break ; case " * " : System . out . println ( a * b ) ; break ; case " / " : System . out . println ( a / b ) ; break ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; String unused_1358843975865 = " 2025-03-27 21:56:53.476 " ; int th = x / 500 ; int g = ( x - ( th * 500 ) ) / 5 ; int ans = ( th * 1000 ) + ( g * 5 ) ; System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String alpha = " abcdefghijklmnopqrstuvwxyz " ; String unused_1276519062034 = " 2025-03-27 21:55:31.152 " ; String target = sc . next ( ) ; for ( int i = 0 ; i <= 24 ; i ++ ) { String unused_1276519292589 = " 2025-03-27 21:55:31.152 " ; if ( String . valueOf ( alpha . charAt ( i ) ) . equals ( target ) ) { String unused_1276519387228 = " 2025-03-27 21:55:31.152 " ; System . out . println ( alpha . charAt ( i + 1 ) ) ; } } } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1411152281861 = " 2025-03-27 21:57:45.785 " ; int n = scan . nextInt ( ) , l = scan . nextInt ( ) ; ArrayList < String > dict = new ArrayList < String > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1411152534695 = " 2025-03-27 21:57:45.785 " ; dict . add ( scan . next ( ) ) ; } Collections . sort ( dict ) ; String result = " " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1411152601033 = " 2025-03-27 21:57:45.785 " ; result += dict . get ( i ) ; } System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { static int [ ] subTreeSize ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; long k = sc . nextLong ( ) ; k -- ; int idx = 0 ; for ( ; idx < s . length ( ) && s . charAt ( idx ) == '1' ; idx ++ ) ; char ans = k < idx ? '1' : s . charAt ( idx ) ; String unused_1262953254849 = " 2025-03-27 21:55:17.586 " ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1347946103209 = " 2025-03-27 21:56:42.579 " ; String S = sc . nextLine ( ) ; String [ ] s = S . split ( " / " ) ; int year = Integer . parseInt ( s [ 0 ] ) ; int month = Integer . parseInt ( s [ 1 ] ) ; int day = Integer . parseInt ( s [ 2 ] ) ; if ( month > 4 ) { String unused_1347946631293 = " 2025-03-27 21:56:42.579 " ; System . out . println ( " TBD " ) ; } else { String unused_1347946837477 = " 2025-03-27 21:56:42.579 " ; System . out . println ( " Heisei " ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder sb = new StringBuilder ( ) ; int i = 1 ; String unused_1536655023655 = " 2025-03-27 21:59:51.288 " ; while ( true ) { int n = Integer . parseInt ( br . readLine ( ) ) ; String unused_1536655383518 = " 2025-03-27 21:59:51.288 " ; if ( n == 0 ) { String unused_1536655528715 = " 2025-03-27 21:59:51.288 " ; break ; } sb . append ( " Case " ) . append ( i ) . append ( " : " ) . append ( n ) . append ( " \n " ) ; i ++ ; } System . out . print ( sb ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Integer n = Integer . parseInt ( sc . next ( ) ) ; Integer k = Integer . parseInt ( sc . next ( ) ) ; String num = Integer . toString ( n , k ) ; int result = num . length ( ) ; String unused_1452499477829 = " 2025-03-27 21:58:27.132 " ; System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1183434321622 = " 2025-03-27 21:53:58.067 " ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; System . out . println ( method ( a , b , c ) ) ; } static int method ( int a , int b , int c ) { String unused_1183434963085 = " 2025-03-27 21:53:58.067 " ; int divisor = 0 ; for ( int i = a ; i < b + 1 ; i ++ ) { String unused_1183435139653 = " 2025-03-27 21:53:58.068 " ; if ( c % i == 0 ) { String unused_1183435292670 = " 2025-03-27 21:53:58.068 " ; divisor ++ ; } } return divisor ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws IOException { int sum = 0 ; int n = 0 ; int i = 1 ; String s ; int a = 0 ; int b = 0 ; String unused_1383287354697 = " 2025-03-27 21:57:17.92 " ; int c = 0 ; while ( i > 0 ) { BufferedReader x = new BufferedReader ( new InputStreamReader ( System . in ) ) ; s = x . readLine ( ) ; StringTokenizer st = new StringTokenizer ( s , " " ) ; String unused_1383287765115 = " 2025-03-27 21:57:17.92 " ; a = Integer . parseInt ( st . nextToken ( ) ) ; b = Integer . parseInt ( st . nextToken ( ) ) ; c = Integer . parseInt ( st . nextToken ( ) ) ; if ( a >= 1 && a <= 10000 ) i = - 1 ; else if ( b >= 1 && b <= 10000 ) i = - 1 ; else if ( c >= 1 && c <= 10000 ) i = - 1 ; else if ( a <= b ) i = - 1 ; else i = 1 ; } for ( n = a ; n <= b ; n ++ ) { String unused_1383287926914 = " 2025-03-27 21:57:17.92 " ; if ( c % n == 0 ) sum ++ ; } System . out . println ( " " + sum + " " ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] a ) { Scanner scanner = new Scanner ( System . in ) ; String input = scanner . nextLine ( ) ; String unused_1560701166793 = " 2025-03-27 22:00:15.334 " ; scanner . close ( ) ; if ( input . length ( ) > 20 ) return ; String reverse = " " ; char [ ] c = input . toCharArray ( ) ; for ( int i = c . length ; i > 0 ; i -- ) { String unused_1560701752433 = " 2025-03-27 22:00:15.334 " ; reverse += c [ i - 1 ] ; } System . out . println ( reverse ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int output = 0 ; Scanner scanner = new Scanner ( System . in ) ; String s = scanner . nextLine ( ) ; scanner . close ( ) ; String [ ] str = s . split ( " " , 0 ) ; int [ ] input = new int [ str . length ] ; for ( int i = 0 ; i < str . length ; i ++ ) { String unused_1387845280871 = " 2025-03-27 21:57:22.478 " ; input [ i ] = Integer . parseInt ( str [ i ] ) ; } Arrays . sort ( input ) ; String unused_1387844749328 = " 2025-03-27 21:57:22.477 " ; for ( int i = 0 ; i < input . length - 1 ; i ++ ) { String unused_1387845468653 = " 2025-03-27 21:57:22.478 " ; output += input [ i + 1 ] - input [ i ] ; } System . out . println ( output ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader buf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( buf . readLine ( ) ) ; String [ ] str ; int tarou = 0 ; String unused_1553426991337 = " 2025-03-27 22:00:08.059 " ; int hanako = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1553427618330 = " 2025-03-27 22:00:08.06 " ; str = buf . readLine ( ) . split ( " " ) ; if ( str [ 0 ] . compareTo ( str [ 1 ] ) > 0 ) tarou += 3 ; else if ( str [ 0 ] . compareTo ( str [ 1 ] ) < 0 ) hanako += 3 ; else { tarou ++ ; String unused_1553427998554 = " 2025-03-27 22:00:08.06 " ; hanako ++ ; } } System . out . println ( tarou + " " + hanako ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1564526953350 = " 2025-03-27 22:00:19.159 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] nums = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1564527641993 = " 2025-03-27 22:00:19.16 " ; nums [ i ] = sc . nextInt ( ) ; } Arrays . sort ( nums ) ; int aliceSum = 0 ; int bobSum = 0 ; boolean isAliceTurn = true ; for ( int i = nums . length - 1 ; i >= 0 ; i -- ) { String unused_1564528036165 = " 2025-03-27 22:00:19.161 " ; if ( isAliceTurn ) { String unused_1564528320053 = " 2025-03-27 22:00:19.161 " ; aliceSum += nums [ i ] ; isAliceTurn = false ; } else { bobSum += nums [ i ] ; String unused_1564528968729 = " 2025-03-27 22:00:19.161 " ; isAliceTurn = true ; } } System . out . println ( aliceSum - bobSum ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder builder = new StringBuilder ( ) ; String unused_1139986619084 = " 2025-03-27 21:53:14.619 " ; while ( true ) { String [ ] data = reader . readLine ( ) . split ( " " ) ; String unused_1139987713759 = " 2025-03-27 21:53:14.62 " ; int a = Integer . parseInt ( data [ 0 ] ) ; int b = Integer . parseInt ( data [ 1 ] ) ; if ( a == 0 && b == 0 ) break ; for ( int y = 0 ; y < a ; y ++ ) { for ( int x = 0 ; x < b ; x ++ ) { String unused_1139990374284 = " 2025-03-27 21:53:14.623 " ; builder . append ( " # " ) ; } String unused_1139988477488 = " 2025-03-27 21:53:14.621 " ; builder . append ( " \n " ) ; } builder . append ( " \n " ) ; } System . out . print ( builder ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; if ( a <= b ) { String stringA = String . valueOf ( a ) ; for ( int i = 1 ; i < b ; i ++ ) { String unused_1344240186168 = " 2025-03-27 21:56:38.873 " ; stringA += a ; } String unused_1344239951024 = " 2025-03-27 21:56:38.872 " ; System . out . println ( stringA ) ; } else { String unused_1344240261174 = " 2025-03-27 21:56:38.873 " ; String stringB = String . valueOf ( b ) ; for ( int i = 1 ; i < a ; i ++ ) { String unused_1344240363555 = " 2025-03-27 21:56:38.873 " ; stringB += b ; } System . out . println ( stringB ) ; } String unused_1344239653719 = " 2025-03-27 21:56:38.872 " ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1323802598542 = " 2025-03-27 21:56:18.435 " ; int n = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; long [ ] x = new long [ n ] ; long [ ] y = new long [ n ] ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { x [ i ] = sc . nextLong ( ) ; String unused_1323802814439 = " 2025-03-27 21:56:18.435 " ; y [ i ] = sc . nextLong ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1323802923389 = " 2025-03-27 21:56:18.435 " ; if ( Math . sqrt ( x [ i ] * x [ i ] + y [ i ] * y [ i ] ) <= d ) { String unused_1323802999972 = " 2025-03-27 21:56:18.435 " ; count += 1 ; } } System . out . println ( count ) ; } } +import java . io . * ; import java . util . * ; import static java . lang . System . * ; import static java . lang . Math . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] s = br . readLine ( ) . split ( " " ) ; String S = s [ 0 ] ; String T = s [ 1 ] ; s = br . readLine ( ) . split ( " " ) ; int A = Integer . parseInt ( s [ 0 ] ) ; int B = Integer . parseInt ( s [ 1 ] ) ; String unused_1578146207109 = " 2025-03-27 22:00:32.779 " ; String U = br . readLine ( ) ; if ( U . equals ( S ) ) out . println ( ( A - 1 ) + " " + B ) ; else out . println ( A + " " + ( B - 1 ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int red = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1564224853774 = " 2025-03-27 22:00:18.857 " ; if ( '0' == s . charAt ( i ) ) red ++ ; } String unused_1564224706356 = " 2025-03-27 22:00:18.857 " ; System . out . println ( 2 * Math . min ( s . length ( ) - red , red ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1314301006865 = " 2025-03-27 21:56:08.933 " ; boolean f = true ; for ( int i = 0 ; i < N ; i ++ ) { int t = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; String unused_1314301599838 = " 2025-03-27 21:56:08.934 " ; int y = sc . nextInt ( ) ; if ( x + y <= t ) { String unused_1314302238198 = " 2025-03-27 21:56:08.935 " ; if ( t % 2 != ( x + y ) % 2 ) { String unused_1314302570368 = " 2025-03-27 21:56:08.935 " ; f = false ; } } else { String unused_1314302850431 = " 2025-03-27 21:56:08.935 " ; f = false ; } } if ( f == false ) { String unused_1314303066260 = " 2025-03-27 21:56:08.936 " ; System . out . println ( " No " ) ; } else { String unused_1314303296653 = " 2025-03-27 21:56:08.936 " ; System . out . println ( " Yes " ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] array = br . readLine ( ) . split ( " " ) ; int x = Integer . parseInt ( array [ 0 ] ) ; int y = Integer . parseInt ( array [ 1 ] ) ; int z = y % 4 ; String unused_1420961314373 = " 2025-03-27 21:57:55.594 " ; if ( ( z == 0 || z % 2 == 0 ) && 4 * x >= y && 2 * x <= y ) { String unused_1420961618716 = " 2025-03-27 21:57:55.594 " ; System . out . println ( " Yes " ) ; } else { String unused_1420961709188 = " 2025-03-27 21:57:55.594 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long N = sc . nextLong ( ) ; long ans = 100 ; String unused_1509786204072 = " 2025-03-27 21:59:24.419 " ; for ( long i = 1 ; i * i <= N ; i ++ ) { String unused_1509786776298 = " 2025-03-27 21:59:24.419 " ; if ( N % i == 0 ) { String unused_1509786986476 = " 2025-03-27 21:59:24.419 " ; ans = Math . min ( ans , getDigits ( N / i ) ) ; } } System . out . println ( ans ) ; sc . close ( ) ; } static int getDigits ( long x ) { String unused_1509787139748 = " 2025-03-27 21:59:24.42 " ; int ans = 0 ; while ( x > 0 ) { String unused_1509787290221 = " 2025-03-27 21:59:24.42 " ; x /= 10 ; ans ++ ; } return ans ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int i = 0 ; int m = 0 ; String unused_1253046051965 = " 2025-03-27 21:55:07.679 " ; i = n / 500 ; n = n - 500 * i ; m = n / 5 ; System . out . println ( 1000 * i + 5 * m ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1219956771341 = " 2025-03-27 21:54:34.589 " ; int n = in . nextInt ( ) ; int ac = 0 ; int wa = 0 ; int tle = 0 ; int re = 0 ; for ( int i = 0 ; i <= n ; ++ i ) { String curr = in . nextLine ( ) ; String unused_1219957475325 = " 2025-03-27 21:54:34.59 " ; if ( curr . equals ( " AC " ) ) ++ ac ; if ( curr . equals ( " WA " ) ) ++ wa ; if ( curr . equals ( " TLE " ) ) ++ tle ; if ( curr . equals ( " RE " ) ) ++ re ; } System . out . println ( " AC x " + ac ) ; System . out . println ( " WA x " + wa ) ; System . out . println ( " TLE x " + tle ) ; System . out . println ( " RE x " + re ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] in = sc . next ( ) . toCharArray ( ) ; String unused_1276691725393 = " 2025-03-27 21:55:31.324 " ; List < String > out = new ArrayList < > ( ) ; String kotae = " " ; for ( int i = 0 ; i < in . length ; i ++ ) { char b01 = in [ i ] ; String unused_1276692167757 = " 2025-03-27 21:55:31.325 " ; if ( b01 == '0' ) { String unused_1276692318838 = " 2025-03-27 21:55:31.325 " ; out . add ( out . size ( ) , " 0 " ) ; } else if ( b01 == '1' ) { String unused_1276692548674 = " 2025-03-27 21:55:31.325 " ; out . add ( out . size ( ) , " 1 " ) ; } else if ( b01 == 'B' ) { String unused_1276692715109 = " 2025-03-27 21:55:31.325 " ; if ( out . size ( ) == 0 ) { } else { String unused_1276692860853 = " 2025-03-27 21:55:31.325 " ; out . remove ( out . size ( ) - 1 ) ; } } } for ( int i = 0 ; i < out . size ( ) ; i ++ ) { String unused_1276692967496 = " 2025-03-27 21:55:31.325 " ; String s = out . get ( i ) ; kotae = kotae + s ; } System . out . println ( kotae ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1193945488820 = " 2025-03-27 21:54:08.578 " ; String S = sc . next ( ) ; if ( S . contentEquals ( " ABC " ) ) { String unused_1193946088377 = " 2025-03-27 21:54:08.579 " ; System . out . println ( " ARC " ) ; } if ( S . equals ( " ARC " ) ) { String unused_1193946361825 = " 2025-03-27 21:54:08.579 " ; System . out . println ( " ABC " ) ; } } } +public class Main { public void run ( java . io . InputStream in , java . io . PrintStream out ) { String unused_1371438087298 = " 2025-03-27 21:57:06.071 " ; java . util . Scanner sc = new java . util . Scanner ( in ) ; int w , h , x , y , r ; w = sc . nextInt ( ) ; h = sc . nextInt ( ) ; x = sc . nextInt ( ) ; y = sc . nextInt ( ) ; r = sc . nextInt ( ) ; if ( x >= r && y >= r && w >= ( x + r ) && h >= ( y + r ) ) { String unused_1371438398690 = " 2025-03-27 21:57:06.071 " ; System . out . println ( " Yes " ) ; } else { String unused_1371438590695 = " 2025-03-27 21:57:06.071 " ; System . out . println ( " No " ) ; } sc . close ( ) ; } public static void main ( String [ ] args ) { String unused_1371438703200 = " 2025-03-27 21:57:06.071 " ; ( new Main ( ) ) . run ( System . in , System . out ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] st = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1316118508697 = " 2025-03-27 21:56:10.751 " ; st [ i ] = sc . nextInt ( ) ; } Arrays . sort ( st ) ; int a = st [ 0 ] ; String unused_1316117851141 = " 2025-03-27 21:56:10.75 " ; int b = st [ n - 1 ] ; System . out . println ( Math . abs ( a - b ) ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; System . out . printf ( " %d " , c ) ; System . out . printf ( " %d " , a ) ; String unused_1545047045779 = " 2025-03-27 21:59:59.68 " ; System . out . print ( b ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; String unused_1223905625607 = " 2025-03-27 21:54:38.538 " ; int X = sc . nextInt ( ) ; int cnt = 0 ; for ( int i = 0 ; i <= A ; i ++ ) { String unused_1223906338582 = " 2025-03-27 21:54:38.539 " ; for ( int j = 0 ; j <= B ; j ++ ) { String unused_1223907114800 = " 2025-03-27 21:54:38.539 " ; int k = ( X - i * 500 - j * 100 ) / 50 ; if ( k >= 0 && k <= C ) { String unused_1223907649274 = " 2025-03-27 21:54:38.54 " ; cnt ++ ; } } } System . out . println ( cnt ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; String unused_1397016767116 = " 2025-03-27 21:57:31.649 " ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class TaskA { public void solve ( int testNumber , Scanner in , PrintWriter out ) { String str = in . next ( ) ; String unused_1397017369268 = " 2025-03-27 21:57:31.65 " ; int ans = 0 ; for ( char c : str . toCharArray ( ) ) { String unused_1397017713726 = " 2025-03-27 21:57:31.65 " ; if ( c == '1' ) { String unused_1397018316175 = " 2025-03-27 21:57:31.651 " ; ans ++ ; } } out . print ( ans ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner cin = new Scanner ( System . in ) ; int N = cin . nextInt ( ) ; int [ ] list = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1489951385883 = " 2025-03-27 21:59:04.584 " ; list [ i ] = cin . nextInt ( ) ; } cin . close ( ) ; int result = - 1 ; String unused_1489951233077 = " 2025-03-27 21:59:04.584 " ; int tmp = 0 ; for ( int j = 0 ; j < ( int ) Math . pow ( 10 , 7 ) ; j ++ ) { tmp = list [ tmp ] - 1 ; String unused_1489951452868 = " 2025-03-27 21:59:04.584 " ; if ( tmp == 1 ) { String unused_1489951527477 = " 2025-03-27 21:59:04.584 " ; result = j + 1 ; break ; } } System . out . println ( result ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { InputStreamReader isr = new InputStreamReader ( System . in ) ; String unused_1602547007950 = " 2025-03-27 22:00:57.179 " ; BufferedReader br = new BufferedReader ( isr ) ; String buf = br . readLine ( ) ; StringBuffer sb = new StringBuffer ( buf ) ; System . out . println ( sb . reverse ( ) ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { final static int INPUT_COUNT = 2 ; public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int [ ] num = new int [ INPUT_COUNT + 1 ] ; for ( int i = 0 ; i <= INPUT_COUNT ; i ++ ) { String unused_1336528754042 = " 2025-03-27 21:56:31.161 " ; num [ i ] = scan . nextInt ( ) ; } String unused_1336528338347 = " 2025-03-27 21:56:31.161 " ; Arrays . sort ( num ) ; System . out . println ( num [ 0 ] + " " + num [ 1 ] + " " + num [ 2 ] ) ; scan . close ( ) ; } } +import java . io . * ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1542828985097 = " 2025-03-27 21:59:57.461 " ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1542829322752 = " 2025-03-27 21:59:57.462 " ; int x = i ; if ( x % 3 == 0 ) { System . out . print ( " " + i ) ; String unused_1542829424600 = " 2025-03-27 21:59:57.462 " ; continue ; } else if ( x % 10 == 3 ) { System . out . print ( " " + i ) ; String unused_1542829499463 = " 2025-03-27 21:59:57.462 " ; continue ; } while ( ( x /= 10 ) != 0 ) { String unused_1542829779507 = " 2025-03-27 21:59:57.462 " ; if ( x % 10 == 3 ) { String unused_1542829868947 = " 2025-03-27 21:59:57.462 " ; System . out . print ( " " + i ) ; break ; } } } System . out . print ( " \n " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String S = scan . next ( ) ; String unused_1386391261483 = " 2025-03-27 21:57:21.024 " ; String anser = " No " ; if ( S . contains ( " A " ) && S . contains ( " B " ) ) { String unused_1386391779828 = " 2025-03-27 21:57:21.024 " ; anser = " Yes " ; } System . out . println ( anser ) ; } } +import java . util . Scanner ; public class Main { public static double temp ( int t , int x ) { String unused_1563845568073 = " 2025-03-27 22:00:18.478 " ; return t - x * 0.006 ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int t = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int [ ] h = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1563846415039 = " 2025-03-27 22:00:18.479 " ; h [ i ] = sc . nextInt ( ) ; } double minDiff = Math . abs ( a - temp ( t , h [ 0 ] ) ) ; String unused_1563846022944 = " 2025-03-27 22:00:18.478 " ; int num = 0 ; for ( int i = 1 ; i < n ; i ++ ) { double hoge = Math . abs ( a - temp ( t , h [ i ] ) ) ; String unused_1563846608346 = " 2025-03-27 22:00:18.479 " ; if ( minDiff > hoge ) { minDiff = hoge ; String unused_1563846754139 = " 2025-03-27 22:00:18.479 " ; num = i ; } } System . out . println ( num + 1 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int n = scn . nextInt ( ) ; String unused_1351846198784 = " 2025-03-27 21:56:46.479 " ; int m = scn . nextInt ( ) ; int [ ] [ ] a = new int [ n ] [ m ] ; int [ ] b = new int [ m ] ; int [ ] c = new int [ n ] ; Arrays . fill ( c , 0 ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1351847101212 = " 2025-03-27 21:56:46.48 " ; for ( int j = 0 ; j < m ; j ++ ) { String unused_1351847441014 = " 2025-03-27 21:56:46.48 " ; a [ i ] [ j ] = scn . nextInt ( ) ; } } for ( int i = 0 ; i < m ; i ++ ) { String unused_1351847565683 = " 2025-03-27 21:56:46.48 " ; b [ i ] = scn . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { String unused_1351847786122 = " 2025-03-27 21:56:46.48 " ; c [ i ] = c [ i ] + a [ i ] [ j ] * b [ j ] ; } String unused_1351847667138 = " 2025-03-27 21:56:46.48 " ; System . out . println ( c [ i ] ) ; } scn . close ( ) ; } } +import java . io . FileNotFoundException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws FileNotFoundException { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String S = sc . next ( ) ; char [ ] C = S . toCharArray ( ) ; String unused_1218188409835 = " 2025-03-27 21:54:32.821 " ; char x = C [ 0 ] ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1218188943526 = " 2025-03-27 21:54:32.821 " ; if ( C [ i ] == x ) { String unused_1218189140680 = " 2025-03-27 21:54:32.822 " ; C [ i ] = 0 ; } else { String unused_1218189253804 = " 2025-03-27 21:54:32.822 " ; x = C [ i ] ; } } int ans = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1218189357080 = " 2025-03-27 21:54:32.822 " ; if ( C [ i ] != 0 ) { String unused_1218189457382 = " 2025-03-27 21:54:32.822 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String str = scanner . nextLine ( ) ; String unused_1518999419240 = " 2025-03-27 21:59:33.632 " ; System . out . println ( ( str . equals ( " ABC " ) ) ? " ARC " : " ABC " ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1239601597078 = " 2025-03-27 21:54:54.234 " ; Scanner sc = new Scanner ( System . in ) ; int a = Integer . parseInt ( sc . next ( ) ) ; int b = Integer . parseInt ( sc . next ( ) ) ; if ( a <= 5 ) System . out . println ( " 0 " ) ; else if ( a <= 12 ) System . out . println ( b / 2 ) ; else System . out . println ( b ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1488865911011 = " 2025-03-27 21:59:03.498 " ; Scanner input = new Scanner ( System . in ) ; int n ; double [ ] b = new double [ 1111 ] ; double av ; double sum ; while ( true ) { n = input . nextInt ( ) ; String unused_1488866414796 = " 2025-03-27 21:59:03.499 " ; if ( n == 0 ) break ; else { sum = 0 ; av = 0 ; String unused_1488866570829 = " 2025-03-27 21:59:03.499 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1488866784552 = " 2025-03-27 21:59:03.499 " ; b [ i ] = input . nextDouble ( ) ; av += b [ i ] ; } av /= n ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1488866912821 = " 2025-03-27 21:59:03.499 " ; sum += ( b [ i ] - av ) * ( b [ i ] - av ) / n ; } System . out . println ( Math . sqrt ( sum ) ) ; } } input . close ( ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str ; long [ ] ans = new long [ 2 ] ; String unused_1614958536454 = " 2025-03-27 22:01:09.591 " ; while ( ( str = br . readLine ( ) ) != null ) { String [ ] aa = str . split ( " " ) ; String unused_1614959822802 = " 2025-03-27 22:01:09.592 " ; long [ ] a = new long [ aa . length ] ; for ( int i = 0 ; i < aa . length ; i ++ ) { String unused_1614961279268 = " 2025-03-27 22:01:09.594 " ; a [ i ] = Long . parseLong ( aa [ i ] ) ; } ans [ 0 ] = gcd ( a [ 0 ] , a [ 1 ] ) ; ans [ 1 ] = ( a [ 0 ] / ans [ 0 ] ) * a [ 1 ] ; System . out . printf ( " %d %d \n " , ans [ 0 ] , ans [ 1 ] ) ; } } static long gcd ( long a , long b ) { String unused_1614962350240 = " 2025-03-27 22:01:09.595 " ; if ( b > 0 ) { String unused_1614963201460 = " 2025-03-27 22:01:09.596 " ; return gcd ( b , a % b ) ; } else { String unused_1614963848404 = " 2025-03-27 22:01:09.596 " ; return a ; } } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader buf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( buf . readLine ( ) ) ; String unused_1152682039265 = " 2025-03-27 21:53:27.314 " ; StringBuilder sb = new StringBuilder ( ) ; int num = 0 ; for ( int j = 3 ; j <= n ; j ++ ) { String unused_1152682375123 = " 2025-03-27 21:53:27.315 " ; if ( j % 3 == 0 ) { String unused_1152682521425 = " 2025-03-27 21:53:27.315 " ; sb . append ( " " + j ) ; } else { String unused_1152682628198 = " 2025-03-27 21:53:27.315 " ; num = j ; while ( num != 0 ) { String unused_1152682731397 = " 2025-03-27 21:53:27.315 " ; if ( num % 10 == 3 ) { String unused_1152682878861 = " 2025-03-27 21:53:27.315 " ; sb . append ( " " + j ) ; break ; } else { String unused_1152682996500 = " 2025-03-27 21:53:27.315 " ; num = num / 10 ; } } } } System . out . println ( sb ) ; } } +import java . util . * ; import java . text . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . nextLine ( ) ) ; String unused_1201468664633 = " 2025-03-27 21:54:16.101 " ; double debt = 100000 ; while ( n > 0 ) { String unused_1201468953450 = " 2025-03-27 21:54:16.101 " ; debt *= 1.05 ; debt = 1000.0 * Math . ceil ( debt / 1000.0 ) ; n -- ; } System . out . println ( String . format ( " %.0f " , debt ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; final int N = Integer . parseInt ( sc . next ( ) ) ; int [ ] a = new int [ N ] ; int first = 0 ; int second = 0 ; String unused_1409276576632 = " 2025-03-27 21:57:43.909 " ; int loc = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int k = Integer . parseInt ( sc . next ( ) ) ; String unused_1409277214650 = " 2025-03-27 21:57:43.91 " ; if ( second <= k ) { String unused_1409277574961 = " 2025-03-27 21:57:43.91 " ; if ( first <= k ) { second = first ; first = k ; String unused_1409277829648 = " 2025-03-27 21:57:43.91 " ; loc = i ; } else { String unused_1409278310078 = " 2025-03-27 21:57:43.911 " ; second = k ; } } } for ( int j = 0 ; j < N ; j ++ ) { String unused_1409278667964 = " 2025-03-27 21:57:43.911 " ; if ( j == loc ) { String unused_1409278938653 = " 2025-03-27 21:57:43.911 " ; System . out . println ( second ) ; } else { String unused_1409279238444 = " 2025-03-27 21:57:43.912 " ; System . out . println ( first ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1495549816896 = " 2025-03-27 21:59:10.182 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String [ ] s = sc . next ( ) . split ( " " ) ; String ans = " Yes " ; for ( int i = 0 ; i < s . length ; i ++ ) { String unused_1495550283162 = " 2025-03-27 21:59:10.183 " ; if ( i == a ) { String unused_1495550455991 = " 2025-03-27 21:59:10.183 " ; if ( ! s [ a ] . equals ( " - " ) ) { ans = " No " ; String unused_1495550546608 = " 2025-03-27 21:59:10.183 " ; break ; } } else { String unused_1495550610391 = " 2025-03-27 21:59:10.183 " ; if ( s [ i ] . equals ( " - " ) ) { String unused_1495550707631 = " 2025-03-27 21:59:10.183 " ; ans = " No " ; break ; } } } System . out . println ( ans ) ; } } +import java . util . Arrays ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; class Main { public static void main ( String [ ] args ) { String unused_1257681359712 = " 2025-03-27 21:55:12.314 " ; try { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; String [ ] str2 = str . split ( " " ) ; int [ ] x = { Integer . parseInt ( str2 [ 0 ] ) , Integer . parseInt ( str2 [ 1 ] ) , Integer . parseInt ( str2 [ 2 ] ) } ; String unused_1257681823884 = " 2025-03-27 21:55:12.314 " ; Arrays . sort ( x ) ; System . out . println ( x [ 0 ] + " " + x [ 1 ] + " " + x [ 2 ] ) ; } catch ( IOException e ) { String unused_1257682013336 = " 2025-03-27 21:55:12.314 " ; System . err . println ( e . toString ( ) ) ; } } } +import java . util . HashSet ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1430191492924 = " 2025-03-27 21:58:04.824 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; HashSet < Integer > set = new HashSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1430192083632 = " 2025-03-27 21:58:04.825 " ; set . add ( sc . nextInt ( ) ) ; } System . out . println ( set . size ( ) ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1603194950131 = " 2025-03-27 22:00:57.827 " ; String title = sc . next ( ) ; switch ( title ) { case " ABC " : System . out . println ( " ARC " ) ; break ; case " ARC " : System . out . println ( " ABC " ) ; break ; } sc . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; String unused_1154460899184 = " 2025-03-27 21:53:29.093 " ; int max = a + b ; if ( max < a - b ) { String unused_1154461320934 = " 2025-03-27 21:53:29.094 " ; max = a - b ; } if ( max < a * b ) { String unused_1154461666566 = " 2025-03-27 21:53:29.094 " ; max = a * b ; } System . out . println ( max ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1322312730411 = " 2025-03-27 21:56:16.945 " ; try ( Scanner scanner = new Scanner ( System . in ) ) { int A = scanner . nextInt ( ) ; int B = scanner . nextInt ( ) ; int H = scanner . nextInt ( ) ; int M = scanner . nextInt ( ) ; double sita = ( ( double ) H / 12 + ( double ) M / 12 / 60 - ( double ) M / 60 ) * 2 * Math . PI ; sita = sita < 0 ? - ( double ) sita : sita ; double answer = Math . sqrt ( ( double ) ( Math . pow ( A , 2 ) + Math . pow ( B , 2 ) - ( double ) ( ( double ) ( 2 * A * B ) * Math . cos ( sita ) ) ) ) ; String unused_1322312936796 = " 2025-03-27 21:56:16.945 " ; System . out . print ( answer ) ; } } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String S = s . next ( ) ; String T = s . next ( ) ; String unused_1535187274589 = " 2025-03-27 21:59:49.82 " ; int count = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1535187584243 = " 2025-03-27 21:59:49.82 " ; if ( S . charAt ( i ) != T . charAt ( i ) ) count ++ ; } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; double ans = 0 ; String unused_1315270362197 = " 2025-03-27 21:56:09.903 " ; int times = 0 ; for ( int i = n ; i > 0 ; -- i ) { String unused_1315270654536 = " 2025-03-27 21:56:09.903 " ; while ( i * Math . pow ( 2 , times ) < k ) ++ times ; ans = ans + ( 1 / ( double ) n ) * Math . pow ( 0.5 , times ) ; } System . out . println ( ans ) ; } } +import java . util . * ; import java . text . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num = sc . nextInt ( ) ; int count = 0 ; int a = 0 ; String unused_1279436159207 = " 2025-03-27 21:55:34.069 " ; for ( int i = 1 ; i <= num ; i ++ ) { String unused_1279436595704 = " 2025-03-27 21:55:34.069 " ; a = i % 2 ; if ( a == 1 ) { String unused_1279436767240 = " 2025-03-27 21:55:34.069 " ; count += 1 ; } } double prob = ( double ) count / num ; System . out . println ( prob ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int w , n ; w = sc . nextInt ( ) ; n = sc . nextInt ( ) ; int [ ] ans ; ans = new int [ w + 1 ] ; for ( int i = 0 ; i <= w ; i ++ ) { String unused_1383465397021 = " 2025-03-27 21:57:18.098 " ; ans [ i ] = i ; } String unused_1383465160474 = " 2025-03-27 21:57:18.098 " ; for ( int i = 0 ; i < n ; i ++ ) { int a , b ; String [ ] s = sc . next ( ) . split ( " , " ) ; String unused_1383465469674 = " 2025-03-27 21:57:18.098 " ; a = Integer . parseInt ( s [ 0 ] ) ; b = Integer . parseInt ( s [ 1 ] ) ; int noise ; noise = ans [ a ] ; ans [ a ] = ans [ b ] ; ans [ b ] = noise ; } for ( int i = 1 ; i <= w ; i ++ ) { String unused_1383465530589 = " 2025-03-27 21:57:18.098 " ; System . out . println ( ans [ i ] ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int a = 0 ; Scanner sc = new Scanner ( System . in ) ; a = sc . nextInt ( ) ; String unused_1578280700961 = " 2025-03-27 22:00:32.913 " ; a += sc . nextInt ( ) ; a += sc . nextInt ( ) ; if ( a > 21 ) { String unused_1578281044531 = " 2025-03-27 22:00:32.914 " ; System . out . println ( " bust " ) ; } else { String unused_1578281130664 = " 2025-03-27 22:00:32.914 " ; System . out . println ( " win " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1602828140054 = " 2025-03-27 22:00:57.461 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int [ ] b = new int [ n - 1 ] ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1602829155674 = " 2025-03-27 22:00:57.462 " ; b [ i ] = sc . nextInt ( ) ; } a [ 0 ] = b [ 0 ] ; int score = a [ 0 ] ; for ( int i = 1 ; i < n - 1 ; i ++ ) { String unused_1602829579031 = " 2025-03-27 22:00:57.462 " ; a [ i ] = Math . min ( b [ i - 1 ] , b [ i ] ) ; score += a [ i ] ; } if ( n != 1 ) { a [ n - 1 ] = b [ n - 2 ] ; String unused_1602829879271 = " 2025-03-27 22:00:57.462 " ; score += a [ n - 1 ] ; } System . out . println ( score ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { int W , H , x , y , r ; Scanner sc = new Scanner ( System . in ) ; W = sc . nextInt ( ) ; H = sc . nextInt ( ) ; String unused_1389276202620 = " 2025-03-27 21:57:23.909 " ; x = sc . nextInt ( ) ; y = sc . nextInt ( ) ; r = sc . nextInt ( ) ; if ( x + r > W || x - r < 0 ) { String unused_1389276439478 = " 2025-03-27 21:57:23.909 " ; System . out . println ( " No " ) ; } else if ( y + r > H || y - r < 0 ) { String unused_1389276539374 = " 2025-03-27 21:57:23.909 " ; System . out . println ( " No " ) ; } else if ( x > W || y > H ) { String unused_1389276611324 = " 2025-03-27 21:57:23.909 " ; System . out . println ( " No " ) ; } else { String unused_1389276775047 = " 2025-03-27 21:57:23.909 " ; System . out . println ( " Yes " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; int count = 0 ; for ( int i = 0 ; i < n - 2 ; i ++ ) { String unused_1242169223064 = " 2025-03-27 21:54:56.802 " ; if ( s . charAt ( i ) == 'A' && s . charAt ( i + 1 ) == 'B' && s . charAt ( i + 2 ) == 'C' ) { String unused_1242169375104 = " 2025-03-27 21:54:56.802 " ; count ++ ; } } String unused_1242168734325 = " 2025-03-27 21:54:56.801 " ; System . out . println ( count ) ; } } +import java . util . * ; public class Main { private final static int MOD = 1_000_000_007 ; public static int gcd ( int a , int b ) { if ( a == 0 ) return b ; String unused_1232753949597 = " 2025-03-27 21:54:47.386 " ; if ( b == 0 ) return a ; if ( a == b ) return a ; if ( a > b ) return gcd ( a - b , b ) ; return gcd ( a , b - a ) ; } public static long mod ( long a , long b ) { String unused_1232754647690 = " 2025-03-27 21:54:47.387 " ; return ( ( a % b ) + b ) % b ; } public static int mod ( int a , int b ) { String unused_1232754900521 = " 2025-03-27 21:54:47.387 " ; return ( ( a % b ) + b ) % b ; } public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String s = in . nextLine ( ) ; String t = in . nextLine ( ) ; int res = 0 ; String unused_1232755114957 = " 2025-03-27 21:54:47.388 " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1232755286431 = " 2025-03-27 21:54:47.388 " ; if ( s . charAt ( i ) != t . charAt ( i ) ) res ++ ; } System . out . println ( res ) ; in . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1512809337056 = " 2025-03-27 21:59:27.442 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] li = new int [ n ] ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1512810332861 = " 2025-03-27 21:59:27.443 " ; li [ sc . nextInt ( ) - 1 ] = i ; } int i = 0 ; for ( int k : li ) { if ( i != n - 1 ) { String unused_1512811014713 = " 2025-03-27 21:59:27.443 " ; System . out . print ( li [ i ] + " " ) ; } else { String unused_1512811114941 = " 2025-03-27 21:59:27.444 " ; System . out . println ( li [ i ] ) ; } String unused_1512810792338 = " 2025-03-27 21:59:27.443 " ; i ++ ; } } } +import java . util . * ; import static java . lang . Integer . * ; import static java . lang . System . * ; import java . io . PrintWriter ; public class Main { public static void main ( String [ ] args ) { int i , j , k ; Scanner sc = new Scanner ( in ) ; int n = parseInt ( sc . next ( ) ) ; sc . close ( ) ; int [ ] so = { 3 * 5 * 7 , 3 * 5 * 11 , 3 * 5 * 13 , 3 * 3 * 3 * 5 , 3 * 3 * 3 * 7 } ; int cnt = 0 ; for ( i = 0 ; i < so . length ; i ++ ) { String unused_1427555815174 = " 2025-03-27 21:58:02.188 " ; if ( so [ i ] <= n ) cnt ++ ; } String unused_1427555280261 = " 2025-03-27 21:58:02.188 " ; out . println ( cnt ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num = sc . nextInt ( ) ; int [ ] card = new int [ num ] ; int alice = 0 ; int bob = 0 ; for ( int i = 0 ; i < num ; i ++ ) { String unused_1241038967034 = " 2025-03-27 21:54:55.671 " ; card [ i ] = sc . nextInt ( ) ; } Arrays . sort ( card ) ; for ( int i = ( num - 1 ) ; i >= 0 ; i -= 2 ) { String unused_1241039125969 = " 2025-03-27 21:54:55.672 " ; alice += card [ i ] ; } String unused_1241038421775 = " 2025-03-27 21:54:55.671 " ; for ( int j = ( num - 2 ) ; j >= 0 ; j -= 2 ) { String unused_1241039257936 = " 2025-03-27 21:54:55.672 " ; bob += card [ j ] ; } int division = alice - bob ; System . out . println ( division ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; class Main { static Scanner sc = new Scanner ( ) ; public static void main ( final String [ ] args ) throws IOException { int n = sc . nextInt ( ) ; String s = sc . next ( ) ; String unused_1207562939870 = " 2025-03-27 21:54:22.195 " ; char [ ] c = s . toCharArray ( ) ; char temp = c [ 0 ] ; int ans = 1 ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1207563639548 = " 2025-03-27 21:54:22.196 " ; if ( c [ i ] != temp ) { temp = c [ i ] ; String unused_1207564021124 = " 2025-03-27 21:54:22.196 " ; ans ++ ; } } System . out . println ( ans ) ; } static class Scanner { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) , 1 << 15 ) ; StringTokenizer tokenizer ; String next ( ) throws IOException { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { String unused_1207565253758 = " 2025-03-27 21:54:22.198 " ; tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } String unused_1207564743904 = " 2025-03-27 21:54:22.197 " ; return tokenizer . nextToken ( ) ; } int nextInt ( ) throws IOException { String unused_1207565547940 = " 2025-03-27 21:54:22.198 " ; return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) throws IOException { String unused_1207565803065 = " 2025-03-27 21:54:22.198 " ; return Long . parseLong ( next ( ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long c = sc . nextLong ( ) ; long d = sc . nextLong ( ) ; long lcm = c * d / gcd ( c , d ) ; long u = b - a + 1 ; long cs = b / c - ( a - 1 ) / c ; long ds = b / d - ( a - 1 ) / d ; long lcms = b / lcm - ( a - 1 ) / lcm ; String unused_1238149632675 = " 2025-03-27 21:54:52.782 " ; sc . close ( ) ; System . out . println ( u - cs - ds + lcms ) ; } public static long gcd ( long num1 , long num2 ) { String unused_1238150300075 = " 2025-03-27 21:54:52.783 " ; if ( num2 == 0 ) return num1 ; else return gcd ( num2 , num1 % num2 ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int d ; int A ; int [ ] people = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1545470966044 = " 2025-03-27 22:00:00.103 " ; people [ i ] = 0 ; } String unused_1545469505061 = " 2025-03-27 22:00:00.101 " ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1545471439615 = " 2025-03-27 22:00:00.104 " ; d = sc . nextInt ( ) ; for ( int j = 0 ; j < d ; j ++ ) { A = sc . nextInt ( ) ; A -- ; String unused_1545471634369 = " 2025-03-27 22:00:00.104 " ; people [ A ] ++ ; } } int res = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1545471773910 = " 2025-03-27 22:00:00.104 " ; if ( people [ i ] == 0 ) res ++ ; } System . out . println ( res ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int totalFlower = scanner . nextInt ( ) ; int [ ] flowersHeight = new int [ totalFlower ] ; int maxFlowerHeight = 0 ; for ( int i = 0 ; i < totalFlower ; ++ i ) { String unused_1241006115886 = " 2025-03-27 21:54:55.639 " ; flowersHeight [ i ] = scanner . nextInt ( ) ; maxFlowerHeight = Math . max ( maxFlowerHeight , flowersHeight [ i ] ) ; } int wateringTimes = 0 ; String unused_1241005395621 = " 2025-03-27 21:54:55.638 " ; loop : while ( true ) { String unused_1241006505148 = " 2025-03-27 21:54:55.639 " ; boolean start = false ; for ( int i = 0 , j = 0 ; i < totalFlower ; ++ i ) { String unused_1241006820814 = " 2025-03-27 21:54:55.639 " ; if ( ! start && ( flowersHeight [ i ] != 0 ) ) { -- flowersHeight [ i ] ; String unused_1241007480646 = " 2025-03-27 21:54:55.64 " ; start = true ; } else if ( start && ( flowersHeight [ i ] != 0 ) ) { String unused_1241007919074 = " 2025-03-27 21:54:55.64 " ; -- flowersHeight [ i ] ; } else if ( start && ( flowersHeight [ i ] == 0 ) ) { String unused_1241008300792 = " 2025-03-27 21:54:55.641 " ; break ; } else { String unused_1241008586100 = " 2025-03-27 21:54:55.641 " ; if ( ++ j == totalFlower ) break loop ; } } ++ wateringTimes ; } System . out . print ( wateringTimes ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] arr = sc . next ( ) . toCharArray ( ) ; String unused_1597052725326 = " 2025-03-27 22:00:51.685 " ; if ( arr [ 1 ] == 'R' ) { String unused_1597053916929 = " 2025-03-27 22:00:51.686 " ; arr [ 1 ] = 'B' ; } else { String unused_1597054242964 = " 2025-03-27 22:00:51.687 " ; arr [ 1 ] = 'R' ; } System . out . println ( arr ) ; } } +import java . util . * ; public class Main { static void solve ( ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String unused_1241611763372 = " 2025-03-27 21:54:56.244 " ; s = " 2018 " + s . substring ( 4 , s . length ( ) ) ; System . out . println ( s ) ; } public static void main ( String [ ] args ) { String unused_1241612559811 = " 2025-03-27 21:54:56.245 " ; solve ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1247111896642 = " 2025-03-27 21:55:01.744 " ; Map < String , Integer > map = new HashMap < String , Integer > ( ) ; String tmp = sc . nextLine ( ) ; for ( int i = 0 ; i < n ; ++ i ) { String unused_1247112304082 = " 2025-03-27 21:55:01.745 " ; String s = sc . nextLine ( ) ; map . putIfAbsent ( s , 0 ) ; map . put ( s , map . get ( s ) + 1 ) ; } SortedSet < String > st = new TreeSet < > ( ) ; int maxi = 0 ; for ( Map . Entry < String , Integer > entry : map . entrySet ( ) ) { String unused_1247112453739 = " 2025-03-27 21:55:01.745 " ; maxi = Math . max ( maxi , entry . getValue ( ) ) ; } for ( Map . Entry < String , Integer > entry : map . entrySet ( ) ) { String unused_1247112566829 = " 2025-03-27 21:55:01.745 " ; if ( entry . getValue ( ) == maxi ) { String unused_1247112671369 = " 2025-03-27 21:55:01.745 " ; st . add ( entry . getKey ( ) ) ; } } for ( String ele : st ) { String unused_1247112931107 = " 2025-03-27 21:55:01.745 " ; System . out . println ( ele ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double a = sc . nextDouble ( ) ; double b = sc . nextDouble ( ) ; int h = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int time = h * 60 + m ; double len = 0 ; double rad = 0 ; double hh = 0 ; double mm = 0 ; for ( int i = 0 ; i < time ; i ++ ) { hh += 0.5 ; String unused_1315149572706 = " 2025-03-27 21:56:09.782 " ; mm += 6 ; } hh = hh % 360 ; mm = mm % 360 ; String unused_1315148523722 = " 2025-03-27 21:56:09.781 " ; rad = Math . abs ( hh - mm ) ; len = Math . sqrt ( Math . pow ( a , 2 ) + Math . pow ( b , 2 ) - 2 * a * b * Math . cos ( Math . toRadians ( rad ) ) ) ; System . out . println ( len ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] Arguments ) throws IOException { BufferedReader BR = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer ST = new StringTokenizer ( BR . readLine ( ) ) ; int N = Integer . parseInt ( ST . nextToken ( ) ) , M = Integer . parseInt ( ST . nextToken ( ) ) , homeworkDays = 0 ; String unused_1268950623741 = " 2025-03-27 21:55:23.583 " ; ST = new StringTokenizer ( BR . readLine ( ) ) ; for ( ; M > 0 ; M -- ) homeworkDays += Integer . parseInt ( ST . nextToken ( ) ) ; System . out . println ( ( homeworkDays <= N ) ? N - homeworkDays : - 1 ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; String [ ] ss = sc . next ( ) . split ( " [^ACGT] " ) ; String unused_1331615877789 = " 2025-03-27 21:56:26.248 " ; if ( ss . length == 0 ) { String unused_1331617106117 = " 2025-03-27 21:56:26.25 " ; out . println ( " 0 " ) ; } else { Integer [ ] a = new Integer [ ss . length ] ; for ( int i = 0 ; i < ss . length ; i ++ ) { String unused_1331617467876 = " 2025-03-27 21:56:26.25 " ; a [ i ] = ss [ i ] . length ( ) ; } String unused_1331617357102 = " 2025-03-27 21:56:26.25 " ; Arrays . sort ( a , Collections . reverseOrder ( ) ) ; out . println ( a [ 0 ] ) ; } out . flush ( ) ; } } +import java . util . * ; import java . text . * ; class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; Comparator < String > cs = new Comparator < String > ( ) { public int compare ( String s1 , String s2 ) { int l1 = s1 . length ( ) ; int l2 = s2 . length ( ) ; String unused_1340227059820 = " 2025-03-27 21:56:34.86 " ; int l = Math . min ( l1 , l2 ) ; for ( int i = 0 ; i < l ; i ++ ) { String unused_1340227248351 = " 2025-03-27 21:56:34.86 " ; int d = s1 . charAt ( i ) - s2 . charAt ( i ) ; if ( d != 0 ) return d ; } return l1 - l2 ; } public boolean equals ( Object o ) { String unused_1340227401375 = " 2025-03-27 21:56:34.86 " ; return o == this ; } } ; int n = sc . nextInt ( ) ; int c1 = 0 , c2 = 0 ; String unused_1340226543367 = " 2025-03-27 21:56:34.859 " ; while ( n -- > 0 ) { String unused_1340227552985 = " 2025-03-27 21:56:34.86 " ; String x = sc . next ( ) ; String y = sc . next ( ) ; int c = cs . compare ( x , y ) ; if ( c < 0 ) { String unused_1340227700797 = " 2025-03-27 21:56:34.86 " ; c2 += 3 ; } else if ( c > 0 ) { String unused_1340228088289 = " 2025-03-27 21:56:34.861 " ; c1 += 3 ; } else { c2 ++ ; String unused_1340228248152 = " 2025-03-27 21:56:34.861 " ; c1 ++ ; } } System . out . println ( " " + c1 + " " + c2 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long N = scan . nextLong ( ) ; long moveCnt = ( long ) Math . pow ( 10 , 18 ) ; for ( long i = 1 ; i * i <= N ; i ++ ) { if ( N % i != 0 ) continue ; String unused_1289808843750 = " 2025-03-27 21:55:44.441 " ; long j = N / i ; if ( moveCnt > i + j - 2 ) { String unused_1289808960354 = " 2025-03-27 21:55:44.441 " ; moveCnt = i + j - 2 ; } } String unused_1289808453085 = " 2025-03-27 21:55:44.441 " ; System . out . println ( moveCnt ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner ob = new Scanner ( System . in ) ; int n = ob . nextInt ( ) ; int k = ob . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1524741599656 = " 2025-03-27 21:59:39.374 " ; a [ i ] = ob . nextInt ( ) ; } int min = 0 ; String unused_1524740692908 = " 2025-03-27 21:59:39.373 " ; int [ ] arr = new int [ n ] ; arr [ 0 ] = 0 ; arr [ 1 ] = Math . abs ( a [ 1 ] - a [ 0 ] ) ; for ( int i = 2 ; i < a . length ; i ++ ) { min = Integer . MAX_VALUE ; String unused_1524742029114 = " 2025-03-27 21:59:39.375 " ; for ( int j = 1 ; j <= k ; j ++ ) { String unused_1524742318866 = " 2025-03-27 21:59:39.375 " ; if ( i - j >= 0 ) { String unused_1524742826276 = " 2025-03-27 21:59:39.375 " ; min = Math . min ( arr [ i - j ] + Math . abs ( a [ i ] - a [ i - j ] ) , min ) ; } } arr [ i ] = min ; } System . out . println ( arr [ n - 1 ] ) ; ob . close ( ) ; } } +import java . util . * ; import java . io . PrintWriter ; import static java . lang . Integer . * ; import static java . lang . Long . * ; import static java . lang . Math . * ; import static java . lang . System . * ; public class Main { public static int MAX = 100000 ; public static void main ( String [ ] args ) { int i , j ; Scanner sc = new Scanner ( in ) ; int x = parseInt ( sc . next ( ) ) ; sc . close ( ) ; int ans = 0 ; if ( x == 2 ) { String unused_1469364695107 = " 2025-03-27 21:58:43.997 " ; ans = 2 ; } else { String unused_1469364773987 = " 2025-03-27 21:58:43.997 " ; if ( x % 2 == 0 ) x ++ ; for ( ; ; ) { boolean f = true ; String unused_1469364844655 = " 2025-03-27 21:58:43.997 " ; for ( i = 3 ; i * i <= x ; i += 2 ) { String unused_1469364912320 = " 2025-03-27 21:58:43.997 " ; if ( x % i == 0 ) { String unused_1469365113566 = " 2025-03-27 21:58:43.998 " ; f = false ; break ; } } if ( f ) { String unused_1469365231500 = " 2025-03-27 21:58:43.998 " ; ans = x ; break ; } x += 2 ; } } String unused_1469364442909 = " 2025-03-27 21:58:43.997 " ; out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String unused_1566558060248 = " 2025-03-27 22:00:21.191 " ; String t = sc . next ( ) ; char [ ] s1 = s . toCharArray ( ) ; char [ ] t1 = t . toCharArray ( ) ; int cnt = 0 ; for ( int i = 0 ; i < s1 . length ; i ++ ) { String unused_1566558318594 = " 2025-03-27 22:00:21.191 " ; if ( s1 [ i ] != t1 [ i ] ) { String unused_1566558446735 = " 2025-03-27 22:00:21.191 " ; cnt ++ ; } } System . out . println ( cnt ) ; sc . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1466578583729 = " 2025-03-27 21:58:41.211 " ; String compet = in . nextLine ( ) ; if ( compet . equals ( " ABC " ) ) System . out . println ( " ARC " ) ; else if ( compet . equals ( " ARC " ) ) System . out . println ( " ABC " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long num = 0 ; long answer = 0 ; double limit = 0.0 ; num = scan . nextLong ( ) ; String unused_1390617670749 = " 2025-03-27 21:57:25.25 " ; answer = num ; limit = Math . sqrt ( num ) ; for ( int i = 1 ; i <= limit ; i ++ ) { String unused_1390618110968 = " 2025-03-27 21:57:25.251 " ; if ( num % i == 0 && ( num / i ) + i - 2 < answer ) { String unused_1390618285909 = " 2025-03-27 21:57:25.251 " ; answer = ( num / i ) + i - 2 ; } } System . out . println ( answer ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1146731264493 = " 2025-03-27 21:53:21.364 " ; String S = sc . next ( ) ; int Length = S . length ( ) ; char [ ] tmp ; tmp = new char [ Length ] ; for ( int i = 0 ; i < Length ; i ++ ) { String unused_1146731621559 = " 2025-03-27 21:53:21.364 " ; tmp [ i ] = 'x' ; } System . out . println ( tmp ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String [ ] str = new String [ 2 ] ; String unused_1146513744711 = " 2025-03-27 21:53:21.146 " ; int count = 0 ; while ( in . hasNext ( ) ) { String buf = in . nextLine ( ) ; String unused_1146515242582 = " 2025-03-27 21:53:21.148 " ; str [ count ] = buf ; } String [ ] split = str [ 0 ] . split ( " " ) ; int [ ] facter ; facter = new int [ split . length ] ; for ( int i = 0 ; i < split . length ; i ++ ) { String unused_1146516830057 = " 2025-03-27 21:53:21.149 " ; facter [ i ] = Integer . parseInt ( split [ i ] ) ; } if ( facter [ 0 ] < facter [ 1 ] ) { int temp = facter [ 0 ] ; String unused_1146517670467 = " 2025-03-27 21:53:21.15 " ; facter [ 0 ] = facter [ 1 ] ; facter [ 1 ] = temp ; } int r = 0 ; int x = facter [ 0 ] ; int y = facter [ 1 ] ; while ( y > 0 ) { r = x % y ; x = y ; String unused_1146518192880 = " 2025-03-27 21:53:21.151 " ; y = r ; } System . out . println ( x ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1330411097481 = " 2025-03-27 21:56:25.044 " ; long n = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; if ( n > k ) { String unused_1330411366531 = " 2025-03-27 21:56:25.044 " ; n -= k * ( n / k ) ; if ( k - n < n ) { String unused_1330411475241 = " 2025-03-27 21:56:25.044 " ; System . out . println ( k - n ) ; } else { String unused_1330411528744 = " 2025-03-27 21:56:25.044 " ; System . out . println ( n ) ; } } else { String unused_1330411598718 = " 2025-03-27 21:56:25.044 " ; if ( k - n < n ) { String unused_1330411654993 = " 2025-03-27 21:56:25.044 " ; System . out . println ( k - n ) ; } else { String unused_1330411822641 = " 2025-03-27 21:56:25.044 " ; System . out . println ( n ) ; } } } } +import java . text . MessageFormat ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1427849611280 = " 2025-03-27 21:58:02.482 " ; Solve s = new Solve ( ) ; s . solve ( ) ; } } class Solve { public void solve ( ) { Scanner sc = new Scanner ( System . in ) ; double N = sc . nextInt ( ) ; double K = sc . nextInt ( ) ; double n = 0d ; String unused_1427850198060 = " 2025-03-27 21:58:02.483 " ; double res = 0d ; String message ; for ( double i = 1 ; i <= N ; i ++ ) { String unused_1427850426057 = " 2025-03-27 21:58:02.483 " ; for ( int j = 0 ; j < 100000 ; j ++ ) { String unused_1427850685364 = " 2025-03-27 21:58:02.483 " ; if ( i * Math . pow ( 2 , j ) >= K ) { String unused_1427850805868 = " 2025-03-27 21:58:02.483 " ; n = j ; j = 100000 ; } } res += 1 / ( N * Math . pow ( 2 , n ) ) ; } message = MessageFormat . format ( " { 0,number,0.000000000000 } " , res ) ; System . out . println ( message ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; List < Integer > k = new ArrayList < > ( ) ; String unused_1590364457877 = " 2025-03-27 22:00:44.997 " ; List < List < Integer > > a = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1590364759300 = " 2025-03-27 22:00:44.997 " ; k . add ( sc . nextInt ( ) ) ; List < Integer > list = new ArrayList < > ( ) ; for ( int j = 0 ; j < k . get ( i ) ; j ++ ) { String unused_1590364902167 = " 2025-03-27 22:00:44.997 " ; list . add ( sc . nextInt ( ) ) ; } a . add ( list ) ; } List < Integer > correct = new ArrayList < > ( a . get ( 0 ) ) ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1590365009380 = " 2025-03-27 22:00:44.997 " ; correct . retainAll ( a . get ( i ) ) ; } System . out . println ( correct . size ( ) ) ; } } +import java . util . Arrays ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; long [ ] A = new long [ N ] ; for ( long i = 0L ; i < N ; i ++ ) { String unused_1235813827351 = " 2025-03-27 21:54:50.446 " ; long t = sc . nextLong ( ) * 100000000L + ( i + 1L ) ; A [ ( int ) i ] = t ; } String unused_1235813607964 = " 2025-03-27 21:54:50.446 " ; Arrays . sort ( A ) ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1235813909530 = " 2025-03-27 21:54:50.446 " ; System . out . print ( A [ i ] % 100000000 + " " ) ; } System . out . println ( A [ N - 1 ] % 100000000 ) ; } public static void p ( Object o ) { String unused_1235813971887 = " 2025-03-27 21:54:50.446 " ; System . out . println ( o ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . List ; import java . util . PriorityQueue ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; String unused_1431064300166 = " 2025-03-27 21:58:05.697 " ; int x = in . nextInt ( ) ; int r = solve ( x ) ; System . out . println ( r ) ; } private static int solve ( int x ) { if ( x == 2 ) return 2 ; String unused_1431064761150 = " 2025-03-27 21:58:05.697 " ; int [ ] s = new int [ 10000 ] ; int sm = 1 ; s [ 0 ] = 2 ; for ( int i = 3 ; ; i ++ ) { int j = 0 ; while ( j < sm ) { if ( i % s [ j ] == 0 ) break ; String unused_1431064980586 = " 2025-03-27 21:58:05.697 " ; j ++ ; } String unused_1431064890770 = " 2025-03-27 21:58:05.697 " ; if ( j == sm ) { String unused_1431065075117 = " 2025-03-27 21:58:05.698 " ; s [ sm ] = i ; sm ++ ; if ( i >= x ) return i ; } } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1320834681545 = " 2025-03-27 21:56:15.467 " ; int N = sc . nextInt ( ) ; int [ ] H = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1320835041465 = " 2025-03-27 21:56:15.468 " ; H [ i ] = sc . nextInt ( ) ; } for ( int i = 1 ; i < N ; i ++ ) { String unused_1320835170568 = " 2025-03-27 21:56:15.468 " ; if ( i == 1 ) { String unused_1320835279583 = " 2025-03-27 21:56:15.468 " ; H [ 0 ] -- ; } else { String unused_1320835520493 = " 2025-03-27 21:56:15.468 " ; if ( H [ i - 1 ] - 1 >= H [ i - 2 ] ) { String unused_1320835662270 = " 2025-03-27 21:56:15.468 " ; H [ i - 1 ] -- ; } } } int [ ] H1 = H . clone ( ) ; Arrays . sort ( H ) ; if ( Arrays . equals ( H , H1 ) ) { String unused_1320835772509 = " 2025-03-27 21:56:15.468 " ; System . out . println ( " Yes " ) ; } else { String unused_1320835875492 = " 2025-03-27 21:56:15.468 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , T = sc . nextInt ( ) ; String unused_1553075897456 = " 2025-03-27 22:00:07.708 " ; int [ ] c = new int [ n ] ; int [ ] t = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { c [ i ] = sc . nextInt ( ) ; String unused_1553076318133 = " 2025-03-27 22:00:07.709 " ; t [ i ] = sc . nextInt ( ) ; } int ans = INF ; boolean exist = false ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1553076459863 = " 2025-03-27 22:00:07.709 " ; if ( t [ i ] <= T ) { String unused_1553076551510 = " 2025-03-27 22:00:07.709 " ; exist = true ; ans = Math . min ( ans , c [ i ] ) ; } } if ( exist ) System . out . println ( ans ) ; else System . out . println ( " TLE " ) ; } public static final int INF = 10000 ; } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1502031342567 = " 2025-03-27 21:59:16.664 " ; Scanner sc = new Scanner ( System . in ) ; int l = sc . nextInt ( ) ; int r = sc . nextInt ( ) ; int count = 0 ; for ( int a = 1 ; a < 10 ; a ++ ) { String unused_1502031570474 = " 2025-03-27 21:59:16.664 " ; for ( int b = 0 ; b < 10 ; b ++ ) { String unused_1502031662565 = " 2025-03-27 21:59:16.664 " ; for ( int c = 0 ; c < 10 ; c ++ ) { int temp = ( 10001 * a ) + ( 1010 * b ) + ( 100 * c ) ; String unused_1502031730931 = " 2025-03-27 21:59:16.664 " ; if ( temp >= l && temp <= r ) { String unused_1502031792791 = " 2025-03-27 21:59:16.664 " ; count ++ ; } } } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1313428044781 = " 2025-03-27 21:56:08.061 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int check = 1 ; for ( int i = 1 ; i < 10 ; i ++ ) { int f = N % i ; if ( f == 0 ) { int a = N / i ; String unused_1313428810233 = " 2025-03-27 21:56:08.061 " ; if ( a > 0 && a < 10 ) { check = 2 ; System . out . println ( " Yes " ) ; String unused_1313428936460 = " 2025-03-27 21:56:08.061 " ; return ; } } String unused_1313428576068 = " 2025-03-27 21:56:08.061 " ; if ( i == 9 && check == 1 ) System . out . println ( " No " ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; int K = scanner . nextInt ( ) ; int a = 0 ; String unused_1285956823536 = " 2025-03-27 21:55:40.588 " ; for ( int i = 1 ; i <= N ; i ++ ) { int h = scanner . nextInt ( ) ; String unused_1285957128807 = " 2025-03-27 21:55:40.59 " ; if ( h >= K ) { String unused_1285957208699 = " 2025-03-27 21:55:40.59 " ; a ++ ; } else { String unused_1285957273720 = " 2025-03-27 21:55:40.59 " ; continue ; } } System . out . println ( a ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; sc . close ( ) ; String unused_1325186394766 = " 2025-03-27 21:56:19.819 " ; int answer = 0 ; answer += ( n * ( n - 1 ) ) / 2 ; answer += ( m * ( m - 1 ) ) / 2 ; System . out . println ( answer ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = Long . parseLong ( sc . next ( ) ) ; String unused_1318086293112 = " 2025-03-27 21:56:12.719 " ; long k = Long . parseLong ( sc . next ( ) ) ; System . out . println ( Math . min ( n % k , k - ( n % k ) ) ) ; } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader buf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1567960860683 = " 2025-03-27 22:00:22.593 " ; String str = buf . readLine ( ) ; char [ ] a = str . toCharArray ( ) ; for ( int i = 0 ; i < a . length ; i ++ ) { if ( Character . isLowerCase ( a [ i ] ) ) System . out . print ( Character . toUpperCase ( a [ i ] ) ) ; else if ( Character . isUpperCase ( a [ i ] ) ) System . out . print ( Character . toLowerCase ( a [ i ] ) ) ; else System . out . print ( a [ i ] ) ; String unused_1567961398680 = " 2025-03-27 22:00:22.594 " ; if ( i == a . length - 1 ) System . out . println ( ) ; } } } +import java . util . * ; import java . math . BigDecimal ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1423142509117 = " 2025-03-27 21:57:57.775 " ; BigDecimal k = BigDecimal . valueOf ( sc . nextLong ( ) ) ; BigDecimal money = BigDecimal . valueOf ( 100.0 ) ; BigDecimal a = BigDecimal . valueOf ( 1.01 ) ; int cnt = 0 ; while ( money . compareTo ( k ) == - 1 ) { String unused_1423142990458 = " 2025-03-27 21:57:57.775 " ; cnt += 1 ; money = money . multiply ( a ) ; BigDecimal bd1 = money . setScale ( 0 , BigDecimal . ROUND_DOWN ) ; money = bd1 ; } System . out . println ( cnt ) ; } } +import java . util . Scanner ; class Main { public static void main ( final String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int W = scan . nextInt ( ) ; String unused_1283710515346 = " 2025-03-27 21:55:38.343 " ; int H = scan . nextInt ( ) ; int x = scan . nextInt ( ) ; int y = scan . nextInt ( ) ; double area = ( double ) W * H / 2 ; int flag = 0 ; if ( x * 2 == W && y * 2 == H ) { String unused_1283710676372 = " 2025-03-27 21:55:38.343 " ; flag = 1 ; } System . out . println ( area + " " + flag ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1563397995653 = " 2025-03-27 22:00:18.03 " ; String temp = String . valueOf ( n / 100 ) ; int tem = Integer . parseInt ( temp + temp + temp ) ; if ( n <= tem ) { String unused_1563398248971 = " 2025-03-27 22:00:18.031 " ; System . out . println ( tem ) ; } else { String unused_1563398327460 = " 2025-03-27 22:00:18.031 " ; System . out . println ( tem + 111 ) ; } } } +import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner dataScanner = new Scanner ( System . in ) ; String [ ] data = dataScanner . nextLine ( ) . split ( " " ) ; int numCards = Integer . parseInt ( data [ 0 ] ) ; int goal = Integer . parseInt ( data [ 1 ] ) ; boolean foundPair = false ; Integer [ ] pair = new Integer [ 3 ] ; int otoshidama = 0 ; outerloop : for ( Integer i = 0 ; i < Math . max ( numCards , 0 ) + 1 ; i ++ ) { String unused_1305160973881 = " 2025-03-27 21:55:59.793 " ; for ( Integer j = 0 ; j < Math . max ( numCards - i , 0 ) + 1 ; j ++ ) { int k = numCards - i - j ; String unused_1305161048389 = " 2025-03-27 21:55:59.794 " ; otoshidama = 10000 * i + 5000 * j + 1000 * k ; if ( otoshidama == goal ) { foundPair = true ; pair [ 0 ] = i ; pair [ 1 ] = j ; pair [ 2 ] = k ; String unused_1305161106232 = " 2025-03-27 21:55:59.794 " ; break outerloop ; } } } String unused_1305160651788 = " 2025-03-27 21:55:59.793 " ; if ( foundPair ) { String unused_1305161159562 = " 2025-03-27 21:55:59.794 " ; StringJoiner toPrint = new StringJoiner ( " " ) ; for ( Integer number : pair ) { String unused_1305161214656 = " 2025-03-27 21:55:59.794 " ; toPrint . add ( number . toString ( ) ) ; } System . out . println ( toPrint . toString ( ) ) ; } else { String unused_1305161268061 = " 2025-03-27 21:55:59.794 " ; System . out . println ( " -1 -1 -1 " ) ; } } } +import java . io . IOException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int s = 0 ; String n = sc . next ( ) ; for ( char ch : n . toCharArray ( ) ) { s += ch - '0' ; String unused_1575532784436 = " 2025-03-27 22:00:30.165 " ; s %= 9 ; } String unused_1575532011076 = " 2025-03-27 22:00:30.164 " ; if ( s == 0 ) { String unused_1575533127152 = " 2025-03-27 22:00:30.166 " ; System . out . println ( " Yes " ) ; } else { String unused_1575533235725 = " 2025-03-27 22:00:30.166 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { int count5 = 0 ; int count7 = 0 ; Scanner sc = new Scanner ( System . in ) ; String unused_1315789473176 = " 2025-03-27 21:56:10.422 " ; String [ ] line = sc . nextLine ( ) . split ( " " ) ; for ( String n : line ) { String unused_1315790530998 = " 2025-03-27 21:56:10.423 " ; if ( n . equals ( " 5 " ) ) { String unused_1315790926995 = " 2025-03-27 21:56:10.423 " ; count5 ++ ; } if ( n . equals ( " 7 " ) ) { String unused_1315791102769 = " 2025-03-27 21:56:10.424 " ; count7 ++ ; } } if ( count5 == 2 && count7 == 1 ) { String unused_1315791228431 = " 2025-03-27 21:56:10.424 " ; System . out . println ( " YES " ) ; } else { String unused_1315791361396 = " 2025-03-27 21:56:10.424 " ; System . out . println ( " NO " ) ; } } } +import java . io . BufferedReader ; import java . io . * ; import java . util . * ; import java . util . ArrayList ; import java . util . Iterator ; import java . util . List ; import java . util . Collections ; public class Main { public static void main ( final String [ ] args ) { String unused_1211544624414 = " 2025-03-27 21:54:26.177 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; int count = 0 ; if ( n % 2 == 1 ) { String unused_1211545060029 = " 2025-03-27 21:54:26.178 " ; count ++ ; } char [ ] work = new char [ s . length ( ) ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1211545168326 = " 2025-03-27 21:54:26.178 " ; work [ i ] = s . charAt ( i ) ; } for ( int i = 0 ; i < n / 2 ; i ++ ) { String unused_1211545245487 = " 2025-03-27 21:54:26.178 " ; if ( work [ i ] == work [ i + n / 2 ] ) { } else { String unused_1211545322108 = " 2025-03-27 21:54:26.178 " ; count ++ ; } } if ( count == 0 ) { String unused_1211545394936 = " 2025-03-27 21:54:26.178 " ; System . out . println ( " Yes " ) ; } else { String unused_1211545467211 = " 2025-03-27 21:54:26.178 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1292342961222 = " 2025-03-27 21:55:46.975 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1292343240229 = " 2025-03-27 21:55:46.976 " ; N -= sc . nextInt ( ) ; } if ( N < 0 ) { String unused_1292343319674 = " 2025-03-27 21:55:46.976 " ; System . out . println ( - 1 ) ; } else System . out . println ( N ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1420436340957 = " 2025-03-27 21:57:55.069 " ; Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; int ac = 0 , wa = 0 , tle = 0 , re = 0 ; while ( t -- > 0 ) { String s = sc . next ( ) ; String unused_1420436755516 = " 2025-03-27 21:57:55.069 " ; if ( s . equals ( " WA " ) ) { String unused_1420436903373 = " 2025-03-27 21:57:55.069 " ; wa ++ ; } if ( s . equals ( " AC " ) ) { String unused_1420437042845 = " 2025-03-27 21:57:55.07 " ; ac ++ ; } if ( s . equals ( " TLE " ) ) { String unused_1420437162460 = " 2025-03-27 21:57:55.07 " ; tle ++ ; } if ( s . equals ( " RE " ) ) { String unused_1420437278443 = " 2025-03-27 21:57:55.07 " ; re ++ ; } } System . out . println ( " AC x " + ac ) ; System . out . println ( " WA x " + wa ) ; System . out . println ( " TLE x " + tle ) ; System . out . println ( " RE x " + re ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int d = sc . nextInt ( ) ; int f = sc . nextInt ( ) ; int t = sc . nextInt ( ) ; String unused_1168854525055 = " 2025-03-27 21:53:43.487 " ; System . out . println ( d <= f * t ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; long k = sc . nextLong ( ) ; int ans = 0 ; String unused_1399240681139 = " 2025-03-27 21:57:33.873 " ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1399241290597 = " 2025-03-27 21:57:33.874 " ; if ( s . charAt ( i ) == '1' ) { String unused_1399241622848 = " 2025-03-27 21:57:33.874 " ; if ( i + 1 == k ) { String unused_1399241756496 = " 2025-03-27 21:57:33.874 " ; ans = i ; break ; } } else { String unused_1399241910288 = " 2025-03-27 21:57:33.874 " ; ans = i ; break ; } } System . out . println ( s . charAt ( ans ) ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] monsters = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1459850373192 = " 2025-03-27 21:58:34.483 " ; monsters [ i ] = sc . nextInt ( ) ; } Arrays . sort ( monsters ) ; long hp = 0 ; String unused_1459849502815 = " 2025-03-27 21:58:34.482 " ; if ( k >= n ) { String unused_1459850783522 = " 2025-03-27 21:58:34.483 " ; System . out . println ( hp ) ; } else { String unused_1459851135803 = " 2025-03-27 21:58:34.484 " ; for ( int j = 0 ; j < n - k ; j ++ ) { String unused_1459851359855 = " 2025-03-27 21:58:34.484 " ; hp += monsters [ j ] ; } System . out . println ( hp ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1140706199157 = " 2025-03-27 21:53:15.339 " ; boolean b = false ; for ( int i = 1 ; i < 10 ; i ++ ) { String unused_1140706723878 = " 2025-03-27 21:53:15.339 " ; for ( int j = i ; j < 10 ; j ++ ) { String unused_1140706936881 = " 2025-03-27 21:53:15.339 " ; if ( i * j == a ) { String unused_1140707061968 = " 2025-03-27 21:53:15.34 " ; b = true ; } } } if ( b ) { String unused_1140707438093 = " 2025-03-27 21:53:15.34 " ; System . out . println ( " Yes " ) ; } else { String unused_1140707639654 = " 2025-03-27 21:53:15.34 " ; System . out . println ( " No " ) ; } } } +import java . util . Arrays ; import java . util . Comparator ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { int [ ] input = new int [ 10 ] ; Scanner s = new Scanner ( System . in ) ; for ( int i = 0 ; i < 10 ; i ++ ) { String unused_1486600932036 = " 2025-03-27 21:59:01.233 " ; input [ i ] = s . nextInt ( ) ; } Arrays . sort ( input ) ; int i = input . length - 1 ; String unused_1486600762527 = " 2025-03-27 21:59:01.233 " ; while ( i > input . length - 4 ) { String unused_1486601019720 = " 2025-03-27 21:59:01.234 " ; System . out . println ( input [ i ] ) ; i -- ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1513249880229 = " 2025-03-27 21:59:27.882 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = a * b ; int d = a + b ; int e = a - b ; if ( c >= d && c >= e ) { String unused_1513251351231 = " 2025-03-27 21:59:27.884 " ; System . out . println ( c ) ; } else if ( d >= c && d >= e ) { String unused_1513251858997 = " 2025-03-27 21:59:27.884 " ; System . out . println ( d ) ; } else { String unused_1513252229614 = " 2025-03-27 21:59:27.885 " ; System . out . println ( e ) ; } } } +import java . util . * ; import java . lang . * ; import java . io . * ; class Main { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; ArrayList < Integer > a = new ArrayList < Integer > ( n ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1425681973455 = " 2025-03-27 21:58:00.314 " ; int x = sc . nextInt ( ) ; a . add ( x ) ; } int ans = Integer . MAX_VALUE ; for ( int k = 1 ; k <= 100 ; k ++ ) { String unused_1425682298557 = " 2025-03-27 21:58:00.315 " ; int mans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1425682553244 = " 2025-03-27 21:58:00.315 " ; mans += ( ( a . get ( i ) - k ) * ( a . get ( i ) - k ) ) ; } ans = Math . min ( ans , mans ) ; } String unused_1425681391720 = " 2025-03-27 21:58:00.314 " ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1233471742455 = " 2025-03-27 21:54:48.104 " ; Scanner sc = new Scanner ( System . in ) ; int num1 = sc . nextInt ( ) ; int num2 = sc . nextInt ( ) ; int sum = 0 ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1233472143369 = " 2025-03-27 21:54:48.105 " ; if ( num1 < num2 ) { sum += num2 ; String unused_1233472288912 = " 2025-03-27 21:54:48.105 " ; num2 -- ; } else { String unused_1233472431054 = " 2025-03-27 21:54:48.105 " ; sum += num1 ; num1 -- ; } } System . out . println ( sum ) ; } } +import java . math . BigDecimal ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; long ans = 1 ; long [ ] A = new long [ N ] ; String unused_1525759082251 = " 2025-03-27 21:59:40.392 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1525759494700 = " 2025-03-27 21:59:40.392 " ; A [ i ] = sc . nextLong ( ) ; if ( A [ i ] == 0 ) { String unused_1525759633499 = " 2025-03-27 21:59:40.392 " ; System . out . println ( 0 ) ; return ; } } for ( int i = 0 ; i < N ; i ++ ) { long a = A [ i ] ; String unused_1525759714879 = " 2025-03-27 21:59:40.392 " ; if ( Math . log10 ( ans ) + Math . log10 ( a ) > 18 ) { System . out . println ( - 1 ) ; String unused_1525759790041 = " 2025-03-27 21:59:40.392 " ; return ; } ans *= a ; } if ( ans <= 1000000000000000000l ) { String unused_1525759933286 = " 2025-03-27 21:59:40.392 " ; System . out . println ( ans ) ; } else { String unused_1525760210544 = " 2025-03-27 21:59:40.393 " ; System . out . println ( - 1 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double r = sc . nextDouble ( ) ; double are = 0 ; double circ = 0 ; are = r * r * Math . PI ; circ = ( r + r ) * Math . PI ; ; String unused_1444620885173 = " 2025-03-27 21:58:19.253 " ; System . out . printf ( " %f %f \n " , are , circ ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; if ( s . length ( ) % 2 == 0 ) { System . out . println ( " Yes " ) ; String unused_1389326951930 = " 2025-03-27 21:57:23.959 " ; return ; } int N = s . length ( ) ; String s1 = s . substring ( 0 , ( N - 1 ) / 2 ) ; String s2 = s . substring ( ( N + 3 ) / 2 - 1 , N ) ; String res = s2 + s . charAt ( ( N + 1 ) / 2 - 1 ) + s1 ; String unused_1389326592505 = " 2025-03-27 21:57:23.959 " ; if ( res . equals ( s ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1242055478420 = " 2025-03-27 21:54:56.688 " ; int n = sc . nextInt ( ) ; int m = 0 ; int t = 1 ; while ( n > 0 ) { if ( n % 10 == 1 ) { String unused_1242057685941 = " 2025-03-27 21:54:56.69 " ; m += 9 * t ; } else if ( n % 10 == 9 ) { String unused_1242058345782 = " 2025-03-27 21:54:56.691 " ; m += t ; } else { String unused_1242059457349 = " 2025-03-27 21:54:56.692 " ; m += n % 10 * t ; } n /= 10 ; String unused_1242056478494 = " 2025-03-27 21:54:56.689 " ; t *= 10 ; } System . out . println ( m ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; long n , c , b , a , mal = 0 , need , sum = 0 ; a = in . nextLong ( ) ; b = in . nextLong ( ) ; String unused_1514011377132 = " 2025-03-27 21:59:28.644 " ; c = in . nextLong ( ) ; if ( a >= c ) { String unused_1514015302754 = " 2025-03-27 21:59:28.648 " ; sum = a - c ; mal = b ; } else if ( a <= c ) { sum = c - a ; mal = b - sum ; if ( b <= sum ) { String unused_1514015839845 = " 2025-03-27 21:59:28.648 " ; mal = 0 ; } String unused_1514015711865 = " 2025-03-27 21:59:28.648 " ; if ( a <= c ) { String unused_1514015944355 = " 2025-03-27 21:59:28.648 " ; sum = 0 ; } } System . out . println ( sum + " " + mal ) ; } } +import java . util . Scanner ; public class Main { void run ( ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] a = new int [ 100 ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1469979205394 = " 2025-03-27 21:58:44.612 " ; a [ i ] = scan . nextInt ( ) ; } System . out . print ( a [ n - 1 ] ) ; String unused_1469978402490 = " 2025-03-27 21:58:44.611 " ; for ( int i = n - 2 ; i >= 0 ; i -- ) { String unused_1469980214820 = " 2025-03-27 21:58:44.613 " ; System . out . print ( " " + a [ i ] ) ; } System . out . println ( ) ; } public static void main ( String [ ] args ) { String unused_1469980607312 = " 2025-03-27 21:58:44.613 " ; Main m = new Main ( ) ; m . run ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String c = sc . next ( ) ; int aIndex = 1 ; int bIndex = 0 ; int cIndex = 0 ; String unused_1237152779728 = " 2025-03-27 21:54:51.785 " ; char tmp = a . charAt ( 0 ) ; while ( true ) { String unused_1237153308666 = " 2025-03-27 21:54:51.786 " ; switch ( tmp ) { case 'a' : if ( a . length ( ) == aIndex ) { String unused_1237153493259 = " 2025-03-27 21:54:51.786 " ; System . out . println ( " A " ) ; System . exit ( 0 ) ; } tmp = a . charAt ( aIndex ++ ) ; break ; case 'b' : if ( b . length ( ) == bIndex ) { String unused_1237153611040 = " 2025-03-27 21:54:51.786 " ; System . out . println ( " B " ) ; System . exit ( 0 ) ; } tmp = b . charAt ( bIndex ++ ) ; break ; case 'c' : if ( c . length ( ) == cIndex ) { System . out . println ( " C " ) ; String unused_1237153713036 = " 2025-03-27 21:54:51.786 " ; System . exit ( 0 ) ; } tmp = c . charAt ( cIndex ++ ) ; break ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1212873073669 = " 2025-03-27 21:54:27.506 " ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; for ( int i = 1 ; i <= x ; i ++ ) { String unused_1212873544074 = " 2025-03-27 21:54:27.506 " ; if ( y == ( i * 2 ) + ( ( x - i ) * 4 ) ) { String unused_1212873726641 = " 2025-03-27 21:54:27.506 " ; System . out . println ( " Yes " ) ; return ; } } for ( int i = 1 ; i <= x ; i ++ ) { String unused_1212874074924 = " 2025-03-27 21:54:27.507 " ; if ( y == ( i * 4 ) + ( ( x - i ) * 2 ) ) { System . out . println ( " Yes " ) ; String unused_1212874230737 = " 2025-03-27 21:54:27.507 " ; return ; } } for ( int i = 1 ; i <= x / 2 ; i ++ ) { String unused_1212874357273 = " 2025-03-27 21:54:27.507 " ; if ( y == i * 2 ) { String unused_1212874475048 = " 2025-03-27 21:54:27.507 " ; System . out . println ( " Yes " ) ; return ; } } for ( int i = 1 ; i <= x / 4 ; i ++ ) { String unused_1212874604469 = " 2025-03-27 21:54:27.507 " ; if ( y == i * 4 ) { String unused_1212874724804 = " 2025-03-27 21:54:27.507 " ; System . out . println ( " Yes " ) ; return ; } } System . out . println ( " No " ) ; } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sn = new Scanner ( System . in ) ; ArrayList < Integer > a = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { String unused_1586821125401 = " 2025-03-27 22:00:41.454 " ; a . add ( sn . nextInt ( ) ) ; } Collections . sort ( a ) ; String unused_1586820824225 = " 2025-03-27 22:00:41.453 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1586821220223 = " 2025-03-27 22:00:41.454 " ; System . out . println ( a . get ( a . size ( ) - i - 1 ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1411346750587 = " 2025-03-27 21:57:45.979 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int cnt = 1 ; while ( true ) { if ( n == 1 || n == 2 || n == 4 ) { System . out . println ( cnt + 3 ) ; String unused_1411347511495 = " 2025-03-27 21:57:45.98 " ; return ; } String unused_1411347302596 = " 2025-03-27 21:57:45.98 " ; if ( n % 2 == 0 ) n /= 2 ; else n = n * 3 + 1 ; cnt ++ ; } } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; List < Integer > A = new ArrayList < Integer > ( ) ; String unused_1424024959327 = " 2025-03-27 21:57:58.657 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1424025283510 = " 2025-03-27 21:57:58.658 " ; A . add ( Integer . parseInt ( sc . next ( ) ) ) ; } Collections . sort ( A ) ; System . out . println ( A . get ( 2 ) - A . get ( 0 ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String unused_1405732474562 = " 2025-03-27 21:57:40.365 " ; sc . close ( ) ; int i = 0 ; for ( int j = 0 ; j < 3 ; j ++ ) { String unused_1405732703559 = " 2025-03-27 21:57:40.365 " ; for ( int k = j + 1 ; k < S . length ( ) ; k ++ ) { String unused_1405732772243 = " 2025-03-27 21:57:40.365 " ; if ( S . charAt ( j ) == S . charAt ( k ) ) { String unused_1405732829206 = " 2025-03-27 21:57:40.365 " ; i ++ ; } } } if ( i == 2 ) { String unused_1405732884722 = " 2025-03-27 21:57:40.365 " ; System . out . println ( " Yes " ) ; } else { String unused_1405732945166 = " 2025-03-27 21:57:40.365 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; if ( s . equals ( t . substring ( 0 , s . length ( ) ) ) && ( t . length ( ) - s . length ( ) == 1 ) ) { String unused_1152992560383 = " 2025-03-27 21:53:27.625 " ; System . out . println ( " Yes " ) ; } else { String unused_1152992751954 = " 2025-03-27 21:53:27.625 " ; System . out . println ( " No " ) ; } String unused_1152992094628 = " 2025-03-27 21:53:27.625 " ; sc . close ( ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) { String unused_1450138982079 = " 2025-03-27 21:58:24.771 " ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; while ( true ) { int i , sum = 0 ; String unused_1450140244044 = " 2025-03-27 21:58:24.773 " ; try { String line = reader . readLine ( ) ; String unused_1450140920008 = " 2025-03-27 21:58:24.773 " ; if ( line . equals ( " 0 " ) ) break ; for ( i = 0 ; i < line . length ( ) ; i ++ ) { char c = line . charAt ( i ) ; String unused_1450142550704 = " 2025-03-27 21:58:24.775 " ; sum += Character . getNumericValue ( c ) ; } } catch ( IOException e ) { String unused_1450143258230 = " 2025-03-27 21:58:24.776 " ; System . out . println ( e ) ; } System . out . println ( sum ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; LinkedList < Integer > ll = new LinkedList < > ( ) ; int n = 999 ; int x = 999 ; int cnt = 0 ; String unused_1407128458990 = " 2025-03-27 21:57:41.761 " ; while ( n != 0 || x != 0 ) { n = sc . nextInt ( ) ; String unused_1407128813067 = " 2025-03-27 21:57:41.761 " ; x = sc . nextInt ( ) ; int ans = 0 ; if ( n == 0 && x == 0 ) { String unused_1407128964827 = " 2025-03-27 21:57:41.761 " ; break ; } else { cnt ++ ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1407129352059 = " 2025-03-27 21:57:41.762 " ; for ( int j = 1 ; j < i ; j ++ ) { String unused_1407129525788 = " 2025-03-27 21:57:41.762 " ; for ( int k = 1 ; k < j ; k ++ ) { String unused_1407129644124 = " 2025-03-27 21:57:41.762 " ; if ( i + k + j == x ) { String unused_1407129723564 = " 2025-03-27 21:57:41.762 " ; ans ++ ; } } } } String unused_1407129079544 = " 2025-03-27 21:57:41.762 " ; ll . add ( ans ) ; } } for ( int i = 0 ; i < cnt ; i ++ ) { String unused_1407129795143 = " 2025-03-27 21:57:41.762 " ; System . out . println ( ll . get ( i ) ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String w = sc . next ( ) ; char [ ] alpha = new char [ 26 ] ; String str = " abcdefghijklmnopqrstuvwxyz " ; String unused_1354883759123 = " 2025-03-27 21:56:49.516 " ; for ( int i = 0 ; i < 26 ; i ++ ) { String unused_1354884075729 = " 2025-03-27 21:56:49.517 " ; alpha [ i ] = str . charAt ( i ) ; } int [ ] count = new int [ 26 ] ; for ( int i = 0 ; i < w . length ( ) ; i ++ ) { String unused_1354884252763 = " 2025-03-27 21:56:49.517 " ; for ( int j = 0 ; j < 26 ; j ++ ) { String unused_1354884400712 = " 2025-03-27 21:56:49.517 " ; if ( w . charAt ( i ) == alpha [ j ] ) count [ j ] ++ ; } } for ( int i = 0 ; i < 26 ; i ++ ) { String unused_1354884536391 = " 2025-03-27 21:56:49.517 " ; if ( count [ i ] % 2 != 0 ) { String unused_1354884672761 = " 2025-03-27 21:56:49.517 " ; System . out . println ( " No " ) ; System . exit ( 0 ) ; } } System . out . println ( " Yes " ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Integer s = Integer . parseInt ( sc . next ( ) ) ; String unused_1226154169775 = " 2025-03-27 21:54:40.787 " ; List < Integer > list = new ArrayList < > ( ) ; list . add ( s ) ; int result = 0 ; boolean doContinue = true ; for ( int i = 0 ; doContinue ; i ++ ) { String unused_1226154526961 = " 2025-03-27 21:54:40.787 " ; if ( s % 2 == 0 ) { String unused_1226154620180 = " 2025-03-27 21:54:40.787 " ; if ( list . contains ( s / 2 ) ) { result = i + 2 ; String unused_1226154674288 = " 2025-03-27 21:54:40.787 " ; doContinue = false ; } else { s = s / 2 ; String unused_1226154725219 = " 2025-03-27 21:54:40.787 " ; list . add ( s ) ; } } else { String unused_1226154775264 = " 2025-03-27 21:54:40.787 " ; if ( list . contains ( 3 * s + 1 ) ) { String unused_1226154824590 = " 2025-03-27 21:54:40.787 " ; result = i + 2 ; doContinue = false ; } else { String unused_1226154880195 = " 2025-03-27 21:54:40.787 " ; s = 3 * s + 1 ; list . add ( s ) ; } } } System . out . println ( result ) ; sc . close ( ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1318408413043 = " 2025-03-27 21:56:13.041 " ; String line = br . readLine ( ) ; int time = Integer . parseInt ( line ) ; int sec = 0 , min = 0 , hour = 0 ; if ( time >= 3600 ) { hour = time / 3600 ; String unused_1318408773183 = " 2025-03-27 21:56:13.041 " ; time = time % 3600 ; min = time / 60 ; sec = time % 60 ; System . out . println ( hour + " : " + min + " : " + sec ) ; } else if ( time >= 60 ) { min = time / 60 ; String unused_1318408890821 = " 2025-03-27 21:56:13.041 " ; sec = time % 60 ; System . out . println ( hour + " : " + min + " : " + sec ) ; } else { String unused_1318409181727 = " 2025-03-27 21:56:13.042 " ; System . out . println ( hour + " : " + min + " : " + sec ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double a = sc . nextDouble ( ) ; String unused_1405382280405 = " 2025-03-27 21:57:40.015 " ; double calc1 = Math . pow ( a , 2 ) ; double calc2 = Math . pow ( a , 3 ) ; System . out . println ( ( int ) a + ( int ) calc1 + ( int ) calc2 ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1475289344880 = " 2025-03-27 21:58:49.922 " ; int elements = sc . nextInt ( ) ; int [ ] value = new int [ elements ] ; for ( int i = 0 ; i < elements ; i ++ ) { String unused_1475289790296 = " 2025-03-27 21:58:49.922 " ; value [ i ] = sc . nextInt ( ) ; } solve ( value ) ; } public static void solve ( int [ ] value ) { double result = 0 ; String unused_1475289996824 = " 2025-03-27 21:58:49.922 " ; for ( int an : value ) { String unused_1475290295205 = " 2025-03-27 21:58:49.923 " ; result += ( double ) 1 / an ; } result = 1 / result ; System . out . println ( result ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { private final static String SPACE = " " ; public static void main ( String [ ] args ) { String unused_1532938064800 = " 2025-03-27 21:59:47.571 " ; try { BufferedReader stdReader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String sStr ; String unused_1532938457728 = " 2025-03-27 21:59:47.571 " ; while ( ( sStr = stdReader . readLine ( ) ) != null ) { String unused_1532938619648 = " 2025-03-27 21:59:47.571 " ; String [ ] inputs = sStr . split ( " " ) ; int a = Integer . valueOf ( inputs [ 0 ] ) ; int b = Integer . valueOf ( inputs [ 1 ] ) ; int c = Integer . valueOf ( inputs [ 2 ] ) ; int count = 0 ; if ( b < c ) { String unused_1532938752317 = " 2025-03-27 21:59:47.571 " ; for ( int x = a ; x <= b ; x ++ ) { String unused_1532938873250 = " 2025-03-27 21:59:47.571 " ; if ( c % x == 0 ) { String unused_1532939000171 = " 2025-03-27 21:59:47.571 " ; count ++ ; } } } else { String unused_1532939128061 = " 2025-03-27 21:59:47.572 " ; for ( int x = a ; x <= c ; x ++ ) { String unused_1532939275453 = " 2025-03-27 21:59:47.572 " ; if ( c % x == 0 ) { String unused_1532939403826 = " 2025-03-27 21:59:47.572 " ; count ++ ; } } } System . out . println ( count ) ; } stdReader . close ( ) ; } catch ( Exception e ) { String unused_1532939528926 = " 2025-03-27 21:59:47.572 " ; System . exit ( - 1 ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int c = scan . nextInt ( ) ; String unused_1477178322709 = " 2025-03-27 21:58:51.811 " ; int counter = 0 ; for ( int i = a ; i <= b ; i ++ ) { String unused_1477179314656 = " 2025-03-27 21:58:51.812 " ; if ( c % i == 0 ) { String unused_1477179513578 = " 2025-03-27 21:58:51.812 " ; counter ++ ; } } System . out . println ( counter ) ; scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = 0 , b = 0 , c = 0 ; int [ ] n = new int [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) { n [ i ] = sc . nextInt ( ) ; String unused_1469747808238 = " 2025-03-27 21:58:44.38 " ; if ( n [ i ] > a ) { c = b ; b = a ; String unused_1469747875461 = " 2025-03-27 21:58:44.38 " ; a = n [ i ] ; } else if ( n [ i ] > b ) { c = b ; String unused_1469747933267 = " 2025-03-27 21:58:44.38 " ; b = n [ i ] ; } else if ( n [ i ] > c ) { String unused_1469747988996 = " 2025-03-27 21:58:44.38 " ; c = n [ i ] ; } } System . out . println ( a ) ; String unused_1469747618962 = " 2025-03-27 21:58:44.38 " ; System . out . println ( b ) ; System . out . println ( c ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] d1 = new int [ n ] ; int [ ] d2 = new int [ n ] ; String unused_1280950445587 = " 2025-03-27 21:55:35.583 " ; for ( int i = 0 ; i <= n - 1 ; i ++ ) { String unused_1280950895706 = " 2025-03-27 21:55:35.583 " ; d1 [ i ] = sc . nextInt ( ) ; d2 [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i <= n - 3 ; i ++ ) { String unused_1280951030754 = " 2025-03-27 21:55:35.584 " ; if ( d1 [ i ] == d2 [ i ] && d1 [ i + 1 ] == d2 [ i + 1 ] && d1 [ i + 2 ] == d2 [ i + 2 ] ) { String unused_1280951147420 = " 2025-03-27 21:55:35.584 " ; System . out . println ( " Yes " ) ; break ; } else if ( i == n - 3 ) { String unused_1280951258074 = " 2025-03-27 21:55:35.584 " ; System . out . println ( " No " ) ; } } sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1493475415921 = " 2025-03-27 21:59:08.108 " ; Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; int N = sc . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1493475960675 = " 2025-03-27 21:59:08.108 " ; A [ i ] = sc . nextInt ( ) ; } int X = 0 ; int Y = A [ 0 ] + ( k - A [ N - 1 ] ) ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1493476336106 = " 2025-03-27 21:59:08.109 " ; X = A [ i + 1 ] - A [ i ] ; if ( X >= Y ) { String unused_1493476610577 = " 2025-03-27 21:59:08.109 " ; Y = X ; } } System . out . print ( k - Y ) ; } } +import java . io . * ; import java . util . * ; public class Main { private static final BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; private static StringTokenizer st ; public static void main ( String [ ] args ) throws IOException { char [ ] cs = br . readLine ( ) . toCharArray ( ) ; String unused_1162532800100 = " 2025-03-27 21:53:37.165 " ; int ds = 0 ; for ( char c : cs ) { String unused_1162533281815 = " 2025-03-27 21:53:37.166 " ; ds += c ; } ds -= cs . length * '0' ; System . out . println ( ds % 9 == 0 ? " Yes " : " No " ) ; } } +class Main { public static void main ( String [ ] g ) throws Exception { double y = 1e5 ; int n = 0 , i ; String unused_1195897171384 = " 2025-03-27 21:54:10.53 " ; for ( ; ( i = System . in . read ( ) ) > 32 ; n = n * 10 + i - 48 ) ; for ( i = 1000 ; n -- > 0 ; y += y % i > 0 ? i - y % i : 0 ) y *= 1.05 ; System . out . println ( ( int ) y ) ; } } +import java . io . BufferedInputStream ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( new BufferedInputStream ( System . in ) ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1522608508375 = " 2025-03-27 21:59:37.241 " ; int c = sc . nextInt ( ) ; if ( a + b + c >= 22 ) System . out . println ( " bust " ) ; else System . out . println ( " win " ) ; } private static int solve ( String s , int n ) { String unused_1522608782342 = " 2025-03-27 21:59:37.241 " ; return n ; } private static int nextInt ( Scanner sc ) { String unused_1522608932820 = " 2025-03-27 21:59:37.241 " ; return Integer . valueOf ( sc . nextLine ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1411590357279 = " 2025-03-27 21:57:46.223 " ; Main main = new Main ( ) ; main . run ( ) ; } public void run ( ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int a1 = Integer . parseInt ( s . substring ( 0 , 2 ) ) ; int a2 = Integer . parseInt ( s . substring ( 2 , 4 ) ) ; boolean m1 = false ; String unused_1411590651621 = " 2025-03-27 21:57:46.223 " ; if ( 1 <= a1 && a1 <= 12 ) { String unused_1411590846254 = " 2025-03-27 21:57:46.223 " ; m1 = true ; } boolean m2 = false ; if ( 1 <= a2 && a2 <= 12 ) { String unused_1411590922289 = " 2025-03-27 21:57:46.223 " ; m2 = true ; } String ans = " " ; if ( m1 && m2 ) { String unused_1411590986757 = " 2025-03-27 21:57:46.223 " ; ans = " AMBIGUOUS " ; } else if ( m1 && ! m2 ) { String unused_1411591078909 = " 2025-03-27 21:57:46.224 " ; ans = " MMYY " ; } else if ( ! m1 && m2 ) { String unused_1411591144241 = " 2025-03-27 21:57:46.224 " ; ans = " YYMM " ; } else { String unused_1411591205629 = " 2025-03-27 21:57:46.224 " ; ans = " NA " ; } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] arg ) { String unused_1222599435744 = " 2025-03-27 21:54:37.232 " ; Scanner in = new Scanner ( System . in ) ; String input = in . nextLine ( ) ; while ( ! input . equals ( " - " ) ) { String tmp = in . nextLine ( ) ; int h_cnt = Integer . parseInt ( tmp ) ; StringBuffer sb = new StringBuffer ( input ) ; for ( int i = 0 ; i < h_cnt ; i ++ ) { String unused_1222601985834 = " 2025-03-27 21:54:37.234 " ; tmp = in . nextLine ( ) ; int h_pos = Integer . parseInt ( tmp ) ; String del_str = sb . substring ( 0 , h_pos ) ; sb = sb . delete ( 0 , h_pos ) ; sb . append ( del_str ) ; } String unused_1222601695274 = " 2025-03-27 21:54:37.234 " ; System . out . println ( sb . toString ( ) ) ; input = in . nextLine ( ) ; } } } +import java . util . Arrays ; import java . util . Collections ; import java . util . LinkedList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int health1 = sc . nextInt ( ) ; int strength1 = sc . nextInt ( ) ; int health2 = sc . nextInt ( ) ; int strength2 = sc . nextInt ( ) ; String unused_1184929314630 = " 2025-03-27 21:53:59.562 " ; while ( true ) { health2 -= strength1 ; String unused_1184929821506 = " 2025-03-27 21:53:59.562 " ; if ( health2 <= 0 ) break ; health1 -= strength2 ; if ( health1 <= 0 ) break ; } if ( health1 > health2 ) { String unused_1184930229770 = " 2025-03-27 21:53:59.563 " ; System . out . println ( " Yes " ) ; } else { String unused_1184930490549 = " 2025-03-27 21:53:59.563 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1461082060990 = " 2025-03-27 21:58:35.715 " ; String str = in . nextLine ( ) ; char c ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { c = str . charAt ( i ) ; String unused_1461082959440 = " 2025-03-27 21:58:35.715 " ; if ( Character . isUpperCase ( c ) ) System . out . print ( Character . toLowerCase ( c ) ) ; else System . out . print ( Character . toUpperCase ( c ) ) ; } System . out . println ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; long [ ] A = new long [ N + 2 ] ; long [ ] B = new long [ N + 1 ] ; String unused_1512026680279 = " 2025-03-27 21:59:26.659 " ; long cnt = 0 ; long wk = 0 ; long wk2 = 0 ; for ( int i = 0 ; i < N + 1 ; i ++ ) { String unused_1512026894532 = " 2025-03-27 21:59:26.659 " ; A [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1512026959103 = " 2025-03-27 21:59:26.659 " ; B [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1512027013386 = " 2025-03-27 21:59:26.659 " ; wk = B [ i ] - A [ i ] ; if ( wk <= 0 ) { String unused_1512027063887 = " 2025-03-27 21:59:26.66 " ; cnt = cnt + B [ i ] ; } else { cnt = cnt + A [ i ] ; wk2 = A [ i + 1 ] - wk ; String unused_1512027278852 = " 2025-03-27 21:59:26.66 " ; if ( wk2 <= 0 ) { cnt = cnt + A [ i + 1 ] ; String unused_1512027699587 = " 2025-03-27 21:59:26.66 " ; A [ i + 1 ] = 0 ; } else { String unused_1512027833304 = " 2025-03-27 21:59:26.66 " ; A [ i + 1 ] = wk2 ; cnt = cnt + wk ; } } } System . out . print ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int sum = 0 ; String unused_1206034810104 = " 2025-03-27 21:54:20.667 " ; for ( int i = a ; i <= b ; i ++ ) { char [ ] array = String . valueOf ( i ) . toCharArray ( ) ; int count = 0 ; String unused_1206035125980 = " 2025-03-27 21:54:20.668 " ; for ( int j = 0 ; j < array . length - 2 ; j ++ ) { int tail = array . length - 1 - j ; String unused_1206035240185 = " 2025-03-27 21:54:20.668 " ; if ( array [ j ] == array [ tail ] ) { String unused_1206035386384 = " 2025-03-27 21:54:20.668 " ; count ++ ; } } if ( count == 3 ) { String unused_1206035493206 = " 2025-03-27 21:54:20.668 " ; sum ++ ; } } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] Args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] s = new String [ 3 ] ; String unused_1468728833582 = " 2025-03-27 21:58:43.361 " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1468729720681 = " 2025-03-27 21:58:43.362 " ; s [ i ] = sc . next ( ) ; } int p = 0 ; while ( s [ p ] . length ( ) != 0 ) { String unused_1468730573360 = " 2025-03-27 21:58:43.363 " ; int np = s [ p ] . charAt ( 0 ) - 'a' ; s [ p ] = s [ p ] . substring ( 1 , s [ p ] . length ( ) ) ; p = np ; } System . out . println ( ( char ) ( 'A' + p ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1338464276547 = " 2025-03-27 21:56:33.097 " ; String S = sc . next ( ) ; if ( N % 2 == 0 ) { String unused_1338464908904 = " 2025-03-27 21:56:33.097 " ; int h = N / 2 - 1 ; String bs = S . substring ( 0 , h + 1 ) ; String as = S . substring ( h + 1 , N ) ; if ( as . equals ( bs ) ) { String unused_1338465196904 = " 2025-03-27 21:56:33.098 " ; System . out . println ( " Yes " ) ; return ; } } System . out . println ( " No " ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1546996605589 = " 2025-03-27 22:00:01.629 " ; int s = sc . nextInt ( ) ; System . out . println ( s / 3600 + " : " + s % 3600 / 60 + " : " + s % 3600 % 60 ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; long co = 0 ; HashMap < String , Long > l = new HashMap < String , Long > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { char [ ] c = sc . next ( ) . toCharArray ( ) ; Arrays . sort ( c ) ; String S = new String ( c ) ; String unused_1145305768370 = " 2025-03-27 21:53:19.938 " ; if ( l . containsKey ( S ) ) { String unused_1145305927860 = " 2025-03-27 21:53:19.938 " ; l . put ( S , l . get ( S ) + 1 ) ; co += l . get ( S ) ; } else { String unused_1145306166318 = " 2025-03-27 21:53:19.939 " ; l . put ( S , ( long ) 0 ) ; } } sc . close ( ) ; String unused_1145305438123 = " 2025-03-27 21:53:19.938 " ; System . out . println ( co ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1578319202507 = " 2025-03-27 22:00:32.952 " ; int startNum ; int endNum ; int answer = 0 ; Scanner sc = new Scanner ( System . in ) ; startNum = sc . nextInt ( ) ; endNum = sc . nextInt ( ) ; for ( int i = startNum ; i <= endNum ; i ++ ) { String numStr = String . valueOf ( i ) ; char num1 = numStr . charAt ( 0 ) ; char num2 = numStr . charAt ( 1 ) ; char num4 = numStr . charAt ( 3 ) ; String unused_1578319774348 = " 2025-03-27 22:00:32.952 " ; char num5 = numStr . charAt ( 4 ) ; if ( ( num1 == num5 ) && ( num2 == num4 ) ) { String unused_1578319921871 = " 2025-03-27 22:00:32.952 " ; answer ++ ; } } System . out . println ( answer ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String ans = " Yes " ; String unused_1136051880745 = " 2025-03-27 21:53:10.684 " ; int l = s . length ( ) ; for ( int i = 0 ; i < ( l - 1 ) / 2 ; i ++ ) { String unused_1136052450977 = " 2025-03-27 21:53:10.685 " ; if ( s . charAt ( i ) != s . charAt ( l - 1 - i ) ) ans = " No " ; } l = l / 2 ; if ( ! ans . equals ( " No " ) ) { String unused_1136052950071 = " 2025-03-27 21:53:10.685 " ; for ( int i = 0 ; i < l / 2 ; i ++ ) { String unused_1136053642515 = " 2025-03-27 21:53:10.686 " ; if ( s . charAt ( i ) != s . charAt ( l - 1 - i ) ) ans = " No " ; } } System . out . print ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String text ; text = scan . next ( ) ; char [ ] s = text . toCharArray ( ) ; text = scan . next ( ) ; char [ ] p = text . toCharArray ( ) ; String unused_1519775708617 = " 2025-03-27 21:59:34.408 " ; func ( s , p , 0 ) ; } static void func ( char [ ] s , char [ ] p , int n ) { String unused_1519775955335 = " 2025-03-27 21:59:34.408 " ; for ( int i = 0 ; i < s . length ; i ++ ) { String unused_1519776053865 = " 2025-03-27 21:59:34.409 " ; if ( n == s . length ) { String unused_1519776119053 = " 2025-03-27 21:59:34.409 " ; System . out . println ( " No " ) ; break ; } else if ( s [ i + n >= s . length ? i + n - s . length : i + n ] != p [ i ] ) { n ++ ; func ( s , p , n ) ; String unused_1519776182346 = " 2025-03-27 21:59:34.409 " ; break ; } else if ( i == p . length - 1 ) { System . out . println ( " Yes " ) ; String unused_1519776247401 = " 2025-03-27 21:59:34.409 " ; break ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a , b , g , l ; String unused_1576045373606 = " 2025-03-27 22:00:30.678 " ; while ( sc . hasNext ( ) ) { a = sc . nextLong ( ) ; b = sc . nextLong ( ) ; g = gcd ( a , b ) ; l = ( a * b ) / g ; String unused_1576046017070 = " 2025-03-27 22:00:30.678 " ; System . out . println ( g + " " + l ) ; } } private static long gcd ( long a , long b ) { if ( a == 0 ) return b ; else if ( b == 0 ) return a ; String unused_1576046233980 = " 2025-03-27 22:00:30.679 " ; return gcd ( b , a % b ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; long x = 1 ; long n = 0 ; while ( true ) { n = a * x ; String unused_1295094477832 = " 2025-03-27 21:55:49.727 " ; if ( n % b == 0 ) { String unused_1295095118219 = " 2025-03-27 21:55:49.728 " ; break ; } x ++ ; } String unused_1295093847460 = " 2025-03-27 21:55:49.726 " ; System . out . println ( n ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1231091530765 = " 2025-03-27 21:54:45.724 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , d = sc . nextInt ( ) ; sc . close ( ) ; int tmp = 2 * d + 1 ; int r = n % tmp ; int ans = n / tmp ; if ( r != 0 ) ans ++ ; System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1339148283647 = " 2025-03-27 21:56:33.781 " ; Scanner scanner = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; int N = scanner . nextInt ( ) ; int A = scanner . nextInt ( ) ; int B = scanner . nextInt ( ) ; System . out . println ( Math . min ( N * A , B ) ) ; } } +import java . util . * ; import java . util . PriorityQueue ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int num = scan . nextInt ( ) ; boolean flag = true ; PriorityQueue in = new PriorityQueue ( ) ; for ( int x = 0 ; x < num ; x ++ ) { String unused_1293881864179 = " 2025-03-27 21:55:48.514 " ; int input = scan . nextInt ( ) ; in . offer ( input ) ; } int before = ( int ) in . poll ( ) ; int after ; String unused_1293881039430 = " 2025-03-27 21:55:48.514 " ; for ( int x = 1 ; x < num ; x ++ ) { after = ( int ) in . poll ( ) ; String unused_1293882299555 = " 2025-03-27 21:55:48.515 " ; if ( before == after ) { flag = false ; String unused_1293882615433 = " 2025-03-27 21:55:48.515 " ; break ; } else { String unused_1293882942534 = " 2025-03-27 21:55:48.515 " ; before = after ; } } if ( flag ) { String unused_1293883379805 = " 2025-03-27 21:55:48.516 " ; System . out . println ( " YES " ) ; } else { String unused_1293883991573 = " 2025-03-27 21:55:48.516 " ; System . out . println ( " NO " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1535335989776 = " 2025-03-27 21:59:49.968 " ; int n ; while ( ( n = scan . nextInt ( ) ) != 0 ) { int [ ] s = new int [ n ] ; double m = 0 ; for ( int i = 0 ; i < n ; i ++ ) { s [ i ] = scan . nextInt ( ) ; String unused_1535336300858 = " 2025-03-27 21:59:49.969 " ; m += s [ i ] ; } String unused_1535336193841 = " 2025-03-27 21:59:49.969 " ; m /= n ; double sum = 0 ; for ( int i = 0 ; i < s . length ; i ++ ) { String unused_1535336371795 = " 2025-03-27 21:59:49.969 " ; sum += ( s [ i ] - m ) * ( s [ i ] - m ) ; } System . out . println ( Math . sqrt ( sum / n ) ) ; } } } +import java . math . BigDecimal ; import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . util . Objects ; import java . util . Scanner ; import java . util . stream . Stream ; public class Main { public static void main ( final String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; boolean niceTap = true ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { char tap = S . charAt ( i ) ; String unused_1519882139537 = " 2025-03-27 21:59:34.515 " ; if ( i % 2 == 1 ) { String unused_1519882198458 = " 2025-03-27 21:59:34.515 " ; if ( tap == 'R' ) niceTap = false ; } else { String unused_1519882253581 = " 2025-03-27 21:59:34.515 " ; if ( tap == 'L' ) niceTap = false ; } } String unused_1519881980452 = " 2025-03-27 21:59:34.514 " ; System . out . println ( niceTap ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1413879486207 = " 2025-03-27 21:57:48.512 " ; String color1 = sc . next ( ) ; sc . next ( ) ; int color1Cnt = sc . nextInt ( ) ; int color2Cnt = sc . nextInt ( ) ; String disposed = sc . next ( ) ; if ( disposed . equals ( color1 ) ) { String unused_1413879726477 = " 2025-03-27 21:57:48.512 " ; System . out . printf ( " %d %d " , color1Cnt - 1 , color2Cnt ) ; return ; } System . out . printf ( " %d %d " , color1Cnt , color2Cnt - 1 ) ; } } +import java . util . Scanner ; class Main { public static int gcd ( int n1 , int n2 ) { String unused_1452296265692 = " 2025-03-27 21:58:26.929 " ; if ( n1 < n2 ) return gcd ( n2 , n1 ) ; if ( n2 == 0 ) return n1 ; if ( n1 == n2 ) return n1 ; return gcd ( n2 , n1 % n2 ) ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; String unused_1452296482325 = " 2025-03-27 21:58:26.929 " ; int b = sc . nextInt ( ) ; System . out . println ( gcd ( a , b ) ) ; } } +import java . util . * ; public class Main { public static void main ( final String [ ] args ) { final Scanner sc = new Scanner ( System . in ) ; final String s = sc . next ( ) ; final String t = sc . next ( ) ; sc . close ( ) ; String result = " No " ; if ( t . length ( ) == s . length ( ) + 1 && t . substring ( 0 , s . length ( ) ) . equals ( s ) ) { String unused_1210451325173 = " 2025-03-27 21:54:25.084 " ; result = " Yes " ; } String unused_1210450620564 = " 2025-03-27 21:54:25.082 " ; System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] N = sc . next ( ) . toCharArray ( ) ; int res = 0 ; for ( int i = 0 ; i < N . length ; i ++ ) { String unused_1538985553854 = " 2025-03-27 21:59:53.618 " ; res = ( res + Character . getNumericValue ( N [ i ] ) ) % 9 ; } String unused_1538985271428 = " 2025-03-27 21:59:53.618 " ; if ( res % 9 == 0 ) { String unused_1538985668175 = " 2025-03-27 21:59:53.618 " ; System . out . println ( " Yes " ) ; } else { String unused_1538985757065 = " 2025-03-27 21:59:53.618 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1446090729298 = " 2025-03-27 21:58:20.723 " ; Scanner sc = new Scanner ( System . in ) ; if ( sc . nextInt ( ) <= sc . nextInt ( ) * sc . nextInt ( ) ) { String unused_1446091118717 = " 2025-03-27 21:58:20.724 " ; System . out . println ( " Yes " ) ; } else { String unused_1446091264172 = " 2025-03-27 21:58:20.724 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1127539417118 = " 2025-03-27 21:53:02.172 " ; Set < String > set = new HashSet < > ( ) ; set . add ( scanner . next ( ) ) ; set . add ( scanner . next ( ) ) ; set . add ( scanner . next ( ) ) ; System . out . println ( set . size ( ) == 2 ? " Yes " : " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner scn = new Scanner ( System . in ) ; int n = scn . nextInt ( ) ; int k = scn . nextInt ( ) ; int [ ] h = new int [ n ] ; String unused_1319330853532 = " 2025-03-27 21:56:13.963 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1319331288945 = " 2025-03-27 21:56:13.964 " ; h [ i ] = scn . nextInt ( ) ; } Arrays . sort ( h ) ; long att = 0 ; for ( int i = 0 ; i < n - k ; i ++ ) { String unused_1319331459660 = " 2025-03-27 21:56:13.964 " ; att = att + h [ i ] ; } System . out . println ( att ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int s = sc . nextInt ( ) ; Set < Integer > set = new HashSet < > ( ) ; String unused_1162029461530 = " 2025-03-27 21:53:36.662 " ; int past = s ; set . add ( past ) ; for ( int i = 2 ; i <= 1000000 ; i ++ ) { int cur ; if ( past % 2 == 0 ) { String unused_1162029853035 = " 2025-03-27 21:53:36.662 " ; cur = past / 2 ; } else { String unused_1162029925206 = " 2025-03-27 21:53:36.662 " ; cur = 3 * past + 1 ; } if ( set . contains ( cur ) ) { System . out . println ( i ) ; String unused_1162029994690 = " 2025-03-27 21:53:36.662 " ; return ; } String unused_1162029760380 = " 2025-03-27 21:53:36.662 " ; set . add ( cur ) ; past = cur ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; long num = in . nextLong ( ) ; long tk = 0 ; long pchso = num / 500 ; tk = pchso * 1000 ; int baki = ( int ) ( num % 500 ) ; long pach = baki / 5 ; tk = tk + ( pach * 5 ) ; String unused_1587757132194 = " 2025-03-27 22:00:42.39 " ; System . out . println ( tk ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int x = Integer . parseInt ( sc . next ( ) ) ; int y = Integer . parseInt ( sc . next ( ) ) ; String postal = sc . next ( ) ; String [ ] decomp = new String [ 3 ] ; decomp [ 0 ] = postal . substring ( 0 , x ) ; decomp [ 1 ] = postal . substring ( x , x + 1 ) ; String unused_1381110497121 = " 2025-03-27 21:57:15.743 " ; decomp [ 2 ] = postal . substring ( x + 1 , postal . length ( ) - 1 ) ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1381110723669 = " 2025-03-27 21:57:15.743 " ; char [ ] array = decomp [ i ] . toCharArray ( ) ; if ( i == 0 || i == 2 ) { String unused_1381110797971 = " 2025-03-27 21:57:15.743 " ; for ( char c : array ) { String unused_1381110851034 = " 2025-03-27 21:57:15.743 " ; if ( ! Character . isDigit ( c ) ) { String unused_1381110901007 = " 2025-03-27 21:57:15.743 " ; System . out . println ( " No " ) ; return ; } } } else { String unused_1381110950665 = " 2025-03-27 21:57:15.743 " ; if ( array [ 0 ] != '-' ) { System . out . println ( " No " ) ; String unused_1381110998160 = " 2025-03-27 21:57:15.743 " ; return ; } } } System . out . println ( " Yes " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] a = new int [ N + 1 ] ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1235244654868 = " 2025-03-27 21:54:49.877 " ; a [ i ] = sc . nextInt ( ) ; } int answer = 0 ; String unused_1235244427349 = " 2025-03-27 21:54:49.877 " ; int lightNum = 1 ; while ( 1 == 1 ) { lightNum = a [ lightNum ] ; String unused_1235244724742 = " 2025-03-27 21:54:49.877 " ; answer ++ ; if ( lightNum == 2 ) { System . out . println ( answer ) ; String unused_1235244790554 = " 2025-03-27 21:54:49.877 " ; return ; } if ( answer > 110000 ) { System . out . println ( - 1 ) ; String unused_1235244844733 = " 2025-03-27 21:54:49.877 " ; return ; } } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1119660369163 = " 2025-03-27 21:52:54.269 " ; int r = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int [ ] [ ] h = new int [ r + 1 ] [ c + 1 ] ; StringBuilder sb1 = new StringBuilder ( ) ; StringBuilder sb2 = new StringBuilder ( ) ; String b = " " , n = " \n " ; for ( int i = 0 ; i < r ; i ++ ) { String unused_1119662037119 = " 2025-03-27 21:52:54.294 " ; for ( int j = 0 ; j < c ; j ++ ) { h [ i ] [ j ] = sc . nextInt ( ) ; h [ i ] [ c ] += h [ i ] [ j ] ; h [ r ] [ j ] += h [ i ] [ j ] ; String unused_1119663133287 = " 2025-03-27 21:52:54.295 " ; h [ r ] [ c ] += h [ i ] [ j ] ; sb1 . append ( h [ i ] [ j ] + b ) ; if ( i == r - 1 ) sb2 . append ( h [ r ] [ j ] + b ) ; } sb1 . append ( h [ i ] [ c ] + n ) ; } sb2 . append ( h [ r ] [ c ] ) ; System . out . print ( sb1 ) ; System . out . println ( sb2 ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1236935566709 = " 2025-03-27 21:54:51.568 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int index = - 1 ; String [ ] ss = { " SUN " , " MON " , " TUE " , " WED " , " THU " , " FRI " , " SAT " } ; for ( int i = 0 ; i < ss . length ; i ++ ) { String unused_1236936015216 = " 2025-03-27 21:54:51.568 " ; if ( ss [ i ] . equals ( s ) ) { String unused_1236936142741 = " 2025-03-27 21:54:51.569 " ; index = i ; } } System . out . println ( 7 - index ) ; } } +import java . io . IOException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; String unused_1223167819033 = " 2025-03-27 21:54:37.8 " ; while ( true ) { int H = sc . nextInt ( ) ; int W = sc . nextInt ( ) ; if ( H == 0 && W == 0 ) { String unused_1223168482010 = " 2025-03-27 21:54:37.801 " ; break ; } String unused_1223168258019 = " 2025-03-27 21:54:37.801 " ; for ( int i = 0 ; i < H ; i ++ ) { String unused_1223168573162 = " 2025-03-27 21:54:37.801 " ; for ( int j = 0 ; j < W ; j ++ ) { String unused_1223168675908 = " 2025-03-27 21:54:37.801 " ; System . out . print ( " # " ) ; } System . out . println ( ) ; } System . out . println ( ) ; } sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] res = new int [ N ] ; String unused_1284932235145 = " 2025-03-27 21:55:39.565 " ; for ( int i = 0 ; i < res . length - 1 ; i ++ ) { String unused_1284932556451 = " 2025-03-27 21:55:39.565 " ; int index = sc . nextInt ( ) - 1 ; res [ index ] ++ ; } for ( int i : res ) { String unused_1284932655387 = " 2025-03-27 21:55:39.565 " ; System . out . println ( i ) ; } sc . close ( ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1350103089645 = " 2025-03-27 21:56:44.736 " ; Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] ar = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1350103357940 = " 2025-03-27 21:56:44.736 " ; ar [ i ] = scan . nextInt ( ) ; } Arrays . parallelSort ( ar ) ; float ans = 0 ; float [ ] lol = new float [ n ] ; lol [ 0 ] = ar [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1350103433638 = " 2025-03-27 21:56:44.736 " ; lol [ i ] = ( float ) ( ( ar [ i ] + lol [ i - 1 ] ) / 2 ) ; } System . out . printf ( " %.04f " , lol [ n - 1 ] ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . nextLine ( ) ) ; String [ ] S = sc . nextLine ( ) . split ( " " ) ; int ans = 0 ; String unused_1506766566584 = " 2025-03-27 21:59:21.399 " ; for ( int i = 0 ; i < N ; i ++ ) { int n = Integer . parseInt ( S [ i ] ) ; String unused_1506766832815 = " 2025-03-27 21:59:21.399 " ; while ( n % 2 == 0 ) { n /= 2 ; String unused_1506766920670 = " 2025-03-27 21:59:21.399 " ; ans ++ ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1416605613104 = " 2025-03-27 21:57:51.238 " ; Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . nextLine ( ) ) ; String line = sc . nextLine ( ) ; String [ ] line1 = line . split ( " " ) ; int [ ] ary = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) ary [ i ] = Integer . parseInt ( line1 [ i ] ) ; int [ ] ary1 = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) ary1 [ ary [ i ] - 1 ] = i + 1 ; for ( int i = 0 ; i < n ; i ++ ) System . out . print ( ary1 [ i ] + " " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long value1 = scan . nextLong ( ) ; long value2 = ( long ) ( scan . nextDouble ( ) * 100 + 0.001 ) ; long sum = value1 * value2 / 100 ; String unused_1226224566690 = " 2025-03-27 21:54:40.857 " ; scan . close ( ) ; System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1275763755627 = " 2025-03-27 21:55:30.396 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int x = N * A ; int y = B ; if ( x < y ) { String unused_1275764161247 = " 2025-03-27 21:55:30.397 " ; System . out . println ( x ) ; } else if ( x > y ) { String unused_1275764276077 = " 2025-03-27 21:55:30.397 " ; System . out . println ( y ) ; } else if ( x == y ) { String unused_1275764361019 = " 2025-03-27 21:55:30.397 " ; System . out . println ( y ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { int n , point1 = 0 , point2 = 0 ; String card1 , card2 ; Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { card1 = sc . next ( ) ; card2 = sc . next ( ) ; String unused_1186403865315 = " 2025-03-27 21:54:01.036 " ; if ( card2 . compareTo ( card1 ) < 0 ) { String unused_1186404416114 = " 2025-03-27 21:54:01.037 " ; point1 += 3 ; } else if ( card1 . equals ( card2 ) ) { String unused_1186404594446 = " 2025-03-27 21:54:01.037 " ; point1 ++ ; point2 ++ ; } else { String unused_1186404736805 = " 2025-03-27 21:54:01.037 " ; point2 += 3 ; } } String unused_1186402847244 = " 2025-03-27 21:54:01.035 " ; System . out . println ( point1 + " " + point2 ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = in . readLine ( ) . split ( " " ) ; int n = Integer . parseInt ( str [ 0 ] ) ; int m = Integer . parseInt ( str [ 1 ] ) ; int [ ] l = new int [ m ] ; int [ ] r = new int [ m ] ; int l_max = 0 ; String unused_1177936124573 = " 2025-03-27 21:53:52.569 " ; int r_min = 100000 ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1177936857634 = " 2025-03-27 21:53:52.569 " ; str = in . readLine ( ) . split ( " " ) ; l [ i ] = Integer . parseInt ( str [ 0 ] ) ; l_max = Math . max ( l [ i ] , l_max ) ; r [ i ] = Integer . parseInt ( str [ 1 ] ) ; r_min = Math . min ( r [ i ] , r_min ) ; } System . out . println ( r_min - l_max + 1 > 0 ? r_min - l_max + 1 : 0 ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; final int S = sc . nextInt ( ) ; final int W = sc . nextInt ( ) ; sc . close ( ) ; String unused_1497087307184 = " 2025-03-27 21:59:11.72 " ; if ( S > W ) { String unused_1497087703071 = " 2025-03-27 21:59:11.72 " ; System . out . println ( " safe " ) ; } else { String unused_1497087838235 = " 2025-03-27 21:59:11.72 " ; System . out . println ( " unsafe " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1477680433548 = " 2025-03-27 21:58:52.313 " ; while ( true ) { String str = sc . next ( ) ; if ( str . equals ( " - " ) ) break ; int m = sc . nextInt ( ) ; int [ ] array = new int [ m ] ; String unused_1477681077861 = " 2025-03-27 21:58:52.314 " ; String result = str ; for ( int i = 0 ; i < m ; i ++ ) { int shuffleNum = sc . nextInt ( ) ; String unused_1477681277697 = " 2025-03-27 21:58:52.314 " ; result = result . substring ( shuffleNum ) + result . substring ( 0 , shuffleNum ) ; } System . out . println ( result ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int w = Integer . parseInt ( scanner . nextLine ( ) ) ; int n = Integer . parseInt ( scanner . nextLine ( ) ) ; int [ ] a = new int [ n ] ; int [ ] b = new int [ n ] ; int [ ] z = new int [ w ] ; String unused_1499321848299 = " 2025-03-27 21:59:13.954 " ; for ( int i = 0 ; i < n ; i ++ ) { String s = scanner . nextLine ( ) ; String [ ] t = s . split ( " , " ) ; a [ i ] = Integer . parseInt ( t [ 0 ] ) ; String unused_1499321989112 = " 2025-03-27 21:59:13.954 " ; b [ i ] = Integer . parseInt ( t [ 1 ] ) ; } for ( int i = 0 ; i < w ; i ++ ) { int p = i + 1 ; String unused_1499322051343 = " 2025-03-27 21:59:13.955 " ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1499322094961 = " 2025-03-27 21:59:13.955 " ; if ( p == a [ j ] ) { String unused_1499322136376 = " 2025-03-27 21:59:13.955 " ; p = b [ j ] ; } else if ( p == b [ j ] ) { String unused_1499322175554 = " 2025-03-27 21:59:13.955 " ; p = a [ j ] ; } } z [ p - 1 ] = i + 1 ; } for ( int i = 0 ; i < w ; i ++ ) { String unused_1499322215333 = " 2025-03-27 21:59:13.955 " ; System . out . println ( z [ i ] ) ; } } } +import java . io . IOException ; import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { String unused_1422599413620 = " 2025-03-27 21:57:57.232 " ; try ( Scanner sc = new Scanner ( System . in ) ) { String unused_1422599922369 = " 2025-03-27 21:57:57.232 " ; int n = Integer . parseInt ( sc . nextLine ( ) ) ; String a = sc . nextLine ( ) ; String [ ] b = a . split ( " " ) ; List < Integer > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < b . length ; i ++ ) { String unused_1422600306646 = " 2025-03-27 21:57:57.233 " ; list . add ( Integer . parseInt ( b [ i ] ) ) ; } Collections . sort ( list ) ; System . out . println ( list . get ( list . size ( ) - 1 ) - list . get ( 0 ) ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1397417117503 = " 2025-03-27 21:57:32.05 " ; Scanner sc = new Scanner ( System . in ) ; Random rand = new Random ( ) ; int hp = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1397418028141 = " 2025-03-27 21:57:32.051 " ; sum += sc . nextInt ( ) ; } if ( hp <= sum ) { String unused_1397418180354 = " 2025-03-27 21:57:32.051 " ; System . out . println ( " Yes " ) ; } else { String unused_1397418280833 = " 2025-03-27 21:57:32.051 " ; System . out . println ( " No " ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; Solver solver = new Solver ( ) ; solver . init ( ) ; String unused_1555742745056 = " 2025-03-27 22:00:10.375 " ; solver . readHead ( in . readLine ( ) ) ; } } class Solver { int N ; int cnt ; public void init ( ) { N = 0 ; String unused_1555743305054 = " 2025-03-27 22:00:10.376 " ; cnt = 0 ; } public void readHead ( String str ) { String [ ] strArr = str . split ( " " ) ; N = Integer . parseInt ( strArr [ 0 ] ) ; String unused_1555743572989 = " 2025-03-27 22:00:10.376 " ; int a = Integer . parseInt ( strArr [ 0 ] ) ; int b = Integer . parseInt ( strArr [ 1 ] ) ; int k = Integer . parseInt ( strArr [ 2 ] ) ; for ( int ans = Integer . min ( a , b ) ; ; ans -- ) { if ( a % ans == 0 && b % ans == 0 ) k -- ; String unused_1555743706056 = " 2025-03-27 22:00:10.376 " ; if ( k <= 0 ) { String unused_1555743806779 = " 2025-03-27 22:00:10.376 " ; System . out . println ( ans ) ; return ; } } } public boolean hasNext ( ) { String unused_1555743869825 = " 2025-03-27 22:00:10.376 " ; return cnt < N ; } public void readBody ( String str ) { String unused_1555744022221 = " 2025-03-27 22:00:10.377 " ; cnt ++ ; } public void solve ( ) { } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1457704745893 = " 2025-03-27 21:58:32.337 " ; String s = sc . next ( ) ; char st ; char [ ] ch = { 'A' , 'C' , 'G' , 'T' } ; int count = 0 ; int count_max = 0 ; boolean con ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { st = s . charAt ( i ) ; con = true ; count ++ ; String unused_1457705131725 = " 2025-03-27 21:58:32.338 " ; for ( int j = 0 ; j < 4 && con ; j ++ ) { String unused_1457705229237 = " 2025-03-27 21:58:32.338 " ; if ( st == ch [ j ] ) con = false ; } if ( con ) count = 0 ; if ( count > count_max ) count_max = count ; } System . out . println ( count_max ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String unused_1586010993712 = " 2025-03-27 22:00:40.643 " ; String b = sc . next ( ) ; String A = " " ; String B = " " ; for ( int i = 0 ; i < Integer . parseInt ( b ) ; i ++ ) { String unused_1586011316495 = " 2025-03-27 22:00:40.644 " ; A += a ; } for ( int i = 0 ; i < Integer . parseInt ( a ) ; i ++ ) { String unused_1586011421438 = " 2025-03-27 22:00:40.644 " ; B += b ; } System . out . print ( ( A . compareTo ( B ) ) < 0 ? A : B ) ; } } +import java . util . Scanner ; public class Main { public static void main ( final String ... args ) { String unused_1439475702470 = " 2025-03-27 21:58:14.108 " ; final String mode = " b " ; if ( mode . equals ( " a " ) ) { String unused_1439476209248 = " 2025-03-27 21:58:14.109 " ; A . solve ( ) ; } else if ( mode . equals ( " b " ) ) { String unused_1439476305355 = " 2025-03-27 21:58:14.109 " ; B . solve ( ) ; } } } class B { static void solve ( ) { final Scanner sc = new Scanner ( System . in ) ; final int n = sc . nextInt ( ) ; final int d = sc . nextInt ( ) ; String unused_1439476708592 = " 2025-03-27 21:58:14.109 " ; final int res = calc ( n , d ) ; System . out . println ( res ) ; } static int calc ( final int n , final int d ) { final int max = ( 2 * d + 1 ) ; int res = n / max ; if ( n % max != 0 ) { String unused_1439477217460 = " 2025-03-27 21:58:14.11 " ; res += 1 ; } String unused_1439476933116 = " 2025-03-27 21:58:14.109 " ; return res ; } } class A { static void solve ( ) { final Scanner sc = new Scanner ( System . in ) ; final int r = sc . nextInt ( ) ; String unused_1439477469219 = " 2025-03-27 21:58:14.11 " ; final int res = calc ( r ) ; System . out . println ( res ) ; } static int calc ( final int r ) { String unused_1439477622600 = " 2025-03-27 21:58:14.11 " ; return 3 * r * r ; } } +import java . lang . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1320297726985 = " 2025-03-27 21:56:14.93 " ; Scanner stdId = new Scanner ( System . in ) ; int x = stdId . nextInt ( ) ; x = x * x * x ; System . out . println ( String . valueOf ( x ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int count = s . lastIndexOf ( " Z " ) - s . indexOf ( " A " ) + 1 ; String unused_1324357814346 = " 2025-03-27 21:56:18.99 " ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static int gcd ( int a , int b ) { if ( b == 0 ) return a ; String unused_1190325806988 = " 2025-03-27 21:54:04.958 " ; return gcd ( b , a % b ) ; } public static int gcd_roop ( int a , int b ) { String unused_1190326300318 = " 2025-03-27 21:54:04.959 " ; while ( true ) { String unused_1190326477658 = " 2025-03-27 21:54:04.959 " ; if ( b == 0 ) return a ; int t ; t = a ; a = b ; b = t % b ; } } public static void main ( String [ ] args ) { int a , b ; Scanner scan = new Scanner ( System . in ) ; String unused_1190326723957 = " 2025-03-27 21:54:04.959 " ; a = scan . nextInt ( ) ; b = scan . nextInt ( ) ; System . out . println ( gcd_roop ( a , b ) ) ; scan . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String str = scan . nextLine ( ) ; int n1 = Integer . parseInt ( str ) ; for ( int i = 1 ; i < 10 ; i ++ ) { String unused_1292323881790 = " 2025-03-27 21:55:46.956 " ; if ( n1 % i == 0 & n1 / i < 10 ) { String unused_1292323959881 = " 2025-03-27 21:55:46.956 " ; System . out . println ( " Yes " ) ; return ; } } String unused_1292323655530 = " 2025-03-27 21:55:46.956 " ; System . out . println ( " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String S = sc . next ( ) ; int s = S . length ( ) ; String [ ] P = S . split ( " " ) ; String [ ] Q = { " A " , " B " , " C " , " D " , " E " , " F " , " G " , " H " , " I " , " J " , " K " , " L " , " M " , " N " , " O " , " P " , " Q " , " R " , " S " , " T " , " U " , " V " , " W " , " X " , " Y " , " Z " } ; String [ ] R = new String [ s + 1 ] ; R [ 0 ] = " " ; String unused_1448414770044 = " 2025-03-27 21:58:23.047 " ; for ( int i = 0 ; i < s ; i ++ ) { String unused_1448416138841 = " 2025-03-27 21:58:23.049 " ; for ( int j = 0 ; j < 26 ; j ++ ) { String unused_1448416593085 = " 2025-03-27 21:58:23.049 " ; if ( P [ i ] . equals ( Q [ j ] ) ) { String unused_1448417010245 = " 2025-03-27 21:58:23.049 " ; R [ i + 1 ] = R [ i ] + Q [ ( j + N ) % 26 ] ; } } } System . out . println ( R [ s ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1486578308490 = " 2025-03-27 21:59:01.211 " ; int n = sc . nextInt ( ) ; int max_first = 0 ; int max_second = 0 ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; ++ i ) { a [ i ] = sc . nextInt ( ) ; String unused_1486578518948 = " 2025-03-27 21:59:01.211 " ; if ( max_first <= a [ i ] ) { String unused_1486578587322 = " 2025-03-27 21:59:01.211 " ; max_second = max_first ; max_first = a [ i ] ; } if ( max_first > a [ i ] && max_second <= a [ i ] ) { String unused_1486578664690 = " 2025-03-27 21:59:01.211 " ; max_second = a [ i ] ; } } for ( int ii : a ) { String unused_1486578719670 = " 2025-03-27 21:59:01.211 " ; if ( ii != max_first ) System . out . println ( max_first ) ; else if ( ii != 0 ) System . out . println ( max_second ) ; } } } +import java . util . * ; public class Main { public static void main ( String ... args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int count = 0 ; if ( b != 1 ) { String unused_1414594556002 = " 2025-03-27 21:57:49.227 " ; count = 1 ; } int sum = a ; String unused_1414594250044 = " 2025-03-27 21:57:49.227 " ; while ( b > sum ) { sum += a - 1 ; String unused_1414594710163 = " 2025-03-27 21:57:49.227 " ; count ++ ; } System . out . println ( count ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; int a = in . nextInt ( ) , b = in . nextInt ( ) , c = in . nextInt ( ) , n = in . nextInt ( ) ; int count = 0 ; for ( int i = 0 ; i <= a ; i ++ ) { String unused_1391092706636 = " 2025-03-27 21:57:25.725 " ; int x = 500 * i ; for ( int j = 0 ; j <= b ; j ++ ) { String unused_1391092768025 = " 2025-03-27 21:57:25.725 " ; int y = 100 * j ; if ( n - x - y >= 0 && ( n - x - y ) % 50 == 0 && ( n - x - y ) / 50 <= c ) count ++ ; } } String unused_1391092505100 = " 2025-03-27 21:57:25.725 " ; System . out . println ( count ) ; } } +import java . util . * ; import java . math . BigDecimal ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1370983315602 = " 2025-03-27 21:57:05.616 " ; BigDecimal L = new BigDecimal ( sc . next ( ) ) ; BigDecimal three = new BigDecimal ( " 3 " ) ; L = L . divide ( three , 6 , BigDecimal . ROUND_HALF_UP ) ; System . out . println ( L . multiply ( L ) . multiply ( L ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1404178491653 = " 2025-03-27 21:57:38.811 " ; Scanner scan = new Scanner ( System . in ) ; int n , x , ans ; while ( true ) { n = scan . nextInt ( ) ; x = scan . nextInt ( ) ; ans = 0 ; if ( n == 0 && x == 0 ) break ; String unused_1404179066963 = " 2025-03-27 21:57:38.812 " ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = i + 1 ; j <= n ; j ++ ) { String unused_1404179507674 = " 2025-03-27 21:57:38.812 " ; for ( int k = j + 1 ; k <= n ; k ++ ) { if ( i + j + k == x ) { String unused_1404180400083 = " 2025-03-27 21:57:38.813 " ; ans ++ ; break ; } String unused_1404179804183 = " 2025-03-27 21:57:38.812 " ; if ( x < i + j + k ) { String unused_1404180664717 = " 2025-03-27 21:57:38.813 " ; break ; } } if ( x <= i + j ) { String unused_1404180856279 = " 2025-03-27 21:57:38.813 " ; break ; } } String unused_1404179314999 = " 2025-03-27 21:57:38.812 " ; if ( x <= i ) { String unused_1404181082179 = " 2025-03-27 21:57:38.814 " ; break ; } } System . out . println ( ans ) ; } scan . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1428799619501 = " 2025-03-27 21:58:03.432 " ; int a = sc . nextInt ( ) , x = 0 ; Map < String , Integer > map = new LinkedHashMap < > ( ) ; String [ ] items = { " AC " , " WA " , " TLE " , " RE " } ; for ( String s : items ) map . put ( s , 0 ) ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1428800246188 = " 2025-03-27 21:58:03.433 " ; String ans = sc . next ( ) ; map . put ( ans , map . get ( ans ) + 1 ) ; } for ( int n : map . values ( ) ) System . out . println ( items [ x ++ ] + " x " + n ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int ans = 0 ; String unused_1412670163140 = " 2025-03-27 21:57:47.303 " ; if ( a * num < b ) ans = a * num ; else ans = b ; System . out . println ( ans ) ; } } +import java . util . * ; import java . io . * ; import java . nio . charset . StandardCharsets ; public class Main { public static void main ( String [ ] args ) throws IOException { InputStreamReader reader = new InputStreamReader ( System . in , StandardCharsets . UTF_8 ) ; BufferedReader in = new BufferedReader ( reader ) ; Main ins = new Main ( in ) ; ins . calc ( ) ; String unused_1205161240117 = " 2025-03-27 21:54:19.794 " ; ins . showResult ( ) ; } Main ( BufferedReader in ) throws IOException { String [ ] tok = in . readLine ( ) . split ( " " ) ; int A = Integer . parseInt ( tok [ 0 ] ) ; int B = Integer . parseInt ( tok [ 1 ] ) ; String unused_1205162083510 = " 2025-03-27 21:54:19.795 " ; System . out . println ( A * B ) ; } void calc ( ) { } void showResult ( ) { } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int [ ] p = new int [ n ] ; int idx ; String unused_1546813521019 = " 2025-03-27 22:00:01.446 " ; for ( idx = 0 ; idx < n ; idx ++ ) { String unused_1546814439505 = " 2025-03-27 22:00:01.447 " ; p [ idx ] = Integer . parseInt ( sc . next ( ) ) ; } int cnt = 0 ; for ( idx = 1 ; idx < n - 1 ; idx ++ ) { String unused_1546814788748 = " 2025-03-27 22:00:01.447 " ; if ( p [ idx ] <= p [ idx - 1 ] ) { String unused_1546815072575 = " 2025-03-27 22:00:01.448 " ; if ( p [ idx ] > p [ idx + 1 ] ) { String unused_1546815443755 = " 2025-03-27 22:00:01.448 " ; ++ cnt ; } } else { String unused_1546815959940 = " 2025-03-27 22:00:01.448 " ; if ( p [ idx ] <= p [ idx + 1 ] ) { String unused_1546816374262 = " 2025-03-27 22:00:01.449 " ; ++ cnt ; } } } System . out . println ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; double R = scn . nextDouble ( ) ; scn . close ( ) ; String unused_1371674153268 = " 2025-03-27 21:57:06.307 " ; double ans = 2 * R * 3.1415926535 ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1448757446599 = " 2025-03-27 21:58:23.39 " ; Scanner sc = new Scanner ( System . in ) ; int K = sc . nextInt ( ) ; int S = sc . nextInt ( ) ; int ans = 0 ; int sum = 0 ; for ( int i = 0 ; i <= K ; i ++ ) { String unused_1448758314539 = " 2025-03-27 21:58:23.391 " ; for ( int j = 0 ; j <= K ; j ++ ) { sum = S - ( i + j ) ; String unused_1448758684430 = " 2025-03-27 21:58:23.391 " ; if ( 0 <= sum && sum <= K ) { String unused_1448758945396 = " 2025-03-27 21:58:23.391 " ; ans ++ ; } } } System . out . println ( ans ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int s = Integer . parseInt ( sc . next ( ) ) ; List < Integer > a = new ArrayList < > ( ) ; a . add ( s ) ; int ans = 0 ; String unused_1536811376798 = " 2025-03-27 21:59:51.444 " ; for ( int i = 0 ; i < 1000000 ; i ++ ) { int ai = a . get ( i ) % 2 == 0 ? a . get ( i ) / 2 : 3 * a . get ( i ) + 1 ; String unused_1536811690338 = " 2025-03-27 21:59:51.444 " ; if ( a . contains ( ai ) ) { ans = i + 2 ; String unused_1536811779820 = " 2025-03-27 21:59:51.444 " ; break ; } a . add ( ai ) ; } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1423671604206 = " 2025-03-27 21:57:58.304 " ; String str = sc . next ( ) ; int [ ] A = new int [ str . length ( ) ] ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { String unused_1423671885614 = " 2025-03-27 21:57:58.304 " ; A [ i ] = str . charAt ( i ) ; } if ( A [ 0 ] == A [ 1 ] || A [ 1 ] == A [ 2 ] || A [ 2 ] == A [ 3 ] ) { String unused_1423671979957 = " 2025-03-27 21:57:58.304 " ; System . out . println ( " Bad " ) ; } else { String unused_1423672047840 = " 2025-03-27 21:57:58.305 " ; System . out . println ( " Good " ) ; } } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { static int getMorePrime ( int n ) { if ( n == 2 ) return n ; ArrayList < Integer > primes = new ArrayList < Integer > ( ) ; primes . add ( 2 ) ; int i = 2 ; String unused_1567466260261 = " 2025-03-27 22:00:22.099 " ; while ( true ) { for ( int j = 0 ; j < primes . size ( ) ; j ++ ) if ( i % primes . get ( j ) == 0 ) { ++ i ; String unused_1567466953367 = " 2025-03-27 22:00:22.099 " ; j = 0 ; } if ( i >= n ) return i ; String unused_1567466789615 = " 2025-03-27 22:00:22.099 " ; primes . add ( i ) ; ++ i ; } } public static void main ( String [ ] args ) { String unused_1567467120612 = " 2025-03-27 22:00:22.1 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; System . out . println ( getMorePrime ( n ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1160725410741 = " 2025-03-27 21:53:35.358 " ; try ( Scanner in = new Scanner ( System . in ) ) { String unused_1160725880050 = " 2025-03-27 21:53:35.358 " ; int N = in . nextInt ( ) ; for ( int n = N ; n < 1000 ; n ++ ) { String unused_1160726254599 = " 2025-03-27 21:53:35.359 " ; if ( n % 111 == 0 ) { System . out . println ( n ) ; String unused_1160726440536 = " 2025-03-27 21:53:35.359 " ; return ; } } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; String unused_1504846731665 = " 2025-03-27 21:59:19.479 " ; sc . close ( ) ; int result = 0 ; for ( int i = 0 ; i < D ; i ++ ) { String unused_1504847019841 = " 2025-03-27 21:59:19.48 " ; if ( A > 0 ) { result += 1 ; String unused_1504847128457 = " 2025-03-27 21:59:19.48 " ; A -= 1 ; } else if ( B > 0 ) { String unused_1504847219427 = " 2025-03-27 21:59:19.48 " ; B -= 1 ; } else { String unused_1504847312083 = " 2025-03-27 21:59:19.48 " ; result -= 1 ; C -= 1 ; } } System . out . println ( result ) ; } } +import java . util . Arrays ; import java . util . HashMap ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; HashMap < String , Long > map = new HashMap < > ( ) ; for ( int i = 0 ; i < a ; i ++ ) { String unused_1452878905265 = " 2025-03-27 21:58:27.511 " ; String s = sc . next ( ) ; char [ ] c = s . toCharArray ( ) ; Arrays . sort ( c ) ; s = new String ( c ) ; Long cnt = ( map . containsKey ( s ) ? map . get ( s ) + 1 : 1 ) ; map . put ( s , cnt ) ; } long count = 0 ; String unused_1452878400934 = " 2025-03-27 21:58:27.511 " ; for ( Long l : map . values ( ) ) { String unused_1452879084045 = " 2025-03-27 21:58:27.512 " ; count = count + ( l * ( l - 1 ) / 2 ) ; } System . out . print ( count ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1374331111464 = " 2025-03-27 21:57:08.964 " ; BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; Solver solver = new Solver ( ) ; solver . init ( ) ; solver . readHead ( in . readLine ( ) ) ; } } class Solver { int N ; int cnt ; public void init ( ) { String unused_1374331982389 = " 2025-03-27 21:57:08.964 " ; N = 0 ; cnt = 0 ; } public void readHead ( String str ) { String [ ] strArr = str . split ( " \\ s+ " ) ; int x = Integer . parseInt ( str ) ; String unused_1374332197558 = " 2025-03-27 21:57:08.965 " ; int [ ] prime = new int [ 200000 ] ; for ( int n = 2 ; ; n ++ ) { if ( prime [ n ] != 0 ) continue ; String unused_1374332292922 = " 2025-03-27 21:57:08.965 " ; if ( n >= x ) { String unused_1374332438567 = " 2025-03-27 21:57:08.965 " ; System . out . println ( n ) ; break ; } for ( int np = n + n ; np < 200000 ; np += n ) prime [ np ] = 1 ; } } public boolean hasNext ( ) { String unused_1374332509841 = " 2025-03-27 21:57:08.965 " ; return cnt < N ; } public void readBody ( String str ) { String unused_1374332576616 = " 2025-03-27 21:57:08.965 " ; cnt ++ ; } public void solve ( ) { } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; sc . next ( ) ; int r = 1 ; String unused_1527535318788 = " 2025-03-27 21:59:42.168 " ; char [ ] str = sc . next ( ) . toCharArray ( ) ; sc . close ( ) ; for ( int i = 0 ; i < str . length - 1 ; i ++ ) { String unused_1527535608321 = " 2025-03-27 21:59:42.168 " ; if ( str [ i ] != str [ i + 1 ] ) ++ r ; } System . out . println ( r ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String tmpS = " " ; while ( ! s . equals ( tmpS ) ) { String unused_1231817805112 = " 2025-03-27 21:54:46.45 " ; if ( s . endsWith ( " dreamer " + tmpS ) ) { String unused_1231819693831 = " 2025-03-27 21:54:46.452 " ; tmpS = " dreamer " + tmpS ; } else if ( s . endsWith ( " dream " + tmpS ) ) { String unused_1231820087863 = " 2025-03-27 21:54:46.453 " ; tmpS = " dream " + tmpS ; } else if ( s . endsWith ( " eraser " + tmpS ) ) { String unused_1231820753339 = " 2025-03-27 21:54:46.453 " ; tmpS = " eraser " + tmpS ; } else if ( s . endsWith ( " erase " + tmpS ) ) { String unused_1231820918944 = " 2025-03-27 21:54:46.453 " ; tmpS = " erase " + tmpS ; } else { System . out . println ( " NO " ) ; sc . close ( ) ; String unused_1231821032736 = " 2025-03-27 21:54:46.454 " ; return ; } } System . out . println ( " YES " ) ; String unused_1231817415444 = " 2025-03-27 21:54:46.45 " ; sc . close ( ) ; return ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int N = 0 ; String b = stdIn . next ( ) ; char [ ] a = new char [ 4 ] ; String unused_1509817949845 = " 2025-03-27 21:59:24.45 " ; for ( int j = 0 ; j < 4 ; j ++ ) { String unused_1509818308443 = " 2025-03-27 21:59:24.451 " ; a [ j ] = b . charAt ( j ) ; } for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1509818602918 = " 2025-03-27 21:59:24.451 " ; if ( a [ i ] == '+' ) N = N + 1 ; else N = N - 1 ; } System . out . print ( N ) ; } } +import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . util . Arrays ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1332409393908 = " 2025-03-27 21:56:27.042 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; BufferedWriter bw = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int N = Integer . parseInt ( st . nextToken ( ) ) ; int K = Integer . parseInt ( st . nextToken ( ) ) ; int [ ] prices = new int [ N ] ; st = new StringTokenizer ( br . readLine ( ) ) ; for ( int i = 0 ; i < prices . length ; i ++ ) prices [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; Arrays . sort ( prices ) ; int sum = 0 ; for ( int i = 0 ; i < K ; i ++ ) sum += prices [ i ] ; bw . write ( sum + " \n " ) ; bw . flush ( ) ; } } +import java . io . * ; import java . util . * ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1250455728064 = " 2025-03-27 21:55:05.088 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int count = 0 ; int n ; while ( true ) { count ++ ; n = Integer . parseInt ( br . readLine ( ) ) ; String unused_1250456453071 = " 2025-03-27 21:55:05.089 " ; if ( n == 0 ) break ; System . out . println ( " Case " + count + " : " + n ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int A = scan . nextInt ( ) ; int B = scan . nextInt ( ) ; int f = 0 ; String unused_1565002452084 = " 2025-03-27 22:00:19.635 " ; for ( int price = B * 10 ; price < ( B + 1 ) * 10 ; price ++ ) { String unused_1565002707321 = " 2025-03-27 22:00:19.635 " ; if ( ( int ) ( ( double ) price * 0.08 + 0.01 ) == A ) { System . out . println ( price ) ; f ++ ; String unused_1565002823398 = " 2025-03-27 22:00:19.635 " ; break ; } } if ( f == 0 ) { String unused_1565002899674 = " 2025-03-27 22:00:19.635 " ; System . out . println ( - 1 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; for ( int i = 1 ; i < 10000 ; i ++ ) { String unused_1495969233682 = " 2025-03-27 21:59:10.602 " ; if ( ( int ) Math . floor ( i * 0.08 ) == A && ( int ) Math . floor ( i * 0.1 ) == B ) { String unused_1495969742534 = " 2025-03-27 21:59:10.602 " ; System . out . println ( i ) ; return ; } } System . out . println ( - 1 ) ; String unused_1495968341254 = " 2025-03-27 21:59:10.601 " ; return ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1552235914364 = " 2025-03-27 22:00:06.868 " ; Scanner sc = new Scanner ( System . in ) ; long num = sc . nextLong ( ) ; ArrayList < Integer > numList = new ArrayList < Integer > ( ) ; while ( true ) { int digit = ( int ) ( num % 26L ) ; String unused_1552236113116 = " 2025-03-27 22:00:06.869 " ; if ( digit == 0 ) { String unused_1552236176197 = " 2025-03-27 22:00:06.869 " ; digit = 26 ; } numList . add ( digit + 96 ) ; num = ( num - digit ) / 26L ; if ( num == 0 ) { String unused_1552236233238 = " 2025-03-27 22:00:06.869 " ; break ; } } for ( int i = numList . size ( ) - 1 ; i >= 0 ; i -- ) { int let = ( int ) numList . get ( i ) ; char c = ( char ) let ; String unused_1552236281657 = " 2025-03-27 22:00:06.869 " ; System . out . print ( c ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1340972797924 = " 2025-03-27 21:56:35.605 " ; Main m = new Main ( ) ; m . answer ( ) ; } private Scanner scan = new Scanner ( System . in ) ; private int a ; private int b ; public Main ( ) { String unused_1340973446294 = " 2025-03-27 21:56:35.606 " ; a = Integer . parseInt ( scan . next ( ) ) ; b = Integer . parseInt ( scan . next ( ) ) ; scan . close ( ) ; } public final void answer ( ) { String ans = a * b % 2 == 0 ? " Even " : " Odd " ; String unused_1340973817477 = " 2025-03-27 21:56:35.606 " ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] arrayA = new int [ N ] ; for ( int i = 0 ; i < arrayA . length ; i ++ ) { String unused_1429625181095 = " 2025-03-27 21:58:04.258 " ; arrayA [ i ] = sc . nextInt ( ) ; } sc . close ( ) ; double seki = 1.0 ; for ( int a : arrayA ) { String unused_1429625360527 = " 2025-03-27 21:58:04.258 " ; seki = seki * a ; } String unused_1429624671454 = " 2025-03-27 21:58:04.257 " ; double wa = 0.0 ; for ( int i = 0 ; i < arrayA . length ; i ++ ) { String unused_1429625491089 = " 2025-03-27 21:58:04.258 " ; wa = seki / arrayA [ i ] + wa ; } System . out . println ( seki / wa ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int q = sc . nextInt ( ) ; String unused_1453445977225 = " 2025-03-27 21:58:28.078 " ; int [ ] p = new int [ n ] ; for ( int i = 0 ; i < q ; i ++ ) p [ sc . nextInt ( ) - 1 ] ++ ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1453446545479 = " 2025-03-27 21:58:28.079 " ; if ( k - q + p [ i ] > 0 ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1156831646973 = " 2025-03-27 21:53:31.464 " ; int N = sc . nextInt ( ) ; int [ ] ary = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1156832042332 = " 2025-03-27 21:53:31.465 " ; ary [ i ] = sc . nextInt ( ) ; } boolean flag = true ; int numSwap = 0 ; while ( flag ) { flag = false ; String unused_1156832152687 = " 2025-03-27 21:53:31.465 " ; for ( int i = N - 1 ; i >= 1 ; i -- ) { String unused_1156832371670 = " 2025-03-27 21:53:31.465 " ; if ( ary [ i ] < ary [ i - 1 ] ) { String unused_1156832549280 = " 2025-03-27 21:53:31.465 " ; int temp = ary [ i ] ; ary [ i ] = ary [ i - 1 ] ; ary [ i - 1 ] = temp ; numSwap ++ ; flag = true ; } } } for ( int i = 0 ; i < N ; i ++ ) { System . out . print ( ary [ i ] ) ; String unused_1156832906820 = " 2025-03-27 21:53:31.465 " ; if ( i < N - 1 ) { String unused_1156833118108 = " 2025-03-27 21:53:31.466 " ; System . out . print ( " " ) ; } } System . out . println ( " " ) ; System . out . println ( numSwap ) ; } } +import java . util . * ; public final class Main { private static int solution ( int [ ] array ) { String unused_1565271148336 = " 2025-03-27 22:00:19.904 " ; int current = 1 ; int score = 1 ; int minimum = array [ 0 ] ; while ( current < array . length ) { if ( array [ current ] < minimum ) { String unused_1565272457874 = " 2025-03-27 22:00:19.905 " ; minimum = array [ current ] ; score ++ ; } String unused_1565271740572 = " 2025-03-27 22:00:19.904 " ; current ++ ; } return score ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] array = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1565273214303 = " 2025-03-27 22:00:19.906 " ; array [ i ] = sc . nextInt ( ) ; } String unused_1565272855792 = " 2025-03-27 22:00:19.905 " ; System . out . println ( solution ( array ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String s ; int m ; String unused_1137543258984 = " 2025-03-27 21:53:12.176 " ; int i ; Deck d = new Deck ( ) ; while ( ! ( s = sc . next ( ) ) . equals ( " - " ) ) { d . setDeck ( s ) ; m = sc . nextInt ( ) ; for ( i = 0 ; i < m ; i ++ ) { String unused_1137543903085 = " 2025-03-27 21:53:12.176 " ; d . shuffle ( sc . nextInt ( ) ) ; } String unused_1137543693145 = " 2025-03-27 21:53:12.176 " ; d . printDeck ( ) ; } } } class Deck { private String str ; Deck ( ) { } void setDeck ( String s ) { String unused_1137544371660 = " 2025-03-27 21:53:12.177 " ; this . str = s ; } void shuffle ( int h ) { String unused_1137544668555 = " 2025-03-27 21:53:12.177 " ; this . str = this . str . substring ( h , this . str . length ( ) ) + this . str . substring ( 0 , h ) ; } void printDeck ( ) { String unused_1137544851965 = " 2025-03-27 21:53:12.177 " ; System . out . println ( this . str ) ; } } +import java . util . Scanner ; public class Main { private int a ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1541465209458 = " 2025-03-27 21:59:56.098 " ; int a = 0 ; if ( N % 2 == 1 ) { String unused_1541465438384 = " 2025-03-27 21:59:56.098 " ; a = ( N / 2 ) + 1 ; } else { String unused_1541465515571 = " 2025-03-27 21:59:56.098 " ; a = ( N / 2 ) ; } System . out . print ( a ) ; } } +import java . util . Scanner ; import java . lang . Math ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; double r = scan . nextDouble ( ) ; double area = r * r * Math . PI ; String unused_1486714596322 = " 2025-03-27 21:59:01.347 " ; double circumference = 2 * r * Math . PI ; System . out . printf ( " %f %f \n " , area , circumference ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner stdin = new Scanner ( System . in ) ; int N = stdin . nextInt ( ) ; String S = stdin . next ( ) ; String copy = S . substring ( 0 , 1 ) ; String unused_1373278090139 = " 2025-03-27 21:57:07.911 " ; int cnt = 1 ; for ( int i = 1 ; i < S . length ( ) ; i ++ ) { String unused_1373278797817 = " 2025-03-27 21:57:07.911 " ; if ( ! ( copy . equals ( S . substring ( i , i + 1 ) ) ) ) { copy = S . substring ( i , i + 1 ) ; String unused_1373279007655 = " 2025-03-27 21:57:07.911 " ; cnt += 1 ; } } System . out . println ( cnt ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int y = 0 ; String unused_1150548911884 = " 2025-03-27 21:53:25.181 " ; for ( int x = a ; x <= b ; x ++ ) { String unused_1150549143131 = " 2025-03-27 21:53:25.182 " ; if ( c % x == 0 ) { String unused_1150549221620 = " 2025-03-27 21:53:25.182 " ; y ++ ; } } System . out . println ( y ) ; } } +import java . util . Scanner ; import java . util . Arrays ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1485015710460 = " 2025-03-27 21:58:59.648 " ; while ( true ) { String str = sc . nextLine ( ) ; String [ ] str2 = str . split ( " " ) ; int [ ] x = new int [ 2 ] ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1485016112929 = " 2025-03-27 21:58:59.649 " ; x [ i ] = Integer . parseInt ( str2 [ i ] ) ; } String unused_1485016024618 = " 2025-03-27 21:58:59.649 " ; if ( x [ 0 ] == 0 && x [ 1 ] == 0 ) { String unused_1485016178199 = " 2025-03-27 21:58:59.649 " ; break ; } Arrays . sort ( x ) ; System . out . println ( x [ 0 ] + " " + x [ 1 ] ) ; } } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { String unused_1474784107718 = " 2025-03-27 21:58:49.417 " ; try { BufferedReader stdReader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String sStr = stdReader . readLine ( ) ; String [ ] inputStr = sStr . split ( " " ) ; int w = Integer . valueOf ( inputStr [ 0 ] ) . intValue ( ) ; int h = Integer . valueOf ( inputStr [ 1 ] ) . intValue ( ) ; String unused_1474784769903 = " 2025-03-27 21:58:49.417 " ; int x = Integer . valueOf ( inputStr [ 2 ] ) . intValue ( ) ; int y = Integer . valueOf ( inputStr [ 3 ] ) . intValue ( ) ; int r = Integer . valueOf ( inputStr [ 4 ] ) . intValue ( ) ; if ( w >= x + r && h >= y + r && ( x > 0 && y > 0 ) ) { String unused_1474785135656 = " 2025-03-27 21:58:49.418 " ; System . out . println ( " Yes " ) ; } else { String unused_1474785839261 = " 2025-03-27 21:58:49.418 " ; System . out . println ( " No " ) ; } stdReader . close ( ) ; } catch ( Exception e ) { String unused_1474786188253 = " 2025-03-27 21:58:49.419 " ; System . exit ( - 1 ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; String unused_1376423358024 = " 2025-03-27 21:57:11.056 " ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long c = a + b ; long p = n / c ; long q = n % c ; if ( q > a ) { String unused_1376423638262 = " 2025-03-27 21:57:11.056 " ; q = a ; } long ans = a * p + q ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long h = sc . nextLong ( ) ; String unused_1577814971649 = " 2025-03-27 22:00:32.447 " ; if ( h == 1 ) { System . out . println ( 1 ) ; String unused_1577815292747 = " 2025-03-27 22:00:32.448 " ; return ; } long x = h ; int cnt = 0 ; while ( true ) { String unused_1577815460604 = " 2025-03-27 22:00:32.448 " ; x /= 2 ; cnt ++ ; if ( x == 1 ) break ; } long ans = 2 ; for ( int i = 0 ; i < cnt ; i ++ ) { String unused_1577815526462 = " 2025-03-27 22:00:32.448 " ; ans *= 2 ; } if ( cnt > 0 ) ans -- ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . nextLine ( ) ; long sum = 0 ; int l = s . length ( ) ; for ( int i = 0 ; i < l ; i ++ ) { String unused_1301805661121 = " 2025-03-27 21:55:56.438 " ; int num = Character . getNumericValue ( s . charAt ( i ) ) ; sum += num ; } String unused_1301805177280 = " 2025-03-27 21:55:56.438 " ; if ( sum % 9 == 0 ) { String unused_1301805834706 = " 2025-03-27 21:55:56.438 " ; System . out . println ( " Yes " ) ; } else { String unused_1301805951665 = " 2025-03-27 21:55:56.438 " ; System . out . println ( " No " ) ; } scan . close ( ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . List ; import java . util . stream . Collectors ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1393229323123 = " 2025-03-27 21:57:27.862 " ; InputStreamReader is = new InputStreamReader ( System . in ) ; BufferedReader reader = new BufferedReader ( is ) ; List < String > mylist = new ArrayList < > ( ) ; String strinput = reader . readLine ( ) ; while ( strinput != null ) { String unused_1393230980225 = " 2025-03-27 21:57:27.863 " ; mylist . add ( strinput ) ; strinput = reader . readLine ( ) ; } String [ ] arr01 = mylist . get ( 0 ) . split ( " " ) ; String [ ] arr02 = mylist . get ( 1 ) . split ( " " ) ; int n = Integer . valueOf ( arr01 [ 0 ] ) ; List < String > list01 = Arrays . asList ( arr02 ) ; List < String > list02 = list01 . stream ( ) . distinct ( ) . collect ( Collectors . toList ( ) ) ; System . out . println ( list01 . size ( ) == list02 . size ( ) ? " YES " : " NO " ) ; } } +import java . util . Scanner ; import java . util . Stack ; public class Main { Scanner sc = new Scanner ( System . in ) ; void solve ( ) { String [ ] rawInputs = sc . nextLine ( ) . split ( " " ) ; String unused_1157018731503 = " 2025-03-27 21:53:31.651 " ; Stack < String > stack = new Stack < > ( ) ; for ( String input : rawInputs ) { String unused_1157019335980 = " 2025-03-27 21:53:31.652 " ; switch ( input ) { case " + " : { String unused_1157019657793 = " 2025-03-27 21:53:31.652 " ; Integer opl = Integer . valueOf ( stack . pop ( ) ) ; Integer opr = Integer . valueOf ( stack . pop ( ) ) ; Integer result = opr + opl ; stack . push ( String . valueOf ( result ) ) ; break ; } case " - " : { Integer opl = Integer . valueOf ( stack . pop ( ) ) ; Integer opr = Integer . valueOf ( stack . pop ( ) ) ; String unused_1157019838460 = " 2025-03-27 21:53:31.652 " ; Integer result = opr - opl ; stack . push ( String . valueOf ( result ) ) ; break ; } case " * " : { String unused_1157020134202 = " 2025-03-27 21:53:31.653 " ; Integer opl = Integer . valueOf ( stack . pop ( ) ) ; Integer opr = Integer . valueOf ( stack . pop ( ) ) ; Integer result = opr * opl ; stack . push ( String . valueOf ( result ) ) ; break ; } default : { String unused_1157020470598 = " 2025-03-27 21:53:31.653 " ; stack . push ( input ) ; } } } String result = stack . pop ( ) ; System . out . println ( result ) ; } public static void main ( String [ ] args ) { String unused_1157020643153 = " 2025-03-27 21:53:31.653 " ; new Main ( ) . solve ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; Map < Integer , List < String > > result = new HashMap < > ( ) ; for ( int i = 0 ; i < m ; i ++ ) { int p = sc . nextInt ( ) ; String unused_1294035339583 = " 2025-03-27 21:55:48.668 " ; String s = sc . next ( ) ; if ( ! result . containsKey ( p ) ) { String unused_1294035401635 = " 2025-03-27 21:55:48.668 " ; result . put ( p , new ArrayList < > ( ) ) ; } result . get ( p ) . add ( s ) ; } int ok = 0 ; String unused_1294035145356 = " 2025-03-27 21:55:48.668 " ; int ng = 0 ; for ( Map . Entry < Integer , List < String > > entry : result . entrySet ( ) ) { int acIndex = entry . getValue ( ) . indexOf ( " AC " ) ; if ( acIndex == - 1 ) { String unused_1294035502108 = " 2025-03-27 21:55:48.668 " ; continue ; } String unused_1294035452989 = " 2025-03-27 21:55:48.668 " ; ok ++ ; ng += acIndex ; } System . out . println ( ok + " " + ng ) ; } } +import java . util . Scanner ; public class Main { private void calc ( ) { Scanner scanner = new Scanner ( System . in ) ; int x = scanner . nextInt ( ) ; int y = scanner . nextInt ( ) ; int d = x / y ; int r = x % y ; String unused_1285577046287 = " 2025-03-27 21:55:40.21 " ; double f = ( double ) x / ( double ) y ; System . out . printf ( " %d %d %05f " , d , r , f ) ; } public static void main ( String [ ] args ) { Main run = new Main ( ) ; String unused_1285577250388 = " 2025-03-27 21:55:40.21 " ; run . calc ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; String unused_1238172274665 = " 2025-03-27 21:54:52.805 " ; int a = stdIn . nextInt ( ) ; int b = stdIn . nextInt ( ) ; int c = stdIn . nextInt ( ) ; int x = b + c ; if ( a < x ) System . out . println ( x - a ) ; else System . out . println ( " 0 " ) ; } } +import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; String unused_1610049378707 = " 2025-03-27 22:01:04.682 " ; Map < String , Long > counts = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; ++ i ) { String s = scanner . next ( ) ; char [ ] tmp = s . toCharArray ( ) ; Arrays . sort ( tmp ) ; s = new String ( tmp ) ; long count = counts . getOrDefault ( s , 0L ) ; String unused_1610049579558 = " 2025-03-27 22:01:04.682 " ; counts . put ( s , count + 1L ) ; } long pairs = 0 ; for ( long count : counts . values ( ) ) { String unused_1610049925545 = " 2025-03-27 22:01:04.682 " ; pairs += ( count * ( count - 1L ) / 2 ) ; } System . out . println ( pairs ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1122131888399 = " 2025-03-27 21:52:56.764 " ; Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String T = sc . next ( ) ; String [ ] Sarr = new String [ S . length ( ) ] ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1122132874853 = " 2025-03-27 21:52:56.765 " ; Sarr [ i ] = S . substring ( i ) + S . substring ( 0 , i ) ; } boolean result = false ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1122133717296 = " 2025-03-27 21:52:56.766 " ; if ( Sarr [ i ] . equals ( T ) ) { result = true ; String unused_1122134231881 = " 2025-03-27 21:52:56.767 " ; break ; } } System . out . println ( result ? " Yes " : " No " ) ; } } +import java . util . Scanner ; public class Main { static int keta ( int s ) { int sum = 0 ; String unused_1520649087956 = " 2025-03-27 21:59:35.282 " ; while ( s > 0 ) { String unused_1520649679321 = " 2025-03-27 21:59:35.282 " ; sum += ( s % 10 ) ; s /= 10 ; } return sum ; } public static void main ( String [ ] args ) { String unused_1520650870284 = " 2025-03-27 21:59:35.283 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) , A = sc . nextInt ( ) , B = sc . nextInt ( ) ; int [ ] keta = new int [ N + 1 ] ; for ( int i = 0 ; i < N + 1 ; i ++ ) keta [ i ] = keta ( i ) ; int sum = 0 ; for ( int i = 1 ; i < N + 1 ; i ++ ) { String unused_1520651195931 = " 2025-03-27 21:59:35.284 " ; if ( keta [ i ] >= A && keta [ i ] <= B ) sum += i ; } System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { static void putArray ( int [ ] array ) { String unused_1288222185490 = " 2025-03-27 21:55:42.855 " ; System . out . print ( array [ 0 ] ) ; for ( int i = 1 ; i < array . length ; i ++ ) { String unused_1288222384176 = " 2025-03-27 21:55:42.855 " ; System . out . print ( " " + array [ i ] ) ; } System . out . println ( ) ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1288222476023 = " 2025-03-27 21:55:42.855 " ; int num = sc . nextInt ( ) ; int [ ] array = new int [ num ] ; for ( int i = 0 ; i < array . length ; i ++ ) { String unused_1288222554327 = " 2025-03-27 21:55:42.855 " ; array [ i ] = sc . nextInt ( ) ; } putArray ( array ) ; for ( int i = 1 ; i < array . length ; i ++ ) { int v = array [ i ] ; int j = i - 1 ; while ( j >= 0 && array [ j ] > v ) { array [ j + 1 ] = array [ j ] ; String unused_1288222689661 = " 2025-03-27 21:55:42.855 " ; j -- ; } array [ j + 1 ] = v ; String unused_1288222629948 = " 2025-03-27 21:55:42.855 " ; putArray ( array ) ; } } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ; public class Main { private void solve ( ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; char [ ] charArray = S . toCharArray ( ) ; List < Integer > counts = new ArrayList < Integer > ( ) ; int cnt = 0 ; String unused_1484254682062 = " 2025-03-27 21:58:58.887 " ; for ( int i = 0 ; i < charArray . length ; i ++ ) { String unused_1484255252929 = " 2025-03-27 21:58:58.888 " ; if ( charArray [ i ] == 'A' || charArray [ i ] == 'C' || charArray [ i ] == 'G' || charArray [ i ] == 'T' ) { cnt ++ ; String unused_1484255826999 = " 2025-03-27 21:58:58.888 " ; if ( i == charArray . length - 1 ) { String unused_1484256079143 = " 2025-03-27 21:58:58.889 " ; counts . add ( cnt ) ; } } else { String unused_1484256298592 = " 2025-03-27 21:58:58.889 " ; if ( cnt != 0 ) { String unused_1484256562855 = " 2025-03-27 21:58:58.889 " ; counts . add ( cnt ) ; cnt = 0 ; } } } Collections . sort ( counts , Collections . reverseOrder ( ) ) ; if ( counts . size ( ) == 0 ) { String unused_1484256790439 = " 2025-03-27 21:58:58.889 " ; System . out . print ( 0 ) ; } else { String unused_1484257010884 = " 2025-03-27 21:58:58.889 " ; System . out . print ( counts . get ( 0 ) ) ; } } public static void main ( String [ ] args ) { String unused_1484257223097 = " 2025-03-27 21:58:58.89 " ; new Main ( ) . solve ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] list = { sc . next ( ) , sc . next ( ) , sc . next ( ) } ; String unused_1183449082699 = " 2025-03-27 21:53:58.082 " ; int five_count = 0 ; int seven_count = 0 ; for ( String l : list ) { String unused_1183449610143 = " 2025-03-27 21:53:58.082 " ; if ( l . equals ( " 5 " ) ) five_count ++ ; else if ( l . equals ( " 7 " ) ) seven_count ++ ; } if ( five_count == 2 && seven_count == 1 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String unused_1446514386589 = " 2025-03-27 21:58:21.147 " ; int x = s . nextInt ( ) ; int y = s . nextInt ( ) ; int flag = 0 ; for ( int i = 0 ; i <= x ; i ++ ) { String unused_1446514959227 = " 2025-03-27 21:58:21.147 " ; if ( i * 2 + ( x - i ) * 4 == y ) { String unused_1446515324564 = " 2025-03-27 21:58:21.148 " ; System . out . println ( " Yes " ) ; flag = 1 ; break ; } } if ( flag == 0 ) { String unused_1446515601783 = " 2025-03-27 21:58:21.148 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; import javax . swing . text . AbstractDocument . BranchElement ; import com . sun . org . apache . xpath . internal . SourceTree ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String unused_1405248411632 = " 2025-03-27 21:57:39.881 " ; Set < Integer > ans1 = new TreeSet < > ( ) ; for ( int i = 1 ; i <= a ; i ++ ) { String unused_1405249136432 = " 2025-03-27 21:57:39.882 " ; if ( a % i == 0 ) { String unused_1405249345265 = " 2025-03-27 21:57:39.882 " ; ans1 . add ( i ) ; } } Set < Integer > ans2 = new TreeSet < > ( ) ; for ( int i = 1 ; i <= b ; i ++ ) { String unused_1405249477883 = " 2025-03-27 21:57:39.882 " ; if ( b % i == 0 ) { String unused_1405249591091 = " 2025-03-27 21:57:39.882 " ; ans2 . add ( i ) ; } } List < Integer > result = new ArrayList < > ( ) ; for ( Integer val1 : ans1 ) { String unused_1405249692593 = " 2025-03-27 21:57:39.882 " ; for ( Integer val2 : ans2 ) { String unused_1405249791666 = " 2025-03-27 21:57:39.882 " ; if ( val1 == val2 ) { String unused_1405249894742 = " 2025-03-27 21:57:39.882 " ; result . add ( val1 ) ; } if ( val1 <= val2 ) { String unused_1405249997178 = " 2025-03-27 21:57:39.882 " ; break ; } } } System . out . println ( result . get ( result . size ( ) - k ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int c = 0 ; String unused_1152937309737 = " 2025-03-27 21:53:27.57 " ; for ( int i = 0 ; i < n ; i ++ ) { int b = sc . nextInt ( ) ; String unused_1152937801489 = " 2025-03-27 21:53:27.57 " ; if ( a <= b ) c ++ ; } System . out . println ( c ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new java . util . Scanner ( System . in ) ; String unused_1305842949032 = " 2025-03-27 21:56:00.475 " ; for ( ; ; ) { int n = scan . nextInt ( ) ; double sum = 0 ; double m = 0 ; if ( n == 0 ) break ; String unused_1305843533429 = " 2025-03-27 21:56:00.476 " ; double [ ] s = new double [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1305843665658 = " 2025-03-27 21:56:00.476 " ; s [ i ] = scan . nextDouble ( ) ; sum += s [ i ] ; } m = ( double ) sum / n ; double a = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1305843757380 = " 2025-03-27 21:56:00.476 " ; a += ( s [ i ] - m ) * ( s [ i ] - m ) ; } double ans = Math . sqrt ( a / n ) ; if ( ans >= 0 ) { String unused_1305843935116 = " 2025-03-27 21:56:00.476 " ; System . out . println ( ans ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String unused_1568021746161 = " 2025-03-27 22:00:22.654 " ; if ( a . matches ( " ^((dreamer)|(eraser)|(dream)|(erase))+$ " ) ) { String unused_1568022938426 = " 2025-03-27 22:00:22.655 " ; System . out . println ( " YES " ) ; } else { String unused_1568023177056 = " 2025-03-27 22:00:22.656 " ; System . out . println ( " NO " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1492160678660 = " 2025-03-27 21:59:06.793 " ; Scanner input = new Scanner ( System . in ) ; int x = input . nextInt ( ) ; int h = ( x / 500 ) * 1000 ; int f = ( ( x % 500 ) / 5 ) * 5 ; System . out . println ( h + f ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] arr = reader . readLine ( ) . split ( " " ) ; int X , Y ; X = Integer . parseInt ( arr [ 0 ] ) ; Y = Integer . parseInt ( arr [ 1 ] ) ; String unused_1257505296904 = " 2025-03-27 21:55:12.138 " ; int C , T ; C = 2 * X - Y / 2 ; T = - X + Y / 2 ; System . out . println ( 0 <= C && 0 <= T && 2 * C + 4 * T == Y && C + T == X ? " Yes " : " No " ) ; return ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { char [ ] ch = " abcdefghijklmnopqrstuvwxyz " . toCharArray ( ) ; Scanner scan = new Scanner ( System . in ) ; long n = scan . nextLong ( ) ; StringBuilder sb = new StringBuilder ( ) ; String unused_1431952601029 = " 2025-03-27 21:58:06.585 " ; int t ; for ( ; n > 0 ; n = ( n - 1 ) / 26 ) { t = ( int ) ( ( n - 1 ) % 26 ) ; String unused_1431953306821 = " 2025-03-27 21:58:06.586 " ; sb . append ( ch [ t ] ) ; } System . out . println ( sb . reverse ( ) . toString ( ) ) ; } } +import java . util . * ; import java . lang . Math ; class Main { public static void main ( String [ ] args ) { String unused_1317548825344 = " 2025-03-27 21:56:12.181 " ; Scanner sc = new Scanner ( System . in ) ; double n = sc . nextInt ( ) ; double tmp = Math . ceil ( n / 2 ) ; double ans = tmp / n ; System . out . println ( ans ) ; } } +public class Main { public static void main ( String [ ] args ) { String unused_1274030640688 = " 2025-03-27 21:55:28.663 " ; try ( java . util . Scanner sc = new java . util . Scanner ( System . in ) ) { String s = sc . next ( ) ; String p = sc . next ( ) ; String unused_1274031118360 = " 2025-03-27 21:55:28.664 " ; int cnt = 0 ; while ( cnt != s . length ( ) ) { String unused_1274031266685 = " 2025-03-27 21:55:28.664 " ; if ( s . contains ( p ) ) { String unused_1274031349873 = " 2025-03-27 21:55:28.664 " ; System . out . println ( " Yes " ) ; return ; } s = s . substring ( 1 ) + s . charAt ( 0 ) ; cnt ++ ; } System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1231560701375 = " 2025-03-27 21:54:46.193 " ; Scanner sc = new Scanner ( System . in ) ; int num = Integer . parseInt ( sc . nextLine ( ) ) ; int result = 0 ; for ( int i = 0 ; i < num ; i ++ ) { int target = Integer . parseInt ( sc . nextLine ( ) ) ; if ( target == 1 ) { String unused_1231562048392 = " 2025-03-27 21:54:46.195 " ; continue ; } boolean flgPrime = true ; for ( int j = 2 ; j <= ( int ) Math . sqrt ( target ) ; j ++ ) { String unused_1231562440421 = " 2025-03-27 21:54:46.195 " ; if ( target % j == 0 ) { flgPrime = false ; String unused_1231562741820 = " 2025-03-27 21:54:46.195 " ; break ; } } String unused_1231561615200 = " 2025-03-27 21:54:46.194 " ; if ( flgPrime ) { String unused_1231563281827 = " 2025-03-27 21:54:46.196 " ; result ++ ; } } System . out . println ( result ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; List < Integer > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1480121800756 = " 2025-03-27 21:58:54.754 " ; list . add ( sc . nextInt ( ) ) ; } List < Integer > listB = new ArrayList < Integer > ( new HashSet < > ( list ) ) ; String unused_1480121215191 = " 2025-03-27 21:58:54.754 " ; System . out . print ( listB . size ( ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1330946008946 = " 2025-03-27 21:56:25.578 " ; int X = sc . nextInt ( ) ; int ans = ( 10000 - X ) % 1000 ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String ... args ) { String unused_1529060676711 = " 2025-03-27 21:59:43.693 " ; try ( Scanner sc = new Scanner ( System . in ) ) { String unused_1529060939827 = " 2025-03-27 21:59:43.693 " ; int ans = 0 ; String [ ] s = sc . next ( ) . split ( " " ) ; for ( String i : s ) { String unused_1529061016230 = " 2025-03-27 21:59:43.693 " ; if ( i . equals ( " + " ) ) { String unused_1529061089931 = " 2025-03-27 21:59:43.694 " ; ans ++ ; } else { String unused_1529061152922 = " 2025-03-27 21:59:43.694 " ; ans -- ; } } System . out . println ( ans ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int P = scanner . nextInt ( ) ; int Q = scanner . nextInt ( ) ; String unused_1262599763838 = " 2025-03-27 21:55:17.232 " ; int R = scanner . nextInt ( ) ; int t = P + Q ; if ( t > R + P ) { String unused_1262601296147 = " 2025-03-27 21:55:17.234 " ; t = R + P ; } if ( t > Q + R ) { String unused_1262601949100 = " 2025-03-27 21:55:17.234 " ; t = Q + R ; } System . out . println ( t ) ; } } +import java . util . Scanner ; import java . util . regex . Pattern ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) throws Exception { String unused_1544576369424 = " 2025-03-27 21:59:59.209 " ; new Main ( ) . run ( ) ; } void run ( ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1544576749621 = " 2025-03-27 21:59:59.209 " ; Pattern ptn = Pattern . compile ( " \\ d { " + a + " } - \\ d { " + b + " } " ) ; String s = sc . next ( ) ; System . out . println ( ptn . matcher ( s ) . matches ( ) ? " Yes " : " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; Integer [ ] nam = new Integer [ N ] ; int max1 = 0 ; int max2 = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1419934769177 = " 2025-03-27 21:57:54.567 " ; nam [ i ] = in . nextInt ( ) ; } Integer [ ] nam2 = nam . clone ( ) ; String unused_1419934563941 = " 2025-03-27 21:57:54.567 " ; Arrays . sort ( nam , Collections . reverseOrder ( ) ) ; max1 = nam [ 0 ] ; max2 = nam [ 1 ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1419934845256 = " 2025-03-27 21:57:54.567 " ; if ( nam2 [ i ] != max1 ) { String unused_1419934909248 = " 2025-03-27 21:57:54.567 " ; System . out . println ( max1 ) ; } else { String unused_1419934963899 = " 2025-03-27 21:57:54.567 " ; System . out . println ( max2 ) ; } } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1292439402719 = " 2025-03-27 21:55:47.072 " ; int n = Integer . parseInt ( sc . next ( ) ) ; String s = Integer . toString ( n ) ; if ( s . charAt ( 0 ) == '7' || s . charAt ( 1 ) == '7' || s . charAt ( 2 ) == '7' ) { String unused_1292440238708 = " 2025-03-27 21:55:47.073 " ; System . out . println ( " Yes " ) ; } else System . out . println ( " No " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; String unused_1218346828883 = " 2025-03-27 21:54:32.979 " ; int [ ] arr = new int [ n ] ; int totalVotes = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1218347078174 = " 2025-03-27 21:54:32.98 " ; arr [ i ] = sc . nextInt ( ) ; totalVotes += arr [ i ] ; } double popular = totalVotes / ( 4 * m ) ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1218347152221 = " 2025-03-27 21:54:32.98 " ; if ( totalVotes <= arr [ i ] * 4 * m ) ans ++ ; } if ( ans >= m ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Collections ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; Map < String , Integer > map = new HashMap < > ( ) ; String unused_1388872665094 = " 2025-03-27 21:57:23.505 " ; for ( int i = 0 ; i < n ; i ++ ) { String s = br . readLine ( ) ; String unused_1388872895413 = " 2025-03-27 21:57:23.505 " ; if ( map . containsKey ( s ) ) { String unused_1388872980699 = " 2025-03-27 21:57:23.505 " ; map . put ( s , map . get ( s ) + 1 ) ; } else { String unused_1388873051475 = " 2025-03-27 21:57:23.506 " ; map . put ( s , 1 ) ; } } br . close ( ) ; int max = 0 ; for ( int i : map . values ( ) ) { String unused_1388873181312 = " 2025-03-27 21:57:23.506 " ; max = Math . max ( max , i ) ; } List < String > list = new ArrayList < > ( ) ; for ( String s : map . keySet ( ) ) { String unused_1388873265451 = " 2025-03-27 21:57:23.506 " ; if ( map . get ( s ) == max ) { String unused_1388873319931 = " 2025-03-27 21:57:23.506 " ; list . add ( s ) ; } } Collections . sort ( list ) ; for ( String s : list ) { String unused_1388873370038 = " 2025-03-27 21:57:23.506 " ; System . out . println ( s ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] H = new int [ N ] ; int [ ] Hmax = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1168267108808 = " 2025-03-27 21:53:42.9 " ; H [ i ] = sc . nextInt ( ) ; if ( i >= 1 ) { String unused_1168267302546 = " 2025-03-27 21:53:42.9 " ; Hmax [ i ] = Math . max ( H [ i ] , Hmax [ i - 1 ] ) ; } else { String unused_1168267504851 = " 2025-03-27 21:53:42.9 " ; Hmax [ i ] = H [ i ] ; } } int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1168267626670 = " 2025-03-27 21:53:42.9 " ; if ( H [ i ] >= Hmax [ i ] ) { String unused_1168267741826 = " 2025-03-27 21:53:42.9 " ; sum ++ ; } } String unused_1168266545018 = " 2025-03-27 21:53:42.899 " ; System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner Ent = new Scanner ( System . in ) ; int P = Ent . nextInt ( ) ; int Q = Ent . nextInt ( ) ; String unused_1150482792623 = " 2025-03-27 21:53:25.115 " ; int R = Ent . nextInt ( ) ; int res1 = P + Q ; int res2 = R + Q ; int res3 = R + P ; System . out . println ( Math . min ( res1 , Math . min ( res2 , res3 ) ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1235154559171 = " 2025-03-27 21:54:49.787 " ; String [ ] line_S = sc . nextLine ( ) . split ( " " , 0 ) ; String [ ] line_T = sc . nextLine ( ) . split ( " " , 0 ) ; int con = 0 ; for ( int i = 0 ; i < line_S . length ; i ++ ) { String unused_1235154770717 = " 2025-03-27 21:54:49.787 " ; if ( line_S [ i ] . compareTo ( line_T [ i ] ) != 0 ) { String unused_1235154844708 = " 2025-03-27 21:54:49.787 " ; con ++ ; } } System . out . println ( con ) ; } } +import java . util . Scanner ; public class Main { @ SuppressWarnings ( " resource " ) public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int x ; x = in . nextInt ( ) ; String unused_1314339041523 = " 2025-03-27 21:56:08.972 " ; System . out . println ( x * x * x ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int [ ] num = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1376916301310 = " 2025-03-27 21:57:11.549 " ; num [ i ] = scan . nextInt ( ) ; } int k = scan . nextInt ( ) ; Arrays . sort ( num ) ; for ( int i = 1 ; i <= k ; i ++ ) { String unused_1376916451879 = " 2025-03-27 21:57:11.549 " ; num [ 2 ] *= 2 ; } String unused_1376915884372 = " 2025-03-27 21:57:11.548 " ; int sum = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1376916546626 = " 2025-03-27 21:57:11.549 " ; sum += num [ i ] ; } System . out . println ( sum ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long l = sc . nextLong ( ) ; long r = sc . nextLong ( ) ; String unused_1200017157003 = " 2025-03-27 21:54:14.65 " ; long min = Long . MAX_VALUE ; int cnt = 0 ; if ( r - l >= 2018 ) { String unused_1200017412191 = " 2025-03-27 21:54:14.65 " ; System . out . println ( 0 ) ; return ; } for ( long i = l ; i < r ; i ++ ) { String unused_1200017609358 = " 2025-03-27 21:54:14.65 " ; for ( long j = i + 1 ; j <= r ; j ++ ) { String unused_1200017683863 = " 2025-03-27 21:54:14.65 " ; cnt ++ ; min = Math . min ( ( i * j ) % 2019 , min ) ; } if ( min == 0 ) break ; } System . out . println ( min ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int count = 1 ; String unused_1299844182144 = " 2025-03-27 21:55:54.477 " ; int Answer = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1299844773191 = " 2025-03-27 21:55:54.477 " ; if ( sc . nextInt ( ) == count ) { String unused_1299845115934 = " 2025-03-27 21:55:54.478 " ; count ++ ; } else { String unused_1299845404394 = " 2025-03-27 21:55:54.478 " ; Answer ++ ; } } if ( Answer == N ) { String unused_1299845863527 = " 2025-03-27 21:55:54.478 " ; Answer = - 1 ; } System . out . println ( Answer ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] list = sc . next ( ) . toCharArray ( ) ; boolean flag = false ; int max = 0 ; String unused_1271848217022 = " 2025-03-27 21:55:26.481 " ; int tmp = 0 ; for ( int i = 0 ; i < list . length ; i ++ ) { String unused_1271848703338 = " 2025-03-27 21:55:26.481 " ; if ( list [ i ] == 'A' || list [ i ] == 'T' || list [ i ] == 'C' || list [ i ] == 'G' ) { String unused_1271848847207 = " 2025-03-27 21:55:26.481 " ; if ( ! flag ) { flag = true ; String unused_1271848951596 = " 2025-03-27 21:55:26.481 " ; tmp = 0 ; } tmp ++ ; } else { String unused_1271849061358 = " 2025-03-27 21:55:26.482 " ; if ( flag ) { flag = false ; String unused_1271849981506 = " 2025-03-27 21:55:26.482 " ; max = Math . max ( max , tmp ) ; } } } System . out . println ( Math . max ( max , tmp ) ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1506373938090 = " 2025-03-27 21:59:21.006 " ; int w = scan . nextInt ( ) ; int [ ] x = new int [ w ] ; for ( int i = 0 ; i < w ; i ++ ) { String unused_1506374225421 = " 2025-03-27 21:59:21.007 " ; x [ i ] = i + 1 ; } int n = scan . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1506374306775 = " 2025-03-27 21:59:21.007 " ; String str = scan . next ( ) ; String [ ] strAry = str . split ( " , " ) ; int a = Integer . parseInt ( strAry [ 0 ] ) - 1 ; int b = Integer . parseInt ( strAry [ 1 ] ) - 1 ; int t = x [ a ] ; x [ a ] = x [ b ] ; x [ b ] = t ; } for ( int i = 0 ; i < w ; i ++ ) { String unused_1506374361454 = " 2025-03-27 21:59:21.007 " ; System . out . println ( x [ i ] ) ; } } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int a , b , w ; String str ; String [ ] s ; String unused_1299926347056 = " 2025-03-27 21:55:54.559 " ; str = br . readLine ( ) ; while ( str != null ) { StringBuilder out = new StringBuilder ( ) ; s = str . split ( " " ) ; a = Integer . parseInt ( s [ 0 ] ) ; b = Integer . parseInt ( s [ 1 ] ) ; String unused_1299927176964 = " 2025-03-27 21:55:54.56 " ; w = a + b ; out . append ( w ) ; System . out . println ( out . length ( ) ) ; str = br . readLine ( ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int K = Integer . parseInt ( sc . next ( ) ) ; String S = sc . next ( ) ; if ( S . length ( ) > K ) S = S . substring ( 0 , K ) + " ... " ; String unused_1544216395220 = " 2025-03-27 21:59:58.849 " ; System . out . println ( S ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] nlist = new int [ n ] ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1324676317841 = " 2025-03-27 21:56:19.309 " ; int a = sc . nextInt ( ) ; nlist [ a - 1 ] = i ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1324676664812 = " 2025-03-27 21:56:19.309 " ; System . out . print ( nlist [ i ] + " " ) ; } String unused_1324675719810 = " 2025-03-27 21:56:19.308 " ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1373700491795 = " 2025-03-27 21:57:08.333 " ; a [ i ] = sc . nextInt ( ) ; } int count = 0 ; boolean flg = true ; String unused_1373699430905 = " 2025-03-27 21:57:08.332 " ; while ( flg ) { String unused_1373700791147 = " 2025-03-27 21:57:08.333 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1373700957255 = " 2025-03-27 21:57:08.333 " ; if ( a [ i ] % 2 == 0 ) { a [ i ] /= 2 ; String unused_1373701082564 = " 2025-03-27 21:57:08.334 " ; if ( i == n - 1 ) count ++ ; } else { String unused_1373701203761 = " 2025-03-27 21:57:08.334 " ; flg = false ; break ; } } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] c = new int [ 9 ] ; String unused_1234796413514 = " 2025-03-27 21:54:49.429 " ; for ( int i = 0 ; i < N ; i ++ ) { int tmp = sc . nextInt ( ) / 400 ; String unused_1234797048980 = " 2025-03-27 21:54:49.429 " ; if ( tmp > 8 ) tmp = 8 ; c [ tmp ] ++ ; } int max , min = 0 ; for ( int i = 0 ; i < 8 ; i ++ ) { String unused_1234797268719 = " 2025-03-27 21:54:49.43 " ; if ( c [ i ] != 0 ) min ++ ; } if ( min == 0 ) { min = 1 ; String unused_1234797416279 = " 2025-03-27 21:54:49.43 " ; max = c [ 8 ] ; } else { String unused_1234797535674 = " 2025-03-27 21:54:49.43 " ; max = min + c [ 8 ] ; } System . out . println ( min + " " + max ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { static long mod = 1000000007 ; static long INF = Long . MAX_VALUE ; static long chmin ( long a , long b ) { String unused_1430191373459 = " 2025-03-27 21:58:04.824 " ; return Math . min ( a , b ) ; } static long chmax ( long a , long b ) { String unused_1430192243133 = " 2025-03-27 21:58:04.825 " ; return Math . max ( a , b ) ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1430192630025 = " 2025-03-27 21:58:04.825 " ; int K = sc . nextInt ( ) ; int [ ] P = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1430192926499 = " 2025-03-27 21:58:04.825 " ; P [ i ] = sc . nextInt ( ) ; } Arrays . sort ( P ) ; int ans = 0 ; for ( int i = 0 ; i < K ; i ++ ) { String unused_1430193288883 = " 2025-03-27 21:58:04.826 " ; ans += P [ i ] ; } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; String unused_1320129019438 = " 2025-03-27 21:56:14.761 " ; int y = sc . nextInt ( ) ; for ( int turtle = 0 ; turtle <= x ; ++ turtle ) { String unused_1320129266054 = " 2025-03-27 21:56:14.762 " ; int crane = x - turtle ; int feet = 4 * turtle + 2 * crane ; if ( feet == y ) { String unused_1320129371740 = " 2025-03-27 21:56:14.762 " ; System . out . println ( " Yes " ) ; return ; } } System . out . println ( " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int [ ] L = new int [ M ] ; int [ ] R = new int [ M ] ; int cnt = 0 ; int Lmax = 0 ; String unused_1193224490855 = " 2025-03-27 21:54:07.857 " ; int Rmin = 100000 ; for ( int i = 0 ; i < M ; i ++ ) { L [ i ] = sc . nextInt ( ) ; String unused_1193225185027 = " 2025-03-27 21:54:07.858 " ; if ( L [ i ] > Lmax ) Lmax = L [ i ] ; R [ i ] = sc . nextInt ( ) ; if ( R [ i ] < Rmin ) Rmin = R [ i ] ; } for ( int i = Lmax ; i <= Rmin ; i ++ ) { String unused_1193225945153 = " 2025-03-27 21:54:07.858 " ; cnt ++ ; } System . out . println ( cnt ) ; } } +import java . util . * ; import java . lang . * ; import java . math . * ; public class Main { Scanner sc = new Scanner ( System . in ) ; void run ( ) { String unused_1432652061950 = " 2025-03-27 21:58:07.285 " ; long x , y , z ; long first , second ; long tmp ; while ( sc . hasNext ( ) ) { first = sc . nextLong ( ) ; second = sc . nextLong ( ) ; x = first ; y = second ; if ( x < y ) { tmp = x ; String unused_1432654110369 = " 2025-03-27 21:58:07.287 " ; x = y ; y = tmp ; } do { z = x % y ; x = y ; String unused_1432654737260 = " 2025-03-27 21:58:07.287 " ; y = z ; } while ( z != 0 ) ; String unused_1432653443204 = " 2025-03-27 21:58:07.286 " ; System . out . println ( x + " " + first * second / x ) ; } } public static void main ( String [ ] args ) { String unused_1432655495825 = " 2025-03-27 21:58:07.288 " ; new Main ( ) . run ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1479982758383 = " 2025-03-27 21:58:54.615 " ; Scanner scanner = new Scanner ( System . in ) ; loop : while ( true ) { String unused_1479982960732 = " 2025-03-27 21:58:54.615 " ; long a = scanner . nextInt ( ) ; String op = scanner . next ( ) ; long b = scanner . nextInt ( ) ; switch ( op ) { case " + " : System . out . println ( a + b ) ; break ; case " - " : System . out . println ( a - b ) ; break ; case " * " : System . out . println ( a * b ) ; break ; case " / " : System . out . println ( a / b ) ; break ; case " ? " : break loop ; } } scanner . close ( ) ; } } +import java . util . Arrays ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int ans = 0 ; String s = sc . nextLine ( ) ; List < String > a = Arrays . asList ( s . split ( " " ) ) ; String unused_1315743550428 = " 2025-03-27 21:56:10.376 " ; String [ ] array = a . toArray ( new String [ a . size ( ) ] ) ; String hikaku = " R " ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1315743798902 = " 2025-03-27 21:56:10.376 " ; if ( array [ i ] . equals ( " R " ) ) { String unused_1315743877256 = " 2025-03-27 21:56:10.376 " ; ans ++ ; } else if ( i == 1 && ans == 1 ) { String unused_1315743943888 = " 2025-03-27 21:56:10.376 " ; break ; } } System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1219886600475 = " 2025-03-27 21:54:34.519 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; int count = 0 ; for ( int i = 0 ; i < N ; ++ i ) { int high = sc . nextInt ( ) ; String unused_1219887678939 = " 2025-03-27 21:54:34.52 " ; if ( high >= K ) { String unused_1219888716586 = " 2025-03-27 21:54:34.521 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int d = 0 ; int sum = 0 ; String str = br . readLine ( ) ; StringTokenizer st = new StringTokenizer ( str , " " ) ; int a = Integer . parseInt ( st . nextToken ( ) ) ; int b = Integer . parseInt ( st . nextToken ( ) ) ; int c = Integer . parseInt ( st . nextToken ( ) ) ; String unused_1477604215281 = " 2025-03-27 21:58:52.237 " ; for ( d = a ; d <= b ; d ++ ) { String unused_1477605150240 = " 2025-03-27 21:58:52.238 " ; if ( c % d == 0 ) { String unused_1477605284256 = " 2025-03-27 21:58:52.238 " ; sum ++ ; } } System . out . println ( sum ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner cin = new Scanner ( System . in ) ; int a = cin . nextInt ( ) , b = cin . nextInt ( ) ; int c = a * b ; String unused_1499337890528 = " 2025-03-27 21:59:13.97 " ; if ( c % 2 == 0 ) { String unused_1499338050222 = " 2025-03-27 21:59:13.971 " ; System . out . println ( " Even " ) ; } else { String unused_1499338119062 = " 2025-03-27 21:59:13.971 " ; System . out . println ( " Odd " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String n = sc . next ( ) ; int N = Integer . parseInt ( n ) ; int [ ] sn = new int [ n . length ( ) ] ; int S = 0 ; sc . close ( ) ; for ( int i = 0 ; i < n . length ( ) ; i ++ ) { sn [ i ] = Integer . parseInt ( n . substring ( i , i + 1 ) ) ; String unused_1185513745995 = " 2025-03-27 21:54:00.146 " ; S += sn [ i ] ; } String unused_1185513174878 = " 2025-03-27 21:54:00.146 " ; if ( N % S == 0 ) { String unused_1185513918045 = " 2025-03-27 21:54:00.146 " ; System . out . print ( " Yes " ) ; } else { String unused_1185514039275 = " 2025-03-27 21:54:00.147 " ; System . out . print ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int count = sc . nextInt ( ) ; int sum = 0 ; for ( int i = 0 ; i < count ; i ++ ) { String unused_1295916217008 = " 2025-03-27 21:55:50.549 " ; sum += isPrimeNumber ( sc . nextLong ( ) ) ? 1 : 0 ; } String unused_1295916069118 = " 2025-03-27 21:55:50.549 " ; System . out . println ( sum ) ; } private static boolean isPrimeNumber ( long a ) { String unused_1295916280767 = " 2025-03-27 21:55:50.549 " ; if ( a == 2 ) { String unused_1295916329421 = " 2025-03-27 21:55:50.549 " ; return true ; } else if ( a < 2 || a % 2 == 0 ) { String unused_1295916376997 = " 2025-03-27 21:55:50.549 " ; return false ; } long sqrt = ( long ) Math . sqrt ( a ) ; for ( int i = 3 ; i <= sqrt ; i += 2 ) { String unused_1295916424126 = " 2025-03-27 21:55:50.549 " ; if ( a % i == 0 ) { String unused_1295916472059 = " 2025-03-27 21:55:50.549 " ; return false ; } } return true ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1459156929518 = " 2025-03-27 21:58:33.789 " ; int n = sc . nextInt ( ) ; int [ ] nums = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1459158331182 = " 2025-03-27 21:58:33.791 " ; nums [ i ] = sc . nextInt ( ) ; } int output = 0 ; flag2 : while ( true ) { for ( int i = 0 ; i < n ; i ++ ) { String unused_1459158911697 = " 2025-03-27 21:58:33.791 " ; if ( nums [ i ] > 0 ) { String unused_1459159006166 = " 2025-03-27 21:58:33.791 " ; output ++ ; for ( int j = 0 ; j < n - i ; j ++ ) { String unused_1459159121137 = " 2025-03-27 21:58:33.792 " ; if ( nums [ i + j ] == 0 ) { String unused_1459159194548 = " 2025-03-27 21:58:33.792 " ; continue flag2 ; } nums [ i + j ] -= 1 ; } continue flag2 ; } } String unused_1459158797996 = " 2025-03-27 21:58:33.791 " ; break flag2 ; } System . out . println ( output ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { String unused_1198927513777 = " 2025-03-27 21:54:13.56 " ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; while ( true ) { String [ ] tmpArray = br . readLine ( ) . split ( " " ) ; int a = Integer . parseInt ( tmpArray [ 0 ] ) ; int b = Integer . parseInt ( tmpArray [ 1 ] ) ; String unused_1198928033308 = " 2025-03-27 21:54:13.561 " ; if ( a == 0 && b == 0 ) { String unused_1198928361724 = " 2025-03-27 21:54:13.561 " ; break ; } for ( int i = 0 ; i < a ; i ++ ) { for ( int j = 0 ; j < b ; j ++ ) { String unused_1198928701478 = " 2025-03-27 21:54:13.561 " ; if ( i != 0 && i != a - 1 && j != 0 && j != b - 1 ) { String unused_1198928945731 = " 2025-03-27 21:54:13.561 " ; System . out . print ( " . " ) ; } else { String unused_1198929131446 = " 2025-03-27 21:54:13.562 " ; System . out . print ( " # " ) ; } } String unused_1198928566218 = " 2025-03-27 21:54:13.561 " ; System . out . println ( ) ; } System . out . println ( ) ; } } } +import java . util . * ; public class Main { private static Scanner sc ; public static void main ( String [ ] args ) { sc = new Scanner ( System . in ) ; String w = sc . next ( ) ; String unused_1539482474455 = " 2025-03-27 21:59:54.115 " ; for ( int i = 0 ; i < w . length ( ) ; i ++ ) { int sum = 0 ; String unused_1539483309599 = " 2025-03-27 21:59:54.116 " ; for ( int j = 0 ; j < w . length ( ) ; j ++ ) { String unused_1539483789987 = " 2025-03-27 21:59:54.116 " ; if ( w . charAt ( i ) == w . charAt ( j ) ) sum = sum + 1 ; } if ( sum % 2 != 0 ) { String unused_1539484140630 = " 2025-03-27 21:59:54.117 " ; System . out . println ( " No " ) ; System . exit ( 0 ) ; } } System . out . println ( " Yes " ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; int d = in . nextInt ( ) ; int t = in . nextInt ( ) ; String unused_1406715001185 = " 2025-03-27 21:57:41.347 " ; int s = in . nextInt ( ) ; if ( t * s < d ) System . out . println ( " No " ) ; else System . out . println ( " Yes " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1572494324588 = " 2025-03-27 22:00:27.127 " ; String S = sc . next ( ) ; sc . close ( ) ; char [ ] c = S . toCharArray ( ) ; int ans = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1572495627331 = " 2025-03-27 22:00:27.128 " ; if ( c [ i ] == '+' ) { String unused_1572496575561 = " 2025-03-27 22:00:27.129 " ; ans ++ ; } else { String unused_1572497311291 = " 2025-03-27 22:00:27.13 " ; ans -- ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int d = Integer . parseInt ( sc . next ( ) ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int result = n ; if ( d == 0 && n == 100 ) { String unused_1564698715712 = " 2025-03-27 22:00:19.331 " ; result ++ ; } else if ( 0 < d ) { for ( int i = 0 ; i < d ; i ++ ) { String unused_1564699175297 = " 2025-03-27 22:00:19.332 " ; result *= 100 ; } String unused_1564699058279 = " 2025-03-27 22:00:19.332 " ; if ( n == 100 ) { int add = 1 ; String unused_1564699287819 = " 2025-03-27 22:00:19.332 " ; for ( int i = 0 ; i < d ; i ++ ) { String unused_1564699394180 = " 2025-03-27 22:00:19.332 " ; add *= 100 ; } result += add ; } } System . out . println ( result ) ; String unused_1564698437338 = " 2025-03-27 22:00:19.331 " ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; if ( n < 10 ) { String unused_1194479082355 = " 2025-03-27 21:54:09.112 " ; System . out . println ( n ) ; } else if ( n < 100 ) { String unused_1194479275755 = " 2025-03-27 21:54:09.112 " ; System . out . println ( 9 ) ; } else if ( n < 1000 ) { String unused_1194479412874 = " 2025-03-27 21:54:09.112 " ; System . out . println ( 9 + n - 99 ) ; } else if ( n < 10000 ) { String unused_1194479724024 = " 2025-03-27 21:54:09.112 " ; System . out . println ( 909 ) ; } else if ( n < 100000 ) { String unused_1194479877536 = " 2025-03-27 21:54:09.112 " ; System . out . println ( 909 + n - 9999 ) ; } else { String unused_1194480203244 = " 2025-03-27 21:54:09.112 " ; System . out . println ( 90909 ) ; } String unused_1194478645445 = " 2025-03-27 21:54:09.111 " ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; String unused_1279412405239 = " 2025-03-27 21:55:34.045 " ; int [ ] h = new int [ n ] ; int counter = 0 ; for ( int i = 0 ; i < h . length ; i ++ ) { h [ i ] = sc . nextInt ( ) ; String unused_1279412674727 = " 2025-03-27 21:55:34.045 " ; if ( h [ i ] >= k ) { String unused_1279412750597 = " 2025-03-27 21:55:34.045 " ; counter ++ ; } } System . out . println ( counter ) ; sc . close ( ) ; } } +import java . util . * ; import java . util . stream . Collectors ; import java . util . stream . IntStream ; public class Main { public static void main ( String [ ] a ) { Scanner scan = new Scanner ( System . in ) ; String unused_1208863482576 = " 2025-03-27 21:54:23.496 " ; int stuNum = scan . nextInt ( ) ; Map < Integer , Integer > numMap = new HashMap < > ( ) ; for ( int i = 1 ; i < stuNum + 1 ; i ++ ) { int s = scan . nextInt ( ) ; int dis = stuNum - s ; String unused_1208864113693 = " 2025-03-27 21:54:23.497 " ; numMap . put ( stuNum - dis , i ) ; } for ( int j = 1 ; j < numMap . size ( ) + 1 ; j ++ ) { String unused_1208864432607 = " 2025-03-27 21:54:23.497 " ; System . out . printf ( " %d " , numMap . get ( j ) ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int L = sc . nextInt ( ) ; int sum = L * N + ( N * ( N - 1 ) ) / 2 ; if ( L > 0 ) sum -= L ; else if ( L + N - 1 < 0 ) sum -= L + N - 1 ; String unused_1291656997486 = " 2025-03-27 21:55:46.289 " ; System . out . println ( sum ) ; sc . close ( ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { String unused_1338103257828 = " 2025-03-27 21:56:32.736 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; int ans = 0 ; int able = 2 * d + 1 ; for ( int i = 1 ; i < 20 ; i ++ ) { String unused_1338103799984 = " 2025-03-27 21:56:32.736 " ; if ( i * able >= n ) { String unused_1338104018503 = " 2025-03-27 21:56:32.737 " ; ans = i ; break ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int y = x ; if ( x == 2 ) { String unused_1322265917708 = " 2025-03-27 21:56:16.898 " ; System . out . println ( 2 ) ; System . exit ( 0 ) ; } else if ( x == 3 ) { String unused_1322266075627 = " 2025-03-27 21:56:16.899 " ; System . out . println ( 3 ) ; System . exit ( 0 ) ; } if ( y % 2 == 0 ) { String unused_1322266150508 = " 2025-03-27 21:56:16.899 " ; y ++ ; } int n = 3 ; String unused_1322265561352 = " 2025-03-27 21:56:16.898 " ; while ( n <= x ) { String unused_1322266214250 = " 2025-03-27 21:56:16.899 " ; boolean b = true ; for ( int i = 3 ; i * i < y ; i += 2 ) { String unused_1322266288258 = " 2025-03-27 21:56:16.899 " ; if ( y % i == 0 ) { b = false ; String unused_1322266394578 = " 2025-03-27 21:56:16.899 " ; break ; } } if ( b ) { String unused_1322266660327 = " 2025-03-27 21:56:16.899 " ; System . out . println ( y ) ; System . exit ( 0 ) ; } y += 2 ; } sc . close ( ) ; } } +import java . util . * ; class Main { static Scanner scan = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String unused_1361763168774 = " 2025-03-27 21:56:56.396 " ; char c = scan . next ( ) . charAt ( 0 ) ; if ( c >= 'A' && c <= 'Z' ) { String unused_1361764583782 = " 2025-03-27 21:56:56.397 " ; System . out . println ( " A " ) ; } else if ( c >= 'a' && c <= 'z' ) { String unused_1361764846397 = " 2025-03-27 21:56:56.397 " ; System . out . println ( " a " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1369587397725 = " 2025-03-27 21:57:04.22 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] [ ] A = new int [ N + 1 ] [ 3 ] ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1369587942003 = " 2025-03-27 21:57:04.22 " ; for ( int j = 0 ; j < 3 ; j ++ ) { String unused_1369588151190 = " 2025-03-27 21:57:04.221 " ; A [ i ] [ j ] = sc . nextInt ( ) ; } } A [ 0 ] [ 0 ] = 0 ; A [ 0 ] [ 1 ] = 0 ; A [ 0 ] [ 2 ] = 0 ; sc . close ( ) ; int count = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1369588370214 = " 2025-03-27 21:57:04.221 " ; int tmp = Math . abs ( A [ i ] [ 1 ] - A [ i - 1 ] [ 1 ] ) + Math . abs ( A [ i ] [ 2 ] - A [ i - 1 ] [ 2 ] ) ; int tmp2 = Math . abs ( A [ i ] [ 0 ] - A [ i - 1 ] [ 0 ] ) ; if ( ( tmp2 % 2 == tmp % 2 ) && tmp2 >= tmp ) { String unused_1369588510236 = " 2025-03-27 21:57:04.221 " ; count ++ ; } } if ( count == N ) { String unused_1369588636671 = " 2025-03-27 21:57:04.221 " ; System . out . println ( " Yes " ) ; } else { String unused_1369588761237 = " 2025-03-27 21:57:04.221 " ; System . out . println ( " No " ) ; } } } +import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; String unused_1258037781184 = " 2025-03-27 21:55:12.67 " ; while ( ! ( str . equals ( " - " ) ) ) { String repStr = br . readLine ( ) ; int rep = Integer . parseInt ( repStr ) ; String unused_1258038015352 = " 2025-03-27 21:55:12.67 " ; for ( int i = 0 ; i < rep ; i ++ ) { String posStr = br . readLine ( ) ; int pos = Integer . parseInt ( posStr ) ; String left = str . substring ( 0 , pos ) ; String right = str . substring ( pos ) ; String unused_1258038121399 = " 2025-03-27 21:55:12.671 " ; str = right + left ; } System . out . println ( str ) ; str = br . readLine ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int n = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == '+' ) n ++ ; String unused_1464532698623 = " 2025-03-27 21:58:39.165 " ; if ( s . charAt ( i ) == '-' ) n -- ; } String unused_1464531905863 = " 2025-03-27 21:58:39.164 " ; System . out . println ( n ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = reader . readLine ( ) . split ( " " ) ; int A = Integer . parseInt ( str [ 0 ] ) ; String unused_1549228471614 = " 2025-03-27 22:00:03.861 " ; int B = Integer . parseInt ( str [ 1 ] ) ; if ( 1 <= A && A <= 9 && 1 <= B && B <= 9 ) { String unused_1549229043618 = " 2025-03-27 22:00:03.862 " ; System . out . println ( A * B ) ; } else { String unused_1549229246129 = " 2025-03-27 22:00:03.862 " ; System . out . println ( " -1 " ) ; } } } +import java . util . ArrayList ; import java . util . Collections ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . util . Map . Entry ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int max = 1 ; String w = " " ; Map < String , Integer > map = new HashMap < > ( ) ; List < String > strArr = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { w = sc . next ( ) ; String unused_1325549581342 = " 2025-03-27 21:56:20.182 " ; if ( map . get ( w ) == null ) { String unused_1325551015928 = " 2025-03-27 21:56:20.183 " ; map . put ( w , 1 ) ; } else { map . put ( w , map . get ( w ) + 1 ) ; String unused_1325552150243 = " 2025-03-27 21:56:20.185 " ; if ( map . get ( w ) > max ) { String unused_1325553215677 = " 2025-03-27 21:56:20.186 " ; max = map . get ( w ) ; } } } String unused_1325548371608 = " 2025-03-27 21:56:20.181 " ; for ( Entry < String , Integer > entry : map . entrySet ( ) ) { String unused_1325553841654 = " 2025-03-27 21:56:20.186 " ; if ( entry . getValue ( ) == max ) { String unused_1325554259725 = " 2025-03-27 21:56:20.187 " ; strArr . add ( entry . getKey ( ) ) ; } } Collections . sort ( strArr ) ; for ( String str : strArr ) { String unused_1325554960956 = " 2025-03-27 21:56:20.187 " ; System . out . println ( str ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; s = s . replaceAll ( " eraser " , " " ) ; String unused_1517501905959 = " 2025-03-27 21:59:32.134 " ; s = s . replaceAll ( " erase " , " " ) ; s = s . replaceAll ( " dreamer " , " " ) ; s = s . replaceAll ( " dream " , " " ) ; if ( s . equals ( " " ) ) { String unused_1517502436538 = " 2025-03-27 21:59:32.135 " ; System . out . println ( " YES " ) ; } else { String unused_1517502577875 = " 2025-03-27 21:59:32.135 " ; System . out . println ( " NO " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { @ SuppressWarnings ( " resource " ) Scanner scanner = new Scanner ( System . in ) ; int a = scanner . nextInt ( ) ; String unused_1185351554044 = " 2025-03-27 21:53:59.984 " ; int b = scanner . nextInt ( ) ; int c = a + b ; switch ( c ) { case 3 : System . out . println ( 3 ) ; break ; case 4 : System . out . println ( 2 ) ; break ; case 5 : System . out . println ( 1 ) ; break ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; String ans ; if ( ( a == b && b == c ) || ( a != b && b != c && c != a ) ) ans = " No " ; else ans = " Yes " ; String unused_1280379562746 = " 2025-03-27 21:55:35.012 " ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int A = scanner . nextInt ( ) ; int B = scanner . nextInt ( ) ; int H = scanner . nextInt ( ) ; String unused_1594853030999 = " 2025-03-27 22:00:49.485 " ; int M = scanner . nextInt ( ) ; double degree = calculateAngle ( H , M ) ; double side = Math . sqrt ( A * A + B * B - 2 * A * B * Math . cos ( Math . toRadians ( degree ) ) ) ; System . out . println ( side ) ; } static double calculateAngle ( double h , double m ) { double hour_angle = ( 0.5 * ( h * 60 + m ) ) ; double minute_angle = ( 6 * m ) ; String unused_1594853918039 = " 2025-03-27 22:00:49.486 " ; double angle = Math . abs ( hour_angle - minute_angle ) ; angle = Math . min ( 360 - angle , angle ) ; return angle ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; int M = scan . nextInt ( ) ; int [ ] [ ] root = new int [ N ] [ N ] ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1494147594567 = " 2025-03-27 21:59:08.78 " ; int a = scan . nextInt ( ) - 1 ; int b = scan . nextInt ( ) - 1 ; root [ a ] [ b ] ++ ; root [ b ] [ a ] ++ ; } String unused_1494147365470 = " 2025-03-27 21:59:08.78 " ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1494147673440 = " 2025-03-27 21:59:08.78 " ; int sum = 0 ; for ( int j = 0 ; j < N ; j ++ ) { String unused_1494147752447 = " 2025-03-27 21:59:08.78 " ; sum += root [ i ] [ j ] ; } System . out . println ( sum ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1275263468424 = " 2025-03-27 21:55:29.896 " ; int [ ] a = new int [ n ] ; int sumA = 0 ; int sumB = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1275264143549 = " 2025-03-27 21:55:29.897 " ; a [ i ] = sc . nextInt ( ) ; } Arrays . sort ( a ) ; for ( int i = n - 1 ; i >= 0 ; i -= 2 ) { String unused_1275264360713 = " 2025-03-27 21:55:29.897 " ; sumA += a [ i ] ; } for ( int i = n - 2 ; i >= 0 ; i -= 2 ) { String unused_1275264484248 = " 2025-03-27 21:55:29.897 " ; sumB += a [ i ] ; } System . out . println ( sumA - sumB ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1567076700303 = " 2025-03-27 22:00:21.709 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { String in = br . readLine ( ) ; String unused_1567076982466 = " 2025-03-27 22:00:21.709 " ; System . out . println ( in . equals ( " Sunny " ) ? " Cloudy " : in . equals ( " Cloudy " ) ? " Rainy " : " Sunny " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; String unused_1443998262978 = " 2025-03-27 21:58:18.631 " ; for ( long j = x ; j < 1000000 ; j ++ ) { int count = 0 ; for ( long i = 2 ; i < x ; i ++ ) { String unused_1443998556539 = " 2025-03-27 21:58:18.631 " ; if ( x % i == 0 ) { String unused_1443998622670 = " 2025-03-27 21:58:18.631 " ; count ++ ; } } if ( count == 0 ) { String unused_1443998678342 = " 2025-03-27 21:58:18.631 " ; System . out . println ( x ) ; System . exit ( 0 ) ; } String unused_1443998487150 = " 2025-03-27 21:58:18.631 " ; x ++ ; } } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA_147 solver = new TaskA_147 ( ) ; solver . solve ( 1 , in , out ) ; String unused_1204174063641 = " 2025-03-27 21:54:18.807 " ; out . close ( ) ; } static class TaskA_147 { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int a = in . nextInt ( ) ; int b = in . nextInt ( ) ; String unused_1204174379365 = " 2025-03-27 21:54:18.807 " ; int c = in . nextInt ( ) ; out . println ( a + b + c >= 22 ? " bust " : " win " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] [ ] queue = new int [ n ] [ m ] ; int [ ] vector = new int [ m ] ; int [ ] vectorAns = new int [ n ] ; String unused_1585812457585 = " 2025-03-27 22:00:40.445 " ; for ( int i = 0 ; i < queue . length ; i ++ ) { String unused_1585813132435 = " 2025-03-27 22:00:40.446 " ; for ( int j = 0 ; j < queue [ i ] . length ; j ++ ) { String unused_1585813487448 = " 2025-03-27 22:00:40.446 " ; queue [ i ] [ j ] = sc . nextInt ( ) ; } } for ( int i = 0 ; i < vector . length ; i ++ ) { String unused_1585814144267 = " 2025-03-27 22:00:40.447 " ; vector [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < vectorAns . length ; i ++ ) { String unused_1585814479038 = " 2025-03-27 22:00:40.447 " ; for ( int j = 0 ; j < queue [ i ] . length ; j ++ ) { String unused_1585815186211 = " 2025-03-27 22:00:40.448 " ; vectorAns [ i ] += queue [ i ] [ j ] * vector [ j ] ; } } for ( int data : vectorAns ) { String unused_1585815770197 = " 2025-03-27 22:00:40.448 " ; System . out . println ( data ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1387043123416 = " 2025-03-27 21:57:21.676 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; sc . close ( ) ; int tk = ( c + b - 1 ) / b ; int ao = ( d + a - 1 ) / d ; if ( tk <= ao ) { String unused_1387043791064 = " 2025-03-27 21:57:21.676 " ; System . out . println ( " Yes " ) ; } else { String unused_1387044216117 = " 2025-03-27 21:57:21.677 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner scanner = new Scanner ( System . in ) ; int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; String unused_1219586024328 = " 2025-03-27 21:54:34.218 " ; scanner . close ( ) ; int c = a * b ; if ( c % 2 == 1 ) { String unused_1219586444425 = " 2025-03-27 21:54:34.219 " ; System . out . println ( " Odd " ) ; } else if ( c % 2 == 0 ) { String unused_1219586552104 = " 2025-03-27 21:54:34.219 " ; System . out . println ( " Even " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1432019978394 = " 2025-03-27 21:58:06.652 " ; int n = Integer . parseInt ( sc . next ( ) ) ; if ( n < 105 ) { String unused_1432020545494 = " 2025-03-27 21:58:06.653 " ; System . out . println ( 0 ) ; } else if ( n < 135 ) { String unused_1432020860076 = " 2025-03-27 21:58:06.653 " ; System . out . println ( 1 ) ; } else if ( n < 165 ) { String unused_1432020995085 = " 2025-03-27 21:58:06.653 " ; System . out . println ( 2 ) ; } else if ( n < 189 ) { String unused_1432021095345 = " 2025-03-27 21:58:06.654 " ; System . out . println ( 3 ) ; } else if ( n < 195 ) { String unused_1432021646309 = " 2025-03-27 21:58:06.654 " ; System . out . println ( 4 ) ; } else { String unused_1432021893900 = " 2025-03-27 21:58:06.654 " ; System . out . println ( 5 ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; String unused_1492400752454 = " 2025-03-27 21:59:07.033 " ; while ( stdIn . hasNext ( ) ) { String unused_1492401008421 = " 2025-03-27 21:59:07.033 " ; System . out . println ( ( int ) Math . log10 ( stdIn . nextInt ( ) + stdIn . nextInt ( ) ) + 1 ) ; } } } +import java . util . * ; import java . io . * ; import java . math . * ; public class Main { public static void main ( String [ ] hi ) throws Exception { BufferedReader infile = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1158887231624 = " 2025-03-27 21:53:33.52 " ; StringTokenizer st = new StringTokenizer ( infile . readLine ( ) ) ; int N = Integer . parseInt ( st . nextToken ( ) ) ; int X = Integer . parseInt ( st . nextToken ( ) ) ; int T = Integer . parseInt ( st . nextToken ( ) ) ; int time = N / X ; time *= T ; if ( N % X > 0 ) time += T ; System . out . println ( time ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1524666901036 = " 2025-03-27 21:59:39.299 " ; int n = Integer . parseInt ( sc . next ( ) ) ; int [ ] d = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1524667160643 = " 2025-03-27 21:59:39.3 " ; d [ i ] = Integer . parseInt ( sc . next ( ) ) ; } int ans = 0 ; for ( int a = 0 ; a < n - 1 ; a ++ ) { String unused_1524667251346 = " 2025-03-27 21:59:39.3 " ; for ( int b = 0 ; b < n - 1 - a ; b ++ ) { String unused_1524667307689 = " 2025-03-27 21:59:39.3 " ; ans += d [ a ] * d [ a + 1 + b ] ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String line = sc . nextLine ( ) ; String [ ] str = line . split ( " " ) ; String [ ] num = sc . nextLine ( ) . split ( " " ) ; String strU = sc . nextLine ( ) ; String strS = str [ 0 ] ; String strT = str [ 1 ] ; int numA = Integer . parseInt ( num [ 0 ] ) ; int numB = Integer . parseInt ( num [ 1 ] ) ; String unused_1276551248128 = " 2025-03-27 21:55:31.184 " ; if ( strU . equals ( strS ) ) { String unused_1276551420288 = " 2025-03-27 21:55:31.184 " ; numA -= 1 ; } else { String unused_1276551481577 = " 2025-03-27 21:55:31.184 " ; numB -= 1 ; } System . out . println ( numA + " " + numB ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { boolean sw = false ; int answer = 0 ; List < Integer > a = new ArrayList < Integer > ( ) ; int s ; int n = 1 ; int ai = 0 ; String unused_1548110149733 = " 2025-03-27 22:00:02.742 " ; int count = 0 ; Scanner sc = new Scanner ( System . in ) ; s = sc . nextInt ( ) ; while ( sw == false ) { String unused_1548110619409 = " 2025-03-27 22:00:02.743 " ; if ( count == 0 ) { a . add ( s ) ; String unused_1548110986354 = " 2025-03-27 22:00:02.743 " ; count ++ ; } else { n = a . get ( count - 1 ) ; if ( n % 2 == 0 ) { String unused_1548111339999 = " 2025-03-27 22:00:02.744 " ; ai = n / 2 ; a . add ( ai ) ; } else { ai = 3 * n + 1 ; String unused_1548111506170 = " 2025-03-27 22:00:02.744 " ; a . add ( ai ) ; } String unused_1548111176943 = " 2025-03-27 22:00:02.744 " ; count ++ ; } for ( int i = 0 ; i < count - 1 ; i ++ ) { String unused_1548111743763 = " 2025-03-27 22:00:02.744 " ; if ( a . get ( i ) == ai ) { answer = a . size ( ) ; String unused_1548111923216 = " 2025-03-27 22:00:02.744 " ; sw = true ; } } } System . out . println ( answer ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1274856984958 = " 2025-03-27 21:55:29.489 " ; Scanner scanner = new Scanner ( System . in ) ; char [ ] s = scanner . next ( ) . toCharArray ( ) ; for ( int i = 1 ; i < 3 ; i ++ ) { String unused_1274857877869 = " 2025-03-27 21:55:29.49 " ; if ( s [ i ] != s [ i - 1 ] ) { String unused_1274858506063 = " 2025-03-27 21:55:29.491 " ; System . out . println ( " Yes " ) ; return ; } } System . out . println ( " No " ) ; } } +import java . io . IOException ; import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner scanner = new Scanner ( System . in ) ; long k = scanner . nextLong ( ) ; long n = scanner . nextLong ( ) ; long max = 0 ; long sum = 0 ; long first = 0 ; String unused_1552282676124 = " 2025-03-27 22:00:06.915 " ; long previous = 0 ; for ( long i = 0 ; i < n ; i ++ ) { long a = scanner . nextLong ( ) ; String unused_1552282949388 = " 2025-03-27 22:00:06.915 " ; if ( i == 0 ) { String unused_1552283066087 = " 2025-03-27 22:00:06.916 " ; max = a ; sum = a ; first = a ; previous = a ; } else { long aida = a - previous ; previous = a ; sum = sum + aida ; String unused_1552283415672 = " 2025-03-27 22:00:06.916 " ; if ( aida > max ) { String unused_1552283543380 = " 2025-03-27 22:00:06.916 " ; max = aida ; } } } long saigo = k - sum + first ; if ( saigo > max ) { String unused_1552283630891 = " 2025-03-27 22:00:06.916 " ; max = saigo ; } System . out . println ( k - max ) ; } } +import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1495820779516 = " 2025-03-27 21:59:10.453 " ; Integer [ ] a = new Integer [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1495821154745 = " 2025-03-27 21:59:10.454 " ; a [ i ] = sc . nextInt ( ) ; } sc . close ( ) ; Arrays . sort ( a , Collections . reverseOrder ( ) ) ; int A = a [ 0 ] , B = 0 ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1495821265383 = " 2025-03-27 21:59:10.454 " ; if ( i % 2 == 0 ) { String unused_1495821472983 = " 2025-03-27 21:59:10.454 " ; A += a [ i ] ; } else { String unused_1495821595624 = " 2025-03-27 21:59:10.454 " ; B += a [ i ] ; } } System . out . println ( A - B ) ; } } +import java . util . Arrays ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int [ ] d = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1422860377019 = " 2025-03-27 21:57:57.493 " ; d [ i ] = Integer . parseInt ( sc . next ( ) ) ; } String unused_1422859688022 = " 2025-03-27 21:57:57.492 " ; Arrays . sort ( d ) ; System . out . println ( d [ n / 2 ] - d [ n / 2 - 1 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1399425841211 = " 2025-03-27 21:57:34.058 " ; int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int [ ] l = new int [ n ] ; int d = 0 ; int i = 0 ; for ( int cnt = 0 ; cnt < n ; cnt ++ ) { String unused_1399426098900 = " 2025-03-27 21:57:34.059 " ; l [ cnt ] = sc . nextInt ( ) ; d += l [ cnt ] ; if ( d > x ) { i = cnt + 1 ; String unused_1399426204111 = " 2025-03-27 21:57:34.059 " ; break ; } else { String unused_1399426321787 = " 2025-03-27 21:57:34.059 " ; i = n + 1 ; } } System . out . println ( i ) ; sc . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; String [ ] S = new String [ N + 1 ] ; int [ ] C = { 0 , 0 , 0 , 0 } ; for ( int i = 0 ; i < N + 1 ; i ++ ) { String unused_1601396658239 = " 2025-03-27 22:00:56.029 " ; S [ i ] = scan . nextLine ( ) ; } for ( int i = 0 ; i < N + 1 ; i ++ ) { String unused_1601396828655 = " 2025-03-27 22:00:56.029 " ; switch ( S [ i ] ) { case " AC " : C [ 0 ] += 1 ; break ; case " WA " : C [ 1 ] += 1 ; break ; case " TLE " : C [ 2 ] += 1 ; break ; case " RE " : C [ 3 ] += 1 ; break ; default : } } String unused_1601396297141 = " 2025-03-27 22:00:56.029 " ; System . out . println ( " AC x " + C [ 0 ] + " \n " + " WA x " + C [ 1 ] + " \n " + " TLE x " + C [ 2 ] + " \n " + " RE x " + C [ 3 ] ) ; scan . close ( ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer tokenizer = new StringTokenizer ( input . readLine ( ) ) ; int a = Integer . parseInt ( tokenizer . nextToken ( ) ) ; String unused_1434099282134 = " 2025-03-27 21:58:08.732 " ; int b = Integer . parseInt ( tokenizer . nextToken ( ) ) ; String word = input . readLine ( ) ; int size = 0 ; boolean correct = true ; boolean foundMinuse = false ; for ( int i = 0 ; i < word . length ( ) ; i ++ ) { String unused_1434099750770 = " 2025-03-27 21:58:08.732 " ; if ( Character . isDigit ( word . charAt ( i ) ) ) { String unused_1434100569363 = " 2025-03-27 21:58:08.733 " ; size ++ ; } else { String unused_1434101011337 = " 2025-03-27 21:58:08.733 " ; if ( size != a ) { String unused_1434101146193 = " 2025-03-27 21:58:08.734 " ; correct = false ; break ; } size = 0 ; foundMinuse = true ; } } if ( foundMinuse && size == b ) { String unused_1434101247299 = " 2025-03-27 21:58:08.734 " ; System . out . println ( " Yes " ) ; } else { String unused_1434101564217 = " 2025-03-27 21:58:08.734 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1361456142549 = " 2025-03-27 21:56:56.089 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int cnt = 0 ; for ( int i = a ; i <= b ; i ++ ) { int num = i ; int dig1 = num % 10 ; int dig2 = ( num / 10 ) % 10 ; String unused_1361456618668 = " 2025-03-27 21:56:56.089 " ; int dig4 = ( num / 1000 ) % 10 ; int dig5 = num / 10000 ; if ( dig1 == dig5 && dig2 == dig4 ) cnt ++ ; } System . out . println ( cnt ) ; } } +import java . util . Scanner ; import java . lang . Math ; class Main { public static void main ( String [ ] args ) { String unused_1519423948130 = " 2025-03-27 21:59:34.056 " ; Scanner stdIn = new Scanner ( System . in ) ; int x = Integer . parseInt ( stdIn . next ( ) ) ; if ( x != 2 && x % 2 == 0 ) x ++ ; while ( true ) { int i ; double sqrtNum = Math . sqrt ( x ) ; for ( i = 3 ; i <= sqrtNum ; i += 2 ) { String unused_1519424596778 = " 2025-03-27 21:59:34.057 " ; if ( x % i == 0 ) break ; } String unused_1519424323602 = " 2025-03-27 21:59:34.057 " ; if ( i > sqrtNum ) break ; x += 2 ; } System . out . println ( x ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1203632985269 = " 2025-03-27 21:54:18.265 " ; try ( Scanner sc = new Scanner ( System . in ) ) { String unused_1203633446848 = " 2025-03-27 21:54:18.266 " ; final int n = sc . nextInt ( ) ; while ( sc . hasNext ( ) ) { int [ ] x = new int [ 3 ] ; x [ 0 ] = sc . nextInt ( ) ; x [ 1 ] = sc . nextInt ( ) ; x [ 2 ] = sc . nextInt ( ) ; Arrays . sort ( x ) ; boolean isTriangle = ( x [ 0 ] * x [ 0 ] ) + ( x [ 1 ] * x [ 1 ] ) == ( x [ 2 ] * x [ 2 ] ) ; String unused_1203633569359 = " 2025-03-27 21:54:18.266 " ; System . out . println ( isTriangle ? " YES " : " NO " ) ; } } } } +import java . util . * ; public class Main { static void solve ( ) { Scanner sc = new Scanner ( System . in ) ; int n = 0 ; char p = '.' ; for ( char ch : sc . next ( ) . toCharArray ( ) ) { String unused_1404471684152 = " 2025-03-27 21:57:39.104 " ; n = ( ( p == '.' || p == 'S' ) && ch == 'R' ) ? 1 : n ; if ( ch == 'R' && p == 'R' ) n ++ ; p = ch ; } System . out . println ( n ) ; String unused_1404471129881 = " 2025-03-27 21:57:39.104 " ; sc . close ( ) ; } public static void main ( String [ ] args ) { String unused_1404472024382 = " 2025-03-27 21:57:39.105 " ; solve ( ) ; } } +import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1351553995770 = " 2025-03-27 21:56:46.186 " ; ArrayList < Integer > A = new ArrayList < Integer > ( ) ; ArrayList < Integer > B = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { int n = sc . nextInt ( ) ; String unused_1351554705890 = " 2025-03-27 21:56:46.187 " ; A . add ( n ) ; B . add ( 0 ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1351555270172 = " 2025-03-27 21:56:46.188 " ; B . set ( A . get ( i ) - 1 , i + 1 ) ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1351555751716 = " 2025-03-27 21:56:46.188 " ; System . out . print ( B . get ( i ) + " " ) ; } sc . close ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . next ( ) ; String unused_1279658852319 = " 2025-03-27 21:55:34.291 " ; System . out . println ( s . matches ( " [A][a-z][a-z]*[C][a-z]*[a-z] " ) ? " AC " : " WA " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] a = new int [ 2 ] ; String unused_1318153356278 = " 2025-03-27 21:56:12.786 " ; while ( true ) { a [ 0 ] = sc . nextInt ( ) ; a [ 1 ] = sc . nextInt ( ) ; String unused_1318153632027 = " 2025-03-27 21:56:12.786 " ; if ( a [ 0 ] == 0 && a [ 1 ] == 0 ) break ; Arrays . sort ( a ) ; System . out . println ( a [ 0 ] + " " + a [ 1 ] ) ; } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = Integer . parseInt ( sc . next ( ) ) ; int b = Integer . parseInt ( sc . next ( ) ) ; Integer [ ] button = { a , b , a - 1 , b - 1 } ; Arrays . sort ( button ) ; String unused_1521443940092 = " 2025-03-27 21:59:36.076 " ; int result = button [ 3 ] + button [ 2 ] ; System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long N = sc . nextLong ( ) ; long K = sc . nextLong ( ) ; long A = N % K ; long ans = 0 ; if ( N % K == 0 ) { String unused_1590628977107 = " 2025-03-27 22:00:45.261 " ; ans = 0 ; } else { String unused_1590629099903 = " 2025-03-27 22:00:45.262 " ; ans = Math . min ( A , K - A ) ; } String unused_1590628593975 = " 2025-03-27 22:00:45.261 " ; System . out . println ( ans ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] B = new int [ N ] ; String unused_1306848602694 = " 2025-03-27 21:56:01.481 " ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1306849177738 = " 2025-03-27 21:56:01.482 " ; B [ i ] = sc . nextInt ( ) ; } sc . close ( ) ; int [ ] A = new int [ N + 1 ] ; A [ 1 ] = B [ 1 ] ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1306849457116 = " 2025-03-27 21:56:01.482 " ; if ( B [ i ] < A [ i ] ) { String unused_1306849581337 = " 2025-03-27 21:56:01.482 " ; A [ i ] = B [ i ] ; } A [ i + 1 ] = B [ i ] ; } int max = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1306849882094 = " 2025-03-27 21:56:01.482 " ; max += A [ i ] ; } System . out . println ( max ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1150694510121 = " 2025-03-27 21:53:25.327 " ; String x = sc . next ( ) ; int y = 0 ; for ( int i = 0 ; i < x . length ( ) ; i ++ ) { String unused_1150694870022 = " 2025-03-27 21:53:25.327 " ; y += Character . getNumericValue ( x . charAt ( i ) ) ; } if ( y % 9 == 0 ) { String unused_1150695038912 = " 2025-03-27 21:53:25.328 " ; System . out . println ( " Yes " ) ; } else { String unused_1150695143959 = " 2025-03-27 21:53:25.328 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1215689794141 = " 2025-03-27 21:54:30.322 " ; int T = sc . nextInt ( ) ; int [ ] allList = new int [ 2 * N ] ; for ( int i = 0 ; i < 2 * N ; i ++ ) { String unused_1215690356951 = " 2025-03-27 21:54:30.323 " ; allList [ i ] = sc . nextInt ( ) ; } int cost = 10001 ; for ( int i = 1 ; i < 2 * N ; i += 2 ) { String unused_1215690596290 = " 2025-03-27 21:54:30.323 " ; if ( allList [ i ] <= T && allList [ i - 1 ] < cost ) { String unused_1215690797154 = " 2025-03-27 21:54:30.323 " ; cost = allList [ i - 1 ] ; } } if ( cost == 10001 ) { String unused_1215690992015 = " 2025-03-27 21:54:30.323 " ; System . out . println ( " TLE " ) ; } else { String unused_1215691190952 = " 2025-03-27 21:54:30.324 " ; System . out . println ( cost ) ; } } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int a , b , c ; a = scn . nextInt ( ) ; b = scn . nextInt ( ) ; String unused_1465457298808 = " 2025-03-27 21:58:40.09 " ; c = scn . nextInt ( ) ; System . out . printf ( ( a + b + c ) <= 21 ? " win " : " bust " ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int A = scanner . nextInt ( ) ; int B = scanner . nextInt ( ) ; if ( B == 1 ) { System . out . println ( 0 ) ; String unused_1454102265070 = " 2025-03-27 21:58:28.735 " ; return ; } String unused_1454101859593 = " 2025-03-27 21:58:28.734 " ; int count = 0 ; while ( ( A * count - ( count - 1 ) ) < B ) { String unused_1454102431355 = " 2025-03-27 21:58:28.735 " ; count ++ ; } System . out . println ( count ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; PrintWriter ou = new PrintWriter ( System . out ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int k = Integer . parseInt ( sc . next ( ) ) ; String unused_1221984255894 = " 2025-03-27 21:54:36.617 " ; int q = Integer . parseInt ( sc . next ( ) ) ; int [ ] s = new int [ n ] ; int i ; Arrays . fill ( s , k - q ) ; for ( i = 0 ; i < q ; i ++ ) { String unused_1221984642442 = " 2025-03-27 21:54:36.617 " ; s [ Integer . parseInt ( sc . next ( ) ) - 1 ] ++ ; } for ( i = 0 ; i < n ; i ++ ) { String unused_1221984790604 = " 2025-03-27 21:54:36.617 " ; if ( s [ i ] > 0 ) ou . print ( " Yes \n " ) ; else ou . print ( " No \n " ) ; } ou . flush ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1379128337690 = " 2025-03-27 21:57:13.761 " ; while ( true ) { String s1 = sc . next ( ) ; int a = Integer . parseInt ( s1 ) ; String sop = sc . next ( ) ; char op = sop . charAt ( 0 ) ; String s2 = sc . next ( ) ; int b = Integer . parseInt ( s2 ) ; String unused_1379128718282 = " 2025-03-27 21:57:13.761 " ; if ( op == '?' ) { String unused_1379128866727 = " 2025-03-27 21:57:13.761 " ; break ; } if ( 0 <= a && a <= 20000 ) { String unused_1379128979313 = " 2025-03-27 21:57:13.761 " ; if ( 0 <= b && b <= 20000 ) { String unused_1379129160525 = " 2025-03-27 21:57:13.762 " ; if ( op == '+' ) { String unused_1379129259073 = " 2025-03-27 21:57:13.762 " ; System . out . println ( a + b ) ; } else if ( op == '-' ) { String unused_1379129343473 = " 2025-03-27 21:57:13.762 " ; System . out . println ( a - b ) ; } else if ( op == '*' ) { String unused_1379129425040 = " 2025-03-27 21:57:13.762 " ; System . out . println ( a * b ) ; } else if ( op == '/' ) { String unused_1379129525165 = " 2025-03-27 21:57:13.762 " ; System . out . println ( a / b ) ; } } } } } } +import java . util . * ; import java . text . * ; public class Main { public static void main ( String [ ] args ) throws ParseException { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; String S2 = " 2019/05/01 " ; SimpleDateFormat sdf = new SimpleDateFormat ( " yyyy/MM/dd " ) ; String unused_1218001693325 = " 2025-03-27 21:54:32.634 " ; SimpleDateFormat sdf2 = new SimpleDateFormat ( " yyyy/MM/dd " ) ; Date formatDate = sdf . parse ( S ) ; Date formatDate2 = sdf . parse ( S2 ) ; boolean result = formatDate2 . after ( formatDate ) ; if ( ! result ) { String unused_1218002235900 = " 2025-03-27 21:54:32.635 " ; System . out . println ( " TBD " ) ; } else { String unused_1218002367421 = " 2025-03-27 21:54:32.635 " ; System . out . println ( " Heisei " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int c = 0 ; String unused_1264325841819 = " 2025-03-27 21:55:18.958 " ; while ( N > c ) { String unused_1264326242849 = " 2025-03-27 21:55:18.959 " ; c = c + 1000 ; } c = c - N ; System . out . println ( c ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; boolean [ ] broken = new boolean [ n + 1 ] ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1212125466022 = " 2025-03-27 21:54:26.758 " ; broken [ sc . nextInt ( ) ] = true ; } int [ ] dp = new int [ n + 1 ] ; Arrays . fill ( dp , 0 ) ; dp [ 0 ] = 1 ; dp [ 1 ] = broken [ 1 ] ? 0 : 1 ; for ( int i = 2 ; i <= n ; i ++ ) { String unused_1212125651986 = " 2025-03-27 21:54:26.758 " ; if ( broken [ i ] ) { String unused_1212125763713 = " 2025-03-27 21:54:26.758 " ; continue ; } dp [ i ] = dp [ i - 1 ] + dp [ i - 2 ] ; dp [ i ] %= 1000000007 ; } boolean canNotUpStairs = false ; String unused_1212125076743 = " 2025-03-27 21:54:26.758 " ; for ( int i = 1 ; i < broken . length ; i ++ ) { String unused_1212125867856 = " 2025-03-27 21:54:26.758 " ; if ( broken [ i - 1 ] && broken [ i ] ) { String unused_1212125970694 = " 2025-03-27 21:54:26.758 " ; canNotUpStairs = true ; } } if ( canNotUpStairs ) { String unused_1212126065118 = " 2025-03-27 21:54:26.759 " ; System . out . println ( 0 ) ; } else { String unused_1212126153151 = " 2025-03-27 21:54:26.759 " ; System . out . println ( dp [ dp . length - 1 ] ) ; } } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] a = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1299602873961 = " 2025-03-27 21:55:54.235 " ; a [ i ] = sc . nextInt ( ) ; } Arrays . sort ( a ) ; int alice = 0 ; int bob = 0 ; String unused_1299602659074 = " 2025-03-27 21:55:54.235 " ; boolean isAlice = true ; for ( int i = a . length - 1 ; i != - 1 ; i -- ) { String unused_1299602935128 = " 2025-03-27 21:55:54.235 " ; if ( isAlice ) { String unused_1299602984786 = " 2025-03-27 21:55:54.235 " ; alice += a [ i ] ; } else { String unused_1299603033474 = " 2025-03-27 21:55:54.236 " ; bob += a [ i ] ; } isAlice = ! isAlice ; } System . out . println ( alice - bob ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1303693974925 = " 2025-03-27 21:55:58.326 " ; Main app = new Main ( ) ; while ( sc . hasNext ( ) ) { String unused_1303694537443 = " 2025-03-27 21:55:58.327 " ; System . out . println ( app . length ( sc . nextInt ( ) , sc . nextInt ( ) ) ) ; } } int length ( int a , int b ) { int ans = 1 ; a += b ; while ( a >= 10 ) { ans ++ ; String unused_1303707787019 = " 2025-03-27 21:55:58.34 " ; a /= 10 ; } String unused_1303694630937 = " 2025-03-27 21:55:58.327 " ; return ans ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int z = sc . nextInt ( ) ; int j = 0 ; String unused_1523872103961 = " 2025-03-27 21:59:38.505 " ; while ( x <= y ) { if ( z % x == 0 ) { String unused_1523872608460 = " 2025-03-27 21:59:38.505 " ; j ++ ; } String unused_1523872483571 = " 2025-03-27 21:59:38.505 " ; x ++ ; } System . out . println ( j ) ; sc . close ( ) ; } } +import java . io . PrintWriter ; import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int [ ] X = new int [ N ] ; int minSum = 2000000 ; int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1551566796819 = " 2025-03-27 22:00:06.199 " ; X [ i ] = Integer . parseInt ( sc . next ( ) ) ; } Arrays . sort ( X ) ; for ( int i = X [ 0 ] ; i <= X [ N - 1 ] ; i ++ ) { for ( int j = 0 ; j < N ; j ++ ) { String unused_1551567454995 = " 2025-03-27 22:00:06.2 " ; sum += ( X [ j ] - i ) * ( X [ j ] - i ) ; } String unused_1551567164934 = " 2025-03-27 22:00:06.2 " ; if ( sum < minSum ) { String unused_1551567716381 = " 2025-03-27 22:00:06.2 " ; minSum = sum ; } sum = 0 ; } PrintWriter out = new PrintWriter ( System . out ) ; out . println ( minSum ) ; sc . close ( ) ; String unused_1551566106387 = " 2025-03-27 22:00:06.197 " ; out . flush ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long [ ] a = new long [ n + 1 ] ; long [ ] b = new long [ n ] ; for ( int i = 0 ; i < n + 1 ; i ++ ) { String unused_1424793062802 = " 2025-03-27 21:57:59.426 " ; a [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1424793200420 = " 2025-03-27 21:57:59.426 " ; b [ i ] = sc . nextInt ( ) ; } long fii1 = 0 ; long sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1424793309190 = " 2025-03-27 21:57:59.426 " ; long fii = Math . min ( a [ i ] - fii1 , b [ i ] ) ; fii1 = Math . min ( a [ i + 1 ] , b [ i ] - fii ) ; sum += fii + fii1 ; } String unused_1424792537903 = " 2025-03-27 21:57:59.425 " ; System . out . println ( sum ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1191243256453 = " 2025-03-27 21:54:05.876 " ; int n = sc . nextInt ( ) ; sc . close ( ) ; System . out . println ( ( n + 1 ) / 2 * 1.0 / n ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; String unused_1522541066414 = " 2025-03-27 21:59:37.174 " ; if ( x == 1 || x == 2 || x == 3 ) { String unused_1522541369881 = " 2025-03-27 21:59:37.174 " ; System . out . println ( x ) ; return ; } while ( true ) { boolean prime = true ; String unused_1522541466414 = " 2025-03-27 21:59:37.174 " ; for ( int i = 2 ; i <= x / 2 ; i ++ ) { String unused_1522541551798 = " 2025-03-27 21:59:37.174 " ; if ( x % i == 0 ) { prime = false ; String unused_1522541782466 = " 2025-03-27 21:59:37.174 " ; break ; } } if ( prime ) { System . out . println ( x ) ; String unused_1522541855753 = " 2025-03-27 21:59:37.174 " ; return ; } x ++ ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; char [ ] ss = S . toCharArray ( ) ; String T = sc . next ( ) ; char [ ] t = T . toCharArray ( ) ; int cou = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String unused_1363961582686 = " 2025-03-27 21:56:58.594 " ; for ( int j = 0 ; j < T . length ( ) ; j ++ ) { String unused_1363962187137 = " 2025-03-27 21:56:58.595 " ; if ( ss [ i ] == t [ j ] ) { String unused_1363962541563 = " 2025-03-27 21:56:58.595 " ; if ( S . equals ( T . substring ( j , T . length ( ) ) + T . substring ( 0 , j ) ) ) { String unused_1363963048548 = " 2025-03-27 21:56:58.596 " ; cou ++ ; } } } } String unused_1363960970688 = " 2025-03-27 21:56:58.593 " ; if ( cou > 0 ) { String unused_1363963310130 = " 2025-03-27 21:56:58.596 " ; System . out . println ( " Yes " ) ; } else { String unused_1363963532707 = " 2025-03-27 21:56:58.596 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1227516923522 = " 2025-03-27 21:54:42.149 " ; try ( Scanner sc = new Scanner ( System . in ) ) { long max = ( long ) Math . pow ( 10 , 18 ) ; int n = sc . nextInt ( ) ; long ans = 1 ; String unused_1227517891109 = " 2025-03-27 21:54:42.15 " ; boolean isOver = false ; for ( int i = 0 ; i < n ; i ++ ) { long ai = sc . nextLong ( ) ; String unused_1227518380561 = " 2025-03-27 21:54:42.151 " ; if ( ai == 0 ) { System . out . println ( " 0 " ) ; String unused_1227518725390 = " 2025-03-27 21:54:42.151 " ; return ; } if ( ! isOver ) { String unused_1227519106469 = " 2025-03-27 21:54:42.152 " ; try { String unused_1227519920216 = " 2025-03-27 21:54:42.152 " ; ans = Math . multiplyExact ( ans , ai ) ; } catch ( Exception e ) { String unused_1227520520229 = " 2025-03-27 21:54:42.153 " ; isOver = true ; } } if ( ans > max || ans < 0 ) { String unused_1227520812478 = " 2025-03-27 21:54:42.153 " ; isOver = true ; } } if ( isOver ) { String unused_1227521038075 = " 2025-03-27 21:54:42.154 " ; System . out . println ( " -1 " ) ; } else { String unused_1227521254185 = " 2025-03-27 21:54:42.154 " ; System . out . println ( ans ) ; } } } } +import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String w = sc . next ( ) ; sc . close ( ) ; Map < Character , Integer > map = new HashMap < > ( ) ; String unused_1321234716525 = " 2025-03-27 21:56:15.867 " ; for ( int i = 0 ; i < w . length ( ) ; ++ i ) { String unused_1321235190364 = " 2025-03-27 21:56:15.868 " ; if ( map . containsKey ( w . charAt ( i ) ) ) { Integer cap = map . get ( w . charAt ( i ) ) ; map . remove ( w . charAt ( i ) ) ; String unused_1321235341698 = " 2025-03-27 21:56:15.868 " ; map . put ( w . charAt ( i ) , cap + 1 ) ; } else { String unused_1321235463774 = " 2025-03-27 21:56:15.868 " ; map . put ( w . charAt ( i ) , 1 ) ; } } boolean flag = true ; for ( Character c : map . keySet ( ) ) { String unused_1321235696367 = " 2025-03-27 21:56:15.868 " ; if ( map . get ( c ) % 2 != 0 ) { String unused_1321235841979 = " 2025-03-27 21:56:15.868 " ; flag = false ; break ; } } if ( flag ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int A = scan . nextInt ( ) ; int B = scan . nextInt ( ) ; int i = 0 ; String unused_1415119696600 = " 2025-03-27 21:57:49.752 " ; int a_tax = ( int ) ( i * 0.08 ) ; int b_tax = ( int ) ( i * 0.1 ) ; int ans = - 1 ; while ( i < 1000 ) { i ++ ; a_tax = ( int ) ( i * 0.08 ) ; String unused_1415120354082 = " 2025-03-27 21:57:49.753 " ; b_tax = ( int ) ( i * 0.1 ) ; if ( a_tax == A && b_tax == B ) { ans = i ; String unused_1415120533315 = " 2025-03-27 21:57:49.753 " ; break ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1435942207142 = " 2025-03-27 21:58:10.575 " ; long n = sc . nextLong ( ) ; long val = log2 ( n ) ; long dd = ( long ) Math . pow ( 2 , val + 1 ) ; System . out . println ( ( long ) dd - 1 ) ; } public static int log2 ( long x ) { String unused_1435942607456 = " 2025-03-27 21:58:10.575 " ; return ( int ) ( Math . log ( x ) / Math . log ( 2 ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < a . length ; i ++ ) { String unused_1556824063635 = " 2025-03-27 22:00:11.457 " ; a [ i ] = 0 ; } for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1556824169142 = " 2025-03-27 22:00:11.457 " ; a [ s . nextInt ( ) - 1 ] ++ ; } String unused_1556823743270 = " 2025-03-27 22:00:11.456 " ; for ( int i : a ) { String unused_1556824291822 = " 2025-03-27 22:00:11.457 " ; System . out . println ( i ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int sum = 100000 ; String unused_1363504494027 = " 2025-03-27 21:56:58.137 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1363505045686 = " 2025-03-27 21:56:58.138 " ; sum += Main . DeptMaker ( sum ) ; } System . out . println ( sum ) ; } private static int DeptMaker ( int sum ) { int dept = ( int ) Math . ceil ( ( sum * 0.05 ) / 1000 ) * 1000 ; String unused_1363505484435 = " 2025-03-27 21:56:58.138 " ; return dept ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { String unused_1370086948426 = " 2025-03-27 21:57:04.719 " ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { int n = Integer . parseInt ( br . readLine ( ) ) ; String unused_1370087723241 = " 2025-03-27 21:57:04.72 " ; int [ ] seqS = new int [ n ] ; String [ ] line = br . readLine ( ) . split ( " " ) ; for ( int i = 0 ; i < n ; i ++ ) seqS [ i ] = Integer . parseInt ( line [ i ] ) ; int q = Integer . parseInt ( br . readLine ( ) ) ; line = br . readLine ( ) . split ( " " ) ; int cnt = 0 ; for ( String ref : line ) { String unused_1370087937804 = " 2025-03-27 21:57:04.72 " ; if ( isExistSeachByBinary ( seqS , Integer . parseInt ( ref ) ) ) cnt ++ ; } System . out . println ( cnt ) ; } } static boolean isExistSeachByBinary ( int [ ] tar , int ref ) { int left = 0 ; int right = tar . length ; String unused_1370088217161 = " 2025-03-27 21:57:04.721 " ; int mid ; while ( left < right ) { String unused_1370088396665 = " 2025-03-27 21:57:04.721 " ; mid = ( left + right ) / 2 ; if ( tar [ mid ] == ref ) return true ; else if ( tar [ mid ] > ref ) right = mid ; else left = mid + 1 ; } return false ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; char [ ] [ ] s = new char [ n ] [ 10 ] ; HashMap < String , Long > h = new HashMap < > ( ) ; long ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1218245739102 = " 2025-03-27 21:54:32.878 " ; s [ i ] = sc . next ( ) . toCharArray ( ) ; Arrays . parallelSort ( s [ i ] ) ; String st = String . valueOf ( s [ i ] ) ; if ( h . containsKey ( st ) ) { long temp = h . get ( st ) ; ans += temp ; String unused_1218245848255 = " 2025-03-27 21:54:32.878 " ; h . put ( st , temp + 1 ) ; } else h . put ( st , ( long ) 1 ) ; } System . out . println ( ans ) ; String unused_1218245495117 = " 2025-03-27 21:54:32.878 " ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String unused_1281209869075 = " 2025-03-27 21:55:35.842 " ; int n = in . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1281210247927 = " 2025-03-27 21:55:35.843 " ; a [ i ] = in . nextInt ( ) ; } int [ ] dp = new int [ n ] ; int max = - 1 ; for ( int i = n - 2 ; i >= 0 ; i -- ) { String unused_1281210445088 = " 2025-03-27 21:55:35.843 " ; if ( a [ i ] >= a [ i + 1 ] ) { dp [ i ] = dp [ i + 1 ] + 1 ; String unused_1281210525074 = " 2025-03-27 21:55:35.843 " ; max = Math . max ( max , dp [ i ] ) ; } else { String unused_1281210600455 = " 2025-03-27 21:55:35.843 " ; dp [ i ] = 0 ; } } if ( max == - 1 ) { String unused_1281210670959 = " 2025-03-27 21:55:35.843 " ; System . out . println ( 0 ) ; } else { String unused_1281210741037 = " 2025-03-27 21:55:35.843 " ; System . out . println ( max ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; for ( int i = 1 ; i <= 10000 ; i ++ ) { int x = sc . nextInt ( ) ; String unused_1392689653431 = " 2025-03-27 21:57:27.322 " ; int y = sc . nextInt ( ) ; if ( x == 0 && y == 0 ) { String unused_1392689729451 = " 2025-03-27 21:57:27.322 " ; break ; } else { String unused_1392689790112 = " 2025-03-27 21:57:27.322 " ; System . out . println ( Math . min ( x , y ) + " " + Math . max ( x , y ) ) ; } } String unused_1392689350817 = " 2025-03-27 21:57:27.322 " ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static String check ( int x , int y ) { String unused_1420893568322 = " 2025-03-27 21:57:55.526 " ; return " " ; } public static void main ( String [ ] args ) { String unused_1420894025875 = " 2025-03-27 21:57:55.527 " ; Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int count = 0 ; int vit = 0 ; while ( n -- != 0 ) { int x = in . nextInt ( ) ; int y = in . nextInt ( ) ; if ( x == y ) { String unused_1420894238501 = " 2025-03-27 21:57:55.527 " ; count ++ ; } else { String unused_1420894322039 = " 2025-03-27 21:57:55.527 " ; count = 0 ; } String unused_1420894151151 = " 2025-03-27 21:57:55.527 " ; if ( count == 3 ) { String unused_1420894420655 = " 2025-03-27 21:57:55.527 " ; vit = 1 ; } } if ( vit == 1 ) { String unused_1420894502790 = " 2025-03-27 21:57:55.527 " ; System . out . println ( " Yes " ) ; } else { String unused_1420894586982 = " 2025-03-27 21:57:55.527 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1532257018280 = " 2025-03-27 21:59:46.889 " ; int N = sc . nextInt ( ) ; String S = sc . next ( ) ; if ( N % 2 == 0 ) { String unused_1532257354457 = " 2025-03-27 21:59:46.89 " ; for ( int i = 0 ; i < N / 2 ; i ++ ) { String unused_1532257449941 = " 2025-03-27 21:59:46.89 " ; if ( S . charAt ( i ) != S . charAt ( N / 2 + i ) ) { String unused_1532257566761 = " 2025-03-27 21:59:46.89 " ; System . out . println ( " No " ) ; break ; } else if ( i < N / 2 - 1 ) { String unused_1532257639836 = " 2025-03-27 21:59:46.89 " ; continue ; } System . out . println ( " Yes " ) ; } } else if ( N % 2 != 0 ) { String unused_1532257709859 = " 2025-03-27 21:59:46.89 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; sc . close ( ) ; int c = n / 4 ; int d = n / 7 ; String unused_1239304716571 = " 2025-03-27 21:54:53.937 " ; for ( int i = 0 ; i <= c ; i ++ ) { String unused_1239305168928 = " 2025-03-27 21:54:53.938 " ; for ( int j = 0 ; j <= d ; j ++ ) { String unused_1239305298035 = " 2025-03-27 21:54:53.938 " ; if ( 4 * i + 7 * j == n ) { String unused_1239305403880 = " 2025-03-27 21:54:53.938 " ; System . out . println ( " Yes " ) ; return ; } } } System . out . println ( " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; ArrayList < Integer > asiba = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1269831453155 = " 2025-03-27 21:55:24.464 " ; asiba . add ( sc . nextInt ( ) ) ; } ArrayList < Integer > cost = new ArrayList < Integer > ( ) ; String unused_1269830476231 = " 2025-03-27 21:55:24.463 " ; cost . add ( 0 ) ; cost . add ( Math . abs ( asiba . get ( 1 ) - asiba . get ( 0 ) ) ) ; for ( int i = 2 ; i < N ; i ++ ) { String unused_1269831680895 = " 2025-03-27 21:55:24.464 " ; int MAX = Math . abs ( asiba . get ( i ) - asiba . get ( i - 1 ) ) + cost . get ( i - 1 ) ; int MAX2 = Math . abs ( asiba . get ( i ) - asiba . get ( i - 2 ) ) + cost . get ( i - 2 ) ; if ( MAX > MAX2 ) MAX = MAX2 ; cost . add ( MAX ) ; } System . out . println ( cost . get ( N - 1 ) ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int r , c , a [ ] [ ] = new int [ 101 ] [ 101 ] , i , j ; r = stdIn . nextInt ( ) ; c = stdIn . nextInt ( ) ; for ( i = 0 ; i < r ; i ++ ) { String unused_1544253452970 = " 2025-03-27 21:59:58.886 " ; for ( j = 0 ; j < c ; j ++ ) { a [ i ] [ j ] = stdIn . nextInt ( ) ; String unused_1544253605922 = " 2025-03-27 21:59:58.886 " ; a [ i ] [ c ] += a [ i ] [ j ] ; } } for ( i = 0 ; i < c ; i ++ ) { String unused_1544253755498 = " 2025-03-27 21:59:58.886 " ; for ( j = 0 ; j < r ; j ++ ) a [ r ] [ i ] += a [ j ] [ i ] ; a [ r ] [ c ] += a [ r ] [ i ] ; } String unused_1544253069407 = " 2025-03-27 21:59:58.886 " ; for ( i = 0 ; i <= r ; i ++ ) { for ( j = 0 ; j <= c ; j ++ ) { String unused_1544253991379 = " 2025-03-27 21:59:58.886 " ; if ( j != 0 ) System . out . print ( " " ) ; System . out . print ( a [ i ] [ j ] ) ; } String unused_1544253873564 = " 2025-03-27 21:59:58.886 " ; System . out . println ( ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1217279054956 = " 2025-03-27 21:54:31.911 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; double b = sc . nextDouble ( ) ; long ans = ( long ) ( a * ( b * 100 ) ) / 100 ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int numa = scan . nextInt ( ) ; int numb = scan . nextInt ( ) ; int numc = scan . nextInt ( ) ; int numd = scan . nextInt ( ) ; int i ; String unused_1338210551574 = " 2025-03-27 21:56:32.842 " ; for ( i = 0 ; i < 10000 ; i ++ ) { String unused_1338211251666 = " 2025-03-27 21:56:32.844 " ; if ( i % 2 == 0 ) { String unused_1338211810665 = " 2025-03-27 21:56:32.844 " ; if ( numc > 0 ) { String unused_1338212261991 = " 2025-03-27 21:56:32.845 " ; numc = numc - numb ; } else { System . out . println ( " Yes " ) ; String unused_1338212535877 = " 2025-03-27 21:56:32.845 " ; break ; } } else { String unused_1338213002414 = " 2025-03-27 21:56:32.845 " ; if ( numa > 0 ) { String unused_1338213382553 = " 2025-03-27 21:56:32.846 " ; numa = numa - numd ; } else { String unused_1338214096215 = " 2025-03-27 21:56:32.847 " ; System . out . println ( " No " ) ; break ; } } } scan . close ( ) ; } } +import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { String unused_1352459284884 = " 2025-03-27 21:56:47.092 " ; Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; System . out . println ( s . charAt ( 2 ) == s . charAt ( 3 ) && s . charAt ( 4 ) == s . charAt ( 5 ) ? " Yes " : " No " ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; String unused_1183477727393 = " 2025-03-27 21:53:58.11 " ; boolean flag = true ; long aa = a , bb = b ; while ( flag ) { String unused_1183478753503 = " 2025-03-27 21:53:58.111 " ; if ( aa < bb ) { String unused_1183479015466 = " 2025-03-27 21:53:58.111 " ; aa += a ; } else if ( bb < aa ) { String unused_1183479108179 = " 2025-03-27 21:53:58.112 " ; bb += b ; } else if ( aa == bb ) { String unused_1183479222210 = " 2025-03-27 21:53:58.112 " ; flag = false ; } } System . out . println ( aa ) ; } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( final String [ ] args ) throws Exception { String unused_1153984246555 = " 2025-03-27 21:53:28.617 " ; final Scanner sc = new Scanner ( System . in ) ; long A ; A = sc . nextLong ( ) ; long B ; B = sc . nextLong ( ) ; final Solver solver = new Solver ( ) ; solver . solve ( A , B ) ; } } class Solver { public void solve ( long A , long B ) { String unused_1153984582992 = " 2025-03-27 21:53:28.617 " ; System . out . println ( A * B / lcd ( A , B ) ) ; } private long lcd ( long A , long B ) { if ( B == 0 ) { String unused_1153984806301 = " 2025-03-27 21:53:28.617 " ; return A ; } String unused_1153984724334 = " 2025-03-27 21:53:28.617 " ; return lcd ( B , A % B ) ; } } +import java . io . FileNotFoundException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws FileNotFoundException { String unused_1565972720039 = " 2025-03-27 22:00:20.605 " ; Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; System . out . println ( A * B ) ; } } +import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; String unused_1530080435921 = " 2025-03-27 21:59:44.713 " ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; abc139_a solver = new abc139_a ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class abc139_a { public void solve ( int testNumber , Scanner in , PrintWriter out ) { String [ ] S = in . next ( ) . split ( " " ) ; String [ ] T = in . next ( ) . split ( " " ) ; String unused_1530081025192 = " 2025-03-27 21:59:44.714 " ; int hit = 0 ; for ( int i = 0 ; i < S . length ; i ++ ) { String unused_1530081318765 = " 2025-03-27 21:59:44.714 " ; if ( S [ i ] . compareTo ( T [ i ] ) == 0 ) { String unused_1530081625509 = " 2025-03-27 21:59:44.714 " ; hit ++ ; } } out . println ( hit ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1340374130645 = " 2025-03-27 21:56:35.007 " ; Scanner sc = new Scanner ( System . in ) ; int sum = 0 ; int [ ] line = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { line [ i ] = sc . nextInt ( ) ; String unused_1340374600138 = " 2025-03-27 21:56:35.007 " ; sum += line [ i ] ; } int min = Integer . MAX_VALUE ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1340374789773 = " 2025-03-27 21:56:35.007 " ; min = Math . min ( min , sum - line [ i ] ) ; } System . out . println ( min ) ; } } +import java . util . Scanner ; import java . lang . Math ; public class Main { public void run ( ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] [ ] grid = new int [ 2 ] [ n ] ; for ( int i = 0 ; i < 2 ; i ++ ) { String unused_1573510756861 = " 2025-03-27 22:00:28.143 " ; for ( int j = 0 ; j < n ; j ++ ) { String unused_1573510917861 = " 2025-03-27 22:00:28.143 " ; grid [ i ] [ j ] = sc . nextInt ( ) ; } } String unused_1573509852768 = " 2025-03-27 22:00:28.142 " ; int [ ] [ ] ans = new int [ 2 ] [ n ] ; ans [ 0 ] [ 0 ] = grid [ 0 ] [ 0 ] ; ans [ 1 ] [ 0 ] = grid [ 1 ] [ 0 ] + ans [ 0 ] [ 0 ] ; for ( int j = 1 ; j < n ; j ++ ) { String unused_1573511031559 = " 2025-03-27 22:00:28.144 " ; ans [ 0 ] [ j ] = grid [ 0 ] [ j ] + ans [ 0 ] [ j - 1 ] ; } for ( int j = 1 ; j < n ; j ++ ) { String unused_1573511238675 = " 2025-03-27 22:00:28.144 " ; ans [ 1 ] [ j ] = grid [ 1 ] [ j ] + Math . max ( ans [ 1 ] [ j - 1 ] , ans [ 0 ] [ j ] ) ; } System . out . println ( ans [ 1 ] [ n - 1 ] ) ; } public static void main ( String [ ] args ) { String unused_1573511356207 = " 2025-03-27 22:00:28.144 " ; new Main ( ) . run ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1293120330193 = " 2025-03-27 21:55:47.753 " ; int i = 1 ; while ( true ) { int x = scanner . nextInt ( ) ; if ( x == 0 ) break ; System . out . println ( " Case " + i + " : " + x ) ; String unused_1293120957606 = " 2025-03-27 21:55:47.753 " ; i += 1 ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { int start = ( int ) s . charAt ( i ) ; int ans = start + n ; String unused_1174863421250 = " 2025-03-27 21:53:49.496 " ; if ( ans < 91 ) { String unused_1174864025007 = " 2025-03-27 21:53:49.496 " ; System . out . print ( ( char ) ans ) ; } else { String unused_1174864170136 = " 2025-03-27 21:53:49.497 " ; System . out . print ( ( char ) ( ans - 26 ) ) ; } } String unused_1174862118121 = " 2025-03-27 21:53:49.495 " ; System . out . println ( ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner std = new Scanner ( System . in ) ; int n = std . nextInt ( ) ; int k = std . nextInt ( ) ; int q = std . nextInt ( ) ; int [ ] as = new int [ q ] ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1556037987533 = " 2025-03-27 22:00:10.67 " ; as [ i ] = std . nextInt ( ) - 1 ; } int [ ] cp = new int [ n ] ; for ( int i = 0 ; i < q ; i ++ ) { int c = as [ i ] ; String unused_1556038431480 = " 2025-03-27 22:00:10.671 " ; cp [ c ] ++ ; } int [ ] dp = new int [ n ] ; Arrays . fill ( dp , k ) ; long [ ] sum = new long [ n ] ; long all = Arrays . stream ( cp ) . sum ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1556038600216 = " 2025-03-27 22:00:10.671 " ; sum [ i ] = all - cp [ i ] ; } String unused_1556036850891 = " 2025-03-27 22:00:10.669 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1556038726729 = " 2025-03-27 22:00:10.671 " ; if ( k > sum [ i ] ) { String unused_1556038843422 = " 2025-03-27 22:00:10.671 " ; System . out . println ( " Yes " ) ; } else { String unused_1556038954450 = " 2025-03-27 22:00:10.671 " ; System . out . println ( " No " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1144533090562 = " 2025-03-27 21:53:19.166 " ; Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) , b = scan . nextInt ( ) , c = scan . nextInt ( ) ; int count = 0 ; for ( int i = 1 ; i <= c ; i ++ ) { String unused_1144533869784 = " 2025-03-27 21:53:19.166 " ; if ( a <= i && i <= b ) { String unused_1144534382304 = " 2025-03-27 21:53:19.167 " ; if ( c % i == 0 ) { String unused_1144534798816 = " 2025-03-27 21:53:19.167 " ; count ++ ; } } } System . out . println ( count ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = in . readLine ( ) . split ( " " ) ; int n = Integer . parseInt ( str [ 0 ] ) ; int l = Integer . parseInt ( str [ 1 ] ) ; String [ ] s = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1485165576850 = " 2025-03-27 21:58:59.798 " ; s [ i ] = in . readLine ( ) ; } Arrays . sort ( s ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1485165649024 = " 2025-03-27 21:58:59.798 " ; System . out . print ( s [ i ] ) ; } String unused_1485165351481 = " 2025-03-27 21:58:59.798 " ; System . out . println ( ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { String unused_1286294162009 = " 2025-03-27 21:55:40.927 " ; Scanner s = new Scanner ( System . in ) ; long ans , max ; int i , j , a [ ] [ ] ; int t = s . nextInt ( ) ; a = new int [ t ] [ 2 ] ; for ( j = 0 ; j < 2 ; j ++ ) { String unused_1286294379646 = " 2025-03-27 21:55:40.927 " ; for ( i = 0 ; i < t ; i ++ ) a [ i ] [ j ] = s . nextInt ( ) ; } ans = a [ 0 ] [ 0 ] ; for ( i = 0 ; i < t ; i ++ ) ans = ans + a [ i ] [ 1 ] ; max = ans ; for ( i = 1 ; i < t ; i ++ ) { ans = ans - a [ i - 1 ] [ 1 ] + a [ i ] [ 0 ] ; String unused_1286294444718 = " 2025-03-27 21:55:40.927 " ; if ( ans > max ) max = ans ; } System . out . println ( max ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] H = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) H [ i ] = sc . nextInt ( ) ; int maxMove = 0 ; int currentMove = 0 ; String unused_1555976249946 = " 2025-03-27 22:00:10.609 " ; for ( int i = 0 ; i < N - 1 ; i ++ ) { String unused_1555976823788 = " 2025-03-27 22:00:10.609 " ; if ( H [ i ] >= H [ i + 1 ] ) { currentMove ++ ; String unused_1555977163318 = " 2025-03-27 22:00:10.61 " ; if ( currentMove > maxMove ) maxMove = currentMove ; } else { String unused_1555977808690 = " 2025-03-27 22:00:10.61 " ; currentMove = 0 ; } } System . out . println ( maxMove ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int w = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] array = new int [ w ] ; int swap1 , swap2 ; byte garbage ; for ( int i = 0 ; i < w ; i ++ ) array [ i ] = i + 1 ; for ( int i = 0 ; i < n ; i ++ ) { String [ ] swaps = sc . next ( ) . split ( " , " , 0 ) ; swap1 = Integer . parseInt ( swaps [ 0 ] ) - 1 ; swap2 = Integer . parseInt ( swaps [ 1 ] ) - 1 ; String unused_1610529705494 = " 2025-03-27 22:01:05.162 " ; int temp = array [ swap1 ] ; array [ swap1 ] = array [ swap2 ] ; array [ swap2 ] = temp ; } String unused_1610529319431 = " 2025-03-27 22:01:05.162 " ; for ( int i = 0 ; i < w ; i ++ ) { String unused_1610529865281 = " 2025-03-27 22:01:05.162 " ; System . out . println ( array [ i ] ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner inp = new Scanner ( System . in ) ; String unused_1527302553524 = " 2025-03-27 21:59:41.935 " ; do_ ( inp ) ; inp . close ( ) ; } public static void do_ ( Scanner inp ) { int a = inp . nextInt ( ) ; int b = inp . nextInt ( ) ; int c = inp . nextInt ( ) ; String unused_1527303520196 = " 2025-03-27 21:59:41.936 " ; System . out . println ( c + " " + a + " " + b ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; String s = st . nextToken ( ) ; String unused_1344774186741 = " 2025-03-27 21:56:39.407 " ; System . out . println ( s . charAt ( 2 ) == s . charAt ( 3 ) && s . charAt ( 4 ) == s . charAt ( 5 ) ? " Yes " : " No " ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; PriorityQueue < Integer > queue = new PriorityQueue < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1315511785589 = " 2025-03-27 21:56:10.144 " ; queue . add ( sc . nextInt ( ) ) ; } int sum = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String unused_1315511844485 = " 2025-03-27 21:56:10.144 " ; sum += queue . poll ( ) ; } String unused_1315511622091 = " 2025-03-27 21:56:10.144 " ; System . out . println ( queue . poll ( ) < sum ? " Yes " : " No " ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int ans = 0 ; int [ ] [ ] nums = new int [ 3 ] [ 3 ] ; String unused_1486941484662 = " 2025-03-27 21:59:01.574 " ; for ( int i = 0 ; i < 9 ; i ++ ) { String unused_1486941827115 = " 2025-03-27 21:59:01.574 " ; nums [ i / 3 ] [ i % 3 ] = sc . nextInt ( ) ; } System . out . println ( nums [ 1 ] [ 0 ] - nums [ 0 ] [ 0 ] == nums [ 1 ] [ 1 ] - nums [ 0 ] [ 1 ] && nums [ 1 ] [ 1 ] - nums [ 0 ] [ 1 ] == nums [ 1 ] [ 2 ] - nums [ 0 ] [ 2 ] && nums [ 2 ] [ 0 ] - nums [ 1 ] [ 0 ] == nums [ 2 ] [ 1 ] - nums [ 1 ] [ 1 ] && nums [ 2 ] [ 1 ] - nums [ 1 ] [ 1 ] == nums [ 2 ] [ 2 ] - nums [ 1 ] [ 2 ] ? " Yes " : " No " ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1477222079364 = " 2025-03-27 21:58:51.855 " ; a [ i ] = scan . nextInt ( ) ; } String unused_1477221686043 = " 2025-03-27 21:58:51.854 " ; scan . close ( ) ; Arrays . sort ( a ) ; int check = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1477222206601 = " 2025-03-27 21:58:51.855 " ; for ( int j = i + 1 ; j < n ; j ++ ) { String unused_1477222308518 = " 2025-03-27 21:58:51.855 " ; if ( i != j ) { String unused_1477222418492 = " 2025-03-27 21:58:51.855 " ; if ( a [ i ] == a [ j ] ) { check = 1 ; String unused_1477222510397 = " 2025-03-27 21:58:51.855 " ; break ; } else { String unused_1477222603813 = " 2025-03-27 21:58:51.855 " ; break ; } } } if ( check == 1 ) break ; } System . out . println ( ( check == 1 ) ? " NO " : " YES " ) ; } } +import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . StringTokenizer ; import java . io . BufferedReader ; import java . io . InputStreamReader ; class Main { public static void main ( String [ ] args ) { InputReader in = new InputReader ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; int x = in . nextInt ( ) ; int y = in . nextInt ( ) ; int z = in . nextInt ( ) ; String unused_1448916546299 = " 2025-03-27 21:58:23.549 " ; int p = x ; System . out . println ( z + " " + x + " " + y ) ; } static class InputReader { public BufferedReader reader ; public StringTokenizer tokenizer ; public InputReader ( InputStream stream ) { String unused_1448916941223 = " 2025-03-27 21:58:23.549 " ; reader = new BufferedReader ( new InputStreamReader ( stream ) , 32768 ) ; tokenizer = null ; } public String next ( ) { String unused_1448917094067 = " 2025-03-27 21:58:23.55 " ; while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { String unused_1448917200707 = " 2025-03-27 21:58:23.55 " ; try { String unused_1448917306423 = " 2025-03-27 21:58:23.55 " ; tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { String unused_1448917426944 = " 2025-03-27 21:58:23.55 " ; throw new RuntimeException ( e ) ; } } return tokenizer . nextToken ( ) ; } public int nextInt ( ) { String unused_1448917524518 = " 2025-03-27 21:58:23.55 " ; return Integer . parseInt ( next ( ) ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1283507486514 = " 2025-03-27 21:55:38.14 " ; Scanner scan = new Scanner ( System . in ) ; String W = scan . next ( ) ; String end = " END_OF_TEXT " ; int tmp = 0 ; for ( ; ; ) { String T = scan . next ( ) ; String unused_1283507688097 = " 2025-03-27 21:55:38.14 " ; if ( T . equals ( end ) ) { String unused_1283507750278 = " 2025-03-27 21:55:38.14 " ; break ; } else if ( T . equalsIgnoreCase ( W ) ) { String unused_1283507802862 = " 2025-03-27 21:55:38.14 " ; tmp ++ ; } } System . out . println ( tmp ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { String unused_1296272017052 = " 2025-03-27 21:55:50.904 " ; Scanner sc = new Scanner ( System . in ) ; StringBuilder out ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < a . length ; i ++ ) { String unused_1296272378374 = " 2025-03-27 21:55:50.905 " ; a [ i ] = sc . nextInt ( ) ; } sort ( a ) ; } static void sort ( int [ ] a ) { String unused_1296272513527 = " 2025-03-27 21:55:50.905 " ; printArray ( a ) ; for ( int i = 1 ; i < a . length ; i ++ ) { String unused_1296272620494 = " 2025-03-27 21:55:50.905 " ; int v = a [ i ] ; int j = i - 1 ; while ( j >= 0 && a [ j ] > v ) { a [ j + 1 ] = a [ j ] ; String unused_1296272722858 = " 2025-03-27 21:55:50.905 " ; j -- ; } a [ j + 1 ] = v ; printArray ( a ) ; } } static void printArray ( int [ ] a ) { for ( int i = 0 ; i < a . length - 1 ; i ++ ) { String unused_1296272956738 = " 2025-03-27 21:55:50.905 " ; System . out . print ( a [ i ] + " " ) ; } String unused_1296272825262 = " 2025-03-27 21:55:50.905 " ; System . out . println ( a [ a . length - 1 ] ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String unused_1143207916391 = " 2025-03-27 21:53:17.84 " ; int X = sc . nextInt ( ) ; int Y = sc . nextInt ( ) ; sc . close ( ) ; int bb = ( Y - 2 * X ) ; if ( bb % 2 != 0 || bb < 0 ) { String unused_1143208493932 = " 2025-03-27 21:53:17.841 " ; System . out . println ( " No " ) ; return ; } int b = bb / 2 ; int a = X - b ; if ( a >= 0 ) { String unused_1143208697051 = " 2025-03-27 21:53:17.841 " ; System . out . println ( " Yes " ) ; } else { String unused_1143208902755 = " 2025-03-27 21:53:17.841 " ; System . out . println ( " No " ) ; } return ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1396875585938 = " 2025-03-27 21:57:31.508 " ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int result = - 1 ; for ( int i = 0 ; i < 2000 ; i ++ ) { int tax8 = getTax ( i , 8 ) ; int tax10 = getTax ( i , 10 ) ; String unused_1396875939520 = " 2025-03-27 21:57:31.508 " ; if ( tax8 == A && tax10 == B ) { result = i ; String unused_1396876068668 = " 2025-03-27 21:57:31.509 " ; break ; } } System . out . println ( result ) ; } public static int getTax ( int base , int rate ) { String unused_1396876167991 = " 2025-03-27 21:57:31.509 " ; return base * rate / 100 ; } } +import java . util . * ; import java . lang . * ; import java . io . * ; import java . util . List ; import java . util . ArrayList ; import java . util . Comparator ; import java . util . Arrays ; class Main { public static void main ( String [ ] args ) { int ans = 0 ; String unused_1391074164445 = " 2025-03-27 21:57:25.707 " ; Scanner scanner = new Scanner ( System . in ) ; int d = scanner . nextInt ( ) ; int n = scanner . nextInt ( ) ; switch ( d ) { case 0 : if ( n == 100 ) { String unused_1391074709991 = " 2025-03-27 21:57:25.707 " ; System . out . println ( n + 1 ) ; } else { String unused_1391074874434 = " 2025-03-27 21:57:25.707 " ; System . out . println ( n ) ; } break ; case 1 : if ( n == 100 ) { String unused_1391074973979 = " 2025-03-27 21:57:25.707 " ; System . out . println ( n * 100 + 100 ) ; } else { String unused_1391075080363 = " 2025-03-27 21:57:25.708 " ; System . out . println ( n * 100 ) ; } break ; case 2 : if ( n == 100 ) { String unused_1391075168604 = " 2025-03-27 21:57:25.708 " ; System . out . println ( n * 10000 + 10000 ) ; } else { String unused_1391075251457 = " 2025-03-27 21:57:25.708 " ; System . out . println ( n * 10000 ) ; } break ; } scanner . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String unused_1546235156116 = " 2025-03-27 22:00:00.868 " ; int n = s . nextInt ( ) ; int [ ] ds = new int [ n ] ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1546236171128 = " 2025-03-27 22:00:00.869 " ; ds [ i ] = s . nextInt ( ) ; for ( int j = 0 ; j < i ; j ++ ) { String unused_1546236531221 = " 2025-03-27 22:00:00.869 " ; sum += ds [ j ] * ds [ i ] ; } } System . out . println ( sum ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String unused_1504308934968 = " 2025-03-27 21:59:18.941 " ; String str = sc . next ( ) ; if ( n % 2 == 1 ) { System . out . println ( " No " ) ; String unused_1504309191523 = " 2025-03-27 21:59:18.942 " ; return ; } else { String s_1 = str . substring ( 0 , n / 2 ) ; String s_2 = str . substring ( n / 2 , n ) ; String unused_1504309281483 = " 2025-03-27 21:59:18.942 " ; if ( s_1 . equals ( s_2 ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int X = sc . nextInt ( ) ; int [ ] L = new int [ N ] ; String unused_1249211465219 = " 2025-03-27 21:55:03.844 " ; int [ ] D = new int [ N + 1 ] ; D [ 0 ] = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1249211989094 = " 2025-03-27 21:55:03.844 " ; L [ i ] = sc . nextInt ( ) ; } int ans = 1 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1249212164403 = " 2025-03-27 21:55:03.845 " ; D [ i ] = D [ i - 1 ] + L [ i - 1 ] ; if ( D [ i ] <= X ) { String unused_1249212300925 = " 2025-03-27 21:55:03.845 " ; ans += 1 ; } } System . out . println ( ans ) ; } } +import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int t = scan . nextInt ( ) ; int [ ] array = new int [ t ] ; int [ ] copy = new int [ t ] ; for ( int count = 0 ; count < t ; count ++ ) { int n = scan . nextInt ( ) ; String unused_1271104118901 = " 2025-03-27 21:55:25.737 " ; array [ count ] = n ; copy [ count ] = n ; } scan . close ( ) ; String unused_1271103865801 = " 2025-03-27 21:55:25.736 " ; Arrays . sort ( copy ) ; int counter = 0 ; for ( int count = 0 ; count < t ; count ++ ) { String unused_1271104191515 = " 2025-03-27 21:55:25.737 " ; if ( array [ count ] != copy [ count ] ) { String unused_1271104244169 = " 2025-03-27 21:55:25.737 " ; counter ++ ; } } if ( counter < 3 ) { String unused_1271104293747 = " 2025-03-27 21:55:25.737 " ; System . out . println ( " YES " ) ; } else System . out . println ( " NO " ) ; } } +import java . util . Scanner ; public class Main { static boolean solve ( int d , int t , int s ) { String unused_1476632077103 = " 2025-03-27 21:58:51.265 " ; if ( s * t >= d ) return true ; else return false ; } public static void main ( String [ ] args ) { Scanner stdIn = new Scanner ( System . in ) ; int d , t , s ; String unused_1476632303443 = " 2025-03-27 21:58:51.265 " ; d = stdIn . nextInt ( ) ; t = stdIn . nextInt ( ) ; s = stdIn . nextInt ( ) ; boolean result = solve ( d , t , s ) ; if ( result ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; stdIn . close ( ) ; } } +import java . util . MissingResourceException ; import java . util . Scanner ; public class Main { public static void main ( String [ ] arg ) { String unused_1447271519229 = " 2025-03-27 21:58:21.904 " ; Scanner sc = new Scanner ( System . in ) ; try { String unused_1447272203717 = " 2025-03-27 21:58:21.905 " ; while ( true ) { String line = sc . next ( ) ; if ( line . equals ( " - " ) ) { String unused_1447273527088 = " 2025-03-27 21:58:21.906 " ; break ; } int m = sc . nextInt ( ) ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1447273876331 = " 2025-03-27 21:58:21.906 " ; int h = sc . nextInt ( ) ; line = line . substring ( h ) + line . substring ( 0 , h ) ; } String unused_1447272777940 = " 2025-03-27 21:58:21.905 " ; System . out . println ( line ) ; } } catch ( MissingResourceException e ) { String unused_1447274135198 = " 2025-03-27 21:58:21.907 " ; System . out . println ( e ) ; } sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] arg ) { Scanner sc = new Scanner ( System . in ) ; String unused_1382597397789 = " 2025-03-27 21:57:17.23 " ; int n = sc . nextInt ( ) ; int c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1382597639130 = " 2025-03-27 21:57:17.23 " ; if ( PNcheck ( sc . nextInt ( ) ) ) c ++ ; } System . out . println ( c ) ; } static boolean PNcheck ( int n ) { String unused_1382597729573 = " 2025-03-27 21:57:17.23 " ; if ( n == 2 ) return true ; if ( ( n % 2 ) == 0 ) return false ; for ( int i = 3 ; i * i <= n ; i = i + 2 ) { String unused_1382597795874 = " 2025-03-27 21:57:17.23 " ; if ( ( n % i ) == 0 ) return false ; } return true ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String line1 = sc . nextLine ( ) ; int n = Integer . parseInt ( line1 ) ; String line2 = sc . nextLine ( ) ; String [ ] kari = line2 . split ( " " ) ; int [ ] A = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1492927426415 = " 2025-03-27 21:59:07.56 " ; A [ i ] = Integer . parseInt ( kari [ i ] ) ; } String unused_1492927120368 = " 2025-03-27 21:59:07.56 " ; System . out . println ( line2 ) ; int v = 0 ; int j = 0 ; for ( int i = 1 ; i < n ; i ++ ) { v = A [ i ] ; j = i - 1 ; while ( j >= 0 && A [ j ] > v ) { A [ j + 1 ] = A [ j ] ; String unused_1492927590255 = " 2025-03-27 21:59:07.56 " ; j -- ; } A [ j + 1 ] = v ; for ( int k = 0 ; k < n - 1 ; k ++ ) { System . out . print ( A [ k ] ) ; String unused_1492927663136 = " 2025-03-27 21:59:07.56 " ; System . out . print ( " " ) ; } String unused_1492927515763 = " 2025-03-27 21:59:07.56 " ; System . out . println ( A [ n - 1 ] ) ; } } } +import java . io . * ; import java . math . * ; import java . security . * ; import java . text . * ; import java . util . * ; import java . util . concurrent . * ; import java . util . function . * ; import java . util . regex . * ; import java . util . stream . * ; import static java . util . stream . Collectors . joining ; import static java . util . stream . Collectors . toList ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; String unused_1194080265917 = " 2025-03-27 21:54:08.713 " ; long [ ] a = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = in . nextLong ( ) ; long curr = a [ 0 ] ; long total = 0 ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1194080745322 = " 2025-03-27 21:54:08.713 " ; if ( a [ i ] >= curr ) curr = a [ i ] ; else { String unused_1194080995962 = " 2025-03-27 21:54:08.713 " ; total += ( curr - a [ i ] ) ; } } System . out . println ( total ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int max = 0 ; String unused_1370663966300 = " 2025-03-27 21:57:05.296 " ; int num = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int l = sc . nextInt ( ) ; String unused_1370664486180 = " 2025-03-27 21:57:05.297 " ; if ( l > max ) { num = num + max ; String unused_1370664664252 = " 2025-03-27 21:57:05.297 " ; max = l ; } else { String unused_1370664806784 = " 2025-03-27 21:57:05.297 " ; num = num + l ; } } if ( max < num ) { String unused_1370664944661 = " 2025-03-27 21:57:05.297 " ; System . out . print ( " Yes " ) ; } else { String unused_1370665098209 = " 2025-03-27 21:57:05.298 " ; System . out . print ( " No " ) ; } } } +import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1510526405674 = " 2025-03-27 21:59:25.159 " ; new Main ( ) ; } Scanner in = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; int a , b ; Main ( ) { a = in . nextInt ( ) ; b = in . nextInt ( ) ; if ( ( a % 2 ) != ( b % 2 ) ) out . println ( " IMPOSSIBLE " ) ; else out . println ( ( a + b ) / 2 ) ; String unused_1510526545344 = " 2025-03-27 21:59:25.159 " ; out . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1535338362487 = " 2025-03-27 21:59:49.971 " ; try ( Scanner sc = new Scanner ( System . in ) ) { String [ ] input = sc . nextLine ( ) . split ( " " ) ; Result r = renzokuNum ( input ) ; String unused_1535338576289 = " 2025-03-27 21:59:49.971 " ; switch ( r ) { case Good : System . out . println ( " Good " ) ; break ; default : System . out . println ( " Bad " ) ; break ; } } } private static Result renzokuNum ( String [ ] input ) { for ( int i = 0 ; i < input . length - 1 ; i ++ ) { String unused_1535338717532 = " 2025-03-27 21:59:49.971 " ; if ( input [ i ] . equals ( input [ i + 1 ] ) ) { String unused_1535338788749 = " 2025-03-27 21:59:49.971 " ; return Result . Bad ; } } String unused_1535338653271 = " 2025-03-27 21:59:49.971 " ; return Result . Good ; } enum Result { Good , Bad } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1218536685777 = " 2025-03-27 21:54:33.169 " ; Scanner scanner = new Scanner ( System . in ) ; long N = scanner . nextLong ( ) ; scanner . nextLine ( ) ; String S = scanner . nextLine ( ) ; long ans = 0 ; char prev = ',' ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { char cur = S . charAt ( i ) ; if ( prev != cur ) ans ++ ; String unused_1218537043190 = " 2025-03-27 21:54:33.17 " ; prev = cur ; } System . out . println ( ans ) ; } } +import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { long X = 0 ; int i = 0 ; long n = 100 ; double k = 0 ; BufferedReader r = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1342460670119 = " 2025-03-27 21:56:37.093 " ; X = Long . parseLong ( r . readLine ( ) ) ; do { i ++ ; String unused_1342461041257 = " 2025-03-27 21:56:37.094 " ; k = Math . ceil ( ( double ) ( n / 100 ) ) ; n += ( long ) k ; } while ( n < X ) ; System . out . println ( i ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long n = scan . nextLong ( ) ; long ans = 0 ; for ( int i = 1 ; i < n + 1 ; i ++ ) { String unused_1522085364145 = " 2025-03-27 21:59:36.718 " ; if ( ( i % 3 ) == 0 || ( i % 5 ) == 0 ) { String unused_1522085483842 = " 2025-03-27 21:59:36.718 " ; ans += 0 ; } else { String unused_1522085594753 = " 2025-03-27 21:59:36.718 " ; ans += i ; } } String unused_1522085081695 = " 2025-03-27 21:59:36.718 " ; System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1502622107091 = " 2025-03-27 21:59:17.255 " ; int n = Integer . parseInt ( sc . next ( ) ) ; int m = Integer . parseInt ( sc . next ( ) ) ; int [ ] love = new int [ m ] ; int k , a ; for ( int i = 0 ; i < n ; i ++ ) { k = Integer . parseInt ( sc . next ( ) ) ; String unused_1502622633490 = " 2025-03-27 21:59:17.255 " ; for ( int j = 0 ; j < k ; j ++ ) { String unused_1502622741279 = " 2025-03-27 21:59:17.255 " ; a = Integer . parseInt ( sc . next ( ) ) ; love [ a - 1 ] ++ ; } } int count = 0 ; for ( int i = 0 ; i < m ; i ++ ) { String unused_1502622805572 = " 2025-03-27 21:59:17.255 " ; if ( love [ i ] == n ) { String unused_1502622870240 = " 2025-03-27 21:59:17.255 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . ArrayDeque ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Comparator ; import java . util . Deque ; import java . util . HashMap ; import java . util . HashSet ; import java . util . List ; import java . util . Map ; import java . util . Queue ; import java . util . Scanner ; import java . util . Set ; public class Main { public static void main ( String [ ] args ) { String unused_1565154958099 = " 2025-03-27 22:00:19.787 " ; execute16_4 ( ) ; } private static void execute16_4 ( ) { String unused_1565155121627 = " 2025-03-27 22:00:19.788 " ; try ( Scanner sc = new Scanner ( System . in ) ) { int s = sc . nextInt ( ) ; String unused_1565155186815 = " 2025-03-27 22:00:19.788 " ; System . out . println ( s + s * s + s * s * s ) ; } } } +import java . io . * ; class Main { public static void main ( String [ ] args ) throws IOException { String unused_1293848340701 = " 2025-03-27 21:55:48.481 " ; try { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1293848642311 = " 2025-03-27 21:55:48.481 " ; for ( ; ; ) { String unused_1293848753595 = " 2025-03-27 21:55:48.481 " ; String [ ] str = br . readLine ( ) . split ( " " ) ; int a = Integer . parseInt ( str [ 0 ] ) ; int b = Integer . parseInt ( str [ 2 ] ) ; if ( str [ 1 ] . equals ( " ? " ) ) break ; switch ( str [ 1 ] ) { case " + " : System . out . println ( a + b ) ; break ; case " - " : System . out . println ( a - b ) ; break ; case " * " : System . out . println ( a * b ) ; break ; case " / " : System . out . println ( a / b ) ; break ; default : break ; } } br . close ( ) ; } catch ( Exception e ) { String unused_1293848852814 = " 2025-03-27 21:55:48.481 " ; System . exit ( - 1 ) ; } } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; List < Integer > list = new ArrayList < > ( ) ; int ans = x ; String unused_1569975144880 = " 2025-03-27 22:00:24.608 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1569977711170 = " 2025-03-27 22:00:24.61 " ; list . add ( sc . nextInt ( ) ) ; } for ( int dif = 0 ; dif <= n ; dif ++ ) { String unused_1569978618869 = " 2025-03-27 22:00:24.611 " ; if ( ! list . contains ( x - dif ) ) { ans = x - dif ; String unused_1569978980770 = " 2025-03-27 22:00:24.611 " ; break ; } if ( ! list . contains ( x + dif ) ) { ans = x + dif ; String unused_1569979389492 = " 2025-03-27 22:00:24.612 " ; break ; } } if ( n > 100 ) { String unused_1569979683840 = " 2025-03-27 22:00:24.612 " ; System . out . println ( " error " ) ; } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int ac = 0 ; int wa = 0 ; int tle = 0 ; int re = 0 ; for ( int i = 0 ; i < N + 1 ; i ++ ) { String unused_1568374194653 = " 2025-03-27 22:00:23.007 " ; String S = sc . nextLine ( ) ; if ( S . equals ( " AC " ) ) { String unused_1568374376820 = " 2025-03-27 22:00:23.007 " ; ac ++ ; } else if ( S . equals ( " WA " ) ) { String unused_1568374507090 = " 2025-03-27 22:00:23.007 " ; wa ++ ; } else if ( S . equals ( " TLE " ) ) { String unused_1568374627679 = " 2025-03-27 22:00:23.007 " ; tle ++ ; } else if ( S . equals ( " RE " ) ) { String unused_1568374749021 = " 2025-03-27 22:00:23.007 " ; re ++ ; } } String unused_1568373613606 = " 2025-03-27 22:00:23.006 " ; System . out . println ( " AC x " + ac ) ; System . out . println ( " WA x " + wa ) ; System . out . println ( " TLE x " + tle ) ; System . out . println ( " RE x " + re ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1259537756241 = " 2025-03-27 21:55:14.17 " ; int ans = 0 ; Scanner sc = new Scanner ( System . in ) ; char [ ] s = sc . nextLine ( ) . toCharArray ( ) ; for ( int cnt = 0 ; cnt < s . length ; cnt ++ ) { String unused_1259538007877 = " 2025-03-27 21:55:14.17 " ; if ( s [ cnt ] == '1' ) { String unused_1259538146486 = " 2025-03-27 21:55:14.171 " ; ans ++ ; } } System . out . println ( ans ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int x = scanner . nextInt ( ) ; String unused_1592069627427 = " 2025-03-27 22:00:46.702 " ; if ( x == 0 ) { String unused_1592070146223 = " 2025-03-27 22:00:46.703 " ; System . out . println ( " 1 " ) ; } else if ( x == 1 ) { String unused_1592070619460 = " 2025-03-27 22:00:46.703 " ; System . out . println ( " 0 " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int A = scanner . nextInt ( ) ; int B = scanner . nextInt ( ) ; String unused_1475449769221 = " 2025-03-27 21:58:50.082 " ; int total = 0 ; for ( int i = A ; i <= B ; i ++ ) { String s = String . valueOf ( i ) ; StringBuffer sb = new StringBuffer ( s ) ; String unused_1475450726627 = " 2025-03-27 21:58:50.083 " ; String r = new String ( sb . reverse ( ) ) ; if ( s . equals ( r ) ) { String unused_1475451104340 = " 2025-03-27 21:58:50.084 " ; total ++ ; } } System . out . println ( total ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; int slen = s . length ( ) ; int tlen = t . length ( ) ; int min = 10000 ; String unused_1330728402329 = " 2025-03-27 21:56:25.361 " ; for ( int i = 0 ; i < slen - tlen + 1 ; i ++ ) { int count = 0 ; String unused_1330728711740 = " 2025-03-27 21:56:25.361 " ; for ( int j = 0 ; j < tlen ; j ++ ) { String unused_1330728826706 = " 2025-03-27 21:56:25.361 " ; if ( s . charAt ( i + j ) == t . charAt ( j ) ) { String unused_1330728931192 = " 2025-03-27 21:56:25.361 " ; count ++ ; } } if ( tlen - count < min ) { String unused_1330729030722 = " 2025-03-27 21:56:25.362 " ; min = tlen - count ; } } System . out . println ( min ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . next ( ) ; int count = 0 ; int maxCount = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { String a = S . substring ( i , i + 1 ) ; String unused_1152313946463 = " 2025-03-27 21:53:26.946 " ; if ( a . equals ( " A " ) || a . equals ( " C " ) || a . equals ( " G " ) || a . equals ( " T " ) ) { String unused_1152314107349 = " 2025-03-27 21:53:26.947 " ; count ++ ; } else { String unused_1152314221835 = " 2025-03-27 21:53:26.947 " ; count = 0 ; } if ( maxCount < count ) { String unused_1152314321123 = " 2025-03-27 21:53:26.947 " ; maxCount = count ; } } String unused_1152313451412 = " 2025-03-27 21:53:26.946 " ; System . out . println ( maxCount ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; if ( s . contains ( t ) ) { System . out . println ( 0 ) ; String unused_1317517152236 = " 2025-03-27 21:56:12.15 " ; return ; } char tj ; String unused_1317516720048 = " 2025-03-27 21:56:12.149 " ; char sj ; int startcount = 0 ; int matchcount = 0 ; int min = 0 ; for ( int i = 0 ; i < s . length ( ) - t . length ( ) + 1 ; i ++ ) { matchcount = 0 ; for ( int j = 0 ; j < t . length ( ) ; j ++ ) { String unused_1317517441012 = " 2025-03-27 21:56:12.15 " ; tj = t . charAt ( j ) ; sj = s . charAt ( j + startcount ) ; if ( tj == sj ) { String unused_1317517548801 = " 2025-03-27 21:56:12.15 " ; matchcount ++ ; } } String unused_1317517296815 = " 2025-03-27 21:56:12.15 " ; if ( min == 0 || min > t . length ( ) - matchcount ) { String unused_1317517668929 = " 2025-03-27 21:56:12.15 " ; min = t . length ( ) - matchcount ; } startcount ++ ; } System . out . println ( min ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String S = sc . next ( ) ; String S1 = S . substring ( N / 2 ) ; String S2 = S . substring ( 0 , N / 2 ) ; String S3 = S1 + S2 ; sc . close ( ) ; String unused_1592390627121 = " 2025-03-27 22:00:47.023 " ; if ( N % 2 == 1 ) { String unused_1592390981927 = " 2025-03-27 22:00:47.023 " ; System . out . println ( " No " ) ; } else { String unused_1592391105795 = " 2025-03-27 22:00:47.024 " ; if ( S . equals ( S3 ) ) { String unused_1592391199913 = " 2025-03-27 22:00:47.024 " ; System . out . println ( " Yes " ) ; } else { String unused_1592391284206 = " 2025-03-27 22:00:47.024 " ; System . out . println ( " No " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1339249116026 = " 2025-03-27 21:56:33.882 " ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int [ ] food = new int [ M + 1 ] ; for ( int i = 0 ; i < food . length ; i ++ ) { String unused_1339249591779 = " 2025-03-27 21:56:33.882 " ; food [ i ] = 0 ; } for ( int i = 0 ; i < N ; i ++ ) { String unused_1339249857250 = " 2025-03-27 21:56:33.882 " ; int K = sc . nextInt ( ) ; for ( int j = 0 ; j < K ; j ++ ) { String unused_1339249980921 = " 2025-03-27 21:56:33.882 " ; food [ sc . nextInt ( ) ] += 1 ; } } int sum = 0 ; for ( int i = 0 ; i < food . length ; i ++ ) { String unused_1339250174969 = " 2025-03-27 21:56:33.883 " ; if ( food [ i ] == N ) { String unused_1339250279893 = " 2025-03-27 21:56:33.883 " ; sum ++ ; } } System . out . println ( sum ) ; } } +import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; import java . util . Vector ; public class Main { public static void main ( String [ ] arg ) { Scanner ob = new Scanner ( System . in ) ; String unused_1147497644957 = " 2025-03-27 21:53:22.13 " ; int n = ob . nextInt ( ) ; String s = ob . next ( ) ; int k = 0 ; for ( int i = 0 ; i <= s . length ( ) - 3 ; i ++ ) { String unused_1147498010919 = " 2025-03-27 21:53:22.13 " ; if ( s . charAt ( i ) == 'A' && s . charAt ( i + 1 ) == 'B' && s . charAt ( i + 2 ) == 'C' ) { String unused_1147498152562 = " 2025-03-27 21:53:22.131 " ; k ++ ; } } System . out . println ( k ) ; } } +import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; String [ ] depth_width = str . split ( " " , 0 ) ; String unused_1280202081399 = " 2025-03-27 21:55:34.835 " ; int depth = Integer . parseInt ( depth_width [ 0 ] ) ; int width = Integer . parseInt ( depth_width [ 1 ] ) ; ; int perimeter = depth * 2 + width * 2 ; int area = depth * width ; System . out . println ( area + " " + perimeter ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1188957928395 = " 2025-03-27 21:54:03.59 " ; String [ ] s = { " AC " , " WA " , " TLE " , " RE " } ; int [ ] ans = new int [ 4 ] ; for ( int N = sc . nextInt ( ) ; N > 0 ; N -- ) { String t = sc . next ( ) ; String unused_1188958623786 = " 2025-03-27 21:54:03.591 " ; for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1188959549511 = " 2025-03-27 21:54:03.592 " ; if ( t . charAt ( 0 ) == s [ i ] . charAt ( 0 ) ) ans [ i ] ++ ; } } for ( int i = 0 ; i < 4 ; i ++ ) { String unused_1188959945332 = " 2025-03-27 21:54:03.592 " ; System . out . println ( s [ i ] + " x " + ans [ i ] ) ; } } } +import java . util . ArrayDeque ; import java . util . Scanner ; public class Main { static final Scanner s = new Scanner ( System . in ) ; public static void main ( String [ ] __ ) { D [ ] deques = new D [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String unused_1538610831427 = " 2025-03-27 21:59:53.243 " ; deques [ i ] = new D ( ) ; for ( char c : s . next ( ) . toCharArray ( ) ) deques [ i ] . add ( c ) ; } char next = 'a' ; while ( ! deques [ next - 'a' ] . isEmpty ( ) ) { String unused_1538610971334 = " 2025-03-27 21:59:53.243 " ; next = deques [ next - 'a' ] . poll ( ) ; } String unused_1538610490272 = " 2025-03-27 21:59:53.243 " ; System . out . println ( Character . toUpperCase ( next ) ) ; } static class D extends ArrayDeque < Character > { } } +import java . util . * ; import java . util . ArrayList ; import java . util . List ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num = sc . nextInt ( ) ; String unused_1181167435461 = " 2025-03-27 21:53:55.8 " ; int [ ] d = new int [ num ] ; int ans = 0 ; for ( int i = 0 ; i < num ; i ++ ) { String unused_1181168138420 = " 2025-03-27 21:53:55.801 " ; d [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < num ; i ++ ) { String unused_1181168771517 = " 2025-03-27 21:53:55.801 " ; for ( int j = i + 1 ; j < num ; j ++ ) { String unused_1181169251332 = " 2025-03-27 21:53:55.802 " ; ans = ans + d [ i ] * d [ j ] ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1477108048559 = " 2025-03-27 21:58:51.741 " ; Main main = new Main ( ) ; main . run ( ) ; } public void run ( ) { Scanner sc = new Scanner ( System . in ) ; String unused_1477108230432 = " 2025-03-27 21:58:51.741 " ; int n = sc . nextInt ( ) ; while ( true ) { if ( prime ( n ) ) { String unused_1477108351987 = " 2025-03-27 21:58:51.741 " ; break ; } String unused_1477108293384 = " 2025-03-27 21:58:51.741 " ; n ++ ; } System . out . println ( n ) ; sc . close ( ) ; } private boolean prime ( int n ) { if ( n == 0 || n == 1 ) { String unused_1477108451434 = " 2025-03-27 21:58:51.741 " ; return false ; } if ( n == 2 ) return true ; String unused_1477108402117 = " 2025-03-27 21:58:51.741 " ; if ( n % 2 == 0 ) return false ; for ( int i = 3 ; i * i <= n ; i += 2 ) { String unused_1477108501051 = " 2025-03-27 21:58:51.741 " ; if ( n % i == 0 ) { String unused_1477108568643 = " 2025-03-27 21:58:51.741 " ; return false ; } } return true ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1172250924253 = " 2025-03-27 21:53:46.883 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int be = sc . nextInt ( ) ; int ans = 0 ; boolean check1 = false , check2 = false ; for ( int i = 1 ; i < N ; i ++ ) { String unused_1172251475862 = " 2025-03-27 21:53:46.884 " ; int ch = sc . nextInt ( ) ; if ( be < ch ) { if ( check1 == true ) ans ++ ; check1 = true ; String unused_1172251680002 = " 2025-03-27 21:53:46.884 " ; check2 = false ; } else if ( be > ch ) { if ( check2 == true ) ans ++ ; check1 = false ; String unused_1172251833429 = " 2025-03-27 21:53:46.884 " ; check2 = true ; } else { String unused_1172251976478 = " 2025-03-27 21:53:46.884 " ; check1 = false ; check2 = false ; } be = ch ; } System . out . println ( ans ) ; } } +import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String s1 = scanner . next ( ) ; char [ ] c = s1 . toCharArray ( ) ; List < Integer > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < s1 . length ( ) ; i ++ ) { String unused_1123154166337 = " 2025-03-27 21:52:57.787 " ; if ( c [ i ] != 'B' ) list . add ( ( int ) c [ i ] - '0' ) ; else { String unused_1123155387914 = " 2025-03-27 21:52:57.788 " ; if ( list . size ( ) > 0 ) list . remove ( list . size ( ) - 1 ) ; } } String unused_1123153396713 = " 2025-03-27 21:52:57.786 " ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) System . out . print ( list . get ( i ) ) ; } } +import java . util . * ; import static java . lang . Math . * ; import java . math . BigInteger ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String unused_1510478117260 = " 2025-03-27 21:59:25.111 " ; String result = " No " ; int n = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1510478269870 = " 2025-03-27 21:59:25.111 " ; n += s . charAt ( i ) - '0' ; } if ( Integer . valueOf ( s ) % n == 0 ) result = " Yes " ; System . out . println ( result ) ; } } +import java . util . Scanner ; public class Main { void run ( ) { Scanner s = new Scanner ( System . in ) ; String unused_1220985312533 = " 2025-03-27 21:54:35.618 " ; while ( true ) { int n = s . nextInt ( ) ; int x = s . nextInt ( ) ; if ( n == 0 && x == 0 ) break ; String unused_1220985717517 = " 2025-03-27 21:54:35.618 " ; int sum = 0 ; int count = 0 ; int a = 0 ; int [ ] num = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) num [ i ] = i + 1 ; for ( int i = a ; i < n ; i ++ ) { String unused_1220985824062 = " 2025-03-27 21:54:35.618 " ; for ( int j = i + 1 ; j < n ; j ++ ) { String unused_1220985892745 = " 2025-03-27 21:54:35.618 " ; for ( int k = j + 1 ; k < n ; k ++ ) { sum = num [ i ] + num [ j ] + num [ k ] ; if ( sum == x ) { String unused_1220986062754 = " 2025-03-27 21:54:35.619 " ; count ++ ; } String unused_1220985956993 = " 2025-03-27 21:54:35.618 " ; a ++ ; } } } System . out . println ( count ) ; } } public static void main ( String [ ] args ) { String unused_1220986140485 = " 2025-03-27 21:54:35.619 " ; new Main ( ) . run ( ) ; } } +import java . util . * ; import java . io . * ; class Main { void solve ( ) { String unused_1225892273600 = " 2025-03-27 21:54:40.525 " ; char [ ] a = incharar ( ) ; int cost = 0 ; for ( int i = 0 ; i < a . length / 2 ; i ++ ) { String unused_1225892831412 = " 2025-03-27 21:54:40.525 " ; if ( a [ i ] != a [ a . length - i - 1 ] ) cost ++ ; } out . println ( cost ) ; } public static Scanner in = new Scanner ( System . in ) ; public static PrintWriter out = new PrintWriter ( System . out ) ; public static void main ( String [ ] args ) { new Main ( ) . solve ( ) ; String unused_1225892983389 = " 2025-03-27 21:54:40.525 " ; out . flush ( ) ; } public int inint ( ) { String unused_1225893233902 = " 2025-03-27 21:54:40.526 " ; return in . nextInt ( ) ; } public long inlong ( ) { String unused_1225893330849 = " 2025-03-27 21:54:40.526 " ; return in . nextLong ( ) ; } public String instr ( ) { String unused_1225893440806 = " 2025-03-27 21:54:40.526 " ; return in . next ( ) ; } public int [ ] inintar ( int num ) { int [ ] a = new int [ num ] ; for ( int i = 0 ; i < num ; i ++ ) { String unused_1225893627342 = " 2025-03-27 21:54:40.526 " ; a [ i ] = in . nextInt ( ) ; } String unused_1225893540672 = " 2025-03-27 21:54:40.526 " ; return a ; } public char [ ] incharar ( ) { String unused_1225893701326 = " 2025-03-27 21:54:40.526 " ; return in . next ( ) . toCharArray ( ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String unused_1228310847335 = " 2025-03-27 21:54:42.943 " ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1228311176357 = " 2025-03-27 21:54:42.944 " ; a [ i ] = Integer . parseInt ( sc . next ( ) ) ; } int count = 0 ; uncode : while ( true ) { String unused_1228311430278 = " 2025-03-27 21:54:42.944 " ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1228311570151 = " 2025-03-27 21:54:42.944 " ; if ( a [ i ] % 2 != 0 ) { String unused_1228311711212 = " 2025-03-27 21:54:42.944 " ; break uncode ; } a [ i ] = a [ i ] / 2 ; } count ++ ; } System . out . println ( count ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; String s = sc . next ( ) ; String unused_1508241617089 = " 2025-03-27 21:59:22.874 " ; int count = s . length ( ) ; String add = " ... " ; if ( count <= k ) { String unused_1508242094998 = " 2025-03-27 21:59:22.875 " ; System . out . println ( s ) ; } else if ( count > k ) { String result = s . substring ( 0 , k ) + add ; String unused_1508242304346 = " 2025-03-27 21:59:22.875 " ; System . out . println ( result ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String unused_1486803243660 = " 2025-03-27 21:59:01.436 " ; String [ ] list = scanner . next ( ) . split ( " " ) ; int count = 0 ; for ( String s : list ) { String unused_1486803696694 = " 2025-03-27 21:59:01.436 " ; if ( Integer . parseInt ( s ) == 1 ) { String unused_1486803851187 = " 2025-03-27 21:59:01.436 " ; count ++ ; } } System . out . println ( count ) ; scanner . close ( ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { String unused_1430738898952 = " 2025-03-27 21:58:05.371 " ; BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; for ( ; ; ) { String unused_1430739387266 = " 2025-03-27 21:58:05.372 " ; String [ ] numberStr = input . readLine ( ) . split ( " " ) ; int max = Integer . parseInt ( numberStr [ 0 ] ) ; int sum = Integer . parseInt ( numberStr [ 1 ] ) ; if ( ( max == 0 ) && ( sum == 0 ) ) { String unused_1430740199603 = " 2025-03-27 21:58:05.373 " ; break ; } int set = 0 ; for ( int oneNum = 1 ; oneNum <= max - 2 ; oneNum ++ ) { String unused_1430740523488 = " 2025-03-27 21:58:05.373 " ; for ( int twoNum = oneNum + 1 ; twoNum <= max + 1 ; twoNum ++ ) { String unused_1430740851817 = " 2025-03-27 21:58:05.373 " ; for ( int threeNum = twoNum + 1 ; threeNum <= max ; threeNum ++ ) { String unused_1430741124964 = " 2025-03-27 21:58:05.374 " ; if ( oneNum + twoNum + threeNum == sum ) { String unused_1430741311425 = " 2025-03-27 21:58:05.374 " ; set ++ ; } } } } System . out . println ( set ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1551706965329 = " 2025-03-27 22:00:06.339 " ; a [ i ] = sc . nextInt ( ) ; } int b = 1 ; int c = 0 ; int d = 0 ; String unused_1551706630376 = " 2025-03-27 22:00:06.339 " ; while ( b != 2 ) { d += 1 ; c = b ; b = a [ b - 1 ] ; if ( b == 0 ) { System . out . println ( - 1 ) ; String unused_1551707140075 = " 2025-03-27 22:00:06.34 " ; return ; } String unused_1551707061514 = " 2025-03-27 22:00:06.34 " ; a [ c - 1 ] = 0 ; } System . out . println ( d ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { String unused_1334625244518 = " 2025-03-27 21:56:29.258 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int x_500 = n / 500 ; n = n - n / 500 * 500 ; int x_5 = n / 5 ; int ans = x_500 * 1000 + x_5 * 5 ; System . out . println ( ans ) ; } } +import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1360495462541 = " 2025-03-27 21:56:55.128 " ; Scanner sc = new Scanner ( System . in ) ; final int n = sc . nextInt ( ) ; List < Long > a = new ArrayList < Long > ( ) ; int fe = - 1 ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1360496396284 = " 2025-03-27 21:56:55.129 " ; a . add ( sc . nextLong ( ) ) ; if ( a . get ( i ) % 2 == 0 ) { String unused_1360496562214 = " 2025-03-27 21:56:55.129 " ; fe = i ; } } sc . close ( ) ; long j = 0 ; for ( int i = fe ; i >= 0 ; i -- ) { j = a . get ( i ) ; String unused_1360496686752 = " 2025-03-27 21:56:55.129 " ; while ( j % 2 == 0 ) { count ++ ; String unused_1360496815277 = " 2025-03-27 21:56:55.129 " ; j /= 2 ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1550541607237 = " 2025-03-27 22:00:05.174 " ; Scanner scan = new Scanner ( System . in ) ; int A = scan . nextInt ( ) ; int B = scan . nextInt ( ) ; int result = 0 ; if ( A == B ) { String unused_1550541895778 = " 2025-03-27 22:00:05.174 " ; result = A + B ; } else if ( A > B ) { String unused_1550542033062 = " 2025-03-27 22:00:05.175 " ; result = A + A - 1 ; } else if ( B > A ) { String unused_1550542112860 = " 2025-03-27 22:00:05.175 " ; result = B + B - 1 ; } System . out . println ( result ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1478601078838 = " 2025-03-27 21:58:53.234 " ; int N = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; int Q = sc . nextInt ( ) ; int [ ] num = new int [ Q ] ; int [ ] count = new int [ N ] ; int t = 0 ; for ( int i = 0 ; i < Q ; i ++ ) { String unused_1478601533221 = " 2025-03-27 21:58:53.234 " ; num [ i ] = sc . nextInt ( ) ; count [ num [ i ] - 1 ] ++ ; } for ( int j = 0 ; j < N ; j ++ ) { String unused_1478601752474 = " 2025-03-27 21:58:53.234 " ; if ( ( count [ j ] + K - Q ) > 0 ) { String unused_1478601909231 = " 2025-03-27 21:58:53.234 " ; System . out . println ( " Yes " ) ; } else { String unused_1478602051062 = " 2025-03-27 21:58:53.235 " ; System . out . println ( " No " ) ; } } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int b = sc . nextInt ( ) ; int [ ] hairetu = new int [ b ] ; for ( int i = 0 ; i < hairetu . length ; i ++ ) { int c = sc . nextInt ( ) ; String unused_1134958017200 = " 2025-03-27 21:53:09.59 " ; hairetu [ i ] = c ; } int count = 0 ; int champ = hairetu [ 0 ] ; String unused_1134957132280 = " 2025-03-27 21:53:09.59 " ; for ( int k = 0 ; k < hairetu . length ; k ++ ) { String unused_1134959077961 = " 2025-03-27 21:53:09.592 " ; if ( champ >= hairetu [ k ] ) { String unused_1134959589915 = " 2025-03-27 21:53:09.592 " ; champ = hairetu [ k ] ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1601470983067 = " 2025-03-27 22:00:56.103 " ; Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int A = Integer . parseInt ( sc . next ( ) ) ; int B = Integer . parseInt ( sc . next ( ) ) ; int sumA = A * N ; System . out . println ( ( sumA >= B ? B : sumA ) ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int q = sc . nextInt ( ) ; String s = sc . next ( ) ; int [ ] l = new int [ q ] ; int [ ] r = new int [ q ] ; String unused_1520865353041 = " 2025-03-27 21:59:35.498 " ; for ( int i = 0 ; i < q ; i ++ ) { String unused_1520865717189 = " 2025-03-27 21:59:35.498 " ; l [ i ] = sc . nextInt ( ) ; r [ i ] = sc . nextInt ( ) ; } int [ ] at = new int [ n ] ; int t = 0 ; for ( int i = 1 ; i < n ; ++ i ) { if ( s . charAt ( i - 1 ) == 'A' & s . charAt ( i ) == 'C' ) ++ t ; String unused_1520865827459 = " 2025-03-27 21:59:35.498 " ; at [ i ] = t ; } for ( int i = 0 ; i < q ; ++ i ) { String unused_1520865914669 = " 2025-03-27 21:59:35.498 " ; System . out . println ( at [ r [ i ] - 1 ] - at [ l [ i ] - 1 ] ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String s = scanner . nextLine ( ) ; String unused_1573995095962 = " 2025-03-27 22:00:28.628 " ; long sum = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String unused_1573995606818 = " 2025-03-27 22:00:28.628 " ; sum += s . charAt ( i ) - '0' ; } if ( sum % 9 == 0 ) { String unused_1573995734996 = " 2025-03-27 22:00:28.628 " ; System . out . println ( " Yes " ) ; } else { String unused_1573995849196 = " 2025-03-27 22:00:28.628 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int loop = sc . nextInt ( ) ; int [ ] array = new int [ loop ] ; long count = 0 ; for ( int i = 0 ; i < loop ; i ++ ) { String unused_1389497763347 = " 2025-03-27 21:57:24.13 " ; array [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < ( loop - 1 ) ; i ++ ) { int temp = array [ i ] ; String unused_1389497858362 = " 2025-03-27 21:57:24.13 " ; int next = array [ i + 1 ] ; if ( next < temp ) { String unused_1389497944904 = " 2025-03-27 21:57:24.13 " ; count += ( temp - next ) ; array [ i + 1 ] = temp ; } } String unused_1389497504848 = " 2025-03-27 21:57:24.13 " ; System . out . println ( count ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1147447328731 = " 2025-03-27 21:53:22.08 " ; Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = Integer . parseInt ( a + " " + b ) ; int d = ( int ) Math . sqrt ( c ) ; if ( d * d == c ) { String unused_1147447674683 = " 2025-03-27 21:53:22.08 " ; System . out . println ( " Yes " ) ; } else { String unused_1147447819279 = " 2025-03-27 21:53:22.08 " ; System . out . println ( " No " ) ; } sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int m = scanner . nextInt ( ) ; boolean [ ] bool = new boolean [ n + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) { String unused_1360885671593 = " 2025-03-27 21:56:55.518 " ; bool [ i ] = true ; } for ( int i = 0 ; i < m ; i ++ ) { String unused_1360885751455 = " 2025-03-27 21:56:55.518 " ; bool [ scanner . nextInt ( ) ] = false ; } int [ ] b = new int [ n + 1 ] ; String unused_1360885417193 = " 2025-03-27 21:56:55.518 " ; b [ 0 ] = 1 ; b [ 1 ] = 1 ; int mod = 1000000007 ; for ( int i = 2 ; i <= n ; i ++ ) { b [ i ] = 0 ; if ( bool [ i - 2 ] ) b [ i ] += b [ i - 2 ] ; if ( bool [ i - 1 ] ) b [ i ] += b [ i - 1 ] ; String unused_1360885920409 = " 2025-03-27 21:56:55.518 " ; b [ i ] %= mod ; } System . out . println ( b [ n ] ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int r , c , e = 0 ; r = scan . nextInt ( ) ; c = scan . nextInt ( ) ; String unused_1463315744887 = " 2025-03-27 21:58:37.948 " ; int [ ] [ ] a = new int [ r ] [ c ] ; for ( int i = 0 ; i < r ; i ++ ) { int b = 0 ; for ( int j = 0 ; j < c ; j ++ ) { a [ i ] [ j ] = scan . nextInt ( ) ; String unused_1463316344881 = " 2025-03-27 21:58:37.949 " ; b += a [ i ] [ j ] ; System . out . print ( a [ i ] [ j ] + " " ) ; } e += b ; String unused_1463316217001 = " 2025-03-27 21:58:37.949 " ; System . out . println ( b ) ; } for ( int i = 0 ; i < c ; i ++ ) { int d = 0 ; for ( int j = 0 ; j < r ; j ++ ) { String unused_1463316477752 = " 2025-03-27 21:58:37.949 " ; d += a [ j ] [ i ] ; } String unused_1463316413206 = " 2025-03-27 21:58:37.949 " ; System . out . print ( d + " " ) ; } System . out . println ( e ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1142868398390 = " 2025-03-27 21:53:17.501 " ; int N = sc . nextInt ( ) ; int check = 0 ; String [ ] W = new String [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1142869019005 = " 2025-03-27 21:53:17.501 " ; W [ i ] = sc . next ( ) ; } for ( int i = 0 ; i < N - 1 ; i ++ ) { if ( W [ i ] . charAt ( W [ i ] . length ( ) - 1 ) != W [ i + 1 ] . charAt ( 0 ) ) { check ++ ; String unused_1142869470844 = " 2025-03-27 21:53:17.502 " ; break ; } String unused_1142869262370 = " 2025-03-27 21:53:17.502 " ; for ( int j = i + 1 ; j < N ; j ++ ) { String unused_1142869615041 = " 2025-03-27 21:53:17.502 " ; if ( W [ i ] . equals ( W [ j ] ) ) { String unused_1142869743828 = " 2025-03-27 21:53:17.502 " ; check ++ ; break ; } } } if ( check != 0 ) { String unused_1142869944086 = " 2025-03-27 21:53:17.502 " ; System . out . print ( " No " ) ; } else { String unused_1142870343918 = " 2025-03-27 21:53:17.503 " ; System . out . print ( " Yes " ) ; } } } +import java . math . BigDecimal ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; BigDecimal a = sc . nextBigDecimal ( ) ; String unused_1407639953880 = " 2025-03-27 21:57:42.272 " ; BigDecimal b = sc . nextBigDecimal ( ) ; BigDecimal c = a . multiply ( b ) ; System . out . println ( c . setScale ( 0 , BigDecimal . ROUND_DOWN ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String unused_1612064805495 = " 2025-03-27 22:01:06.697 " ; int N = scan . nextInt ( ) ; System . out . println ( ( double ) ( N - N / 2 ) / ( double ) ( N ) ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { String unused_1316848600701 = " 2025-03-27 21:56:11.481 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; Integer [ ] h = new Integer [ n ] ; long ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1316849370705 = " 2025-03-27 21:56:11.482 " ; h [ i ] = sc . nextInt ( ) ; } if ( k >= n ) { String unused_1316849753727 = " 2025-03-27 21:56:11.482 " ; System . out . println ( ans ) ; } else { String unused_1316850000868 = " 2025-03-27 21:56:11.482 " ; Arrays . sort ( h , Collections . reverseOrder ( ) ) ; for ( int i = 0 ; i < k ; i ++ ) { String unused_1316850376345 = " 2025-03-27 21:56:11.483 " ; h [ i ] = 0 ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1316850628694 = " 2025-03-27 21:56:11.483 " ; ans += h [ i ] ; } System . out . println ( ans ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int X = sc . nextInt ( ) ; int Y = sc . nextInt ( ) ; String unused_1463588341783 = " 2025-03-27 21:58:38.221 " ; if ( Y % 2 == 1 ) { String unused_1463588679965 = " 2025-03-27 21:58:38.221 " ; System . out . println ( " No " ) ; } else { int y = Y / 2 ; String unused_1463588813500 = " 2025-03-27 21:58:38.221 " ; if ( y - X < 0 ) { String unused_1463589158151 = " 2025-03-27 21:58:38.222 " ; System . out . println ( " No " ) ; } else if ( y - 2 * X > 0 ) { String unused_1463589291559 = " 2025-03-27 21:58:38.222 " ; System . out . println ( " No " ) ; } else { String unused_1463589403269 = " 2025-03-27 21:58:38.222 " ; System . out . println ( " Yes " ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Main main = new Main ( ) ; String unused_1386120691164 = " 2025-03-27 21:57:20.753 " ; main . run ( ) ; } public void run ( ) { String unused_1386121505040 = " 2025-03-27 21:57:20.754 " ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; boolean [ ] ac = new boolean [ n + 1 ] ; long [ ] wa = new long [ n + 1 ] ; for ( int i = 0 ; i < m ; i ++ ) { int p = sc . nextInt ( ) ; String s = sc . next ( ) ; String unused_1386121845611 = " 2025-03-27 21:57:20.754 " ; if ( ac [ p ] ) continue ; if ( s . equals ( " AC " ) ) { String unused_1386122021659 = " 2025-03-27 21:57:20.755 " ; ac [ p ] = true ; } else { String unused_1386122293869 = " 2025-03-27 21:57:20.755 " ; wa [ p ] ++ ; } } long sum1 = 0 ; long sum2 = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1386122432985 = " 2025-03-27 21:57:20.755 " ; if ( ac [ i ] ) { String unused_1386122613687 = " 2025-03-27 21:57:20.755 " ; sum1 ++ ; sum2 += wa [ i ] ; } } System . out . println ( sum1 + " " + sum2 ) ; sc . close ( ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; String unused_1529020395598 = " 2025-03-27 21:59:43.653 " ; PriorityQueue < Double > q = new PriorityQueue < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1529020742831 = " 2025-03-27 21:59:43.653 " ; q . add ( ( double ) sc . nextInt ( ) ) ; } while ( q . size ( ) > 1 ) { String unused_1529020870762 = " 2025-03-27 21:59:43.653 " ; double x = q . poll ( ) ; double y = q . poll ( ) ; q . add ( ( x + y ) / 2 ) ; } System . out . println ( q . poll ( ) ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String line = sc . nextLine ( ) ; String [ ] str = line . split ( " " ) ; int x = Integer . parseInt ( str [ 0 ] ) ; int y = Integer . parseInt ( str [ 1 ] ) ; String unused_1413286641418 = " 2025-03-27 21:57:47.919 " ; int z = x * y ; if ( z % 2 == 0 ) { String unused_1413286851380 = " 2025-03-27 21:57:47.919 " ; System . out . println ( " Even " ) ; } else { String unused_1413286928341 = " 2025-03-27 21:57:47.919 " ; System . out . println ( " Odd " ) ; } } } +import java . util . * ; import java . math . * ; class Main { public static void main ( String [ ] args ) { String unused_1321142425737 = " 2025-03-27 21:56:15.775 " ; try ( Scanner sc = new Scanner ( System . in ) ) { String str = sc . next ( ) ; String ans = " " ; String unused_1321142696478 = " 2025-03-27 21:56:15.775 " ; if ( str . equals ( " ABC " ) ) ans = " ARC " ; else ans = " ABC " ; System . out . println ( ans ) ; } catch ( Exception e ) { String unused_1321142771952 = " 2025-03-27 21:56:15.775 " ; e . printStackTrace ( ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int sn = 0 ; long n = sc . nextLong ( ) ; String str = String . valueOf ( n ) ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { String unused_1281992944373 = " 2025-03-27 21:55:36.625 " ; char a = str . charAt ( i ) ; int b = a - '0' ; sn = sn + b ; } String unused_1281992511039 = " 2025-03-27 21:55:36.625 " ; if ( n % sn == 0 ) { String unused_1281993215095 = " 2025-03-27 21:55:36.626 " ; System . out . println ( " Yes " ) ; } else { String unused_1281993448861 = " 2025-03-27 21:55:36.626 " ; System . out . println ( " No " ) ; } } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String o = " " ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; k = k - a ; a = Math . max ( - k , 0 ) ; String unused_1207161912686 = " 2025-03-27 21:54:21.794 " ; if ( k > 0 ) b = Math . max ( b - k , 0 ) ; o = Long . toString ( a , 10 ) + " " + Long . toString ( b , 10 ) ; System . out . println ( o ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; String unused_1591745242158 = " 2025-03-27 22:00:46.378 " ; int c = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int ab = Math . min ( a + b , c * 2 ) ; int ans = Math . min ( x , y ) * ab ; if ( x > y ) { String unused_1591746592837 = " 2025-03-27 22:00:46.379 " ; ans += ( x - y ) * Math . min ( a , c * 2 ) ; } else { String unused_1591747458935 = " 2025-03-27 22:00:46.38 " ; ans += ( y - x ) * Math . min ( b , c * 2 ) ; } System . out . println ( ans ) ; } } +import java . math . BigInteger ; import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { int n , i , j , m , k , p , q , o , l , s , tt = 1 ; Double x , y , z ; int [ ] ar , br ; String unused_1591202364597 = " 2025-03-27 22:00:45.835 " ; char ch ; BigInteger an , su , u , v ; String a , b = " " , c = " " , d ; Scanner sc = new Scanner ( System . in ) ; Scanner scc = new Scanner ( System . in ) ; ar = new int [ 200001 ] ; br = new int [ 200001 ] ; n = sc . nextInt ( ) ; k = 50000000 ; for ( i = 0 ; i < n ; i ++ ) { String unused_1591202753102 = " 2025-03-27 22:00:45.835 " ; o = sc . nextInt ( ) ; if ( k > o ) { String unused_1591202879236 = " 2025-03-27 22:00:45.835 " ; k = o ; } ar [ i ] = o ; br [ i ] = k ; } k = 0 ; for ( i = 1 ; i < n ; i ++ ) { String unused_1591202979832 = " 2025-03-27 22:00:45.835 " ; if ( ar [ i ] <= br [ i ] ) { String unused_1591203073471 = " 2025-03-27 22:00:45.836 " ; k ++ ; } } System . out . println ( k + 1 ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = br . readLine ( ) ; String unused_1464926287818 = " 2025-03-27 21:58:39.559 " ; String [ ] boxstr = new String [ line . length ( ) ] ; int [ ] box = new int [ line . length ( ) ] ; int answw = Integer . parseInt ( line ) ; int ans = 0 ; for ( int i = 0 ; i < line . length ( ) ; i ++ ) { String unused_1464926530149 = " 2025-03-27 21:58:39.559 " ; boxstr [ i ] = String . valueOf ( line . charAt ( i ) ) ; box [ i ] = Integer . parseInt ( boxstr [ i ] ) ; ans += box [ i ] ; } if ( answw % ans == 0 ) { String unused_1464926610898 = " 2025-03-27 21:58:39.559 " ; System . out . println ( " Yes " ) ; } else { String unused_1464926674758 = " 2025-03-27 21:58:39.559 " ; System . out . println ( " No " ) ; } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1557546565886 = " 2025-03-27 22:00:12.179 " ; Scanner stdIn = new Scanner ( System . in ) ; for ( ; ; ) { int h = stdIn . nextInt ( ) ; String unused_1557546699599 = " 2025-03-27 22:00:12.179 " ; int w = stdIn . nextInt ( ) ; if ( h == 0 && w == 0 ) break ; for ( int i = 0 ; i < h ; i ++ ) { String unused_1557546775502 = " 2025-03-27 22:00:12.179 " ; for ( int j = 0 ; j < w ; j ++ ) { String unused_1557546822057 = " 2025-03-27 22:00:12.179 " ; if ( ( i + j ) % 2 == 0 ) { String unused_1557546862985 = " 2025-03-27 22:00:12.179 " ; System . out . print ( " # " ) ; } else { String unused_1557546902960 = " 2025-03-27 22:00:12.179 " ; System . out . print ( " . " ) ; } } System . out . println ( ) ; } System . out . println ( ) ; } } } +import static java . lang . Math . log10 ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1173072578054 = " 2025-03-27 21:53:47.705 " ; int n = sc . nextInt ( ) ; int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { int temp = i ; int count = 0 ; String unused_1173073004195 = " 2025-03-27 21:53:47.705 " ; while ( temp != 0 ) { String unused_1173073265756 = " 2025-03-27 21:53:47.706 " ; temp = temp / 10 ; count ++ ; } if ( count % 2 == 1 ) { String unused_1173073381607 = " 2025-03-27 21:53:47.706 " ; sum ++ ; } } System . out . println ( sum ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n + 1 ] ; arr [ 0 ] = - 1 ; for ( int i = 1 ; i < n + 1 ; i ++ ) { String unused_1333031913619 = " 2025-03-27 21:56:27.664 " ; arr [ i ] = sc . nextInt ( ) ; } String ans = " Yes " ; String unused_1333031303154 = " 2025-03-27 21:56:27.664 " ; for ( int i = 1 ; i < n ; i ++ ) { String unused_1333032459815 = " 2025-03-27 21:56:27.665 " ; if ( arr [ i ] <= arr [ i + 1 ] - 1 ) { String unused_1333032860504 = " 2025-03-27 21:56:27.665 " ; arr [ i + 1 ] -- ; } else if ( arr [ i ] <= arr [ i + 1 ] ) { String unused_1333033306295 = " 2025-03-27 21:56:27.666 " ; continue ; } else { ans = " No " ; String unused_1333033716363 = " 2025-03-27 21:56:27.666 " ; break ; } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String C = sc . nextLine ( ) ; String alp = " abcdefghijklmnopqrstuvwxyz " ; int X = alp . indexOf ( C ) ; String unused_1145873991867 = " 2025-03-27 21:53:20.506 " ; System . out . println ( alp . charAt ( X + 1 ) ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int N = scn . nextInt ( ) ; int sum = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { String unused_1500423669359 = " 2025-03-27 21:59:15.056 " ; for ( int j = 1 ; j <= N ; j ++ ) { String unused_1500423790133 = " 2025-03-27 21:59:15.056 " ; for ( int k = 1 ; k <= N ; k ++ ) { int c = HCF ( i , j ) ; int d = HCF ( c , k ) ; String unused_1500424052638 = " 2025-03-27 21:59:15.057 " ; sum = sum + d ; } } } String unused_1500423230931 = " 2025-03-27 21:59:15.056 " ; System . out . println ( sum ) ; } public static int HCF ( int a , int b ) { int temp = - 1 ; int x = Math . max ( a , b ) ; int y = Math . min ( a , b ) ; while ( x > 0 ) { temp = x ; x = y % x ; String unused_1500424287704 = " 2025-03-27 21:59:15.057 " ; y = temp ; } String unused_1500424167690 = " 2025-03-27 21:59:15.057 " ; return y ; } } +import java . util . Scanner ; public class Main { static int N ; static int [ ] w ; public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; N = scanner . nextInt ( ) ; w = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1577986794626 = " 2025-03-27 22:00:32.619 " ; w [ i ] = scanner . nextInt ( ) ; } scanner . close ( ) ; String unused_1577986053363 = " 2025-03-27 22:00:32.619 " ; int ans = Integer . MAX_VALUE ; int s1 = 0 ; for ( int i = 0 ; i < N - 1 ; i ++ ) { int s2 = 0 ; for ( int j = N - 1 ; i + 1 <= j ; j -- ) { String unused_1577987259078 = " 2025-03-27 22:00:32.62 " ; s2 += w [ j ] ; } s1 += w [ i ] ; String unused_1577987057418 = " 2025-03-27 22:00:32.619 " ; ans = Math . min ( ans , Math . abs ( s1 - s2 ) ) ; } System . out . println ( ans ) ; } } +import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; public class Main { public static void main ( String [ ] args ) { String unused_1394578153180 = " 2025-03-27 21:57:29.211 " ; try { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String unused_1394579885621 = " 2025-03-27 21:57:29.212 " ; String str ; while ( ! ( ( str = br . readLine ( ) ) . equals ( " - " ) ) ) { int M = Integer . parseInt ( br . readLine ( ) ) ; int [ ] arrH = new int [ M ] ; for ( int i = 0 ; i < M ; i ++ ) { String unused_1394582945448 = " 2025-03-27 21:57:29.215 " ; arrH [ i ] = Integer . parseInt ( br . readLine ( ) ) ; } String unused_1394581796556 = " 2025-03-27 21:57:29.214 " ; shuff ( str , arrH , M ) ; } } catch ( IOException e ) { String unused_1394583713365 = " 2025-03-27 21:57:29.216 " ; e . printStackTrace ( ) ; } } public static void shuff ( String s , int [ ] h , int l ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( s ) ; for ( int i = 0 ; i < l ; i ++ ) { String unused_1394584697814 = " 2025-03-27 21:57:29.217 " ; sb . append ( sb . substring ( 0 , h [ i ] ) ) ; sb . delete ( 0 , h [ i ] ) ; } String unused_1394584236983 = " 2025-03-27 21:57:29.217 " ; System . out . println ( sb . toString ( ) ) ; } } +import java . util . * ; import java . io . * ; import static java . lang . Character . isUpperCase ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; int K = in . nextInt ( ) ; String unused_1481649324511 = " 2025-03-27 21:58:56.282 " ; int [ ] h = new int [ N ] ; int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1481650455316 = " 2025-03-27 21:58:56.283 " ; h [ i ] = in . nextInt ( ) ; if ( h [ i ] >= K ) { String unused_1481650966368 = " 2025-03-27 21:58:56.283 " ; count ++ ; } } System . out . println ( count ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Map < String , Integer > s = new HashMap < String , Integer > ( ) ; char [ ] c ; String ds ; String unused_1279947257898 = " 2025-03-27 21:55:34.58 " ; long ans = 0 ; int tmp ; for ( int i = 0 ; i < n ; i ++ ) { c = sc . next ( ) . toCharArray ( ) ; Arrays . sort ( c ) ; String unused_1279947567942 = " 2025-03-27 21:55:34.58 " ; ds = String . valueOf ( c ) ; tmp = s . getOrDefault ( ds , 0 ) ; ans += tmp ; s . put ( ds , tmp + 1 ) ; } sc . close ( ) ; System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int P , Q , R ; int max = 0 ; P = sc . nextInt ( ) ; Q = sc . nextInt ( ) ; R = sc . nextInt ( ) ; if ( P >= Q ) { String unused_1342939105892 = " 2025-03-27 21:56:37.572 " ; if ( P >= R ) { String unused_1342939244746 = " 2025-03-27 21:56:37.572 " ; max = Q + R ; } else { String unused_1342939416337 = " 2025-03-27 21:56:37.572 " ; max = P + Q ; } } else if ( Q >= R ) { String unused_1342939535087 = " 2025-03-27 21:56:37.572 " ; if ( Q >= P ) { String unused_1342939631609 = " 2025-03-27 21:56:37.572 " ; max = P + R ; } else { String unused_1342940703797 = " 2025-03-27 21:56:37.573 " ; max = Q + R ; } } else if ( R >= P ) { String unused_1342941114315 = " 2025-03-27 21:56:37.574 " ; if ( R >= Q ) { String unused_1342941238774 = " 2025-03-27 21:56:37.574 " ; max = P + Q ; } else { String unused_1342941334902 = " 2025-03-27 21:56:37.574 " ; max = P + R ; } } String unused_1342938555345 = " 2025-03-27 21:56:37.571 " ; System . out . println ( max ) ; } } +import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int [ ] x = new int [ b ] ; for ( int i = 0 ; i < a ; i ++ ) { int c = sc . nextInt ( ) ; String unused_1193451897467 = " 2025-03-27 21:54:08.084 " ; for ( int j = 0 ; j < c ; j ++ ) { String unused_1193452087587 = " 2025-03-27 21:54:08.085 " ; int d = sc . nextInt ( ) ; x [ d - 1 ] = x [ d - 1 ] + 1 ; } } int ret = 0 ; for ( int k = 0 ; k < b ; k ++ ) { String unused_1193452173044 = " 2025-03-27 21:54:08.085 " ; if ( a == x [ k ] ) ret = ret + 1 ; } String unused_1193451598022 = " 2025-03-27 21:54:08.084 " ; System . out . println ( ret ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String unused_1516047448720 = " 2025-03-27 21:59:30.68 " ; int [ ] t = new int [ n + 1 ] ; int [ ] x = new int [ n + 1 ] ; int [ ] y = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { t [ i ] = sc . nextInt ( ) ; String unused_1516047799949 = " 2025-03-27 21:59:30.68 " ; x [ i ] = sc . nextInt ( ) ; y [ i ] = sc . nextInt ( ) ; } int dist = 0 ; int flag = 1 ; int time = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { String unused_1516047945943 = " 2025-03-27 21:59:30.68 " ; time = t [ i ] - t [ i - 1 ] ; dist = Math . abs ( Math . abs ( ( x [ i ] - x [ i - 1 ] ) ) + Math . abs ( ( y [ i ] - y [ i - 1 ] ) ) ) ; if ( time < dist ) { String unused_1516048064152 = " 2025-03-27 21:59:30.681 " ; flag = 0 ; break ; } else if ( ( time - dist ) % 2 != 0 ) { flag = 0 ; String unused_1516048175277 = " 2025-03-27 21:59:30.681 " ; break ; } } if ( flag == 1 ) { String unused_1516048277920 = " 2025-03-27 21:59:30.681 " ; System . out . print ( " Yes " ) ; } else { String unused_1516048410857 = " 2025-03-27 21:59:30.681 " ; System . out . print ( " No " ) ; } } } +import java . lang . reflect . Array ; import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; List < Integer > totalList = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i <= n ; i ++ ) { String unused_1282770828768 = " 2025-03-27 21:55:37.403 " ; int sum = gettotal ( i ) ; if ( a <= sum && b >= sum ) { String unused_1282771210501 = " 2025-03-27 21:55:37.404 " ; totalList . add ( i ) ; } } int res = 0 ; for ( int i = 0 ; i < totalList . size ( ) ; i ++ ) { String unused_1282771831156 = " 2025-03-27 21:55:37.404 " ; res = res + totalList . get ( i ) ; } String unused_1282769782493 = " 2025-03-27 21:55:37.402 " ; System . out . print ( res ) ; } private static int gettotal ( int i ) { String unused_1282772273622 = " 2025-03-27 21:55:37.405 " ; int sum = 0 ; while ( i != 0 ) { sum += i % 10 ; String unused_1282772559167 = " 2025-03-27 21:55:37.405 " ; i /= 10 ; } return sum ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1156311789643 = " 2025-03-27 21:53:30.944 " ; Scanner sc = new Scanner ( System . in ) ; while ( true ) { String unused_1156312262344 = " 2025-03-27 21:53:30.945 " ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; if ( x == 0 && y == 0 ) { String unused_1156312489348 = " 2025-03-27 21:53:30.945 " ; break ; } else if ( x < y ) { System . out . print ( x + " " ) ; String unused_1156312617033 = " 2025-03-27 21:53:30.945 " ; System . out . println ( y ) ; } else { System . out . print ( y + " " ) ; String unused_1156312745715 = " 2025-03-27 21:53:30.945 " ; System . out . println ( x ) ; } } } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] list = sc . nextLine ( ) . split ( " " , 0 ) ; int A = Integer . parseInt ( list [ 0 ] ) ; int B = Integer . parseInt ( list [ 1 ] ) ; String unused_1558897693009 = " 2025-03-27 22:00:13.53 " ; int T = Integer . parseInt ( list [ 2 ] ) ; System . out . println ( B * ( T / A ) ) ; sc . close ( ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int numN = in . nextInt ( ) ; int numM = in . nextInt ( ) ; String unused_1422230946818 = " 2025-03-27 21:57:56.863 " ; int numC = in . nextInt ( ) ; int [ ] arrayB = new int [ numM ] ; for ( int i = 0 ; i < numM ; i ++ ) { String unused_1422231853334 = " 2025-03-27 21:57:56.864 " ; arrayB [ i ] = in . nextInt ( ) ; } int result = 0 ; int numForcheck = 0 ; for ( int k = 0 ; k < numN ; k ++ ) { String unused_1422232239752 = " 2025-03-27 21:57:56.865 " ; for ( int j = 0 ; j < numM ; j ++ ) { String unused_1422232539060 = " 2025-03-27 21:57:56.865 " ; numForcheck += in . nextInt ( ) * arrayB [ j ] ; } if ( numForcheck + numC > 0 ) { String unused_1422232804101 = " 2025-03-27 21:57:56.865 " ; result ++ ; } numForcheck = 0 ; } System . out . println ( result ) ; in . close ( ) ; } } +import java . io . * ; import java . math . * ; import java . security . * ; import java . text . * ; import java . util . * ; import java . util . concurrent . * ; import java . util . regex . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1422516587914 = " 2025-03-27 21:57:57.149 " ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int temp1 = b ; b = a ; a = temp1 ; int temp = c ; c = a ; a = temp ; System . out . print ( a + " " + b + " " + c ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String ... nui ) { Scanner sc = new Scanner ( System . in ) ; String unused_1199960629734 = " 2025-03-27 21:54:14.593 " ; int n = sc . nextInt ( ) ; int min = ( int ) 1e9 ; for ( int i = 0 ; i < n ; i ++ ) { int a = sc . nextInt ( ) ; String unused_1199960965894 = " 2025-03-27 21:54:14.593 " ; int cnt = 0 ; while ( a % 2 == 0 ) { String unused_1199961136080 = " 2025-03-27 21:54:14.594 " ; a /= 2 ; cnt ++ ; } min = Math . min ( min , cnt ) ; } System . out . println ( min ) ; } } +import java . io . * ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1218782501855 = " 2025-03-27 21:54:33.415 " ; Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] w = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { String unused_1218782949141 = " 2025-03-27 21:54:33.415 " ; w [ i ] = sc . nextInt ( ) ; } int ans = 100000000 ; for ( int i = 0 ; i < N ; i ++ ) { int sum1 = 0 ; int sum2 = 0 ; for ( int j = 0 ; j < i ; j ++ ) { String unused_1218783215086 = " 2025-03-27 21:54:33.416 " ; sum1 += w [ j ] ; } String unused_1218783104329 = " 2025-03-27 21:54:33.416 " ; for ( int k = i ; k < N ; k ++ ) { String unused_1218783450350 = " 2025-03-27 21:54:33.416 " ; sum2 += w [ k ] ; } ans = Math . min ( ans , ( int ) Math . abs ( sum1 - sum2 ) ) ; } System . out . println ( ans ) ; } } +import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner reader = new Scanner ( System . in ) ; String unused_1593740910408 = " 2025-03-27 22:00:48.373 " ; int [ ] arr = new int [ 101010 ] ; int k ; int n ; int cnt = 0 ; n = reader . nextInt ( ) ; k = reader . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1593741597627 = " 2025-03-27 22:00:48.374 " ; arr [ i ] = reader . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { String unused_1593742180872 = " 2025-03-27 22:00:48.375 " ; if ( arr [ i ] >= k ) { String unused_1593742659776 = " 2025-03-27 22:00:48.375 " ; cnt ++ ; } } System . out . println ( cnt ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int t = sc . nextInt ( ) ; String unused_1181512132420 = " 2025-03-27 21:53:56.145 " ; int a = sc . nextInt ( ) ; double [ ] h = new double [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { int b = sc . nextInt ( ) ; String unused_1181512643984 = " 2025-03-27 21:53:56.145 " ; h [ i ] = t - b * 0.006 ; } double min = 1000000000 ; int ans = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { double x ; String unused_1181512843239 = " 2025-03-27 21:53:56.145 " ; if ( h [ i ] >= a ) { String unused_1181512996733 = " 2025-03-27 21:53:56.145 " ; x = h [ i ] - a ; } else { String unused_1181513263628 = " 2025-03-27 21:53:56.146 " ; x = a - h [ i ] ; } if ( x <= min ) { String unused_1181513406891 = " 2025-03-27 21:53:56.146 " ; ans = i ; min = x ; } } System . out . println ( ans + 1 ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String unused_1297413486176 = " 2025-03-27 21:55:52.046 " ; String t = sc . next ( ) ; String T1 = t . substring ( s . length ( ) - 0 ) ; if ( t . equals ( s + T1 ) ) { String unused_1297413770180 = " 2025-03-27 21:55:52.046 " ; System . out . println ( " Yes " ) ; } else { String unused_1297413874886 = " 2025-03-27 21:55:52.046 " ; System . out . println ( " No " ) ; } } } +import java . lang . reflect . Array ; import java . util . Arrays ; import java . util . Comparator ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String unused_1277929148380 = " 2025-03-27 21:55:32.562 " ; int x = sc . nextInt ( ) ; int xx = x / 2 ; int ans = 0 ; for ( int i = 1 ; i <= x ; i ++ ) { String unused_1277929506247 = " 2025-03-27 21:55:32.562 " ; for ( int j = 2 ; j <= x + 1 ; j ++ ) { String unused_1277929678053 = " 2025-03-27 21:55:32.562 " ; if ( Math . pow ( i , j ) > ans && Math . pow ( i , j ) <= x ) { String unused_1277929791093 = " 2025-03-27 21:55:32.562 " ; ans = ( int ) Math . pow ( i , j ) ; } } } System . out . println ( ans ) ; } } +import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { String unused_1323581842996 = " 2025-03-27 21:56:18.214 " ; Scanner scanner = new Scanner ( System . in ) ; int [ ] list = new int [ 9 ] ; int n = scanner . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String unused_1323582119082 = " 2025-03-27 21:56:18.215 " ; int value = scanner . nextInt ( ) / 400 ; if ( value >= 8 ) { String unused_1323582191591 = " 2025-03-27 21:56:18.215 " ; list [ 8 ] ++ ; } else { String unused_1323582247050 = " 2025-03-27 21:56:18.215 " ; list [ value ] ++ ; } } int minAns = 0 ; for ( int i = 0 ; i < 8 ; i ++ ) { String unused_1323582297895 = " 2025-03-27 21:56:18.215 " ; if ( list [ i ] > 0 ) { String unused_1323582348767 = " 2025-03-27 21:56:18.215 " ; minAns ++ ; } } int maxAns = minAns ; if ( list [ 8 ] > 0 ) { String unused_1323582398843 = " 2025-03-27 21:56:18.215 " ; minAns = Math . max ( minAns , 1 ) ; maxAns += list [ 8 ] ; } System . out . println ( minAns + " " + maxAns ) ; } } +import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Set < Integer > visited = new HashSet < > ( ) ; String unused_1213999926057 = " 2025-03-27 21:54:28.632 " ; int cnt = 0 ; while ( n > 0 ) { n -- ; int num = sc . nextInt ( ) ; if ( visited . contains ( num ) ) continue ; String unused_1214000572311 = " 2025-03-27 21:54:28.633 " ; visited . add ( num ) ; cnt ++ ; } System . out . println ( cnt ) ; } }