import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; import java . io . PrintWriter ;     public class A {   public static void main ( String [ ] args ) throws IOException { FastReader sc = new FastReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; double d = sc . nextDouble ( ) ; double h = sc . nextDouble ( ) ; double v = sc . nextDouble ( ) ; double e = sc . nextDouble ( ) ;   double v1 = 4 * v / ( Math . PI * d * d ) ; out . println ( e > v1 ? " NO " : " YES \n " + h / ( v1 - e ) ) ; out . close ( ) ; }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ;   public class PouringRain_CodeForces {   public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; String [ ] r = br . readLine ( ) . split ( " ▁ " ) ; double d = Double . parseDouble ( r [ 0 ] ) ; double h = Double . parseDouble ( r [ 1 ] ) ; double v = Double . parseDouble ( r [ 2 ] ) ; double e = Double . parseDouble ( r [ 3 ] ) ; double t = ( Math . PI * d * d * h ) / ( 4 * v - Math . PI * d * d * e ) ; out . println ( t >= 0 ? " YES " + " \n " + t : " NO " ) ; out . flush ( ) ; out . close ( ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class PouringRain {   public static void main ( String [ ] args ) { FastReader reader = new FastReader ( ) ;   int d = reader . nextInt ( ) ; int h = reader . nextInt ( ) ; int v = reader . nextInt ( ) ; int e = reader . nextInt ( ) ;   double area = ( Math . PI * d * d ) / 4.0 ; double drinking = v / area ;   if ( drinking < e ) { System . out . println ( " NO " ) ; } else { double time = h / ( drinking - e ) ; System . out . println ( " YES " ) ; System . out . printf ( " % .4f \n " , time ) ; } }   static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . * ; public class test { static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } public static void main ( String [ ] args ) { FastReader scan = new FastReader ( ) ; int d = scan . nextInt ( ) ; int h = scan . nextInt ( ) ; int v = scan . nextInt ( ) ; int e = scan . nextInt ( ) ; double speed = ( double ) v / ( ( Math . PI * d * d ) / 4 ) ; if ( speed > ( double ) e ) { double seconds = ( double ) h / ( ( 4 * v ) / ( Math . PI * d * d ) - e ) ; if ( seconds > 0.0000 ) { System . out . println ( " YES " ) ; System . out . printf ( " % .12f " , seconds ) ; } else System . out . println ( " NO " ) ; } else System . out . println ( " NO " ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class PouringRain { public static void main ( String [ ] args ) { FastReader fs = new FastReader ( ) ; StringBuilder sb = new StringBuilder ( ) ; int d = fs . nextInt ( ) ; int h = fs . nextInt ( ) ; int v = fs . nextInt ( ) ; double e = ( fs . nextInt ( ) * Math . PI * d * d ) / 4.0 ; if ( Double . compare ( e , v ) >= 0 ) { System . out . println ( " NO " ) ; return ; } else { double startAmount = Math . PI * d * d * h / 4.0 ; System . out . println ( " YES " ) ; System . out . println ( startAmount / ( v - e ) ) ; } }   static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   float nextFloat ( ) { return Float . parseFloat ( next ( ) ) ; } } }

import mathd , h , v , e = tuple ( [ int ( num ) for num in input ( ) . split ( ) ] ) NEW_LINE

from math import pid , h , v , e = list ( map ( int , input ( ) . split ( ) ) ) a = ( d ** 2 / 4 ) * pi * hve = ( d ** 2 / 4 ) * pi * eif ( v > ve ) : print ( " YES " ) print ( a / ( v - ve ) ) else : print ( " NO " ) NEW_LINE

import sysimport math   d , h , v , e = ( map ( float , input ( ) . strip ( ) . split ( ) ) )   if not h : print ( " YES \n 0" ) else : drink_speed = v / ( math . pi * d ** 2 / 4 ) if drink_speed < e : print ( " NO " ) else : print ( f " YES \n { h ▁ / ▁ - ( e ▁ - ▁ drink _ speed ) } " ) NEW_LINE


import java . util . Scanner ;   public class Problem37 {   public static void main ( String [ ] args ) {

import java . util . * ; public class program { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] f = new int [ n ] ; int [ ] l = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { f [ i ] = sc . nextInt ( ) ; l [ i ] = sc . nextInt ( ) ; } int k = sc . nextInt ( ) ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( l [ i ] >= k ) { count ++ ; } } System . out . println ( count ) ; } }

import java . io . * ; import java . math . * ; import java . util . * ;        public class Main {   private static int dx [ ] = { 1 , 0 , - 1 , 0 } ; private static int dy [ ] = { 0 , - 1 , 0 , 1 } ; private static int dx1 [ ] = { 1 , 1 , 0 , - 1 , - 1 , - 1 , 0 , 1 } ; private static int dy1 [ ] = { 0 , - 1 , - 1 , - 1 , 0 , 1 , 1 , 1 } ;   private static final long INF = ( long ) Math . pow ( 10 , 16 ) ; private static final int INT_INF = Integer . MAX_VALUE ; private static final long NEG_INF = Long . MIN_VALUE ; private static final int NEG_INT_INF = Integer . MIN_VALUE ; private static final double EPSILON = 1e-10 ;   private static final long MAX = ( long ) 1e12 ; private static final long MOD = 1000000007 ;   private static final int MAXN = 200001 ; private static final int MAXA = 1000004 ; private static final int MAXLOG = 22 ; private static final double PI = Math . acos ( - 1 ) ; public static void main ( String [ ] args ) throws IOException {   InputReader in = new InputReader ( System . in ) ;

import java . io . * ; import java . util . * ; import java . math . * ;   public class Natasha { static final Random random = new Random ( ) ; static PrintWriter out = new PrintWriter ( ( System . out ) ) ; static Reader sc = new Reader ( ) ;   public static void main ( String args [ ] ) throws IOException {

import java . util . Arrays ; import java . util . Scanner ;   public class Singleton_Pattern { 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 ++ ) { int l = sc . nextInt ( ) ; int r = sc . nextInt ( ) ; array [ i ] = r ; } int a = 0 ; int k = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( k - 1 >= array [ i ] ) { a ++ ; } }

n = int ( input ( ) ) check = [ 0 ] * 10005 for i in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) for j in range ( a , b + 1 ) : check [ j ] = ic = int ( input ( ) ) print ( n - check [ c ] ) NEW_LINE

n = int ( input ( ) ) d = [ ] while ( n > 0 ) : l , r = map ( int , input ( ) . split ( ) ) n -= 1 z = [ l , r ] d . append ( z ) m = int ( input ( ) ) a = 0 for i in range ( len ( d ) ) : d1 = d [ i ] [ 0 ] d2 = d [ i ] [ 1 ] if ( m >= d1 or m <= d2 ) and m <= d2 : a += 1   print ( a ) NEW_LINE

import sys   def main ( ) : inp = sys . stdin . read ( ) . strip ( ) . split ( ' \n ' ) p = int ( inp [ - 1 ] ) n = int ( inp [ 0 ] ) for i in range ( 1 , n + 1 ) : x , y = map ( int , inp [ i ] . split ( ) ) if x <= p <= y : return n - i + 1   print ( main ( ) ) NEW_LINE

n = int ( input ( ) ) m = [ ] while n != 0 : l , r = map ( int , input ( ) . split ( ) ) m . append ( l ) m . append ( r ) n -= 1 k = int ( input ( ) ) for i in range ( len ( m ) ) : if k <= m [ i ] : print ( int ( ( ( len ( m ) - i ) + 1 ) / 2 ) ) break NEW_LINE

def string_list ( s , char ) : output_list = [ ] intermediator = " " for i in range ( len ( s ) ) : if s [ i ] != char : intermediator += s [ i ] if i == len ( s ) - 1 : output_list . append ( int ( intermediator ) ) else : if intermediator : output_list . append ( int ( intermediator ) ) intermediator = " " return output_list     def list_string ( l , char ) : output_str = " " for i in range ( len ( l ) - 1 ) : output_str += str ( l [ i ] ) + char output_str += str ( l [ len ( l ) - 1 ] ) return output_str     def merge_sort ( l ) : def merge ( l1 , l2 ) : i , j = 0 , 0 output_list = [ ] while i < len ( l1 ) and j < len ( l2 ) : if l1 [ i ] < l2 [ j ] : output_list . append ( l1 [ i ] ) i += 1 else : output_list . append ( l2 [ j ] ) j += 1 if i == len ( l1 ) : output_list += ( l2 [ j : ] ) else : output_list += ( l1 [ i : ] ) return output_list   def sorts ( l ) : if len ( l ) < 2 : return l else : mid = len ( l ) // 2 left = sorts ( l [ : mid ] ) right = sorts ( l [ mid : ] ) return merge ( left , right ) return sorts ( l )       def main_function ( ) : output_list = [ ] t = int ( input ( ) ) chapters = [ ] for i in range ( t ) : chapter = string_list ( input ( ) , " ▁ " ) chapters . append ( chapter ) page = int ( input ( ) ) already_red = 0 for i in range ( len ( chapters ) ) : if page > chapters [ i ] [ 1 ] : already_red += 1 else : break return len ( chapters ) - already_red   return list_string ( output_list , " ▁ " )       print ( main_function ( ) )   NEW_LINE


import javax . print . DocFlavor ; import javax . swing . * ; import java . awt . image . BandedSampleModel ; import java . util . * ;   public class Example { static long [ ] [ ] dp ;

import java . util . Scanner ;   public class Inbox { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int squSize = scanner . nextInt ( ) ; int [ ] numbers = new int [ squSize ] ; int ones = 0 ; for ( int i = 0 ; i < squSize ; i ++ ) { numbers [ i ] = scanner . nextInt ( ) ; if ( numbers [ i ] == 1 ) { ones ++ ; } } int counter = 0 ; for ( int i = 0 ; i < squSize - 1 ; i ++ ) { if ( numbers [ i ] == 1 ) { ones -- ; if ( ones > 0 ) { counter += 2 ; if ( numbers [ i + 1 ] == 1 ) { counter -- ; } } else { counter ++ ; } } } if ( numbers [ squSize - 1 ] == 1 ) { counter ++ ; } System . out . println ( counter ) ; } }

import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int a [ ] = new int [ n ] ; int prev = - 1 , c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = in . nextInt ( ) ; if ( prev != - 1 && a [ i ] == 1 ) { if ( i - prev <= 2 ) c = c + ( i - prev ) ; else c = c + 2 ; prev = i ; } if ( prev == - 1 && a [ i ] == 1 ) { prev = i ; c = c + 1 ; } } System . out . println ( c ) ; } }

import java . util . Scanner ;   public class Inbox100500 { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , i , d = 0 , c = 0 ; boolean b = false ; for ( i = 0 ; i < n ; i ++ ) { int x = in . nextInt ( ) ; if ( x == 1 ) { b = true ; c += d == 0 ? 1 : 2 ; d = 0 ; } else if ( b ) { d ++ ; } } in . close ( ) ; System . out . println ( c ) ; } }

import java . util . * ;   public class Check2 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] ar = new int [ n ] ; int lastin = 0 ; for ( int i = 0 ; i < n ; i ++ ) { ar [ i ] = sc . nextInt ( ) ; if ( ar [ i ] == 1 ) { lastin = i ; } } long c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( i < n - 1 ) { if ( ar [ i ] == 1 ) { c ++ ; if ( ar [ i + 1 ] != 1 && ( i + 1 ) <= lastin ) { c ++ ; } } } else { if ( ar [ i ] == 1 ) { c ++ ; } } } System . out . println ( c ) ;    }   public static void Mybfs ( List < List < Integer > > lists , int source , int [ ] dist , boolean [ ] visited ) { dist [ source ] = 0 ;

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) prev = 1 ans = 0 for x in a : if x == 1 : if ans == 0 or prev == 1 : ans += 1 else : ans += 2 prev = xprint ( ans ) NEW_LINE

import mathimport osimport randomimport reimport sysimport functoolsfrom operator import itemgetter , attrgetterfrom collections import Counter   if __name__ == ' _ _ main _ _ ' : Y = lambda : list ( map ( int , input ( ) . split ( ) ) ) P = lambda : map ( int , input ( ) . split ( ) ) N = lambda : int ( input ( ) )   n = N ( ) a = Y ( ) f , cnt = 0 , 0 for i in a : if i : cnt += 1 f = 1 else : if f : cnt += 1 f = 0 print ( cnt if ( a [ n - 1 ] or not cnt ) else cnt - 1 ) NEW_LINE

n = int ( input ( ) ) arr = [ int ( i ) for i in input ( ) . split ( ) ] i = 0 while ( i < n and arr [ i ] == 0 ) : arr [ i ] = - 1 i = i + 1 i = n - 1 while ( arr [ i ] == 0 ) : arr [ i ] = - 1 i = i - 1 i , c = 0 , 0 while ( i < n ) : if arr [ i ] == 1 : c = c + 1 i = i + 1 elif arr [ i ] == 0 : c = c + 1 while ( arr [ i ] == 0 ) : i = i + 1 else : i = i + 1 print ( c ) NEW_LINE

import sysinput = sys . stdin . readlinen = int ( input ( ) ) l = input ( ) . split ( ) li = [ int ( i ) for i in l ] l = [ ] for i in range ( n ) : if ( li [ i ] == 1 ) : l . append ( i ) ans = 0 for i in range ( len ( l ) - 1 ) : ans += min ( l [ i + 1 ] - l [ i ] , 2 ) if ( l != [ ] ) : ans += 1 print ( ans ) NEW_LINE

import itertoolsimport bisectimport mathfrom collections import * import osimport sysfrom io import BytesIO , IOBase   ii = lambda : int ( input ( ) ) lmii = lambda : list ( map ( int , input ( ) . split ( ) ) ) slmii = lambda : sorted ( map ( int , input ( ) . split ( ) ) ) li = lambda : list ( input ( ) ) mii = lambda : map ( int , input ( ) . split ( ) ) msi = lambda : map ( str , input ( ) . split ( ) )     def main ( ) : NEW_LINE


import java . util . Scanner ;   public class StringEqualiser { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ;   String a = scanner . nextLine ( ) ; String b = scanner . nextLine ( ) ;   int seven = 0 , four = 0 , count = 0 ;   for ( int i = 0 ; i < a . length ( ) ; i ++ ) { if ( a . charAt ( i ) != b . charAt ( i ) ) { if ( a . charAt ( i ) == '4' ) four ++ ; else seven ++ ;   count ++ ; } }   System . out . println ( count - Math . min ( four , seven ) ) ; } }

import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) , b = sc . next ( ) ; int dif = 0 , dif2 = 0 , q = 0 , w = 0 , temp = 0 ; for ( int i = 0 ; i < a . length ( ) ; i ++ ) { q = Integer . parseInt ( String . valueOf ( a . charAt ( i ) ) ) ; w = Integer . parseInt ( String . valueOf ( b . charAt ( i ) ) ) ; temp = q - w ; if ( temp > 0 ) { dif ++ ; } else if ( temp < 0 ) { dif2 ++ ; } } if ( dif >= dif2 ) { System . out . println ( dif ) ; } else { System . out . println ( dif2 ) ; } } }

import java . util . Scanner ;    public class Main {   public static void main ( String [ ] args ) { Scanner leer = new Scanner ( System . in ) ; String C1 ; String C2 ; int pos = 0 ; int neg = 0 ; C1 = leer . nextLine ( ) ; C2 = leer . nextLine ( ) ; char A [ ] = C1 . toCharArray ( ) ; char B [ ] = C2 . toCharArray ( ) ; if ( ! C1 . equals ( C2 ) ) for ( int i = 0 ; i < ( C1 . length ( ) ) ; i ++ ) { if ( ( ( ( int ) A [ i ] ) - ( ( int ) B [ i ] ) ) < 0 ) neg ++ ; else if ( ( ( ( int ) A [ i ] ) - ( ( int ) B [ i ] ) ) > 0 ) pos ++ ; } if ( pos == neg ) System . out . print ( pos ) ; else if ( pos < neg ) System . out . print ( pos + ( neg - pos ) ) ; else System . out . print ( neg + ( pos - neg ) ) ;   } }

a = list ( input ( ) ) b = list ( input ( ) )   a_copy = a [ : ] a_copy . sort ( ) b_copy = b [ : ] b_copy . sort ( )   replace_counter = 0 swap_counter = 0   for i in range ( len ( a_copy ) ) : if ( a_copy [ i ] != b_copy [ i ] ) : replace_counter += 1   for i in range ( len ( a ) ) : if ( a [ i ] != b [ i ] ) : swap_counter += 1   swap_counter = ( swap_counter - replace_counter ) // 2 print ( replace_counter + swap_counter ) NEW_LINE

a , b = input ( ) , input ( ) ; l = [ a [ i ] + b [ i ] for i in range ( len ( a ) ) ] ; print ( max ( l . count ( '47' ) , l . count ( '74' ) ) ) NEW_LINE

a = list ( map ( int , input ( ) ) ) b = list ( map ( int , input ( ) ) ) c = 0 ; z = 0 for i in range ( len ( a ) ) : if a [ i ] != b [ i ] : if a [ i ] == 4 : c += 1 else : z += 1 print ( max ( c , z ) )   NEW_LINE

from collections import Counter   string1 = input ( ) string2 = input ( )   x1 = Counter ( string1 ) x2 = Counter ( string2 )   string1 = list ( string1 ) string2 = list ( string2 ) q = Counter ( ) q [ '4' ] = abs ( x1 [ '4' ] - x2 [ '4' ] ) q [ '7' ] = abs ( x1 [ '7' ] - x2 [ '7' ] ) if q [ '4' ] < q [ '7' ] : w = '4' else : w = '7' ans = 0 dp = 0 for i in range ( len ( string1 ) ) : if string1 [ i ] != string2 [ i ] : if q [ w ] > 0 : ans += 1 q [ w ] -= 1 else : dp += 1 dp //= 2 print ( ans + dp ) NEW_LINE

from collections import Counter   string1 = input ( ) string2 = input ( )   x1 = Counter ( string1 ) x2 = Counter ( string2 )   string1 = list ( string1 ) string2 = list ( string2 ) mn = min ( abs ( x1 [ '4' ] - x2 [ '4' ] ) , abs ( x1 [ '7' ] - x2 [ '7' ] ) )   ans = 0 dp = 0 for i in range ( len ( string1 ) ) : if string1 [ i ] != string2 [ i ] : if mn > 0 : ans += 1 mn -= 1 else : dp += 1 dp //= 2 print ( ans + dp ) NEW_LINE


import java . io . BufferedReader ; import java . io . FileReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . * ; import java . io . * ; public class codeforces { static class Student { int x , y ; Student ( int x , int y ) { this . x = x ; this . y = y ;

import java . io . BufferedReader ; import java . io . * ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . * ; import java . math . * ; public class Main { static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } public static void main ( String [ ] args ) throws java . lang . Exception { int test = 1 ; FastReader sc = new FastReader ( ) ; PrintWriter pw = new PrintWriter ( System . out ) ;

import java . io . * ; import java . util . * ; public class Solution { static Scanner sc = new Scanner ( System . in ) ; static PrintWriter out = new PrintWriter ( System . out ) ;

import java . util . * ; import java . io . * ;   public class Main { public static void main ( String [ ] args ) throws Exception { FastReader sc = new FastReader ( ) ; StringBuilder sb = new StringBuilder ( ) ; int n = sc . nextInt ( ) ; int max = sc . nextInt ( ) ; int d = max ; for ( int i = 1 ; i < n ; i ++ ) { int temp = sc . nextInt ( ) ; max = Math . max ( max , temp ) ; d = gcd ( d , temp ) ; } System . out . println ( ( ( max / d ) - n ) % 2 == 1 ? " Alice " : " Bob " ) ; } static int gcd ( int a , int b ) { if ( b == 0 ) return a ; else return gcd ( b , a % b ) ; } } class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } }

import java . util . * ; public class Solution {   static int gcd ( int a , int b ) { if ( a % b == 0 ) return b ; return gcd ( b , a % b ) ; } public static String gameWinner ( int [ ] ar , int n ) {

import mathfor _ in range ( 1 ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) g = 0 for i in range ( 0 , len ( a ) ) : g = math . gcd ( a [ i ] , g ) maxi = max ( a ) // g if ( n - maxi ) % 2 == 0 : print ( " Bob " ) else : print ( " Alice " ) NEW_LINE

from math import * n = int ( input ( ) ) ls = [ int ( x ) for x in input ( ) . split ( ) ] g = 0 for i in ls : g = gcd ( g , i ) x = max ( ls ) // gif ( x - n ) & 1 : print ( ' Alice ' ) else : print ( ' Bob ' ) NEW_LINE

import math as mtimport sys , stringinput = sys . stdin . readlinefrom collections import defaultdictL = lambda : list ( map ( int , input ( ) . split ( ) ) ) Ls = lambda : list ( input ( ) . split ( ) ) M = lambda : map ( int , input ( ) . split ( ) ) I = lambda : int ( input ( ) )   n = I ( ) l = L ( ) m = 0 g = l [ 0 ] for i in l : g = mt . gcd ( g , i ) m = max ( m , i ) ans = ( m // g - n ) if ( ans % 2 ) : print ( " Alice " ) else : print ( " Bob " ) NEW_LINE

n , listo2 , c = int ( input ( ) ) , [ ] , 0 import mathlisto = list ( map ( int , input ( ) . split ( ) ) ) listo . sort ( ) obaa = listo [ 0 ]   def gcd ( x , y ) : while ( y ) : x , y = y , x % y return x     for i in range ( 1 , n ) : GCD = gcd ( listo [ i ] , obaa ) obaa = GCDbomba = int ( listo [ n - 1 ] / GCD ) - n if bomba % 2 == 0 : print ( " Bob " ) else : print ( " Alice " ) NEW_LINE

from fractions import gcdn = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) d = max ( a ) c = 0 for i in range ( len ( a ) ) : c = gcd ( c , a [ i ] ) result = d // c - nif result % 2 == 0 : print ( " Bob " ) else : print ( " Alice " ) NEW_LINE


import java . awt . Point ; import java . util . * ; import java . io . * ; import static java . lang . Math . * ;   public class PracticeProblem { public static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } }   public static FastReader in = new FastReader ( ) ; public static PrintWriter out = new PrintWriter ( System . out ) ; public static final int MOD = ( int ) 1e9 + 7 ;   public static void main ( String [ ] args ) { solve ( ) ;   out . close ( ) ; }   public static void solve ( ) { long n = in . nextInt ( ) , k = in . nextInt ( ) ;   if ( ( n * ( n - 1 ) ) / 2 <= k ) { out . println ( " no ▁ solution " ) ; return ; }   for ( int i = 0 ; i < n ; i ++ ) { out . println ( 0 + " ▁ " + i ) ; }   }   }

import java . io . BufferedReader ; import java . util . Collections ; import java . io . FileNotFoundException ; import java . io . FileReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; public class hh { public static void hanoitower ( int n , char from , char to , char aux ) { if ( n == 1 ) { System . out . println ( n + " ▁ " + from + " to " + to ) ; return ; } hanoitower ( n - 1 , from , aux , to ) ; System . out . println ( n + " ▁ " + from + " to " + to ) ; hanoitower ( n - 1 , aux , to , from ) ; } public static double factorial ( int n ) { if ( n == 0 ) { return 1 ; } else { return n * factorial ( n - 1 ) ; } } public static void main ( String [ ] args ) throws IOException , InterruptedException { PrintWriter pw = new PrintWriter ( System . out ) ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; boolean flag = false ; long fac = 0 ; fac = ( n ) * ( n - 1 ) ; fac /= 2 ;

n , k = map ( int , input ( ) . split ( ) )   fac = n * ( n - 1 ) / 2 ; if ( fac > k ) : i = 0 while ( i < n ) : print ( 1 , " ▁ " , i ) i = i + 1 else : print ( " no ▁ solution " ) NEW_LINE

n , k = map ( int , input ( ) . split ( ) ) if k * 2 >= ( n - 1 ) * n : print ( ' no ▁ solution ' ) else : [ print ( 0 , i ) for i in range ( n ) ] NEW_LINE

r = lambda x : ( x * ( x + 1 ) ) // 2 a , b = map ( int , input ( ) . split ( ) ) if r ( a - 1 ) <= b : exit ( print ( " no ▁ solution " ) ) for i in range ( a ) : print ( 0 , 0 + i ) NEW_LINE

n , k = map ( int , input ( ) . split ( ) ) tot = ( ( n * ( n - 1 ) ) / 2 )   if tot <= k : print ( " no ▁ solution " ) else : for i in range ( 1 , n + 1 ) : print ( 0 , i ) NEW_LINE


import java . util . * ; public class A_Multiples_of_Length { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int i = 0 ; int ar [ ] = new int [ n ] ; for ( i = 0 ; i < n ; i ++ ) { ar [ i ] = sc . nextInt ( ) ; } System . out . println ( 1 + " ▁ " + n ) ; for ( i = 0 ; i < n ; i ++ ) { System . out . print ( ( ( long ) - 1 * ( long ) ar [ i ] * ( long ) n ) + " ▁ " ) ; } System . out . println ( ) ; System . out . println ( 1 + " ▁ " + 1 ) ; System . out . println ( ( long ) ( n - 1 ) * ( long ) ar [ 0 ] ) ; if ( n == 1 ) { System . out . println ( 1 + " ▁ " + 1 ) ; System . out . println ( 0 ) ; return ; } System . out . println ( 2 + " ▁ " + n ) ; for ( i = 1 ; i < n ; i ++ ) { System . out . print ( ( long ) ( n - 1 ) * ( long ) ar [ i ] + " ▁ " ) ; } } }

from sys import stdin , stdout NEW_LINE input = stdin . readline NEW_LINE def main ( ) : NEW_LINE INDENT t = 1 NEW_LINE for i in range ( t ) : NEW_LINE INDENT n = int ( input ( ) ) NEW_LINE ai = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE if n == 1 : NEW_LINE INDENT print ( 1 , 1 ) NEW_LINE print ( 0 ) NEW_LINE print ( 1 , 1 ) NEW_LINE print ( 0 ) NEW_LINE print ( 1 , 1 ) NEW_LINE print ( int ( - ai [ 0 ] ) ) NEW_LINE return NEW_LINE DEDENT print ( 1 , n ) NEW_LINE n2 = n * ( n - 1 ) NEW_LINE ai2 = [ n * ( n - 1 - i % ( n - 1 ) ) for i in ai ] NEW_LINE print ( * ai2 ) NEW_LINE ai = [ ai [ i ] + ai2 [ i ] for i in range ( n ) ] NEW_LINE print ( 1 , 1 ) NEW_LINE print ( int ( - ai [ 0 ] ) ) NEW_LINE print ( 2 , n ) NEW_LINE print ( * [ int ( - ai [ i ] ) for i in range ( 1 , n ) ] ) NEW_LINE DEDENT DEDENT main ( ) NEW_LINE

from bisect import bisect_left NEW_LINE n = int ( input ( ) ) NEW_LINE l = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE if n == 1 : NEW_LINE INDENT print ( 1 , 1 ) NEW_LINE print ( - 1 * l [ 0 ] ) NEW_LINE print ( 1 , 1 ) NEW_LINE print ( 0 ) NEW_LINE print ( 1 , 1 ) NEW_LINE print ( 0 ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( 1 , n ) NEW_LINE x = n - 1 NEW_LINE for i in range ( n ) : NEW_LINE INDENT t = l [ i ] NEW_LINE if l [ i ] % x : NEW_LINE INDENT l [ i ] += ( x + 1 ) * ( x - t % x ) NEW_LINE DEDENT print ( l [ i ] - t , end = " ▁ " ) NEW_LINE DEDENT x = x - 1 NEW_LINE print ( ) NEW_LINE print ( 2 , n ) NEW_LINE for i in range ( 1 , n ) : NEW_LINE INDENT print ( - 1 * l [ i ] , end = " ▁ " ) NEW_LINE DEDENT print ( ) NEW_LINE print ( 1 , 1 ) NEW_LINE print ( - 1 * l [ 0 ] ) NEW_LINE DEDENT

n = int ( input ( ) ) NEW_LINE a = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) NEW_LINE if n == 1 : NEW_LINE INDENT print ( 1 , 1 ) NEW_LINE print ( - a [ 0 ] ) NEW_LINE print ( 1 , 1 ) NEW_LINE print ( 0 ) NEW_LINE print ( 1 , 1 ) NEW_LINE print ( 0 ) NEW_LINE DEDENT elif n == 2 : NEW_LINE INDENT print ( 1 , 1 ) NEW_LINE print ( - a [ 0 ] ) NEW_LINE print ( 2 , 2 ) NEW_LINE print ( - a [ 1 ] ) NEW_LINE print ( 1 , 1 ) NEW_LINE print ( 0 ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( 1 , 1 ) NEW_LINE print ( - a [ 0 ] ) NEW_LINE a [ 0 ] = 0 NEW_LINE b = [ ] NEW_LINE for i in range ( 1 , len ( a ) ) : NEW_LINE INDENT moda = a [ i ] % n NEW_LINE c = moda * ( n - 1 ) NEW_LINE b . append ( c ) NEW_LINE a [ i ] += c NEW_LINE DEDENT print ( 2 , n ) NEW_LINE print ( ' ▁ ' . join ( list ( map ( str , b ) ) ) ) NEW_LINE print ( 1 , n ) NEW_LINE b = [ ] NEW_LINE for i in a : NEW_LINE INDENT b . append ( - i ) NEW_LINE DEDENT print ( ' ▁ ' . join ( list ( map ( str , b ) ) ) ) NEW_LINE DEDENT


import java . math . BigInteger ; import java . text . DecimalFormat ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashSet ; import java . util . Scanner ; @ SuppressWarnings ( " unused " ) public class B { public static Scanner scan = new Scanner ( System . in ) ; public static void solve ( ) { int n = scan . nextInt ( ) ; int [ ] [ ] a = new int [ 1005 ] [ 1005 ] ; int cnt = 0 ; for ( int i = 0 ; i < 1000 ; i ++ ) { for ( int j = 0 ; j < 1000 ; j ++ ) { a [ i ] [ j ] = 0 ; } } for ( int k = 0 ; k < n ; k ++ ) { int x1 = scan . nextInt ( ) ; int y1 = scan . nextInt ( ) ; int x2 = scan . nextInt ( ) ; int y2 = scan . nextInt ( ) ; for ( int i = x1 ; i <= x2 ; i ++ ) { for ( int j = y1 ; j <= y2 ; j ++ ) { a [ i ] [ j ] ++ ; } } } for ( int i = 0 ; i <= 100 ; i ++ ) { for ( int j = 0 ; j <= 100 ; j ++ ) { cnt += a [ i ] [ j ] ; } } System . out . println ( cnt ) ; } public static void main ( String [ ] args ) { solve ( ) ; scan . close ( ) ; }   }

import java . io . * ; import java . math . BigInteger ; 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 = 0 ; i < n ; i ++ ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; ans = ans + ( Math . abs ( a - c ) + 1 ) * ( Math . abs ( d - b ) + 1 ) ; } System . out . println ( ans ) ; } }

import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; long ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x1 = in . nextInt ( ) ; int y1 = in . nextInt ( ) ; int x2 = in . nextInt ( ) ; int y2 = in . nextInt ( ) ; ans += ( x2 - x1 + 1 ) * ( y2 - y1 + 1 ) ; } System . out . println ( ans ) ; } }

n = int ( input ( ) ) ans = 0 for _ in range ( n ) : x1 , y1 , x2 , y2 = map ( int , input ( ) . split ( ) ) ans += ( x2 - x1 + 1 ) * ( y2 - y1 + 1 ) print ( ans ) NEW_LINE

n = int ( input ( ) ) r = 0 for i in range ( n ) : x1 , y1 , x2 , y2 = list ( map ( int , input ( ) . split ( ) ) ) r += ( x2 - x1 + 1 ) * ( y2 - y1 + 1 ) print ( r ) NEW_LINE

r = 0 for i in range ( int ( input ( ) ) ) : x1 , y1 , x2 , y2 = list ( map ( int , input ( ) . split ( ) ) ) r = r + ( x2 - x1 + 1 ) * ( y2 - y1 + 1 ) print ( r ) NEW_LINE

n = int ( input ( ) ) s = 0 for _ in range ( n ) : x1 , y1 , x2 , y2 = map ( int , input ( ) . split ( ) ) s = s + abs ( x2 - x1 + 1 ) * abs ( y2 - y1 + 1 ) print ( s ) NEW_LINE

def build ( ) : arr = [ ] for i in range ( 100 ) : arr . append ( [ 0 ] * 100 ) return arr       def solve ( arr ) : res = build ( ) for i , v in enumerate ( arr ) : for row in range ( v [ 2 ] - ( v [ 0 ] - 1 ) ) : for col in range ( v [ 3 ] - ( v [ 1 ] - 1 ) ) : res [ row ] [ col ] += 1 tot = 0 for i in res : tot += sum ( i ) return tot                   def main ( ) : n = int ( input ( ) ) arr = [ ] for _ in range ( n ) : i = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) arr . append ( i ) print ( solve ( arr ) ) main ( ) NEW_LINE


# include < bits / stdc ++ . h > # define it register int # define ct const int # define il inlineusing namespace std ; typedef long long ll ; # define rll register ll # define cll const ll # define P 998244353 const int N = 1000005 ; int n , a [ N ] , ans ; multiset < int > S ; namespace io { il char nc ( ) { static char buf [ 100000 ] , * p1 = buf , * p2 = buf ; return p1 == p2 && ( p2 = ( p1 = buf ) + fread ( buf , 1 , 100000 , stdin ) , p1 == p2 ) ? EOF : * p1 ++ ; } template < class I > il void fr ( I & num ) { num = 0 ; register char c = nc ( ) ; it p = 1 ; while ( c < '0' || c > '9' ) c == ' - ' ? p = - 1 , c = nc ( ) : c = nc ( ) ; while ( c >= '0' && c <= '9' ) num = num * 10 + c - '0' , c = nc ( ) ; num *= p ; } } using namespace io ; map < int , int > cn ; int main ( ) { fr ( n ) ; it i ; for ( i = 1 ; i <= n ; ++ i ) fr ( a [ i ] ) , ++ cn [ a [ i ] ] , cn [ a [ i ] ] > ans ? ans = cn [ a [ i ] ] : 0 ;

import java . util . * ; import java . math . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;

import sysinput = sys . stdin . readline   '''   '''   n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( reverse = True ) count = 0 l , r = 0 , 1   while l < n and r < n : if a [ l ] > a [ r ] : l += 1 r += 1 count += 1 else : r += 1   print ( count ) NEW_LINE

n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) map = { } for i in arr : if i not in map : map [ i ] = 1 else : map [ i ] += 1 max = 0 for i in map : if map [ i ] > max : max = map [ i ] print ( n - max ) NEW_LINE

z , zz = input , lambda : list ( map ( int , z ( ) . split ( ) ) ) fast = lambda : stdin . readline ( ) . strip ( ) zzz = lambda : [ int ( i ) for i in fast ( ) . split ( ) ] szz , graph , mod , szzz = lambda : sorted ( zz ( ) ) , { } , 10 ** 9 + 7 , lambda : sorted ( zzz ( ) ) from string import * from re import * from collections import * from queue import * from sys import * from collections import * from math import * from heapq import * from itertools import * from bisect import * from collections import Counter as ccfrom math import factorial as ffrom bisect import bisect as bsfrom bisect import bisect_left as bslfrom itertools import accumulate as acdef lcd ( xnum1 , xnum2 ) : return ( xnum1 * xnum2 // gcd ( xnum1 , xnum2 ) ) def prime ( x ) : p = ceil ( x ** .5 ) + 1 for i in range ( 2 , p ) : if ( x % i == 0 and x != 2 ) or x == 0 : return 0 return 1 def dfs ( u , visit , graph ) : visit [ u ] = 1 for i in graph [ u ] : if not visit [ i ] : dfs ( i , visit , graph )   NEW_LINE


import java . io . BufferedWriter ; import java . io . ByteArrayInputStream ; import java . io . FileInputStream ; import java . io . FileWriter ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . InputMismatchException ;   public class Main { private static final long MOD = ( long ) 1e9 + 7 ; static InputStream is ; static PrintWriter out ; static String INPUT = " " ; static int lenbuf = 0 , ptrbuf = 0 ; private static byte [ ] inbuf = new byte [ 1024 ] ; static boolean readFile = true ;

import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . FileReader ; import java . io . FileWriter ; import java . io . IOException ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . Deque ; import java . util . LinkedList ; import java . util . StringTokenizer ;   public class Main { static StringTokenizer st ; static BufferedReader in ;   public static void main ( String [ ] args ) throws IOException { in = new BufferedReader ( new FileReader ( " input . txt " ) ) ; PrintWriter pw = new PrintWriter ( new BufferedWriter ( new FileWriter ( " output . txt " ) ) ) ; int n = nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = nextInt ( ) ; } Arrays . sort ( a ) ; int min = Integer . MAX_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { int j = upper_bound ( a , i , 2 * a [ i ] ) ; min = Math . min ( min , i + n - j ) ; } pw . println ( min ) ;   pw . close ( ) ; }   private static int upper_bound ( int [ ] a , int l , int target ) { int r = a . length ; while ( l < r ) { int mid = l + ( r - l ) / 2 ; if ( a [ mid ] > target ) { r = mid ; } else { l = mid + 1 ; } } return l ; }   private static int nextInt ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; }   private static long nextLong ( ) throws IOException { return Long . parseLong ( next ( ) ) ; }   private static double nextDouble ( ) throws IOException { return Double . parseDouble ( next ( ) ) ; }   private static String next ( ) throws IOException { while ( st == null || ! st . hasMoreTokens ( ) ) { st = new StringTokenizer ( in . readLine ( ) ) ; } return st . nextToken ( ) ; } }

file = open ( ' input . txt ' , ' r ' ) n = int ( file . readline ( ) ) - 1 lis = sorted ( list ( map ( int , file . readline ( ) . split ( ) ) ) ) i , j = 0 , 0 for i in range ( n + 1 ) : if lis [ i ] <= lis [ j ] * 2 : continue j += 1 open ( " output . txt " , " w " ) . write ( str ( j ) ) NEW_LINE

from math import ceil as cefrom collections import Counter as cc   import syssys . stdin = open ( " input . txt " ) sys . stdout = open ( " output . txt " , ' w ' )   n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) d = dict ( cc ( l ) ) l = sorted ( list ( d . items ( ) ) , key = lambda x : x [ 0 ] )   co = [ 0 ] * 5001j = 0       for i in range ( 1 , 5001 ) : if j < len ( l ) and l [ j ] [ 0 ] == i : co [ i ] += l [ j ] [ 1 ] j += 1 co [ i ] += co [ i - 1 ] NEW_LINE

f = open ( ' input . txt ' , ' r ' ) n = int ( f . readline ( ) ) c = sorted ( map ( int , f . readline ( ) . split ( ) ) ) j , v = 0 , n - 1 for i in range ( n ) : while j < n - 1 and 2 * c [ i ] >= c [ j + 1 ] : j += 1 v = min ( v , n + i - j - 1 ) open ( ' output . txt ' , ' w ' ) . write ( str ( v ) ) NEW_LINE

import bisectimport syssys . stdin = open ( ' input . txt ' , ' r ' ) sys . stdout = open ( ' output . txt ' , ' w ' ) n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( ) ans = 10 ** 18 for i in range ( n ) : x = a [ i ] * 2 idx = bisect . bisect_right ( a , x ) cnt = i + ( n - idx ) ans = min ( ans , cnt ) print ( ans ) NEW_LINE

file = open ( ' input . txt ' , ' r ' ) n = int ( file . readline ( ) ) - 1 lis = sorted ( list ( map ( int , file . readline ( ) . split ( ) ) ) ) i , j = 0 , 0 for i in range ( n + 1 ) : if lis [ i ] <= lis [ j ] * 2 : continue j += 1 out = n - i + jprint ( out ) open ( " output . txt " , " w " ) . write ( str ( out ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ;   public class CloningToys { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] input = br . readLine ( ) . split ( " ▁ " ) ; int copied = Integer . parseInt ( input [ 0 ] ) ; int original = Integer . parseInt ( input [ 1 ] ) ; if ( original <= 0 ) { System . out . println ( " No " ) ; } else if ( original == 1 ) { if ( copied == 0 ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } else { original -- ; copied -= original ; if ( copied % 2 == 0 && copied >= 0 ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } } }

import java . util . * ;   public class CodeForces922A { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int x = input . nextInt ( ) ; int y = input . nextInt ( ) ; y -- ; x -= y ; if ( x % 2 == 0 && x >= 0 && y > 0 || y == 0 && x == 0 ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }

import java . util . Scanner ;   public class P922A {   public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; long desiredClones = s . nextLong ( ) ; long desiredOriginals = s . nextLong ( ) ; long startingClones = desiredOriginals - 1 ; long neededClones = desiredClones - startingClones ; if ( neededClones != 0 ) { if ( neededClones > 0 && neededClones % 2 == 0 && startingClones >= 1 ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } else { if ( desiredOriginals >= 1 ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } } }

import java . util . Scanner ;   public class CloningToys { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int x = in . nextInt ( ) , y = in . nextInt ( ) - 1 ;   in . close ( ) ; System . out . println ( ( y > 0 && x >= y && ( x - y ) % 2 == 0 ) || ( y == 0 && x == y ) ? " Yes " : " No " ) ; } }

x , y = map ( int , input ( ) . split ( ) ) if ( y == 0 ) or ( y == 1 and x != 0 ) : print ( " No " ) else : if ( x - ( y - 1 ) ) % 2 == 0 and x >= ( y - 1 ) and y != 0 : print ( " Yes " ) else : print ( " No " ) NEW_LINE

x , y = map ( int , input ( ) . split ( ) ) a = 1 b = 0   if ( y == 0 or ( y == 1 and x > 0 ) ) : print ( " No " ) exit ( )   else : a = a + a * ( y - 1 ) b = b + y - 1   x = x - b   if ( x % 2 == 0 and x >= 0 ) : print ( " Yes " )                   else : print ( " No " ) NEW_LINE

x , y = map ( int , input ( ) . split ( ) ) if y == 0 : print ( ' No ' ) exit ( 0 ) if y == 1 : if x == 0 : print ( ' Yes ' ) else : print ( ' No ' ) exit ( 0 ) print ( ' Yes ' if x - y + 1 >= 0 and ( x - y + 1 ) % 2 == 0 else ' No ' ) NEW_LINE

x , y = map ( int , input ( ) . split ( ) )   if y == 0 : print ( ' No ' ) exit ( 0 )   if y == 1 : if x == 0 : print ( ' Yes ' ) else : print ( ' No ' ) exit ( 0 )   print ( ' Yes ' if x >= y - 1 and ( x - y + 1 ) % 2 == 0 else ' No ' ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class R {   public static void main ( String [ ] args ) { FastReader fr = new FastReader ( ) ; long a [ ] = new long [ 3 ] ; a [ 0 ] = fr . nextLong ( ) ; a [ 1 ] = fr . nextLong ( ) ; a [ 2 ] = fr . nextLong ( ) ; Arrays . parallelSort ( a ) ; long result = 0 ; if ( a [ 0 ] == 0 && a [ 1 ] == 1 ) { System . out . println ( a [ 2 ] ) ; } else if ( a [ 0 ] == a [ 1 ] ) { System . out . println ( a [ 0 ] ) ; } else if ( a [ 2 ] == a [ 1 ] ) { System . out . println ( a [ 2 ] ) ; } else if ( ( a [ 1 ] - a [ 0 ] ) % 2 == 1 ) { result += a [ 2 ] - a [ 1 ] ; result += a [ 1 ] ; System . out . println ( result ) ; } else { result += ( a [ 1 ] - a [ 0 ] ) / 2 ; result += ( a [ 1 ] + a [ 0 ] ) / 2 ; System . out . println ( result ) ; } }    static class FastReader { BufferedReader bf ; StringTokenizer st ;   public FastReader ( ) { bf = new BufferedReader ( new InputStreamReader ( System . in ) ) ;

import java . util . Scanner ;   public class Pixel { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; long i , j , k , n , a , b , c , big , middle , small , sum ; boolean is ; while ( input . hasNext ( ) ) { a = input . nextLong ( ) ; b = input . nextLong ( ) ; c = input . nextLong ( ) ; sum = 0 ; is = false ;   big = ( a >= b ) ? ( ( a >= c ) ? a : c ) : ( ( b >= c ) ? b : c ) ; small = ( a >= b ) ? ( ( b >= c ) ? c : b ) : ( ( a >= c ) ? c : a ) ; middle = a > b ? ( c > a ? a : ( b > c ) ? b : c ) : ( c > b ? b : a > c ? a : c ) ;

import java . util . Arrays ; import java . util . Scanner ;   public class Main { static Scanner input = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { long [ ] data = new long [ 3 ] ; data [ 0 ] = input . nextLong ( ) ; data [ 1 ] = input . nextLong ( ) ; data [ 2 ] = input . nextLong ( ) ; Arrays . sort ( data ) ; if ( ( data [ 1 ] - data [ 0 ] ) % 2 == 0 ) { System . out . println ( data [ 1 ] ) ; } else { System . out . println ( data [ 2 ] ) ; } } }

import java . util . Arrays ; import java . util . Scanner ;   public class Main { static long [ ] a = new long [ 3 ] ; public static void main ( String [ ] args ) { Scanner reader = new Scanner ( System . in ) ; a [ 0 ] = reader . nextLong ( ) ; a [ 1 ] = reader . nextLong ( ) ; a [ 2 ] = reader . nextLong ( ) ; Arrays . sort ( a ) ; System . out . println ( ( a [ 1 ] - a [ 0 ] ) % 2 == 0 ? a [ 1 ] : a [ 2 ] ) ; } }

import sysinput = sys . stdin . readlinel = input ( ) . split ( ) li = [ int ( i ) for i in l ] maxa = 10 ** 18 li . sort ( ) if ( ( li [ 2 ] - li [ 1 ] ) % 2 == 0 ) : maxa = min ( maxa , li [ 2 ] ) if ( ( li [ 2 ] - li [ 0 ] ) % 2 == 0 ) : maxa = min ( maxa , li [ 2 ] ) if ( ( li [ 1 ] - li [ 0 ] ) % 2 == 0 ) : maxa = min ( maxa , li [ 1 ] ) if ( maxa == 10 ** 18 ) : print ( - 1 ) else : print ( maxa ) NEW_LINE

a = list ( map ( int , input ( ) . split ( ) ) ) def calc ( a ) : return int ( ( ( ( a [ 1 ] - a [ 0 ] ) + ( a [ 1 ] + a [ 0 ] ) ) / 2 ) ) a . sort ( ) if a [ 1 ] % 2 == 0 and a [ 0 ] % 2 == 0 : print ( calc ( a ) ) elif a [ 1 ] % 2 == 0 or a [ 0 ] % 2 == 0 : print ( a [ 2 ] ) else : print ( calc ( a ) ) NEW_LINE

def pixel ( input ) : red , green , blue = input . split ( ) red = int ( red ) green = int ( green ) blue = int ( blue )   plist = [ red , green , blue ] plist . sort ( )   lowestChet = is_chet ( plist [ 0 ] ) midChet = is_chet ( plist [ 1 ] )   if ( ( midChet + lowestChet ) == 2 ) or ( ( midChet + lowestChet ) == 0 ) : return plist [ 1 ] else : return plist [ 2 ]     def is_chet ( n ) : return 1 if n % 2 == 0 else 0 print ( pixel ( input ( ) ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Aorangy1 {   static int m ;   static long f ( long v , int floor ) { if ( floor == 1 ) { return ( v - 1 ) * ( m - 1 ) * 2 ; } if ( floor == m ) { return ( m - 1 ) + ( ( v - 1 ) * ( m - 1 ) * 2 ) ; } long ret = 0 ; long even = v / 2 ; long odd = v / 2 ; if ( v % 2 == 0 ) even -- ; long sumEven = even * ( m - floor ) * 2 ; long sumOdd = odd * ( floor - 1 ) * 2 ; sumOdd = sumOdd - ( floor - 1 ) ; ret = sumEven + sumOdd ; return ret ; }   public static void main ( String [ ] args ) throws IOException {

import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigDecimal ; import java . math . BigInteger ; import java . util . StringTokenizer ;   public class Main {   public static void main ( String [ ] args ) { InputReader in = new InputReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ;

n , m = map ( int , input ( ) . split ( ) ) k = 2 * ( m - 1 ) p = [ 0 ] * nfor i in range ( n ) : s , f , t = map ( int , input ( ) . split ( ) ) d = t % k if s < f : p [ i ] = ( k if s <= d else 0 ) + f - 1 + t - d elif f < s : p [ i ] = ( k if d + s > k + 1 else 0 ) + k + 1 - f + t - d else : p [ i ] = tprint ( ' \n ' . join ( map ( str , p ) ) ) NEW_LINE

n , m = map ( int , input ( ) . split ( ) ) k = 2 * ( m - 1 ) for i in range ( n ) : s , f , t = map ( int , input ( ) . split ( ) ) d = t % k if s < f : print ( k * ( s <= d ) + f - 1 + t - d ) elif f < s : print ( k * ( d + s > k + 1 ) + k + 1 - f + t - d ) else : print ( t ) NEW_LINE


import java . util . * ; import java . io . * ; public class Bdiv1 { public static void main ( String ... thegame ) { FastScanner sc = new FastScanner ( ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] [ ] map = new int [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { map [ i ] [ j ] = sc . nextInt ( ) ; } } if ( n > 10 ) { int res = k + 1 ; for ( int t = 0 ; t < n ; t ++ ) {

import java . io . * ; import java . util . * ; import java . util . stream . * ;   public class a implements Runnable { public static void main ( String [ ] args ) { new Thread ( null , new a ( ) , " process " , 1 << 26 ) . start ( ) ; } public void run ( ) { FastReader scan = new FastReader ( ) ; PrintWriter out = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ;

import java . io . ByteArrayInputStream ; 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 . nio . charset . StandardCharsets ; import java . util . Arrays ; import java . util . InputMismatchException ;   public class B425 {   static class Solver {   int N , M , K , grid [ ] [ ] , g2 [ ] [ ] ;   int fix ( int [ ] model , int [ ] cand , int cap ) {

from functools import * read_line = lambda : [ int ( i ) for i in input ( ) . split ( ) ] n , m , k = read_line ( ) a = [ read_line ( ) for i in range ( n ) ] if n < m : n , m , a = m , n , zip ( * a ) xs = [ reduce ( lambda x , b : 2 * x + b , y ) for y in a ] minm = lambda a : min ( a , m - a ) work = lambda y : sum ( minm ( bin ( x ^ y ) . count ( '1' ) ) for x in xs ) ans = min ( map ( work , xs if m > k else range ( 1 << m ) ) ) print ( ans if ans <= k else - 1 ) NEW_LINE


import java . util . * ;   public class CF102 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; long low = 0 ; long high = n ; while ( low <= high ) { long mid = low + ( high - low ) / 2 ;

import java . sql . SQLOutput ; import java . util . * ; import java . lang . * ; import java . io . * ;   public class codeforces { static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } public static void main ( String [ ] args ) {   FastReader sc = new FastReader ( ) ; long n = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; long x = ( long ) ( - 3 + ( Math . sqrt ( 9 + 8 * ( n + k ) ) ) ) / 2 ; System . out . println ( n - x ) ;   } }

import java . util . * ; public class Sport_Mafia { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; long sum = 0 ; long i = 1 ; for ( i = 1 ; i <= n ; i ++ ) { sum = i * ( i + 1 ) ; sum = sum / 2 ; sum -= ( n - i ) ; if ( sum == k ) { System . out . println ( n - i ) ; break ; } } } }

import java . util . * ; import java . io . * ; public class main { public static void main ( String [ ] args ) { FastScanner scan = new main ( ) . new FastScanner ( ) ; long a = scan . nextLong ( ) ; long b = scan . nextLong ( ) ; long ans = ( long ) ( - 3 + Math . sqrt ( 9 + 8 * ( a + b ) ) ) / 2 ; System . out . print ( a - ans ) ; } class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }

n , k = map ( int , input ( ) . split ( ) ) i = 0j = nwhile ( i <= j ) : a = ( i + j ) // 2 s = ( n - a ) * ( n - a + 1 ) // 2 if ( s - a == k ) : print ( a ) break elif ( s - a > k ) : i = a else : j = a NEW_LINE

n , k = map ( int , input ( ) . split ( ) )   c = 0 i = 1 while 1 : c += i if n - i == c - k : print ( n - i ) break i += 1   NEW_LINE

n , k = list ( map ( int , input ( ) . split ( ) ) )   for t in range ( 1 , n + 1 ) : total = t * ( t + 1 ) // 2 eat = total - k if eat + t == n : print ( eat ) break NEW_LINE

n , k = map ( int , input ( ) . split ( ) ) for r in range ( 1 , 10 ** 5 ) : if ( r * ( r + 1 ) ) // 2 + r == k + n : print ( n - r ) exit ( ) NEW_LINE

def bs ( l , h ) : while l <= h : m = ( l + h ) // 2 if gf ( m ) == 0 : return m if gf ( m ) == 1 : l = m + 1 else : h = m - 1   def gf ( x ) : if ( n - x ) * ( n - x + 1 ) // 2 - x == k : return 0 if ( n - x ) * ( n - x + 1 ) / 2 - x > k : return 1 return - 1     n , k = map ( int , input ( ) . split ( ) ) print ( bs ( 0 , n ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Deque ; import java . util . LinkedList ; import java . util . StringTokenizer ;   public class CF1063B { static final int [ ] dx = { + 1 , - 1 , 0 , 0 } ; static final int [ ] dy = { 0 , 0 , + 1 , - 1 } ;   public static void main ( String [ ] args ) throws IOException { FastScanner sc = new FastScanner ( ) ; PrintWriter pw = new PrintWriter ( System . out ) ;   int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; int xS = sc . nextInt ( ) - 1 , yS = sc . nextInt ( ) - 1 ; int l = sc . nextInt ( ) , r = sc . nextInt ( ) ; boolean [ ] g = new boolean [ n * m ] ; for ( int i = 0 ; i < n ; i ++ ) { char [ ] line = sc . nextToken ( ) . toCharArray ( ) ; for ( int j = 0 ; j < m ; j ++ ) if ( line [ j ] == ' . ' ) g [ i * m + j ] = true ; }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Deque ; import java . util . LinkedList ; import java . util . StringTokenizer ;   public class CF1063B { static final int [ ] dx = { + 1 , - 1 , 0 , 0 } ; static final int [ ] dy = { 0 , 0 , + 1 , - 1 } ;   public static void main ( String [ ] args ) throws IOException { FastScanner sc = new FastScanner ( ) ; PrintWriter pw = new PrintWriter ( System . out ) ;   int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; int xS = sc . nextInt ( ) - 1 , yS = sc . nextInt ( ) - 1 ; int l = sc . nextInt ( ) , r = sc . nextInt ( ) ; boolean [ ] [ ] g = new boolean [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { char [ ] line = sc . nextToken ( ) . toCharArray ( ) ; for ( int j = 0 ; j < m ; j ++ ) if ( line [ j ] == ' . ' ) g [ i ] [ j ] = true ; }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Deque ; import java . util . LinkedList ; import java . util . StringTokenizer ;   public class CF1063B { static final int [ ] dx = { + 1 , - 1 , 0 , 0 } ; static final int [ ] dy = { 0 , 0 , + 1 , - 1 } ;   public static void main ( String [ ] args ) throws IOException { FastScanner sc = new FastScanner ( ) ; PrintWriter pw = new PrintWriter ( System . out ) ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; int xS = sc . nextInt ( ) - 1 , yS = sc . nextInt ( ) - 1 ; int l = sc . nextInt ( ) , r = sc . nextInt ( ) ; boolean [ ] [ ] grid = new boolean [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { char [ ] line = sc . nextToken ( ) . toCharArray ( ) ; for ( int j = 0 ; j < m ; j ++ ) if ( line [ j ] == ' . ' ) grid [ i ] [ j ] = true ; }

from collections import dequen , m = [ int ( x ) for x in input ( ) . split ( ) ] x , y = [ int ( x ) for x in input ( ) . split ( ) ] left , right = [ int ( x ) for x in input ( ) . split ( ) ] s = [ ] ans = 0 d = [ None ] * 2007 for i in range ( 0 , 2007 ) : d [ i ] = [ 0 for j in range ( 0 , 2007 ) ]   for i in range ( 0 , n ) : s . append ( input ( ) )   q = deque ( )   q . append ( [ x - 1 , y - 1 , left , right ] )   while ( len ( q ) ) : v = q [ 0 ] q . popleft ( ) if ( v [ 0 ] < 0 or v [ 0 ] >= n or v [ 1 ] < 0 or v [ 1 ] >= m or d [ v [ 0 ] ] [ v [ 1 ] ] == 1 or v [ 2 ] < 0 or v [ 3 ] < 0 or s [ v [ 0 ] ] [ v [ 1 ] ] == ' * ' ) : continue d [ v [ 0 ] ] [ v [ 1 ] ] = 1 q . appendleft ( [ v [ 0 ] + 1 , v [ 1 ] , v [ 2 ] , v [ 3 ] ] ) q . appendleft ( [ v [ 0 ] - 1 , v [ 1 ] , v [ 2 ] , v [ 3 ] ] ) q . append ( [ v [ 0 ] , v [ 1 ] + 1 , v [ 2 ] , v [ 3 ] - 1 ] ) q . append ( [ v [ 0 ] , v [ 1 ] - 1 , v [ 2 ] - 1 , v [ 3 ] ] ) for i in range ( 0 , n ) : for j in range ( 0 , m ) : ans += d [ i ] [ j ]   print ( ans ) NEW_LINE

import sysimport mathfrom collections import defaultdictfrom collections import deque   MAXNUM = math . infMINNUM = - 1 * math . infASCIILOWER = 97 ASCIIUPPER = 65     def getInt ( ) : return int ( sys . stdin . readline ( ) . rstrip ( ) )     def getInts ( ) : return map ( int , sys . stdin . readline ( ) . rstrip ( ) . split ( " ▁ " ) )     def getString ( ) : return sys . stdin . readline ( ) . rstrip ( )     def printOutput ( ans ) : sys . stdout . write ( ) pass     def successors ( grid , curPos , moves ) : r , c = curPos x , y = moves   succStates = [ ] for a , b in [ ( 1 , 0 ) , ( - 1 , 0 ) ] : if ( 0 <= r + a < len ( grid ) and 0 <= c + b <= len ( grid [ 0 ] ) and grid [ r + a ] [ c + b ] != " * " ) : succStates . append ( ( ( r + a , c + b ) , moves ) )   NEW_LINE


import java . util . * ; import java . io . * ; import java . math . * ; public class Main { public static void main ( String [ ] args ) throws IOException { PrintWriter out = new PrintWriter ( System . out ) ;

import sysfrom collections import Counterinput = sys . stdin . buffer . readline   m , k , n , s = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) b = Counter ( map ( int , input ( ) . split ( ) ) )   counts = Counter ( ) unsatisfied = len ( b ) to_remove = m + 1 mn_len = m + 1 remove_idx = - 1   j = 0 for i in range ( m ) : while j < m and unsatisfied != 0 : counts [ a [ j ] ] += 1 if counts [ a [ j ] ] == b [ a [ j ] ] : unsatisfied -= 1   j += 1   if unsatisfied == 0 : curr_remove = i % k + max ( 0 , j - i - k ) if curr_remove < to_remove : to_remove = curr_remove mn_len = j - i remove_idx = i   if counts [ a [ i ] ] == b [ a [ i ] ] : unsatisfied += 1   counts [ a [ i ] ] -= 1   if m - to_remove < n * k : print ( - 1 ) else : print ( to_remove )   indexes = { } for i in range ( remove_idx , remove_idx + mn_len ) : if a [ i ] in indexes : indexes [ a [ i ] ] . append ( i + 1 ) else : indexes [ a [ i ] ] = [ i + 1 ]   removed = list ( range ( 1 , remove_idx % k + 1 ) ) to_remove -= remove_idx % k   for i in indexes : if to_remove == 0 : break else : removed . extend ( indexes [ i ] [ : min ( len ( indexes [ i ] ) - b [ i ] , to_remove ) ] ) to_remove -= min ( len ( indexes [ i ] ) - b [ i ] , to_remove )   print ( * removed )             NEW_LINE

def main ( ) : m , k , n , s = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE


import java . util . * ;   public class Main {   public static void main ( String [ ] args ) {   Scanner sc = new Scanner ( System . in ) ; String cards = sc . next ( ) ; sc . close ( ) ;   char [ ] str = cards . toCharArray ( ) ;   int min = 0 ;   for ( int i = 0 ; i < str . length ; i ++ ) { if ( str [ i ] == ' a ' || str [ i ] == ' e ' || str [ i ] == ' i ' || str [ i ] == ' u ' || str [ i ] == ' o ' ) { min ++ ; } else if ( str [ i ] == '1' || str [ i ] == '3' || str [ i ] == '5' || str [ i ] == '7' || str [ i ] == '9' ) { min ++ ; } }   System . out . println ( min ) ;   }   }

import java . util . Scanner ;   public class NewYearAndCountingCards {   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . nextLine ( ) ; int c = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == ' a ' || s . charAt ( i ) == ' e ' || s . charAt ( i ) == ' i ' || s . charAt ( i ) == ' o ' || s . charAt ( i ) == ' u ' || s . charAt ( i ) == '1' || s . charAt ( i ) == '3' || s . charAt ( i ) == '5' || s . charAt ( i ) == '7' || s . charAt ( i ) == '9' ) { c ++ ; } } System . out . println ( c ) ; }   }

import java . util . Scanner ;   public class CountCards { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; String s = in . next ( ) ; in . close ( ) ; int c = 0 , i ;   for ( i = 0 ; i < s . length ( ) ; i ++ ) { char v = s . charAt ( i ) ; if ( v == ' a ' || v == ' e ' || v == ' i ' || v == ' o ' || v == ' u ' || ( Character . isDigit ( v ) && Integer . parseInt ( String . valueOf ( v ) ) % 2 != 0 ) ) { c ++ ; } } System . out . println ( c ) ; } }

import java . lang . * ; import java . util . * ; import java . io . * ; public class test { Scanner sc = new Scanner ( System . in ) ; PrintWriter pr = new PrintWriter ( System . out , true ) ; public static void main ( String ... args ) { test c = new test ( ) ; c . prop ( ) ; } public void prop ( ) { String s = sc . next ( ) ; int n = s . length ( ) , count = 0 , count2 = 0 ; for ( int i = 0 ; i < n ; ++ i ) { char c = s . charAt ( i ) ; if ( c == ' a ' || c == ' e ' || c == ' i ' || c == ' o ' || c == ' u ' || c == '1' || c == '3' || c == '5' || c == '7' || c == '9' ) ++ count ; } pr . println ( count ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . util . StringTokenizer ;    public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ; solver . solve ( in , out ) ; out . close ( ) ; } static class TaskA { public void solve ( InputReader in , PrintWriter out ) { String s = in . next ( ) ; int ans = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( pd ( s . charAt ( i ) ) ) ans ++ ; } out . println ( ans ) ; } static boolean pd ( char c ) { if ( c <= '9' && c >= '0' ) { if ( ( int ) ( c - '0' ) % 2 == 1 ) return true ; } if ( c == ' a ' || c == ' e ' || c == ' i ' || c == ' o ' || c == ' u ' ) return true ; return false ; } } static class InputReader { public BufferedReader reader ; public StringTokenizer tokenizer ; public InputReader ( InputStream stream ) { reader = new BufferedReader ( new InputStreamReader ( stream ) ) ; tokenizer = null ; } public String next ( ) { while ( tokenizer == null || ! tokenizer . hasMoreElements ( ) ) { try { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } return tokenizer . nextToken ( ) ; } public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } } }

import math   def main_function ( ) : output_list = [ ] s = input ( ) count = 0 vowels = [ " a " , " e " , " o " , " i " , " u " , "1" , "3" , "5" , "7" , "9" ] hash_list = [ 0 for i in vowels ] dict = { } for i in range ( len ( vowels ) ) : dict [ vowels [ i ] ] = i for i in s : if i in vowels : hash_list [ dict [ i ] ] += 1 return sum ( hash_list )               print ( main_function ( ) ) NEW_LINE

vowels_and_even_numbers = [ '1' , '3' , '5' , '7' , '9' , ' a ' , ' e ' , ' i ' , ' o ' , ' u ' ] minimum = 0 s = input ( )   for char in s : if char in vowels_and_even_numbers : minimum += 1   print ( minimum ) NEW_LINE

cards = input ( ) numbers = "0123456789" even = "02468" vowals = " aeiou " count = 0   for s in range ( len ( cards ) ) : if cards [ s ] in vowals : count += 1 else : if cards [ s ] in numbers and cards [ s ] not in even : count += 1   print ( count ) NEW_LINE

a = input ( )   lista = [ '1' , '3' , '5' , '7' , '9' , ' a ' , ' e ' , ' i ' , ' o ' , ' u ' ]   i = 0   for x in range ( len ( a ) ) : if a [ x ] in lista : i = i + 1   print ( i ) NEW_LINE

import sys   def main ( ) : s = sys . stdin . read ( ) . strip ( ) return sum ( i in set ( ' aeiou13579' ) for i in s ) print ( main ( ) ) NEW_LINE


import java . util . Arrays ; import java . util . Scanner ; public class _0640BalancedRemainders { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int cases = sc . nextInt ( ) ; while ( cases > 0 ) { int n = sc . nextInt ( ) ; int [ ] arr = new int [ 3 ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ sc . nextInt ( ) % 3 ] ++ ; } int count = 0 ; while ( arr [ 0 ] != arr [ 1 ] || arr [ 0 ] != arr [ 2 ] ) { for ( int i = 0 ; i < 3 ; i ++ ) { if ( arr [ i ] > n / 3 ) { arr [ i ] -- ; arr [ ( i + 1 ) % 3 ] ++ ; count ++ ; } } } System . out . println ( count ) ; cases -- ; } } }

import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; int res = 0 ; int [ ] cnt = new int [ 3 ] ; for ( int i = 0 ; i < n ; i ++ ) cnt [ a [ i ] % 3 ] ++ ; while ( Math . min ( cnt [ 0 ] , Math . min ( cnt [ 1 ] , cnt [ 2 ] ) ) != n / 3 ) { for ( int i = 0 ; i < 3 ; i ++ ) if ( cnt [ i ] > n / 3 ) { res ++ ; cnt [ i ] -- ; cnt [ ( i + 1 ) % 3 ] ++ ; } } System . out . println ( res ) ; } } }

import java . util . * ; public class S { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner scan = new Scanner ( System . in ) ; int t = scan . nextInt ( ) ; while ( t -- != 0 ) { int n = scan . nextInt ( ) ; int [ ] arr = new int [ 3 ] ; for ( int i = 0 ; i < n ; i ++ ) { int num = scan . nextInt ( ) ; arr [ num % 3 ] ++ ; } int maxi = - 1 , max = - 1 ; for ( int i = 0 ; i < 3 ; i ++ ) { if ( arr [ i ] > max ) { maxi = i ; max = arr [ i ] ; } } int ans = ( arr [ maxi ] - ( n / 3 ) ) ; arr [ ( maxi + 1 ) % 3 ] += ans ; if ( arr [ ( maxi + 1 ) % 3 ] > arr [ ( maxi + 2 ) % 3 ] ) ans += ( ( n / 3 ) - arr [ ( maxi + 2 ) % 3 ] ) ; else ans += 2 * ( ( arr [ ( maxi + 2 ) % 3 ] ) - ( n / 3 ) ) ; System . out . println ( ans ) ; } } }

import java . util . Scanner ; public class Solution_2 { public static void main ( String [ ] args ) { int t , n ; Scanner sc = new Scanner ( System . in ) ; t = sc . nextInt ( ) ; while ( t -- > 0 ) { n = sc . nextInt ( ) ; int [ ] c = new int [ 3 ] ; for ( int i = 0 ; i < n ; i ++ ) { c [ sc . nextInt ( ) % 3 ] ++ ; } System . out . println ( solve ( c , n / 3 ) ) ; } } static int solve ( int [ ] c , int b ) { int res = 0 ; for ( int i = 0 ; i < 2 ; i ++ ) { if ( c [ 0 ] > b ) { res += c [ 0 ] - b ; c [ 1 ] += c [ 0 ] - b ; c [ 0 ] = b ; } if ( c [ 1 ] > b ) { res += c [ 1 ] - b ; c [ 2 ] += c [ 1 ] - b ; c [ 1 ] = b ; } if ( c [ 2 ] > b ) { res += c [ 2 ] - b ; c [ 0 ] += c [ 2 ] - b ; c [ 2 ] = b ; } } return res ; } }

import java . util . * ; public class CodeForces1490B { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int t = input . nextInt ( ) ; for ( int j = 0 ; j < t ; j ++ ) { int n = input . nextInt ( ) ; int [ ] a = new int [ 3 ] ; for ( int i = 0 ; i < n ; i ++ ) { int c = input . nextInt ( ) ; a [ c % 3 ] ++ ; } int count = 0 ; n /= 3 ; for ( int i = 0 ; i < 5 ; i ++ ) { if ( a [ i % 3 ] > n ) { a [ ( i + 1 ) % 3 ] += a [ i % 3 ] - n ; count += a [ i % 3 ] - n ; a [ i % 3 ] = n ; } } System . out . println ( count ) ; } } }

for s in [ * open ( 0 ) ] [ 2 : : 2 ] : NEW_LINE INDENT c = [ 0 ] * 3 NEW_LINE for x in s . split ( ) : c [ int ( x ) % 3 ] += 1 NEW_LINE print ( max ( c [ i ] - c [ i - 1 ] for i in ( 0 , 1 , 2 ) ) ) NEW_LINE DEDENT

for s in [ * open ( 0 ) ] [ 2 : : 2 ] : NEW_LINE INDENT c = [ 0 ] * 3 ; NEW_LINE r = i = 0 NEW_LINE for x in s . split ( ) : c [ int ( x ) % 3 ] += 1 NEW_LINE while len ( { * c } ) > 1 : j = ( i + 1 ) % 3 ; f = c [ i ] > c [ j ] ; c [ i ] -= f ; c [ j ] += f ; r += f ; i = j NEW_LINE print ( r ) NEW_LINE DEDENT

for i in [ * open ( 0 ) ] [ 2 : : 2 ] : NEW_LINE INDENT q = [ 0 ] * 3 NEW_LINE for _ in map ( int , i . split ( ) ) : q [ _ % 3 ] += 1 NEW_LINE print ( max ( q [ i ] - q [ i - 1 ] for i in ( 0 , 1 , 2 ) ) ) NEW_LINE DEDENT

for s in [ * open ( 0 ) ] [ 2 : : 2 ] : NEW_LINE INDENT c = [ 0 ] * 3 NEW_LINE for x in s . split ( ) : c [ int ( x ) % 3 ] += 1 NEW_LINE print ( max ( c [ i ] - c [ i - 1 ] for i in range ( 3 ) ) ) NEW_LINE DEDENT


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class A_Tram { public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; int n = fs . nextInt ( ) , ans = 0 , total = 0 , a , b ; for ( int i = 0 ; i < n ; i ++ ) { a = fs . nextInt ( ) ; b = fs . nextInt ( ) ; total = total - a + b ; ans = max ( ans , total ) ; }   System . out . println ( ans ) ; }   static int min ( int a , int b ) { return Math . min ( a , b ) ; }   static int max ( int a , int b ) { return Math . max ( a , b ) ; }   static long min ( long a , long b ) { return Math . min ( a , b ) ; }   static long max ( long a , long b ) { return Math . max ( a , b ) ; }   static class FastScanner { BufferedReader br ; StringTokenizer st ;   public FastScanner ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } char nextChar ( ) { return next ( ) . charAt ( 0 ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }

import java . util . Scanner ;   public class BigO {   public static void main ( String [ ] args ) { int a , b , n ; int minCapacity = 0 ; int du = 0 ; int peopleAtStop = 0 ; Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ;   for ( int i = 0 ; i < n ; i ++ ) { a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; peopleAtStop = b - a + du ; du = peopleAtStop ; if ( peopleAtStop > minCapacity ) { minCapacity = peopleAtStop ; } } System . out . println ( minCapacity ) ;   }   }

import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . StringTokenizer ; import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . InputStream ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; FastScanner in = new FastScanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; ATram solver = new ATram ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class ATram { public void solve ( int testNumber , FastScanner fs , PrintWriter out ) { int n = fs . nextInt ( ) ; int a , b , ans = 0 , total = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a = fs . nextInt ( ) ; b = fs . nextInt ( ) ; total -= a ; total += b ; ans = Utilities . max ( ans , total ) ; } out . println ( ans ) ; }   }   static class FastScanner { BufferedReader br ; StringTokenizer st ;   public FastScanner ( InputStream inputStream ) { br = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; }   public String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   }   static class Utilities { public static int max ( int a , int b ) { return Math . max ( a , b ) ; }   } }

import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int tran = 0 ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int a = scan . nextInt ( ) ;

import java . io . * ; import java . lang . * ; import java . util . * ;    public class Main {   static Main . MyScanner sc = new Main . MyScanner ( ) ; static PrintStream out = System . out ;   public static void main ( String [ ] args ) throws Exception { int n = sc . nextInt ( ) , count = 0 , x = 0 , y = 0 , temp = 0 ; for ( int i = 0 ; i < n ; i ++ ) { x = sc . nextInt ( ) ; y = sc . nextInt ( ) ; temp += y - x ; if ( count < temp ) count = temp ; } out . print ( count ) ; out . close ( ) ; } static private class MyScanner { BufferedReader br ; StringTokenizer st ;   public MyScanner ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   public long mod ( long x ) {

p = q = 0 for x in [ 0 ] * int ( input ( ) ) : q -= eval ( input ( ) . replace ( ' ▁ ' , ' - ' ) ) ; p = max ( p , q ) print ( p ) NEW_LINE

n = int ( input ( ) ) x = 0 y = 0 for i in range ( 0 , n ) : z = list ( map ( int , input ( ) . rstrip ( ) . split ( ) ) ) x = x - z [ 0 ] x = x + z [ 1 ] if y < x : y = xprint ( y ) NEW_LINE

stop_n = int ( input ( ) ) in_tram = [ ] out_tram = [ ] for i in range ( stop_n ) : exit_a , enter_b = map ( int , input ( ) . split ( ) ) in_tram . append ( enter_b ) out_tram . append ( exit_a )   NEW_LINE

n = int ( input ( ) ) li = list ( ) for i in range ( n ) : a , b = input ( ) . split ( ) a = int ( a ) ; b = int ( b ) if ( i == 0 ) : npass = b li . append ( npass ) else : cpss = npass - a + b npass = cpss li . append ( cpss ) print ( max ( li ) ) NEW_LINE

n = int ( input ( ) ) stop = [ ] person = 0 count = 0 for i in range ( n ) : a = list ( map ( int , input ( ) . split ( ) ) ) stop . append ( a )   for i in stop : person = person - i [ 0 ] + i [ 1 ] if count < person : count = person print ( count ) NEW_LINE


import java . util . * ; import java . util . stream . * ; public class Solution { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int k = scan . nextInt ( ) ; List < Integer > a = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { a . add ( scan . nextInt ( ) ) ; } Collections . sort ( a ) ; String result = ( n < k ) ? " - 1" : a . get ( n - k ) + " ▁ " + a . get ( n - k ) ; 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 ( ) , k = sc . nextInt ( ) ; Integer [ ] ar = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { ar [ i ] = sc . nextInt ( ) ; } if ( k > n ) { System . out . println ( - 1 ) ; } else { Arrays . sort ( ar , Collections . reverseOrder ( ) ) ; System . out . println ( ar [ k - 1 ] + " ▁ " + ar [ k - 1 ] ) ; } } }

import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = in . nextInt ( ) ; Arrays . sort ( a ) ; if ( k == n ) System . out . println ( a [ 0 ] + " ▁ " + a [ 0 ] ) ; else { int i = n - 1 ; while ( k -- > 0 ) { i -- ; } if ( i < 0 ) System . out . println ( " - 1" ) ; else System . out . println ( a [ i ] + 1 + " ▁ " + a [ i ] ) ; } } }

import java . util . Arrays ; import java . util . Scanner ;   public class SquareChecker { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ;   int n = scan . nextInt ( ) ; int k = scan . nextInt ( ) ; long [ ] a = new long [ n ] ;   if ( k > n ) System . out . println ( - 1 ) ; else { for ( int i = 0 ; i < n ; i ++ ) a [ i ] = scan . nextInt ( ) ;   Arrays . sort ( a ) ;   System . out . println ( a [ n - k ] + " ▁ " + a [ n - k ] ) ; } } }

import java . util . Arrays ; import java . util . Scanner ;   public class problem106 {   public static void main ( String [ ] args ) {

n , k = list ( map ( int , input ( ) . split ( ) ) ) a = list ( map ( int , input ( ) . split ( ) ) )   if k <= n : a . sort ( reverse = True ) print ( f " { a [ k ▁ - ▁ 1 ] } ▁ { a [ k ▁ - ▁ 1 ] } " ) else : print ( - 1 ) NEW_LINE

n , k = list ( map ( int , input ( ) . split ( ) ) ) a = list ( map ( int , input ( ) . split ( ) ) ) if ( k > n ) : print ( - 1 ) elif ( k == n ) : print ( 0 , 0 ) else : a . sort ( reverse = True ) for i in range ( k ) : if ( i == k - 1 ) : print ( a [ i ] , 0 ) break NEW_LINE

import sys   def input ( ) : return sys . stdin . readline ( ) . strip ( ) def iinput ( ) : return int ( input ( ) ) def rinput ( ) : return map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) def get_list ( ) : return list ( map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) )       n , k = rinput ( ) a = get_list ( )   if ( k > n ) : print ( - 1 ) else : a . sort ( ) a = list ( reversed ( a ) ) print ( a [ k - 1 ] , 0 ) NEW_LINE

from sys import stdin   def read_lines ( sep = ' ▁ ' , input_type = None ) : NEW_LINE

n , k = map ( int , input ( ) . split ( ) ) arr = [ int ( i ) for i in input ( ) . split ( ) ] arr . sort ( ) if k > n : print ( - 1 ) else : print ( arr [ n - k ] , arr [ n - k ] ) NEW_LINE


import java . util . * ; import java . util . Scanner ; import java . io . * ; import javax . lang . model . util . ElementScanner6 ; import static java . lang . System . out ; import java . util . Stack ; import java . util . Queue ; import java . util . LinkedList ;   public class B129 {   static int mod = ( int ) ( 1e9 + 7 ) ; static long MOD = ( long ) ( 1e9 + 7 ) ; static FastReader in = new FastReader ( ) ; static PrintWriter pr = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; static ArrayList < HashSet < Integer > > al ; static boolean vis [ ] ; public static void main ( String args [ ] ) {   int tc = 1 ;

import java . util . * ; import java . io . * ;   public class B {   public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] [ ] edge = new int [ 101 ] [ 101 ] ; while ( m -- > 0 ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; edge [ a ] [ b ] = 1 ; edge [ b ] [ a ] = 1 ; edge [ a ] [ 0 ] ++ ; edge [ b ] [ 0 ] ++ ; }   Queue < Integer > queue = new LinkedList < > ( ) ; for ( int i = 1 ; i <= n ; i ++ ) if ( edge [ i ] [ 0 ] == 1 ) queue . offer ( i ) ;   int count = 0 ; while ( ! queue . isEmpty ( ) ) { int size = queue . size ( ) ; for ( int j = 0 ; j < size ; j ++ ) { int a = queue . poll ( ) ; for ( int i = 1 ; i < 101 ; i ++ ) { if ( edge [ a ] [ i ] == 1 ) { edge [ a ] [ i ] = 0 ; edge [ i ] [ a ] = 0 ; edge [ i ] [ 0 ] -- ; edge [ a ] [ 0 ] -- ; } } }   for ( int i = 1 ; i <= n ; i ++ ) if ( edge [ i ] [ 0 ] == 1 ) queue . offer ( i ) ;   count ++ ; } System . out . println ( count ) ; }   }

import java . util . LinkedList ; import java . util . Queue ; import java . util . Scanner ; public class Section { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int c = 0 , c1 = 0 ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] [ ] l = new int [ 101 ] [ 101 ] ; while ( m -- > 0 ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; l [ a ] [ b ] = 1 ; l [ b ] [ a ] = 1 ; l [ a ] [ 0 ] ++ ; l [ b ] [ 0 ] ++ ; } Queue < Integer > q = new LinkedList < > ( ) ; for ( int i = 1 ; i <= n ; i ++ ) if ( l [ i ] [ 0 ] == 1 ) q . offer ( i ) ; while ( ! q . isEmpty ( ) ) { int size = q . size ( ) ; for ( int j = 0 ; j < size ; j ++ ) { int a = q . poll ( ) ; for ( int i = 0 ; i < 101 ; i ++ ) { if ( l [ a ] [ i ] == 1 ) { l [ a ] [ i ] = 0 ; l [ i ] [ a ] = 0 ; l [ i ] [ 0 ] -- ; l [ a ] [ 0 ] -- ; } } } for ( int i = 1 ; i <= n ; i ++ ) { if ( l [ i ] [ 0 ] == 1 ) { q . offer ( i ) ; } } c ++ ; } System . out . println ( c ) ; } }

import sysinput = sys . stdin . readlineimport math   def inpit ( ) : NEW_LINE

n , m = map ( int , input ( ) . split ( ) ) g = [ set ( ) for i in range ( n ) ] for _ in range ( m ) : a , b = map ( int , input ( ) . split ( ) ) g [ a - 1 ] . add ( b - 1 ) g [ b - 1 ] . add ( a - 1 ) cnt = 0 while True : p = set ( ) for i in range ( n ) : if len ( g [ i ] ) == 1 : p . add ( i ) g [ i ] = set ( ) if len ( p ) == 0 : break cnt += 1 for i in range ( n ) : g [ i ] -= pprint ( cnt ) NEW_LINE

def mingrid ( ) : for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) segcost = input ( ) . split ( ) minodd = int ( segcost [ 0 ] ) mineven = int ( segcost [ 1 ] ) sumodd = minodd sumeven = mineven codd = 1 ceven = 1 res = sumodd + minodd * ( n - codd ) + sumeven + mineven * ( n - ceven ) for i in range ( 2 , n ) : now = int ( segcost [ i ] ) if ( i + 1 ) % 2 : NEW_LINE

n , m = map ( int , input ( ) . split ( ) ) arr = [ ] for i in range ( m ) : arr . append ( list ( map ( int , input ( ) . split ( ) ) ) ) s = set ( ) ans = 0 while True : count = [ 0 ] * ( n ) for a , b in arr : if a not in s and b not in s : count [ a - 1 ] += 1 count [ b - 1 ] += 1 flag = False for i in range ( n ) : if count [ i ] == 1 : flag = True s . add ( i + 1 ) if flag is False : print ( ans ) exit ( ) ans += 1 NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class ArithmeticOrGeometric {   private static BufferedReader bufferedReader ; private static StringTokenizer st ;   public static void main ( String [ ] args ) throws IOException {   bufferedReader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int a1 = Integer . parseInt ( next ( ) ) ; int a2 = Integer . parseInt ( next ( ) ) ; int a3 = Integer . parseInt ( next ( ) ) ; int a4 = Integer . parseInt ( next ( ) ) ;   int d = a2 - a1 ;   if ( d == a3 - a2 && d == a4 - a3 ) { System . out . println ( a4 + d ) ; } else if ( a1 * a3 == a2 * a2 && a2 * a4 == a3 * a3 && a4 * a4 % a3 == 0 ) { System . out . println ( ( a4 * a4 ) / a3 ) ; } else { System . out . println ( 42 ) ; }   }   static String next ( ) throws IOException {   while ( st == null || ! st . hasMoreElements ( ) ) { st = new StringTokenizer ( bufferedReader . readLine ( ) ) ; }   return st . nextToken ( ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . text . DecimalFormat ; import java . util . StringTokenizer ;   public class ArithmeticOrGeometric {   private static BufferedReader bufferedReader ; private static StringTokenizer st ;   public static void main ( String [ ] args ) throws IOException {   bufferedReader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int a1 = Integer . parseInt ( next ( ) ) ; int a2 = Integer . parseInt ( next ( ) ) ; int a3 = Integer . parseInt ( next ( ) ) ; int a4 = Integer . parseInt ( next ( ) ) ;   int d = a2 - a1 ; double r = ( double ) a2 / a1 ;   if ( d == a3 - a2 && d == a4 - a3 ) { System . out . println ( a4 + d ) ; } else if ( a1 * a3 == a2 * a2 && a2 * a4 == a3 * a3 && a4 * a4 % a3 == 0 ) { DecimalFormat decimalFormat = new DecimalFormat ( " # # # # # # " ) ; System . out . println ( decimalFormat . format ( a4 * r ) ) ; } else { System . out . println ( 42 ) ; }   }   static String next ( ) throws IOException {   while ( st == null || ! st . hasMoreElements ( ) ) { st = new StringTokenizer ( bufferedReader . readLine ( ) ) ; }   return st . nextToken ( ) ; } }

import java . io . * ; import java . util . * ; public class Main {   public static void main ( String [ ] args ) { InputReader sc = new InputReader ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; Random gen = new Random ( ) ; int test = 1 ;

import java . util . Scanner ;   public class IQTestTwo {    public static void main ( String [ ] args ) {   Scanner z = new Scanner ( System . in ) ; String line = z . nextLine ( ) ;   String [ ] arrayOfNumberString = line . split ( " ▁ " ) ;      int [ ] a = new int [ 4 ] ;    a [ 0 ] = Integer . valueOf ( arrayOfNumberString [ 0 ] ) ; a [ 1 ] = Integer . valueOf ( arrayOfNumberString [ 1 ] ) ; a [ 2 ] = Integer . valueOf ( arrayOfNumberString [ 2 ] ) ; a [ 3 ] = Integer . valueOf ( arrayOfNumberString [ 3 ] ) ;     int d = a [ 1 ] - a [ 0 ] ;   if ( a [ 2 ] - a [ 1 ] == d && a [ 3 ] - a [ 2 ] == d ) System . out . println ( a [ 3 ] + d ) ; else if ( ( a [ 0 ] * a [ 2 ] == a [ 1 ] * a [ 1 ] ) && ( a [ 1 ] * a [ 3 ] == a [ 2 ] * a [ 2 ] ) && ( a [ 3 ] * a [ 3 ] % a [ 2 ] == 0 ) ) System . out . println ( a [ 3 ] * a [ 3 ] / a [ 2 ] ) ; else System . out . println ( 42 ) ; }   }

def test_arithmetic ( in_list ) : arithmetic = True current_nr = in_list [ 0 ] dif = in_list [ 1 ] - in_list [ 0 ] for nr in in_list [ 1 : ] : if nr - current_nr != dif : arithmetic = False else : current_nr = nr if arithmetic : next = nr + dif return next else : return 42     def test_geometric ( in_list ) : geometric = True for nr in in_list : if nr == 0 : return False else : quotient = in_list [ 1 ] / in_list [ 0 ] current_nr = in_list [ 0 ] for nr in in_list [ 1 : ] : if nr / current_nr != quotient : geometric = False else : current_nr = nr if geometric : next = nr * quotient if int ( next ) == 0 or int ( next ) / nr != quotient : return 42 else : return next else : return 42     if __name__ == " _ _ main _ _ " : in_numbers = list ( map ( int , input ( ) . split ( ) ) ) answer_ari = test_arithmetic ( in_numbers ) answer_geo = test_geometric ( in_numbers ) if answer_ari != 42 : print ( int ( answer_ari ) ) else : print ( int ( answer_geo ) ) NEW_LINE

def main ( ) : a , b , c , d = [ int ( i ) for i in input ( ) . split ( ) ] p1 , p2 , p3 = b - a , c - b , d - c q1 , q2 , q3 = b / a , c / b , d / c if ( p1 == p2 == p3 ) : print ( d + p3 ) elif ( q1 == q2 == q3 and q1 != 1 and int ( d * q3 ) == d * q3 ) : print ( int ( d * q3 ) ) else : print ( 42 ) main ( ) NEW_LINE

import sysn = input ( ) . split ( ) a = int ( n [ 0 ] ) b = int ( n [ 1 ] ) c = int ( n [ 2 ] ) d = int ( n [ 3 ] ) if ( b - a == c - b == d - c ) : print ( 2 * d - c ) sys . exit ( ) if ( b * b == a * c and c * c == b * d ) : if ( d * d % c == 0 ) : print ( d * d // c ) else : print ( 42 ) sys . exit ( ) print ( 42 ) NEW_LINE

a , b , c , d = list ( map ( int , input ( ) . split ( ) ) )   a1 = b - aa2 = c - ba3 = d - c   g1 = b / ag2 = c / bg3 = d / c NEW_LINE


import java . util . Scanner ;   public class _0718ChungaChanga {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; long y = sc . nextLong ( ) ; long z = sc . nextLong ( ) ; if ( x % z == 0 && y % z == 0 ) { System . out . print ( ( x / z + y / z ) + " ▁ " + 0 ) ; } else { System . out . print ( ( x + y ) / z + " ▁ " ) ; if ( ( x % z + y % z ) >= z ) { System . out . print ( z - Math . max ( x % z , y % z ) ) ; } else { System . out . print ( 0 ) ; } } }   }

import java . util . * ;   public class CodeForces1181A { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; long x = input . nextLong ( ) ; long y = input . nextLong ( ) ; long z = input . nextLong ( ) ;   long count = x / z + y / z ; x = x % z ; y = y % z ; long min = Long . MAX_VALUE ; if ( y >= z - x ) { min = z - x ; } if ( x >= z - y ) { min = Math . min ( min , z - y ) ; }   if ( min == Long . MAX_VALUE ) { System . out . println ( count + " ▁ " + 0 ) ; } else { count ++ ; System . out . println ( count + " ▁ " + min ) ; } } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   import static java . lang . Integer . * ;   public class Example {   public static void main ( String [ ] args ) {    Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; long y = sc . nextLong ( ) ; long z = sc . nextLong ( ) ; long ans = x / z + y / z ; long re = x % z + y % z ; if ( re / z >= 1 ) { long ans2 = 0 ; long xre = x % z ; long yre = y % z ; if ( xre > yre ) { ans2 = z - xre ; } else { ans2 = z - yre ; } System . out . println ( ++ ans + " ▁ " + ans2 ) ; } else { System . out . println ( ans + " ▁ " + 0 ) ; }   }   }

import java . util . * ;   public class CF102 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; long y = sc . nextLong ( ) ; long z = sc . nextLong ( ) ;   long case1coco1 = x / z ; long exc1 = x % z ; long case1coco2 = ( y + exc1 ) / z ; long diff1 = ( y + exc1 ) % z ; if ( diff1 >= exc1 ) { exc1 = 0 ; } else { exc1 = exc1 - diff1 ; }   long sum1 = case1coco1 + case1coco2 ;   long cas2coco2 = y / z ; long exc2 = y % z ; long case2coco1 = ( x + exc2 ) / z ; long diff2 = ( x + exc2 ) % z ; if ( diff2 >= exc2 ) { exc2 = 0 ; } else { exc2 = exc2 - diff2 ; }   long sum2 = cas2coco2 + case2coco1 ;   if ( exc1 == 0 || exc2 == 0 ) { if ( exc1 == 0 && exc2 != 0 ) { System . out . println ( sum1 + " ▁ " + exc1 ) ; } else if ( exc1 != 0 && exc2 == 0 ) { System . out . println ( sum2 + " ▁ " + exc2 ) ; } else { if ( ( sum1 ) >= ( sum2 ) ) { System . out . println ( sum1 + " ▁ " + exc1 ) ; } else { System . out . println ( sum2 + " ▁ " + exc2 ) ; } }   } else { if ( ( ( sum1 * exc2 ) ) > ( ( sum2 * exc1 ) ) ) { System . out . println ( sum1 + " ▁ " + exc1 ) ; } else if ( ( ( sum1 * exc2 ) ) < ( ( sum2 * exc1 ) ) ) { System . out . println ( sum2 + " ▁ " + exc2 ) ; } else { if ( ( sum1 ) >= ( sum2 ) ) { System . out . println ( sum1 + " ▁ " + exc1 ) ; } else { System . out . println ( sum2 + " ▁ " + exc2 ) ; } } }    } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Chunga_Changa { static class RealScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } } public static void main ( String [ ] args ) { RealScanner sc = new RealScanner ( ) ; long x , y , z ; x = sc . nextLong ( ) ; y = sc . nextLong ( ) ; z = sc . nextLong ( ) ; long sum = 0 ; if ( x % z == 0 && y % z == 0 ) { sum += ( x / z ) + ( y / z ) ; } else { sum += ( x / z ) + ( y / z ) + ( ( x % z + y % z ) / z ) ;

x , y , z = map ( int , input ( ) . split ( ) ) total = x // z + y // zif total == ( x + y ) // z : print ( total , 0 ) else : print ( total + 1 , min ( ( z - x % z ) , ( z - y % z ) ) ) NEW_LINE

import sysinput = sys . stdin . readlinefrom collections import defaultdict as dcfrom collections import Counterfrom bisect import bisect_right , bisect_leftimport mathfrom operator import itemgetterfrom heapq import heapify , heappop , heappushfrom queue import PriorityQueue as pqx , y , z = map ( int , input ( ) . split ( ) ) c = ( x + y ) // zp = ( x + y ) % zx = x % zy = y % z NEW_LINE

x , y , z = map ( int , input ( ) . split ( ) ) n = ( x + y ) // zans = 0 if x // z + y // z < n : print ( n , min ( z - x % z , z - y % z ) ) else : print ( n , 0 ) NEW_LINE

x , y , z = map ( int , input ( ) . split ( ) ) cnt = ( x + y ) // zif x % z + y % z < z : given = 0 else : given = min ( z - x % z , z - y % z ) print ( cnt , given ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashMap ; import java . util . LinkedList ; import java . util . Locale ; import java . util . Objects ; import java . util . Queue ; import java . util . Scanner ; import java . util . Stack ; import java . util . TreeSet ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . lang . reflect . Array ; import java . math . BigInteger ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Map ; import java . util . Vector ;   public class Main {   public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int casos = Integer . parseInt ( br . readLine ( ) ) ; while ( casos > 0 ) { String [ ] entry = br . readLine ( ) . split ( " ▁ " ) ; long x = Long . parseLong ( entry [ 0 ] ) ; long y = Long . parseLong ( entry [ 1 ] ) ; long a = Long . parseLong ( entry [ 2 ] ) ; long b = Long . parseLong ( entry [ 3 ] ) ; long up = y - x ; long down = a + b ; if ( up % down != 0 ) { System . out . println ( " - 1" ) ; } else { System . out . println ( up / down ) ; }   casos -- ; } } }

import java . util . Scanner ;   public class Nk { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ;   int t = input . nextInt ( ) ; int m = 0 ;   while ( t -- > 0 ) {   int x = input . nextInt ( ) ; int y = input . nextInt ( ) ; int a = input . nextInt ( ) ; int b = input . nextInt ( ) ;   if ( ( y - x ) % ( a + b ) == 0 ) { System . out . println ( ( y - x ) / ( a + b ) ) ; }   else { System . out . println ( - 1 ) ; } } } }

import java . util . * ; import java . io . * ; import java . math . * ;     public class A {   private static long INF = 2000000000000000000L , M = 1000000007 , MM = 998244353 ; private static int N = 0 ;   public static void process ( ) throws IOException {   long x = sc . nextLong ( ) , y = sc . nextLong ( ) , a = sc . nextLong ( ) , b = sc . nextLong ( ) ; long l = 0 , r = Integer . MAX_VALUE ; while ( l <= r ) { long mid = ( l + r ) / 2 ; long curr = mid * a + x ; long other = y - mid * b ; if ( curr > other ) { r = mid - 1 ; } else if ( curr < other ) { l = mid + 1 ; } else { System . out . println ( mid ) ; return ; } } System . out . println ( - 1 ) ;   }

import java . util . Scanner ;   public class A1304 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = scanner . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int x = scanner . nextInt ( ) , y = scanner . nextInt ( ) , a = scanner . nextInt ( ) , b = scanner . nextInt ( ) ; int distance = y - x , oneSecond = a + b ; System . out . println ( distance % oneSecond == 0 ? distance / oneSecond : - 1 ) ; } } }

def main ( ) : allans = [ ] t = int ( input ( ) ) for _ in range ( t ) : x , y , a , b = readIntArr ( ) relativeV = a + b d = y - x if d % relativeV == 0 : allans . append ( d // relativeV ) else : allans . append ( - 1 ) multiLineArrayPrint ( allans ) return import sysinput = sys . stdin . buffer . readline NEW_LINE

t = int ( input ( ) ) lst = [ ] for i in range ( t ) : var = list ( map ( int , input ( ) . split ( ) ) ) lst . append ( var ) for i in range ( t ) : x , y , a , b = lst [ i ] n = ( x - y ) % ( a + b ) if n == 0 : print ( abs ( int ( ( x - y ) / ( a + b ) ) ) ) else : print ( - 1 )               NEW_LINE

t = input ( ) t = int ( t ) while t != 0 : res = input ( ) res = res . split ( ) x = int ( res [ 0 ] ) y = int ( res [ 1 ] ) a = int ( res [ 2 ] ) b = int ( res [ 3 ] ) res = ( y - x ) % ( a + b ) if res == 0 : print ( ( y - x ) // ( a + b ) ) else : print ( - 1 ) t = t - 1 NEW_LINE

exec ( int ( input ( ) ) * ' x , y , a , b = map ( int , input ( ) . split ( ) ) ; y - = x ; a + = b ; print ( ( y / / a , -1 ) [ y % a > 0 ] ) ; ' ) NEW_LINE