import java . util . * ;   public class Absolutezero {    public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; List < String > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { list . add ( sc . next ( ) ) ; } int dots = 0 ; int mo = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { char ch = list . get ( i ) . charAt ( j ) ; if ( ch == ' . ' ) { dots ++ ; } } } for ( int i = 1 ; i < n - 1 ; i ++ ) { for ( int j = 1 ; j < n - 1 ; j ++ ) { String s1 = list . get ( i ) ; String s2 = list . get ( i - 1 ) ; String s3 = list . get ( i + 1 ) ; char ch = list . get ( i ) . charAt ( j ) ; char ch1 = list . get ( i ) . charAt ( j + 1 ) ; char ch2 = list . get ( i ) . charAt ( j - 1 ) ; char ch3 = list . get ( i - 1 ) . charAt ( j ) ; char ch4 = list . get ( i + 1 ) . charAt ( j ) ;   if ( ch == ' . ' && ch1 == ' . ' && ch2 == ' . ' && ch3 == ' . ' && ch4 == ' . ' ) { String s11 = s1 . substring ( 0 , j - 1 ) + " # # # " + s1 . substring ( j + 2 ) ; list . set ( i , s11 ) ; String s12 = s2 . substring ( 0 , j ) + " # " + s2 . substring ( j + 1 ) ; list . set ( i - 1 , s12 ) ; String s13 = s3 . substring ( 0 , j ) + " # " + s3 . substring ( j + 1 ) ; list . set ( i + 1 , s13 ) ;


if __name__ == " _ _ main _ _ " : n = int ( input ( ) ) matrix = [ ] supposed_to_be_total = ( n * n ) while n : s = input ( ) matrix . append ( list ( s ) ) n = n - 1 m = len ( matrix ) i = 1 while i < m - 1 : j = 1 while j < m - 1 : if matrix [ i ] [ j ] == ' # ' : count = 0 j = j + 1 continue else : if ( matrix [ i + 1 ] [ j ] == ' . ' ) and ( matrix [ i - 1 ] [ j ] == ' . ' ) and ( matrix [ i ] [ j - 1 ] == ' . ' ) and ( matrix [ i ] [ j + 1 ] == ' . ' ) : matrix [ i + 1 ] [ j ] = ' # ' matrix [ i - 1 ] [ j ] = ' # ' matrix [ i ] [ j - 1 ] = ' # ' matrix [ i ] [ j + 1 ] = ' # ' matrix [ i ] [ j ] = ' # ' j = j + 1 i = i + 1 for i in range ( m ) : if ' . ' in matrix [ i ] : print ( " NO " ) exit ( 0 ) print ( " YES " ) NEW_LINE


import java . io . File ; import java . io . FileInputStream ; import java . io . FileNotFoundException ; import java . io . IOException ; import java . io . PrintStream ; import java . io . PrintWriter ; import java . security . AccessControlException ; import java . util . Arrays ; import java . util . Collection ; import java . util . List ; import java . util . Objects ; import java . util . Scanner ; import java . util . function . Function ; import java . util . stream . Collectors ; import java . util . stream . IntStream ; import java . util . stream . LongStream ; import java . util . stream . Stream ; public class _p001150B { static public void main ( final String [ ] args ) throws IOException { p001150B . _main ( args ) ; }

n = int ( input ( ) )   arr = [ list ( input ( ) ) for _ in range ( n ) ]   for i in range ( n ) : for j in range ( n ) : if i == 0 or i == n - 1 or j == 0 or j == n - 1 : continue if arr [ i ] [ j ] == ' # ' : continue   if arr [ i - 1 ] [ j ] == ' # ' or arr [ i + 1 ] [ j ] == ' # ' or arr [ i ] [ j - 1 ] == ' # ' or arr [ i ] [ j + 1 ] == ' # ' : continue   arr [ i ] [ j ] = ' # ' arr [ i ] [ j + 1 ] = ' # ' arr [ i ] [ j - 1 ] = ' # ' arr [ i + 1 ] [ j ] = ' # ' arr [ i - 1 ] [ j ] = ' # ' f = Truefor i in arr : if ' . ' in i : f = False break     print ( " YES " if f else " NO " ) NEW_LINE


import java . util . * ; public class tilingChallange { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] [ ] a = new int [ n ] [ n ] ; sc . nextLine ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String s = sc . nextLine ( ) . trim ( ) ; for ( int j = 0 ; j < n ; j ++ ) { if ( s . charAt ( j ) == ' # ' ) a [ i ] [ j ] = 1 ; else a [ i ] [ j ] = 0 ; } } for ( int i = 1 ; i < n - 1 ; i ++ ) { for ( int j = 1 ; j < n - 1 ; j ++ ) { if ( a [ i ] [ j ] == 0 ) { if ( a [ i - 1 ] [ j ] == 0 && a [ i + 1 ] [ j ] == 0 && a [ i ] [ j + 1 ] == 0 && a [ i ] [ j - 1 ] == 0 ) { a [ i - 1 ] [ j ] = a [ i + 1 ] [ j ] = a [ i ] [ j - 1 ] = a [ i ] [ j + 1 ] = a [ i ] [ j ] = 1 ; } } } } for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < n ; j ++ ) { if ( a [ i ] [ j ] == 0 ) { System . out . println ( " NO " ) ; return ; } } System . out . println ( " YES " ) ; } }


import java . io . IOException ; import java . util . * ; public class GuessThePermutation {   public static void main ( String [ ] args ) throws IOException {

n = int ( input ( ) ) a = [ list ( map ( int , input ( ) . split ( ) ) ) for i in range ( n ) ] ans = [ n for i in range ( n ) ]   for num in range ( n ) : lol = 0 c = 0 for i in range ( len ( a ) ) : if ( a [ i ] . count ( num ) > c ) : lol = i c = a [ i ] . count ( num ) ans [ lol ] = numprint ( * ans )                           NEW_LINE


n = int ( input ( ) ) permutation = [ ] for _ in range ( n ) : S = set ( input ( ) . split ( ) ) permutation . append ( len ( S ) - 1 ) for i in range ( n ) : if permutation [ i ] == n - 1 : permutation [ i ] += 1 breakprint ( * permutation ) NEW_LINE


n = int ( input ( ) ) permutation = [ ] for _ in range ( n ) : S = set ( input ( ) . split ( ) ) permutation . append ( len ( S ) - 1 ) permutation [ permutation . index ( n - 1 ) ] = nprint ( * permutation ) NEW_LINE


n = int ( input ( ) ) a = [ list ( map ( int , input ( ) . split ( ) ) ) for i in range ( n ) ] chosen = set ( ) p = [ 0 ] * nfor i in range ( 1 , n + 1 ) : b = - 1 for j in range ( n ) : if not j in chosen and all ( a [ j ] [ k ] <= i for k in range ( n ) ) and all ( a [ k ] [ j ] <= i for k in range ( n ) ) : b = j p [ b ] = i chosen . add ( b ) print ( * p ) NEW_LINE


import sysarr = [ ] n = int ( input ( ) ) for x in range ( n ) : arr . append ( max ( list ( map ( int , input ( ) . split ( ) ) ) ) ) arr [ arr . index ( n - 1 ) ] = nprint ( * arr ) NEW_LINE


import java . util . * ; import java . io . * ; import java . math . BigInteger ; import java . text . * ; public class Main { static long mod = 1000_000_007 ; static long mod1 = 998244353 ; static boolean fileIO = false ; static boolean memory = true ; static FastScanner f ; static PrintWriter pw ; static double eps = ( double ) 1e-6 ; static int oo = ( int ) 1e7 ;

n , k = map ( int , input ( ) . split ( ) ) px , py = map ( int , input ( ) . split ( ) ) ans = 0 for i in range ( n - 1 ) : x , y = map ( int , input ( ) . split ( ) ) ans += ( ( ( px - x ) ** 2 + ( py - y ) ** 2 ) ** .5 ) px , py = x , yprint ( ans * ( k / 50 ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) a , b = map ( int , input ( ) . split ( ) ) l = 0   for _ in range ( 1 , n ) : x , y = map ( int , input ( ) . split ( ) ) l += ( ( x - a ) ** 2 + ( y - b ) ** 2 ) ** 0.5 a , b = x , y   print ( l * k / 50 ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) distance = 0 x , y = map ( int , input ( ) . split ( ) ) for i in range ( n - 1 ) : a , b = map ( int , input ( ) . split ( ) ) distance += ( ( x - a ) ** 2 + ( y - b ) ** 2 ) ** 0.5 x , y = a , btotal = k * distanceprint ( ' % .9f ' % ( total / 50 ) ) NEW_LINE


import math as mtn , k = map ( int , input ( ) . split ( ) ) arr = [ list ( map ( int , input ( ) . split ( ) ) ) for i in range ( n ) ] dist = 0 for i in range ( 1 , n ) : dist += ( mt . sqrt ( ( arr [ i ] [ 1 ] - arr [ i - 1 ] [ 1 ] ) ** 2 + ( arr [ i ] [ 0 ] - arr [ i - 1 ] [ 0 ] ) ** 2 ) ) print ( " { : . 9f } " . format ( dist * k / 50 ) ) NEW_LINE


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


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 ) ; int t = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; double x1 = sc . nextDouble ( ) ; double y1 = sc . nextDouble ( ) ; double len = 0 ; while ( t -- > 1 ) { double x2 = sc . nextDouble ( ) ; double y2 = sc . nextDouble ( ) ; len += Math . sqrt ( Math . pow ( x2 - x1 , 2 ) + Math . pow ( y2 - y1 , 2 ) ) ; x1 = x2 ; y1 = y2 ; } out . println ( ( len / 50 ) * k ) ; out . close ( ) ; }


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 ( ) ; double s = 0 ; int tx = 0 ; int ty = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x = scan . nextInt ( ) ; int y = scan . nextInt ( ) ; if ( i > 0 ) { s += Math . sqrt ( ( ( x - tx ) * ( x - tx ) ) + ( ( y - ty ) * ( y - ty ) ) ) ; } tx = x ; ty = y ; } double result = ( k * s ) / 50 ; System . out . println ( result ) ; } }


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; int a = in . nextInt ( ) ; int b = in . nextInt ( ) ; double ans = 0 ; for ( int i = 1 ; i < n ; i ++ ) { int c = in . nextInt ( ) ; int d = in . nextInt ( ) ; ans += Math . abs ( Math . sqrt ( ( a - c ) * ( a - c ) + ( b - d ) * ( b - d ) ) ) ; a = c ; b = d ; } System . out . println ( ( ans * k / 50 ) ) ; in . close ( ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class WastedTime { public static void main ( String [ ] args ) { FastReader fs = new FastReader ( ) ; StringBuilder sb = new StringBuilder ( ) ; int t = fs . nextInt ( ) ; int k = fs . nextInt ( ) ; int prevX = 0 ; int prevY = 0 ; int currX = 0 ; int currY = 0 ; double sum = 0 ; for ( int tt = 0 ; tt < t ; tt ++ ) { if ( tt == 0 ) { prevX = fs . nextInt ( ) ; prevY = fs . nextInt ( ) ; } else { currX = fs . nextInt ( ) ; currY = fs . nextInt ( ) ; sum += dist ( currX , prevX , currY , prevY ) ; prevX = currX ; prevY = currY ; } } System . out . println ( k * sum / 50.0 ) ; }   public static double dist ( int x1 , int x2 , int y1 , int y2 ) { return Math . sqrt ( ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ) ) ; }   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 java . util . * ; public class asd { static Scanner s = new Scanner ( System . in ) ; public static void main ( String args [ ] ) { int t = 1 ; while ( t -- > 0 ) { solve ( ) ; } } public static void solve ( ) { int n = s . nextInt ( ) - 1 ; ArrayList < Integer > list = new ArrayList < > ( ) ;   int p = s . nextInt ( ) ; int q = s . nextInt ( ) ; for ( int i = p ; i < q ; i ++ ) { list . add ( i ) ; } while ( n -- > 0 ) { int a = s . nextInt ( ) ; int b = s . nextInt ( ) ; for ( int i = a ; i < b ; i ++ ) { if ( list . contains ( i ) ) list . remove ( new Integer ( i ) ) ; } } System . out . println ( list . size ( ) ) ;   } }

n = int ( input ( ) ) l = [ ] q = [ 0 ] * 100 p = list ( map ( int , input ( ) . split ( ) ) ) l . append ( p ) for i in range ( n - 1 ) : p = list ( map ( int , input ( ) . split ( ) ) ) l . append ( p ) for k in range ( p [ 0 ] , p [ 1 ] ) : q [ k ] = 1 r = 0 for i in range ( l [ 0 ] [ 0 ] , l [ 0 ] [ 1 ] ) : if ( q [ i ] == 0 ) : r = r + 1 print ( r ) NEW_LINE


n = int ( input ( ) ) a , b = input ( ) . split ( ) a , b = int ( a ) , int ( b ) z = [ 0 ] * 101 for i in range ( n - 1 ) : S , E = input ( ) . split ( ) for i in range ( int ( S ) + 1 , int ( E ) + 1 ) : z [ i ] = 1 NEW_LINE


n = int ( input ( ) ) f = 1 start = [ ] end = [ ] main = [ ] res = [ ] for i in range ( n ) : num = list ( map ( int , input ( ) . split ( ) ) ) main . append ( num [ 0 ] ) main . append ( num [ 1 ] ) if f == 1 : f = 0 als = num [ 0 ] ale = num [ 1 ] continue start . append ( num [ 0 ] ) end . append ( num [ 1 ] ) m = max ( main ) NEW_LINE


n = int ( input ( ) ) ans = [ 1 ] * 100   a , b = map ( int , input ( ) . split ( ) )   for k in range ( n - 1 ) : l , r = map ( int , input ( ) . split ( ) ) for i in range ( l , r ) : ans [ i ] = 0   print ( sum ( ans [ a : b ] ) ) NEW_LINE


n = int ( input ( ) ) Al , Ar = map ( int , input ( ) . split ( ) ) cnt = [ 0 ] * 101 for i in range ( n - 1 ) : l , r = map ( int , input ( ) . split ( ) ) for j in range ( l , r ) : cnt [ j ] = 1 ans = 0 for i in range ( Al , Ar ) : if cnt [ i ] == 0 : ans += 1 print ( ans ) NEW_LINE


import java . io . * ; import java . util . * ;   public class Test { static BufferedReader reader ; static StringTokenizer tokenizer ; static PrintWriter writer ;   static int nextInt ( ) throws IOException { return Integer . parseInt ( nextToken ( ) ) ; }   static long nextLong ( ) throws IOException { return Long . parseLong ( nextToken ( ) ) ; }   static double nextDouble ( ) throws IOException { return Double . parseDouble ( nextToken ( ) ) ; }   static String nextToken ( ) throws IOException { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } return tokenizer . nextToken ( ) ; } static String nexts ( ) throws IOException { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; String s = " " ; while ( tokenizer . hasMoreTokens ( ) ) { s += tokenizer . nextElement ( ) + " ▁ " ; } return s ; }


import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ; import java . util . ArrayList ; import java . util . Collections ; import java . lang . Math ; public class Lo { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] A = new int [ 101 ] ; int l1 = sc . nextInt ( ) ; int r1 = sc . nextInt ( ) ; for ( int i = l1 ; i < r1 ; i ++ ) { A [ i ] = 1 ; } for ( int i = 0 ; i < n - 1 ; i ++ ) { int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; for ( int j = x ; j < y ; j ++ ) { A [ j ] = 2 ; } } int count = 0 ; for ( int i = 0 ; i <= 100 ; i ++ ) { if ( A [ i ] == 1 ) { count ++ ; } } System . out . println ( count ) ; } }


import java . util . Scanner ;   public class A_OnSegmentsOwnPoints {   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] times = new int [ 101 ] ; int start = scan . nextInt ( ) ; int end = scan . nextInt ( ) ; for ( int i = start ; i < end ; i ++ ) { times [ i ] = 1 ; } for ( int j = 0 ; j < n - 1 ; j ++ ) { int oStart = scan . nextInt ( ) ; int oEnd = scan . nextInt ( ) ; for ( int k = oStart ; k < oEnd ; k ++ ) { times [ k ] = 0 ; } } int totalTime = 0 ; for ( int l = 0 ; l < times . length ; l ++ ) { totalTime += times [ l ] ; } System . out . println ( totalTime ) ;   scan . close ( ) ; }   }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ;


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class TshirtHunt { public static boolean winTshirt ( int s , int p ) { int a = ( s / 50 ) % 475 ;   for ( int i = 0 ; i < 25 ; i ++ ) { a = ( a * 96 + 42 ) % 475 ; if ( p == 26 + a ) return true ; } return false ; }   public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;   StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int p = Integer . parseInt ( st . nextToken ( ) ) ; int x = Integer . parseInt ( st . nextToken ( ) ) ; int y = Integer . parseInt ( st . nextToken ( ) ) ;   for ( int i = x ; i >= y ; i -= 50 ) { if ( winTshirt ( i , p ) ) { System . out . println ( 0 ) ; return ; } }   int counter = 0 ; while ( true ) { counter ++ ; x += 100 ;   if ( x < y ) continue ;   if ( winTshirt ( x , p ) ) { break ; }   if ( x - 50 >= y && winTshirt ( x - 50 , p ) ) { break ; } }   System . out . println ( counter ) ; } }


p , x , y = map ( int , input ( ) . split ( ) )     def check ( s ) : i = ( s // 50 ) % 475 for t in range ( 25 ) : i = ( i * 96 + 42 ) % 475 if 26 + i == p : return True return False     flag = Falsefor up in range ( 500 ) : for down in range ( 500 ) : if x + 100 * up - 50 * down >= y and check ( x + 100 * up - 50 * down ) : print ( up ) flag = True break if flag : break NEW_LINE


p , x , y = map ( int , input ( ) . split ( ) )   def check ( s ) : i = ( s // 50 ) % 475 for t in range ( 25 ) : i = ( i * 96 + 42 ) % 475 if 26 + i == p : return True return False   for up in range ( 500 ) : for down in range ( 500 ) : if x + 100 * up - 50 * down >= y and check ( x + 100 * up - 50 * down ) : print ( up ) exit ( )   assert ( False ) NEW_LINE


import mathp , x , y = map ( int , input ( ) . split ( ) ) s = ywhile 1 : if abs ( x - s ) % 50 == 0 : break s -= - 1 while 1 : i = ( s // 50 ) % 475 for j in range ( 25 ) : i = ( i * 96 + 42 ) % 475 if i + 26 == p : break if i + 26 == p : break s += 50 if s <= x : print ( 0 ) else : if ( s - x ) % 100 == 0 : print ( ( s - x ) // 100 ) else : print ( ( s - x ) // 100 + 1 ) NEW_LINE


import java . math . BigInteger ; import java . sql . Array ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collection ; import java . util . Collections ; import java . util . Comparator ; import java . util . HashMap ; import java . util . InputMismatchException ; import java . util . Iterator ; import java . util . LinkedHashSet ; import java . util . LinkedList ; import java . util . List ; import java . util . Map ; import java . util . Map . Entry ; import java . util . PriorityQueue ; import java . util . Queue ; import java . util . Scanner ; import java . util . Set ; import java . util . Stack ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . TreeMap ; import java . util . TreeSet ; public class Main { static InputReader rd = new InputReader ( System . in ) ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int p , x , y ; p = sc . nextInt ( ) ; x = sc . nextInt ( ) ; y = sc . nextInt ( ) ;   int i = ( x / 50 ) % 475 ; int k = - 1 ; for ( int j = x ; j >= y ; j -- ) { if ( isPresent ( j , p ) && ( x - j ) % 50 == 0 ) { k = j ; break ; } }


import java . io . * ; import java . util . * ;   public class practice807b { public static void main ( String [ ] args ) throws Exception {


import java . io . BufferedReader ; import java . io . File ; import java . io . FileWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ;   import javafx . util . Pair ;   public class Main {   public static void main ( String args [ ] ) { FastScanner input = new FastScanner ( ) ; int p = input . nextInt ( ) ; int x = input . nextInt ( ) ; int y = input . nextInt ( ) ;   for ( int s = y ; s <= 1000000 ; s ++ ) { if ( ( s % 50 ) != ( x % 50 ) ) { continue ; } int i = ( s / 50 ) % 475 ;   for ( int j = 0 ; j < 25 ; j ++ ) {   i = ( i * 96 + 42 ) % 475 ; if ( i + 26 == p ) { System . out . println ( ( Math . max ( 0 , s - x ) + 50 ) / 100 ) ; return ; } } }   }   static 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 ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) throws IOException { return br . readLine ( ) ; } }   }


import java . util . * ; import java . io . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { FastScanner sc = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = sc . nextInt ( ) ; List < Pair > arr = new ArrayList < > ( ) ; int maxP = - 1 , maxT = - 1 , maxG = - 1 ; while ( n -- > 0 ) { int k = sc . nextInt ( ) ; String name = sc . next ( ) ; int t = 0 , g = 0 , p = 0 ; for ( int i = 0 ; i < k ; i ++ ) { String phone = sc . next ( ) ; int temp [ ] = new int [ 6 ] ; int l = 0 ; for ( int j = 0 ; j < 8 ; j ++ ) { if ( phone . charAt ( j ) == ' - ' ) continue ; temp [ l ] = phone . charAt ( j ) - '0' ; l ++ ; } boolean allSame = true , Sorted = true ;

n = int ( input ( ) ) taxi = { } pizza = { } girls = { } for l in range ( n ) : m , name = input ( ) . split ( ) taxi [ name ] = 0 pizza [ name ] = 0 girls [ name ] = 0 for o in range ( int ( m ) ) : x = input ( ) x = x . replace ( " - " , " " ) c = 0 v = x [ 0 ] for i in range ( 0 , 6 ) : if x [ i ] != v : c = 1 if c == 0 : taxi [ name ] += 1 continue c = 0 for i in range ( 1 , 6 ) : if x [ i ] >= x [ i - 1 ] : c = 1 if c == 0 : pizza [ name ] += 1 continue girls [ name ] += 1 c = 0 for i in taxi : if taxi [ i ] > c : c = taxi [ i ] x = [ ] print ( " If ▁ you ▁ want ▁ to ▁ call ▁ a ▁ taxi , ▁ you ▁ should ▁ call : " , end = " ▁ " ) for i in taxi : if c == taxi [ i ] : x . append ( i ) s = " , ▁ " . join ( x ) print ( s + " . " ) c = 0 for i in pizza : if pizza [ i ] > c : c = pizza [ i ] x = [ ] print ( " If ▁ you ▁ want ▁ to ▁ order ▁ a ▁ pizza , ▁ you ▁ should ▁ call : " , end = " ▁ " ) for i in pizza : if c == pizza [ i ] : x . append ( i ) s = " , ▁ " . join ( x ) print ( s + " . " ) c = 0 for i in girls : if girls [ i ] > c : c = girls [ i ] x = [ ] print ( " If ▁ you ▁ want ▁ to ▁ go ▁ to ▁ a ▁ cafe ▁ with ▁ a ▁ wonderful ▁ girl , ▁ you ▁ should ▁ call : " , end = " ▁ " ) for i in girls : if c == girls [ i ] : x . append ( i ) s = " , ▁ " . join ( x ) print ( s + " . " ) NEW_LINE


names = { } n = int ( input ( ) )   for book in range ( n ) : s , name = map ( str , input ( ) . split ( ) ) taxi = pizza = cafe = 0 for i in range ( int ( s ) ) : number = input ( ) . replace ( ' - ' , ' ' ) if number == number [ 0 ] * 6 : taxi += 1 elif len ( set ( number ) ) == 6 : for j in range ( 1 , len ( number ) ) : if int ( number [ j ] ) >= int ( number [ j - 1 ] ) : cafe += 1 break else : pizza += 1 else : cafe += 1 names [ name ] = { " taxi " : taxi , " pizza " : pizza , " cafe " : cafe }   taxi_guys , pizza_guys , cafe_guys = [ ] , [ ] , [ ] max_taxi = max_pizza = max_cafe = 0   for name in names : max_taxi = max ( names [ name ] [ " taxi " ] , max_taxi ) max_pizza = max ( names [ name ] [ " pizza " ] , max_pizza ) max_cafe = max ( names [ name ] [ " cafe " ] , max_cafe )   for name in names : if names [ name ] [ " taxi " ] == max_taxi : taxi_guys . append ( name ) if names [ name ] [ " pizza " ] == max_pizza : pizza_guys . append ( name ) if names [ name ] [ " cafe " ] == max_cafe : cafe_guys . append ( name )   print ( f " If ▁ you ▁ want ▁ to ▁ call ▁ a ▁ taxi , ▁ you ▁ should ▁ call : ▁ { ' , ▁ ' . join ( taxi _ guys ) } . " ) print ( f " If ▁ you ▁ want ▁ to ▁ order ▁ a ▁ pizza , ▁ you ▁ should ▁ call : ▁ { ' , ▁ ' . join ( pizza _ guys ) } . " ) print ( f " If ▁ you ▁ want ▁ to ▁ go ▁ to ▁ a ▁ cafe ▁ with ▁ a ▁ wonderful ▁ girl , ▁ you ▁ should ▁ call : ▁ { ' , ▁ ' . join ( cafe _ guys ) } . " ) NEW_LINE


def main ( ) : n = int ( input ( ) ) arr = [ ] for _ in range ( n ) : k , name = input ( ) . split ( ) arr . append ( [ name , 0 , 0 , 0 ] ) for i in range ( int ( k ) ) : num = input ( ) . replace ( " - " , " " ) if all ( a > b for a , b in zip ( num , num [ 1 : ] ) ) : arr [ - 1 ] [ 2 ] += 1 elif len ( set ( num ) ) == 1 : arr [ - 1 ] [ 1 ] += 1 else : arr [ - 1 ] [ 3 ] += 1   t = [ " If ▁ you ▁ want ▁ to ▁ call ▁ a ▁ taxi , ▁ you ▁ should ▁ call : " , " If ▁ you ▁ want ▁ to ▁ order ▁ a ▁ pizza , ▁ you ▁ should ▁ call : " , " If ▁ you ▁ want ▁ to ▁ go ▁ to ▁ a ▁ cafe ▁ with ▁ a ▁ wonderful ▁ girl , ▁ you ▁ should ▁ call : " ]   for i , s in enumerate ( t , start = 1 ) : m = max ( r [ i ] for r in arr ) print ( s , " , ▁ " . join ( r [ 0 ] for r in arr if r [ i ] == m ) + " . " ) if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE


import java . io . * ; import java . util . * ;   public class PhoneProblems_107B { public static void main ( String [ ] args ) throws IOException { FastReader fr = new FastReader ( ) ; PrintWriter pr = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ; int t = fr . nextInt ( ) ;   TreeMap < Integer , List < String > > taxi = new TreeMap < > ( ) ; TreeMap < Integer , List < String > > pizza = new TreeMap < > ( ) ; TreeMap < Integer , List < String > > girl = new TreeMap < > ( ) ;   while ( t -- > 0 ) { int n = fr . nextInt ( ) ; String s = fr . next ( ) ;   int [ ] count = new int [ 3 ] ;   for ( int i = 0 ; i < n ; i ++ ) { String str = fr . nextLine ( ) ; count [ validate ( str ) ] ++ ; }


import java . io . * ; import java . util . * ;   public class Main { public static void main ( String args [ ] ) { long s = System . currentTimeMillis ( ) ; FastReader input = new FastReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int T = 1 ; while ( T -- > 0 ) { int n = input . nextInt ( ) ; int a [ ] = new int [ n ] ; int pre [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = input . nextInt ( ) ; if ( i == 0 ) { pre [ i ] = a [ i ] ; } else { pre [ i ] = a [ i ] ^ pre [ i - 1 ] ; } } long xor [ ] [ ] = new long [ 2 ] [ 2000000 ] ; xor [ 1 ] [ 0 ] ++ ; long ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { ans += xor [ i % 2 ] [ pre [ i ] ] ; xor [ i % 2 ] [ pre [ i ] ] ++ ; } out . println ( ans ) ; } out . close ( ) ; } 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 ; } } }

n = int ( input ( ) ) a = [ 0 ] + list ( map ( int , input ( ) . split ( ) ) ) dict_even = { } dict_odd = { } count = 0 xor = 0 for i in range ( 0 , n + 1 ) : xor = xor ^ a [ i ] if ( i % 2 == 0 ) : if xor in dict_even : count += dict_even [ xor ] dict_even [ xor ] += 1 else : dict_even [ xor ] = 1 else : if xor in dict_odd : count += dict_odd [ xor ] dict_odd [ xor ] += 1 else : dict_odd [ xor ] = 1 print ( count ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) ans = 0 o = { } e = { } x = [ a [ 0 ] ] for i in range ( 1 , n ) : g = a [ i ] ^ x [ - 1 ] x . append ( g ) if g == 0 and i % 2 == 1 : ans = ans + 1 s = [ 0 ] * nfor i in range ( n ) : if i % 2 == 1 : u = o . get ( x [ i ] , - 1 ) if u == - 1 : o [ x [ i ] ] = i else : s [ i ] = s [ u ] + 1 o [ x [ i ] ] = i else : u = e . get ( x [ i ] , - 1 ) if u == - 1 : e [ x [ i ] ] = i else : s [ i ] = s [ u ] + 1 e [ x [ i ] ] = ians = ans + sum ( s ) print ( ans ) NEW_LINE


import sysinput = sys . stdin . readlinen = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) dic1 = { } dic2 = { } dic1 [ 0 ] = 1 ans = 0 curr = 0 for i in range ( n ) : curr = a [ i ] ^ curr if i % 2 == 0 : if curr in dic2 : ans += dic2 [ curr ] dic2 [ curr ] += 1 else : dic2 [ curr ] = 1 else : if curr in dic1 : ans += dic1 [ curr ] dic1 [ curr ] += 1 else : dic1 [ curr ] = 1 print ( ans ) NEW_LINE


import java . io . * ; import java . util . * ; import java . lang . * ; import java . math . * ; import java . text . DecimalFormat ; import java . lang . reflect . Array ; import java . io . BufferedOutputStream ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigDecimal ; public class Codeforces { public static PrintWriter out = new PrintWriter ( new BufferedOutputStream ( System . out ) ) ; static long MOD = ( long ) ( 1e9 + 7 ) ; static long MOD2 = MOD * MOD ;


import java . io . * ; import java . util . * ; public class Solution { public static void main ( String ag [ ] ) { Scanner sc = new Scanner ( System . in ) ; int i , j , k ; int N = sc . nextInt ( ) ; long A [ ] = new long [ N + 1 ] ; for ( i = 1 ; i <= N ; i ++ ) { A [ i ] = sc . nextLong ( ) ; } HashMap < Long , Long > odd = new HashMap < > ( ) ; HashMap < Long , Long > even = new HashMap < > ( ) ; odd . put ( 0L , 1L ) ; long xor = 0 ; long ans = 0 ; for ( i = 1 ; i <= N ; i ++ ) { xor ^= A [ i ] ; if ( i % 2 == 0 ) { if ( odd . containsKey ( xor ) ) { ans += odd . get ( xor ) ; odd . put ( xor , odd . get ( xor ) + 1 ) ; } else { odd . put ( xor , 1L ) ; } } else { if ( even . containsKey ( xor ) ) { ans += even . get ( xor ) ; even . put ( xor , even . get ( xor ) + 1 ) ; } else { even . put ( xor , 1L ) ; } } } System . out . println ( ans ) ; } }


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = scanner . nextInt ( ) ; } solve ( arr , n ) ; scanner . close ( ) ; }   private static void solve ( int [ ] arr , int n ) { int [ ] prefix = new int [ n ] ; prefix [ 0 ] = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { prefix [ i ] = arr [ i ] ^ prefix [ i - 1 ] ; }   int [ ] [ ] cnt = new int [ 2 ] [ ( 1 << 20 ) + 3 ] ; cnt [ 1 ] [ 0 ] = 1 ; long ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { ans += cnt [ i % 2 ] [ prefix [ i ] ] ; cnt [ i % 2 ] [ prefix [ i ] ] ++ ; }   System . out . println ( ans ) ; } }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { int a , b , ji1 = 0 , ji2 = 0 , ou1 = 0 , ou2 = 0 ; Scanner reader = new Scanner ( System . in ) ; a = reader . nextInt ( ) ; b = reader . nextInt ( ) ; int i , x ; for ( i = 0 ; i < a ; ++ i ) { x = reader . nextInt ( ) ; if ( x % 2 == 1 ) ji1 ++ ; else ou1 ++ ; } for ( i = 0 ; i < b ; ++ i ) { x = reader . nextInt ( ) ; if ( x % 2 == 1 ) ji2 ++ ; else ou2 ++ ; } if ( ji1 > ou2 ) ji1 = ou2 ; if ( ji2 > ou1 ) ji2 = ou1 ; System . out . println ( ji1 + ji2 ) ; } }

def count ( l ) : count_even = 0 count_odd = 0 for i in l : if not i % 2 : count_even += 1 else : count_odd += 1 return count_even , count_odd     def main_function ( ) : n , m = [ int ( i ) for i in input ( ) . split ( " ▁ " ) ] a = [ int ( i ) for i in input ( ) . split ( " ▁ " ) ] b = [ int ( i ) for i in input ( ) . split ( " ▁ " ) ] a_even , a_odd = count ( a ) b_even , b_odd = count ( b ) count_1 = min ( a_even , b_odd ) + min ( b_even , a_odd ) count_2 = min ( b_even , a_odd ) + min ( b_odd , a_even ) return max ( count_2 , count_1 )     print ( main_function ( ) ) NEW_LINE


def odd_check ( n ) : if n % 2 != 0 : return True else : return False   n , m = map ( int , input ( ) . split ( " ▁ " ) ) chests = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) keys = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) chests_o , chests_e , keys_o , keys_e = 0 , 0 , 0 , 0 c = 0 for i in range ( n ) : if chests [ i ] % 2 == 1 : chests_o += 1 else : chests_e += 1 for i in range ( m ) : if keys [ i ] % 2 == 1 : keys_o += 1 else : keys_e += 1 NEW_LINE


I = lambda : map ( int , input ( ) . split ( ) ) n , m = I ( ) x = sum ( a % 2 for a in I ( ) ) y = sum ( b % 2 for b in I ( ) ) print ( min ( x , m - y ) + min ( y , n - x ) ) NEW_LINE


i = lambda : map ( int , input ( ) . split ( ) ) n , m = i ( ) ; a , b = i ( ) , i ( ) x = sum ( x % 2 for x in a ) y = sum ( x % 2 for x in b ) print ( min ( x , m - y ) + min ( y , n - x ) ) NEW_LINE


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


import java . util . * ; public class contest17 { static Scanner scn = new Scanner ( System . in ) ; public static void main ( String [ ] args ) {


import java . util . ArrayList ; 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 m = sc . nextInt ( ) ; int n_odd = 0 ; int n_even = 0 ; int m_odd = 0 ; int m_even = 0 ;   for ( int i = 0 ; i < n ; i ++ ) { int a = sc . nextInt ( ) ; if ( ( a & 1 ) == 0 ) n_even ++ ; else n_odd ++ ; } for ( int i = 0 ; i < m ; i ++ ) { int b = sc . nextInt ( ) ; if ( ( b & 1 ) == 0 ) m_even ++ ; else m_odd ++ ; } System . out . println ( Integer . min ( n_even , m_odd ) + Integer . min ( n_odd , m_even ) ) ; } }


import java . util . Scanner ; import java . util . Set ; import java . util . HashSet ; import java . util . LinkedList ; import java . util . Queue ;   public class RedBlueButton { public static void main ( String [ ] args ) { int n , m ; Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ; m = sc . nextInt ( ) ; System . out . println ( findMoves1 ( n , m ) ) ; }   public static int findMoves ( int n , int m ) { Set < Integer > visited = new HashSet < > ( ) ; Queue < Integer > nodes = new LinkedList < > ( ) ; nodes . add ( n ) ; int moves = 0 ; while ( ! nodes . isEmpty ( ) ) {   if ( nodes . contains ( m ) ) { break ; } Queue < Integer > children = new LinkedList < > ( ) ; while ( ! nodes . isEmpty ( ) ) { Integer num = nodes . poll ( ) ; if ( ! visited . contains ( num ) ) { visited . add ( num ) ; children . add ( num * 2 ) ; children . add ( num - 1 ) ; } } nodes = children ; moves ++ ; } return moves ; }   public static int findMoves1 ( int n , int m ) { int moves = 0 ; while ( m > n ) { if ( m % 2 != 0 ) { m += 1 ; } else { m /= 2 ; } moves ++ ; }   return moves + ( n - m ) ; } }

def f ( x , y ) : if x >= y : return ( x - y ) else : if y % 2 != 0 : return ( f ( x , y + 1 ) + 1 ) else : return ( f ( x , y / 2 ) + 1 ) a , b = ( input ( " " ) . split ( ) ) x = int ( a ) y = int ( b ) print ( int ( f ( x , y ) ) ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) q = 0 while n != m : m = [ m // 2 , m + 1 ] [ m & 1 or m < n ] q += 1 print ( q ) NEW_LINE


from collections import deque   n , m = map ( int , input ( ) . split ( ) ) a = [ 1000000 ] * 10100 a [ n ] = 0 q = deque ( ) q . append ( n ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) cnt = 0 while m > n : if m % 2 : m = m // 2 + 1 cnt += 2 else : m //= 2 cnt += 1 print ( n - m + cnt ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) )   queue = [ n ] depth = 0 list_of_visited = [ ] for i in range ( 2 * ( 10 ** 4 ) + 1 ) : list_of_visited . append ( - 1 ) list_of_visited [ n ] = 0 while True : a = queue . pop ( 0 ) if a == m : my_ans = list_of_visited [ a ] break   if a - 1 > 0 and list_of_visited [ a - 1 ] == - 1 : queue . append ( a - 1 ) list_of_visited [ a - 1 ] = list_of_visited [ a ] + 1 if a < 10 ** 4 and list_of_visited [ a * 2 ] == - 1 : queue . append ( a * 2 ) list_of_visited [ a * 2 ] = list_of_visited [ a ] + 1 print ( my_ans ) NEW_LINE


import java . io . * ; import java . util . * ; import java . util . LinkedList ; import java . util . Queue ;     public class Main { static class Pair { int data , level ; Pair ( int data , int level ) { this . data = data ; this . level = level ; } } public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; Set < Integer > numberSet = new HashSet < Integer > ( ) ; Queue < Pair > q = new LinkedList < Pair > ( ) ; q . add ( new Pair ( n , 0 ) ) ; while ( ! q . isEmpty ( ) ) { Pair current = q . remove ( ) ; if ( current . data == m ) { System . out . println ( current . level ) ; return ; } int newDouble = current . data * 2 ; int newLess = current . data - 1 ; if ( ! numberSet . contains ( newDouble ) ) { if ( current . data <= m ) { q . add ( new Pair ( newDouble , current . level + 1 ) ) ; numberSet . add ( newDouble ) ; } } if ( ! numberSet . contains ( newLess ) ) { q . add ( new Pair ( newLess , current . level + 1 ) ) ; numberSet . add ( newLess ) ; } } return ; } }


import java . util . Scanner ;   public class codeforces { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; long start = in . nextLong ( ) ; long end = in . nextLong ( ) ; int click = 0 ; while ( start < end ) { if ( end % 2 == 0 ) { end /= 2 ; } else { end += 1 ; } click ++ ; } System . out . println ( click + start - end ) ; } }


import java . util . Scanner ;   public class code { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int m = scan . nextInt ( ) ; int count = 0 ; while ( m > n ) { if ( m % 2 != 0 ) { m ++ ; count ++ ; } m /= 2 ; count ++ ; }   System . out . println ( count + n - m ) ; }    }


import java . util . Arrays ; import java . util . Scanner ;   public class solution { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; if ( n == m ) { System . out . println ( 0 ) ; return ; } if ( n > m ) { System . out . print ( n - m ) ; return ; } int step = 0 ; while ( n < m ) { step ++ ; m = m % 2 == 0 ? m / 2 : m + 1 ; } System . out . println ( step + n - m ) ; } }


import java . io . * ; import java . util . * ; import java . math . * ;   public class Main { public static void main ( String [ ] args ) throws java . lang . Exception {

import osimport sysfrom io import BytesIO , IOBase   BUFSIZE = 8192     class FastIO ( IOBase ) : newlines = 0   def __init__ ( self , file ) : self . _fd = file . fileno ( ) self . buffer = BytesIO ( ) self . writable = " x " in file . mode or " r " not in file . mode self . write = self . buffer . write if self . writable else None   def read ( self ) : while True : b = os . read ( self . _fd , max ( os . fstat ( self . _fd ) . st_size , BUFSIZE ) ) if not b : break ptr = self . buffer . tell ( ) self . buffer . seek ( 0 , 2 ) , self . buffer . write ( b ) , self . buffer . seek ( ptr ) self . newlines = 0 return self . buffer . read ( )   def readline ( self ) : while self . newlines == 0 : b = os . read ( self . _fd , max ( os . fstat ( self . _fd ) . st_size , BUFSIZE ) ) self . newlines = b . count ( b " \n " ) + ( not b ) ptr = self . buffer . tell ( ) self . buffer . seek ( 0 , 2 ) , self . buffer . write ( b ) , self . buffer . seek ( ptr ) self . newlines -= 1 return self . buffer . readline ( )   def flush ( self ) : if self . writable : os . write ( self . _fd , self . buffer . getvalue ( ) ) self . buffer . truncate ( 0 ) , self . buffer . seek ( 0 )     class IOWrapper ( IOBase ) : def __init__ ( self , file ) : self . buffer = FastIO ( file ) self . flush = self . buffer . flush self . writable = self . buffer . writable self . write = lambda s : self . buffer . write ( s . encode ( " ascii " ) ) self . read = lambda : self . buffer . read ( ) . decode ( " ascii " ) self . readline = lambda : self . buffer . readline ( ) . decode ( " ascii " )     sys . stdin , sys . stdout = IOWrapper ( sys . stdin ) , IOWrapper ( sys . stdout ) input = lambda : sys . stdin . readline ( ) . rstrip ( " \n " ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) t = [ input ( ) for i in range ( n ) ] p = list ( zip ( * t ) ) u , v = [ True ] * n , [ True ] * mx , u [ n - 1 ] , d = [ n - 1 ] , False , 0 while x : y = [ ] for i in x : for j , k in enumerate ( t [ i ] ) : if k == ' # ' and v [ j ] : v [ j ] = False y . append ( j ) x = [ ] for i in y : for j , k in enumerate ( p [ i ] ) : if k == ' # ' and u [ j ] : u [ j ] = False x . append ( j ) d += 1 if 0 in x : print ( 2 * d ) breakelse : print ( - 1 ) NEW_LINE


from collections import dequefrom collections import defaultdict   n , m = map ( int , input ( ) . split ( ) ) INF = 10 ** 9 visited = defaultdict ( int )   g = [ [ ] for _ in range ( n + m ) ] NEW_LINE


import java . util . Scanner ;   public class A907 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int V1 = in . nextInt ( ) ; int V2 = in . nextInt ( ) ; int V3 = in . nextInt ( ) ; int Vm = in . nextInt ( ) ; for ( int x = V1 ; x <= 2 * V1 ; x ++ ) { for ( int y = V2 ; y <= 2 * V2 ; y ++ ) { if ( x <= y ) continue ; for ( int z = V3 ; z <= 2 * V3 ; z ++ ) { if ( y <= z ) continue ; if ( z < Vm ) continue ; if ( z > 2 * Vm ) continue ; if ( y <= 2 * Vm ) continue ; System . out . println ( x + " \n " + y + " \n " + z ) ; return ; } } } System . out . println ( " - 1" ) ; }   }

father_size , mother_size , son_size , masha_size = list ( map ( int , input ( ) . split ( ) ) )   son_car = 0 father_car = 0 mother_car = 0 t = max ( masha_size , son_size ) for car_size in range ( t , 201 ) : if ( 2 * t ) >= car_size and ( 2 * son_size ) >= car_size and ( 2 * masha_size ) >= car_size : son_car = car_size breakfor car_size in range ( mother_size , 201 ) : if ( 2 * mother_size ) >= car_size and ( car_size > ( 2 * t ) ) : mother_car = car_size break for car_size in range ( father_size , 201 ) : if ( 2 * father_size ) >= car_size and car_size > mother_car : father_car = car_size break if father_car and mother_car and son_car : print ( father_car ) print ( mother_car ) print ( son_car ) else : print ( - 1 ) NEW_LINE


en = list ( map ( int , input ( ) . split ( ) ) ) a , b , c , d = en [ 0 ] , en [ 1 ] , en [ 2 ] , en [ 3 ]   aux = max ( c , d )   if ( 2 * c >= aux and 2 * d >= aux and 2 * d < 2 * a and 2 * d < 2 * b ) : print ( 2 * a ) print ( 2 * b ) print ( aux ) else : print ( - 1 ) NEW_LINE


def aaa ( ) : a , b , c , d = map ( int , input ( ) . split ( ) ) for aa in range ( a , 2 * a + 1 ) : for bb in range ( b , min ( aa , 2 * b + 1 ) ) : for cc in range ( c , min ( bb , 2 * c + 1 ) ) : if d <= aa and aa > d * 2 and d <= bb and bb > d * 2 and d <= cc and cc <= d * 2 : return [ aa , bb , cc ] return [ - 1 ] for aa in aaa ( ) : print ( aa ) NEW_LINE


pai , mae , filho , maria = [ int ( x ) for x in input ( ) . split ( ' ▁ ' ) ] def solve ( ) : if filho > 2 * maria or maria > 2 * filho or maria >= mae : return - 1 if filho > maria : return max ( pai , 2 * maria + 2 ) , max ( mae , 2 * maria + 1 ) , filho return max ( pai , 2 * maria + 2 ) , max ( mae , 2 * maria + 1 ) , maria x = solve ( ) if x == - 1 : print ( - 1 ) else : print ( x [ 0 ] ) print ( x [ 1 ] ) print ( x [ 2 ] ) NEW_LINE


import java . util . * ; import java . util . stream . Collectors ; import java . util . stream . Stream ;   import static java . lang . Integer . max ; import static java . lang . Integer . reverse ; import static java . lang . Math . min ;   public class Solution { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) , b = sc . nextInt ( ) , c = sc . nextInt ( ) , d = sc . nextInt ( ) ; if ( b > d && c + c >= d && d + d >= c ) { System . out . printf ( " % d \n % d \n % d " , max ( a , max ( c , d ) * 2 + 2 ) , max ( b , max ( c , d ) * 2 + 1 ) , max ( c , d ) ) ; } else System . out . println ( - 1 ) ; } }


import java . util . * ; import java . awt . * ;    public class p907A { public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; int dad = in . nextInt ( ) ; int mom = in . nextInt ( ) ; int son = in . nextInt ( ) ; int marsha = in . nextInt ( ) ;   int dadCar = dad ; int momCar = mom ; int sonCar = son ;   while ( marsha * 2 >= dadCar ) { dadCar ++ ; }   while ( marsha * 2 >= momCar ) { momCar ++ ; }   while ( marsha * 2 < sonCar ) { sonCar -- ; }   while ( marsha > sonCar ) { sonCar ++ ; }   while ( momCar <= sonCar ) { momCar ++ ; } while ( dadCar <= momCar ) { dadCar ++ ; }   if ( dadCar <= dad * 2 && momCar <= mom * 2 && sonCar <= son * 2 && sonCar <= marsha * 2 && sonCar >= son ) { System . out . println ( dadCar ) ; System . out . println ( momCar ) ; System . out . println ( sonCar ) ; } else { System . out . println ( - 1 ) ; }     } }


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


import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int t = s . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int a = s . nextInt ( ) ; int b = s . nextInt ( ) ; int count = 0 ; int d = Math . abs ( a - b ) ; count = count + d / 5 ; d = d % 5 ; count = count + d / 2 ; d = d % 2 ; count = count + d ; System . out . println ( count ) ; } } }

t = int ( input ( ) ) while ( t ) : a , b = map ( int , input ( ) . split ( ) ) if a < b : a , b = b , a ans = ( a - b ) // 5 m = ( a - b ) % 5 if m == 1 or m == 2 : ans += 1 elif m == 3 or m == 4 : ans += 2 print ( ans ) t -= 1 NEW_LINE


t = int ( input ( ) ) for i in range ( t ) : a , b = list ( map ( int , input ( ) . split ( ) ) ) d = abs ( a - b ) print ( int ( d / 5 ) + int ( d % 5 / 2 ) + d % 5 % 2 ) NEW_LINE


n = int ( input ( ) ) for i in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) c = abs ( a - b ) print ( c // 5 + ( c % 5 ) // 2 + ( c % 5 ) % 2 ) NEW_LINE


for i in range ( int ( input ( ) ) ) : a , b = map ( int , input ( ) . split ( ) ) d = abs ( a - b ) print ( d // 5 + d % 5 // 2 + d % 5 % 2 ) NEW_LINE


def result ( c ) : count = 0 if c >= 5 : count = count + c // 5 c = c - ( c // 5 ) * 5 if c >= 2 : count = count + c // 2 c = c - ( c // 2 ) * 2 if c == 1 : count = count + c c = c - c print ( count ) def calculate ( a , b ) : if a == b : print ( '0' ) elif a > b : result ( a - b ) else : result ( b - a ) test = int ( input ( ) ) while test : a , b = map ( int , input ( ) . split ( " ▁ " ) ) calculate ( a , b ) test -= 1 NEW_LINE


import java . util . * ; import java . util . Arrays ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = 0 ; if ( a > b ) { c = a - b ; } else { c = b - a ; } int count = 0 ; if ( a == b ) { System . out . println ( "0" ) ; } else { while ( c != 0 ) { if ( c >= 5 ) { count = count + ( c / 5 ) ; c = c % 5 ; } else if ( c >= 2 && c < 5 ) { count = count + ( c / 2 ) ; c = c % 2 ; } else { count = count + ( c / 1 ) ; c = c % 1 ; } } System . out . println ( count ) ; } } } }


import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; PrintWriter out = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ; int t = in . nextInt ( ) ; while ( t -- != 0 ) { int a = in . nextInt ( ) ; int b = in . nextInt ( ) ; if ( a > b ) { int c = a ; a = b ; b = c ; } int res = b - a ; int ans = res / 10 * 2 ; res %= 10 ; int [ ] nums = new int [ ] { 0 , 1 , 1 , 2 , 2 , 1 , 2 , 2 , 3 , 3 , 2 } ; ans += nums [ res ] ; out . println ( ans ) ; } in . close ( ) ; out . flush ( ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; public class C { static 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 ( ) ) ; }   int [ ] nextArray ( 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 ( ) ) ; } } static class FastWriter extends PrintWriter { FastWriter ( ) { super ( System . out ) ; }   void println ( int [ ] array ) { for ( int i = 0 ; i < array . length ; i ++ ) { print ( array [ i ] + " ▁ " ) ; } println ( ) ; }   void println ( long [ ] array ) { for ( int i = 0 ; i < array . length ; i ++ ) { print ( array [ i ] + " ▁ " ) ; } println ( ) ; } } public static void main ( String [ ] args ) {


import java . util . * ; import java . lang . * ; import java . io . * ;   public class FastIO { BufferedReader br ; StringTokenizer st ; public FastIO ( ) {

n , k = [ int ( x ) for x in input ( ) . split ( ' ▁ ' ) ] NEW_LINE a = [ int ( x ) for x in input ( ) . split ( ' ▁ ' ) ] NEW_LINE a_dict = { i : 0 for i in range ( k + 1 ) } NEW_LINE for x in a : if NEW_LINE x in a_dict : a_dict [ x ] += 1 else : a_dict [ x ] = 1 NEW_LINE steps = 0 NEW_LINE while a_dict [ k ] < n : a_dict = { i : a_dict [ i ] - int ( a_dict [ i ] > 0 and i < k ) + int ( i > 0 and a_dict [ i - 1 ] > 0 ) for i in range ( 1 , k + 1 ) } NEW_LINE a_dict [ 0 ] = 0 NEW_LINE steps += 1 NEW_LINE print ( steps ) NEW_LINE


n , k = [ int ( i ) for i in input ( ) . split ( ) ] NEW_LINE a = list ( map ( int , input ( ) . split ( ) ) ) [ : n ] NEW_LINE b = 0 NEW_LINE while a . count ( k ) != len ( a ) : for NEW_LINE i in set ( a ) : NEW_LINE if i != k : x = a . index ( i ) NEW_LINE a [ x ] = a [ x ] + 1 NEW_LINE b = b + 1 NEW_LINE print ( b ) NEW_LINE


def solve ( x , a ) : a . sort ( ) NEW_LINE c = 0 NEW_LINE while a [ 0 ] != x : for NEW_LINE i in range ( len ( a ) ) : NEW_LINE if i != len ( a ) - 1 : if NEW_LINE a [ i ] != a [ i + 1 ] : a [ i ] = a [ i ] + 1 else : a [ i ] = a [ i ] + 1 NEW_LINE


from collections import Counter   if __name__ == ' _ _ main _ _ ' : cin = input NEW_LINE n , k = map ( int , cin ( ) . split ( ) ) NEW_LINE d , cnt = Counter ( [ int ( i ) for i in cin ( ) . split ( ) ] ) , 0 NEW_LINE while d [ k ] < n : for NEW_LINE i in range ( k - 1 , 0 , - 1 ) : NEW_LINE if d [ i ] : d [ i + 1 ] += 1 NEW_LINE d [ i ] -= 1 NEW_LINE cnt += 1 NEW_LINE print ( cnt ) NEW_LINE


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] a = new int [ 101 ] ; for ( int i = 0 ; i < n ; i ++ ) a [ sc . nextInt ( ) ] ++ ; int count = 0 ; while ( a [ k ] != n ) { for ( int i = k - 1 ; i > 0 ; i -- ) { if ( a [ i ] > 0 ) { a [ i ] -- ; a [ i + 1 ] ++ ; } } count ++ ; } System . out . println ( count ) ; sc . close ( ) ; } }


import java . io . * ; import java . math . BigDecimal ; import java . math . BigInteger ; import java . util . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;    public class Main1 {    public static void main ( String [ ] args ) {   try {    FastScanner in = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ;    int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; int A [ ] = in . readArray ( n ) ; int ct = 0 ; int ptr = 100000 ;   while ( ptr -- > 0 ) { boolean flag = false ; int prev = k ; for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( A [ i ] >= k ) continue ;   flag = true ; if ( A [ i ] != prev ) { prev = A [ i ] ; A [ i ] ++ ; }   } if ( flag ) ct ++ ; else break ; }   System . out . println ( ct ) ;                              out . flush ( ) ; out . close ( ) ;    } catch ( Exception e ) { return ; }                      }    static 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 ( ) ) ; }   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 ( ) ) ; } }    }


import java . util . * ; import java . io . * ;   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 ) { FastReader fr = new FastReader ( ) ; Scanner sc = new Scanner ( System . in ) ; int a = fr . nextInt ( ) , b = fr . nextInt ( ) , ab = fr . nextInt ( ) ; long ans = ab * 2L ; if ( a == b ) ans += 2L * a ; else ans += Math . min ( a , b ) * 2L + 1L ; System . out . println ( ans ) ; } }

def insertion_sort ( l ) : for i in range ( len ( l ) ) : for j in ( range ( i ) ) : k = i - j if l [ k ] >= l [ k - 1 ] : l [ k - 1 ] , l [ k ] = l [ k ] , l [ k - 1 ] else : break return l       def selection_sort ( l ) : for i in range ( len ( l ) ) : min_ind = i min_val = l [ i ] for j in range ( i , len ( l ) ) : if min_val > l [ j ] : min_val = l [ j ] min_ind = j l [ i ] , l [ min_ind ] = l [ min_ind ] , l [ i ] return l     def bubble_sort ( l ) : for i in range ( len ( l ) - 1 ) : for j in range ( len ( l ) - 1 - i ) : if l [ j ] > l [ j + 1 ] : l [ j ] , l [ j + 1 ] = l [ j + 1 ] , l [ j ] return l     NEW_LINE


a , b , c = map ( int , input ( ) . split ( ) ) if a < b : s = ( a * 2 + c * 2 ) else : s = ( b * 2 + c * 2 ) if a != b : s += 1 print ( s )   NEW_LINE


a , b , c = map ( int , input ( ) . split ( ) ) print ( 2 * min ( a , b ) + 2 * c + ( 0 if a == b else 1 ) ) NEW_LINE


temp = [ int ( x ) for x in input ( ) . split ( ) ] a = temp [ 0 ] b = temp [ 1 ] c = temp [ 2 ] x = a + cy = b + cif a > b : print ( 2 * c + 2 * b + 1 ) elif b > a : print ( 2 * c + 2 * a + 1 ) else : print ( 2 * c + 2 * a ) NEW_LINE


import sys   def main ( ) : a , b , c = map ( int , sys . stdin . read ( ) . strip ( ) . split ( ) ) return c * 2 + min ( a , b ) * 2 + bool ( b - a ) print ( main ( ) ) NEW_LINE


import java . io . FileInputStream ; import java . io . FileNotFoundException ; import java . io . IOException ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . List ; import java . util . Scanner ; import java . util . stream . Collectors ; public class _p001148A { static public void main ( final String [ ] args ) throws IOException { p001148A . _main ( args ) ; }


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


import java . util . * ; import java . text . * ;   public class B { static String [ ] s1 = null , s2 = null ; static int [ ] ss2 = new int [ 3 ] ; static Vector < Date > dates = new Vector < > ( ) ; static final String fs = " dd / MM / yyyy " ; static SimpleDateFormat format = new SimpleDateFormat ( fs ) ;   public static int age ( Date birthday , Date date ) { DateFormat formatter = new SimpleDateFormat ( " yyyyMMdd " ) ; int d1 = Integer . parseInt ( formatter . format ( birthday ) ) ; int d2 = Integer . parseInt ( formatter . format ( date ) ) ; int age = ( d2 - d1 ) / 10000 ; return age ; }   public static boolean val ( String x , String y , String z ) { try { format . parse ( x + " / " + y + " / " + "20" + z ) ; } catch ( ParseException e ) { return false ; } catch ( IllegalArgumentException e ) { return false ; } return true ; }   public static void main ( String [ ] args ) throws Exception { Scanner in = new Scanner ( System . in ) ; s1 = in . next ( ) . split ( " \\ . " ) ; s2 = in . next ( ) . split ( " \\ . " ) ; format . setLenient ( false ) ; for ( int i = 0 ; i < s2 . length ; i ++ ) ss2 [ i ] = Integer . parseInt ( s2 [ i ] ) ; Date d1 = format . parse ( s1 [ 0 ] + " / " + s1 [ 1 ] + " / 20" + s1 [ 2 ] ) ;   if ( val ( s2 [ 0 ] , s2 [ 1 ] , s2 [ 2 ] ) ) dates . add ( format . parse ( s2 [ 0 ] + " / " + s2 [ 1 ] + " / 20" + s2 [ 2 ] ) ) ;


t = tuple ( map ( int , input ( ) . split ( ' . ' ) ) )   dc = ( 0 , 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 )   def f ( d , m , y ) :   if m not in range ( 13 ) or d > dc [ m ] + ( m == 2 and y % 4 == 0 ) :   return False   else :   return t [ 2 ] - y > 18 or t [ 2 ] - y == 18 and ( m , d ) <= ( t [ 1 ] , t [ 0 ] )   a , b , c = map ( int , input ( ) . split ( ' . ' ) )   print ( ' YES ' if any ( ( f ( a , b , c ) , f ( a , c , b ) , f ( b , a , c ) , f ( b , c , a ) , f ( c , a , b ) , f ( c , b , a ) ) ) else ' NO ' )       NEW_LINE


d , m , y = map ( int , input ( ) . split ( ' . ' ) ) a , b , c = map ( int , input ( ) . split ( ' . ' ) )   months = [ 0 , 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 ] count = 0 while ( count < 6 ) : if b < c and c in range ( 13 ) and months [ c ] >= a + ( b % 4 == 0 and b == 2 ) : temp = b b = c c = temp count = 0 else : count += 1 if a < c and c <= ( months [ b ] + ( a % 4 == 0 and b == 2 ) ) : temp = c c = a a = temp count = 0 else : count += 1 if a < b and a in range ( 13 ) : temp = a a = b b = tempcount = 0 if y - c > 18 : print ( " YES " ) elif y - c == 18 : if m > b : print ( " YES " ) elif m == b : if d >= a : print ( " YES " ) else : print ( " NO " ) else : print ( " NO " ) else : print ( " NO " )   NEW_LINE


# import ipdb   class ReaderHelper ( object ) :   def __init__ ( self ) : self . currentLine = None self . currentIndex = - 1   def __call__ ( self ) : try : # ipdb . set_trace ( ) self . currentIndex += 1 if not self . currentLine or self . currentIndex >= len ( self . currentLine ) : self . currentIndex = 0 self . currentLine = raw_input ( ) . split ( ) return self . currentLine [ self . currentIndex ]   except EOFError : return None   next = ReaderHelper ( ) def next_int ( ) : return int ( next ( ) )    def main ( ) : n , m = next_int ( ) , next_int ( ) cluster1 , cluster2 = [ ] , [ ] size_a , size_b = 0 , 0   for i in xrange ( n ) : cluster1 . append ( next_int ( ) ) size_a += cluster1 [ i ]   for i in xrange ( m ) : cluster2 . append ( next_int ( ) ) size_b += cluster2 [ i ] cluster1 . sort ( ) cluster2 . sort ( ) max_a , max_b = size_b + size_a - cluster1 [ n - 1 ] , size_b + size_a - cluster2 [ m - 1 ] # moving from B to A i = 1 while i < n and max_a + size_b - cluster1 [ n - i - 1 ] < max_a : max_a = max_a + size_b - cluster1 [ n - i - 1 ] i += 1 # moving from A to B i = 1 while i < m and max_b + size_a - cluster2 [ m - i - 1 ] < max_b : max_b = max_b + size_a - cluster2 [ m - i - 1 ] i += 1 if max_a > max_b : max_a = max_b print max_a   " " " ▁ ▁ ▁ ▁ Suppose ▁ that ▁ we ▁ move ▁ all ▁ elements ▁ from ▁ B ▁ to ▁ A . ▁ ▁ ▁ ▁ ▁ then ▁ we ▁ need ▁ to ▁ maximize ▁ B * k + A - a _ 1 - a _ 2 - a _ 3 - . . . - a _ k TABSYMBOL " " "     	    main ( )

m , n = [ int ( x ) for x in raw_input ( ) . strip ( ) . split ( ) ] pm = [ int ( x ) for x in raw_input ( ) . strip ( ) . split ( ) ] pn = [ int ( x ) for x in raw_input ( ) . strip ( ) . split ( ) ] pm . sort ( ) pn . sort ( ) best = 10 ** 20   def coalesce ( first , second ) : ss = sum ( second ) totalcost = ss biggestb = max ( second ) coal = first [ - 1 ] ss = sum ( second ) for i in range ( len ( first ) - 1 ) : if coal < biggestb : coal += first [ i ] totalcost += first [ i ] continue if first [ i ] <= ss : coal += first [ i ] totalcost += first [ i ] else : totalcost += ss if coal < biggestb : return 10 ** 20 return totalcost best = min ( best , coalesce ( pm , pn ) ) best = min ( best , coalesce ( pn , pm ) )   if best == 10 ** 20 : best = 0 for i in pm : for j in pn : best += min ( i , j )   print best NEW_LINE


import java . util . List ; import java . util . Scanner ; import java . io . OutputStream ; import java . io . IOException ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Collections ; import java . io . InputStream ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskB solver = new TaskB ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } }   class TaskB { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int m , n ; m = in . nextInt ( ) ; n = in . nextInt ( ) ; ArrayList < Long > Ai = new ArrayList < Long > ( m ) ; Long sumA = new Long ( 0 ) ; for ( int i = 0 ; i < m ; ++ i ) { Ai . add ( in . nextLong ( ) ) ; sumA += Ai . get ( i ) ; } ArrayList < Long > Bi = new ArrayList < Long > ( n ) ; Long sumB = new Long ( 0 ) ; for ( int i = 0 ; i < n ; ++ i ) { Bi . add ( in . nextLong ( ) ) ; sumB += Bi . get ( i ) ; } Collections . sort ( Ai ) ; Collections . sort ( Bi ) ; Long As = sumA ; Long Bs = sumB ; for ( int i = 0 ; i < Ai . size ( ) - 1 ; ++ i ) { Bs += min ( Ai . get ( i ) , sumB ) ; } for ( int i = 0 ; i < Bi . size ( ) - 1 ; ++ i ) { As += min ( Bi . get ( i ) , sumA ) ; } out . println ( min ( As , Bs ) ) ; } private Long min ( Long a , Long b ) { return a > b ? b : a ; } }


import java . util . * ; import java . io . * ; public class b { public static void main ( String [ ] args ) throws IOException { input . init ( System . in ) ; int n = input . nextInt ( ) , m = input . nextInt ( ) ; int [ ] as = new int [ n ] , bs = new int [ m ] ; for ( int i = 0 ; i < n ; i ++ ) as [ i ] = input . nextInt ( ) ; for ( int i = 0 ; i < m ; i ++ ) bs [ i ] = input . nextInt ( ) ; System . out . println ( Math . min ( go ( as , bs ) , go ( bs , as ) ) ) ; } static long go ( int [ ] a , int [ ] b ) { long sum = 0 ; for ( int x : b ) sum += x ; long res = 0 ; int max = 0 ; for ( int i = 0 ; i < a . length ; i ++ ) { max = Math . max ( max , a [ i ] ) ; res += Math . min ( a [ i ] , sum ) ; } return res + sum - Math . min ( max , sum ) ; } public static class input { static BufferedReader reader ; static StringTokenizer tokenizer ;   static void init ( InputStream input ) { reader = new BufferedReader ( new InputStreamReader ( input ) ) ; tokenizer = new StringTokenizer ( " " ) ; }   static String next ( ) throws IOException { while ( ! tokenizer . hasMoreTokens ( ) ) {


import java . util . * ; import java . io . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastScanner in = new FastScanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; int t = in . nextInt ( ) ; Main m = new Main ( ) ; while ( t -- > 0 ) { m . run ( in , out ) ; } out . close ( ) ; }   public static long mod = 17352642619633L ;   void run ( FastScanner in , PrintWriter out ) {

t = int ( input ( ) ) for _ in range ( t ) : n , m = map ( int , input ( ) . split ( ) ) m = str ( m ) if len ( set ( m ) ) == 1 and m [ - 1 ] == '9' : print ( n * ( len ( m ) ) ) else : print ( n * ( len ( m ) - 1 ) ) NEW_LINE


t = int ( input ( ) ) for i in range ( t ) : c = 0 a , b = input ( ) . split ( ) a = int ( a ) b = int ( b ) flg = 0 if ( b < 9 ) : print ( "0" ) else : while ( b != 0 ) : x = b % 10 if ( x != 9 ) : flg = 1 c = c + 1 b = int ( b / 10 ) if ( flg == 1 ) : c = c - 1 v = a * c print ( v ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : l = list ( input ( ) . split ( ) ) a = l [ 0 ] b = l [ 1 ] x = len ( b ) if ( '9' * len ( b ) != b ) : x = x - 1 print ( int ( a ) * x ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : a , b = map ( int , input ( ) . split ( ) ) print ( a * ( len ( str ( b + 1 ) ) - 1 ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . HashSet ; import java . util . List ; import java . util . Map ; import java . util . Set ; import java . util . StringTokenizer ; import java . util . TreeMap ;    public class Main implements Runnable { int n , m ; static boolean use_n_tests = true ;   void solve ( FastScanner in , PrintWriter out , int testNumber ) {


import java . util . Scanner ;   public class MemeProblem { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long p = 1 , c = 0 ; while ( Math . pow ( 10 , p ) - 1 <= b ) { c += a ; p ++ ; } System . out . println ( c ) ; } } }


import java . io . * ; import java . math . BigInteger ; import java . util . * ; import java . util . Stack ;    public class Main { public static class FastReader { BufferedReader br ; StringTokenizer root ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( root == null || ! root . hasMoreTokens ( ) ) { try { root = new StringTokenizer ( br . readLine ( ) ) ; } catch ( Exception r ) { r . printStackTrace ( ) ; } } return root . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( Exception r ) { r . printStackTrace ( ) ; } return str ; } } public static PrintWriter out = new PrintWriter ( new BufferedOutputStream ( System . out ) ) ; static int mod = ( int ) ( 1e9 + 7 ) ; static long cf = 998244353 ; static final int MAX = ( int ) ( 1e5 + 1 ) ; static int dfs = 0 , bridges = 0 ; public static List < Integer > [ ] edges ; public static int [ ] [ ] parent ; public static int col = 20 ; public static long [ ] Bit ; public static long [ ] fac , inv ; public static int [ ] prime ; public static long [ ] dp , idx , low ; public static boolean found = false ; public static boolean [ ] vis ; public static TreeSet < Pair > st = new TreeSet < > ( ) ; public static FastReader sc = new FastReader ( ) ; public static void main ( String [ ] args ) {

import randomimport sys   def valid ( st ) : return len ( set ( x for x in st ) ) == 4   def comp ( guess , secret ) : b , c = 0 , 0 for i in range ( 4 ) : if secret [ i ] == guess [ i ] : b += 1 elif secret [ i ] in guess : c += 1 return ( b , c )   def check ( guess , secret , bulls , cows ) : b , c = comp ( guess , secret ) return bulls == b and cows == c   def filtered ( candidates , history ) : ret = [ ] for c in candidates : good = True for query , res in history : if not check ( c , query , res [ 0 ] , res [ 1 ] ) : good = False if good : ret . append ( c ) return ret   def next_guess ( candidates , step ) : if step < 2 : return candidates [ random . randint ( 0 , len ( candidates ) - 1 ) ] NEW_LINE


import sys   Secret = "7321" testing = False     def get_response ( query ) : if testing : print ( query ) bulls = 0 cows = 0 for x in range ( len ( query ) ) : if query [ x ] == Secret [ x ] : bulls += 1 elif query [ x ] in Secret : cows += 1 return [ bulls , cows ] else : print ( query ) sys . stdout . flush ( ) return [ int ( x ) for x in input ( ) . split ( " ▁ " ) ]     class CodeforcesTask753BSolution : def __init__ ( self ) : self . result = ' '   def read_input ( self ) : pass   def process_task ( self ) : l = - 1 digi_cnt = [ 0 for x in range ( 10 ) ] mak = False while True : NEW_LINE


import java . io . * ; import java . util . * ; @ SuppressWarnings ( " unused " ) public class Solution {


import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int arr [ ] = new int [ n ] ; int prefix [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = s . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { if ( i < 2 ) { prefix [ i ] = arr [ i ] ; } else { prefix [ i ] = prefix [ i - 2 ] + arr [ i ] ; } } int suffix [ ] = new int [ n ] ; for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( i + 2 >= n ) { suffix [ i ] = arr [ i ] ;   } else { suffix [ i ] = suffix [ i + 2 ] + arr [ i ] ; } } int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int left = 0 , right = 0 ; if ( i > 0 ) { left = prefix [ i - 1 ] ; } if ( i + 2 < n ) { left += suffix [ i + 2 ] ; } if ( i > 1 ) { right = prefix [ i - 2 ] ; } if ( i + 1 < n ) { right += suffix [ i + 1 ] ; } if ( left == right ) { count ++ ; }   } System . out . println ( count ) ;   } }

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) s1 , s2 = 0 , 0 for i in range ( n ) : if i % 2 == 0 : s1 += a [ i ] else : s2 += a [ i ]   ans = 0 pre = 0 ev , od = 0 , 0 for i in range ( n ) : if i % 2 == 0 : s1 -= a [ i ] od += pre else : s2 -= a [ i ] ev += pre if ev + s2 == od + s1 : ans += 1 pre = a [ i ] print ( ans ) NEW_LINE


n = int ( input ( ) ) d = [ 0 ] arr = list ( map ( int , input ( ) . split ( ) ) ) for i , c in enumerate ( arr ) : if i % 2 == 0 : d . append ( d [ - 1 ] + c ) else : d . append ( d [ - 1 ] - c ) ans = 0 for i in range ( 1 , len ( d ) ) : if d [ i - 1 ] == d [ - 1 ] - d [ i ] : ans += 1 print ( ans ) NEW_LINE


n = int ( input ( ) ) A = [ int ( i ) for i in input ( ) . split ( ) ] ans = 0 S = [ 0 , 0 ] for i , a in enumerate ( A ) : S [ i % 2 ] += a S [ 0 ] -= A [ 0 ] if S [ 0 ] == S [ 1 ] : ans += 1 for i in range ( 1 , n ) : S [ i % 2 ] -= A [ i ] S [ i % 2 ] += A [ i - 1 ] if S [ 0 ] == S [ 1 ] : ans += 1 print ( ans ) NEW_LINE


'''   ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ Online ▁ Python ▁ Compiler . ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ Code , ▁ Compile , ▁ Run ▁ and ▁ Debug ▁ python ▁ program ▁ online . Write ▁ your ▁ code ▁ in ▁ this ▁ editor ▁ and ▁ press ▁ " Run " ▁ button ▁ to ▁ execute ▁ it .   '''   n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) m = [ 0 ] * ne = 0 o = 0 for i in range ( n ) : if ( ( i + 1 ) % 2 == 0 ) : e += l [ i ] m [ i ] = 1 else : o += l [ i ] m [ i ] = 2 o -= l [ 0 ] c = 0 if ( e == o ) : c += 1 for i in range ( 1 , n ) : if ( m [ i ] == 1 ) : e -= l [ i ] e += l [ i - 1 ] if ( e == o ) : c += 1 else : o -= l [ i ] o += l [ i - 1 ] if ( e == o ) : c += 1 print ( c ) NEW_LINE


import java . io . * ; import java . util . * ;    public class D { public static void main ( String [ ] args ) { FastScanner sc = new FastScanner ( System . in ) ; int n = sc . nextInt ( ) ; long arr [ ] = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } long a [ ] [ ] = new long [ 4 ] [ n + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { if ( i % 2 == 0 ) { a [ 0 ] [ i + 1 ] = arr [ i ] + ( i - 2 < 0 ? 0 : a [ 0 ] [ i - 1 ] ) ;


import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   public class temp4 { 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 ; } } static class Print { private final BufferedWriter bw ; public Print ( ) { bw = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ; } public void print ( String str ) throws IOException { bw . append ( str ) ; } public void println ( String str ) throws IOException { print ( str ) ; bw . append ( " \n " ) ; } public void close ( ) throws IOException { bw . close ( ) ; } } public static void main ( String [ ] args ) throws IOException { FastReader scn = new FastReader ( ) ;


import java . util . * ; import java . io . * ; public class B { public static FastReader sc = new FastReader ( ) ; public static PrintWriter out = new PrintWriter ( System . out ) ; public static void taskSolver ( ) { int n = sc . nextInt ( ) ; int ans = 0 ; int arr [ ] = new int [ n + 1 ] ; int oddsuff = 0 ; int evensuff = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; if ( i % 2 == 0 ) evensuff += arr [ i ] ; else oddsuff += arr [ i ] ; } int oddpref = 0 , evenpref = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { if ( i % 2 == 0 ) evensuff -= arr [ i ] ; else oddsuff -= arr [ i ] ; if ( oddpref + evensuff == evenpref + oddsuff ) ans ++ ; if ( i % 2 == 0 ) evenpref += arr [ i ] ; else oddpref += arr [ i ] ; } out . println ( ans ) ; } public static void main ( String args [ ] ) throws java . lang . Exception { taskSolver ( ) ; out . close ( ) ; } 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 . util . * ; import java . lang . * ; import java . io . * ;   public class Code { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int odd = 0 ; int even = 0 ; int next = 0 ; int interchange = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; if ( i % 2 == 0 ) { even = even + a [ i ] ; } else { odd = odd + a [ i ] ; } } int count = 0 ; even = even - a [ 0 ] ; interchange = even ; even = odd ; odd = interchange ; if ( odd == even ) { count ++ ; } next = a [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { if ( i % 2 == 0 ) { odd = odd - a [ i ] + next ; } else { even = even - a [ i ] + next ; } if ( odd == even ) { count ++ ; } next = a [ i ] ; } System . out . println ( count ) ; } }


import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStream ; import java . io . OutputStreamWriter ; import java . io . PrintWriter ; import java . io . Writer ; import java . util . InputMismatchException ;   public class SpiderMan {   public static void main ( String [ ] args ) { InputReader in = new InputReader ( System . in ) ;

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) odd = 0 even = 0 turn = 0 for i in range ( n ) : if a [ i ] % 2 == 0 : even += 1 if even % 2 != 0 : print ( 1 ) else : print ( 2 ) NEW_LINE


import math   n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) )   e = 0 for i in range ( n ) : e += a [ i ] - 1 if e % 2 == 0 : print ( 2 ) else : print ( 1 ) NEW_LINE


n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) v = 0 for i in l : v ^= i - 1 if ( v & 1 ) : print ( 1 ) else : print ( 2 ) NEW_LINE


import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStream ; import java . io . OutputStreamWriter ; import java . io . PrintWriter ; import java . io . Writer ; import java . util . InputMismatchException ; import java . util . Scanner ;   public class SpiderMan {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ;


import java . util . * ;   public class questionCF {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextInt ( ) ; long k = sc . nextInt ( ) ; if ( k == 1 ) { System . out . println ( n + 1 ) ; return ; } if ( n % k == 0 ) ++ n ; long x = n % k ; System . out . println ( n + ( k - x ) ) ; } }

n , m = map ( int , input ( ) . split ( ) ) x = n % mif ( x == 0 ) : print ( n + m ) else : print ( n + ( m - x ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( ' ▁ ' ) ) if n % k == 0 : print ( n + k ) else : ans = 0 i = n // k while ans < n : ans = k * i i += 1 print ( ans ) NEW_LINE


n , k = map ( int , input ( ) . split ( ' ▁ ' ) ) if n % k == 0 : print ( n + k ) else : ans = 0 i = n // k print ( k * ( i + 1 ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) print ( n + k - ( n % k ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) ceil = ( n + k - 1 ) // kif ceil * k > n : print ( ceil * k ) else : print ( ceil * k + k ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   public class johny { public static void main ( String [ ] args ) { FastScanner scan = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ;   long n = scan . nextInt ( ) , k = scan . nextInt ( ) ; out . println ( n + ( k - n % k ) ) ; out . close ( ) ; } static class FastScanner { BufferedReader br ; StringTokenizer st ;   public FastScanner ( ) { try { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } }   public String next ( ) { if ( st . hasMoreTokens ( ) ) return st . nextToken ( ) ; try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; }   public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   public long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   public double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   public String nextLine ( ) { String line = " " ; if ( st . hasMoreTokens ( ) ) line = st . nextToken ( ) ; else try { return br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } while ( st . hasMoreTokens ( ) ) line += " ▁ " + st . nextToken ( ) ; return line ; } } }


import java . util . * ; import java . io . * ; public class test { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = Integer . parseInt ( st . nextToken ( ) ) ; int k = Integer . parseInt ( st . nextToken ( ) ) ; out . println ( ( n / k + 1 ) * k ) ; out . close ( ) ; } }


import java . util . * ; import java . io . * ; public class test { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = Integer . parseInt ( st . nextToken ( ) ) ; int k = Integer . parseInt ( st . nextToken ( ) ) ; System . out . println ( ( n / k + 1 ) * k ) ; } }


import java . math . * ; import java . util . * ; import java . io . * ; public class er105b {


import java . util . Scanner ;   public class _30_Chips {   public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ;   int n = scn . nextInt ( ) ; int k = scn . nextInt ( ) ; boolean [ ] row = new boolean [ n ] ; boolean [ ] col = new boolean [ n ] ; for ( int i = 0 ; i < k ; i ++ ) { int val = scn . nextInt ( ) ; int val2 = scn . nextInt ( ) ; row [ val - 1 ] = true ; col [ val2 - 1 ] = true ; } long ans = 0 ; for ( int i = 1 ; i < n - 1 ; i ++ ) { if ( n % 2 == 1 && i == n / 2 ) { if ( ! row [ i ] || ! col [ i ] ) { ans ++ ; } } else if ( ! row [ i ] || ! col [ i ] ) { ans = ans + ( ( ! row [ i ] && ! col [ i ] ) ? 2 : 1 ) ; } } System . out . println ( ans ) ; }   }

I = inputn , m = map ( int , I ( ) . split ( ) ) b = [ 1 ] * n * 2 b [ 0 ] = b [ n - 1 ] = b [ n ] = b [ 2 * n - 1 ] = 0 for i in range ( m ) : r , c = map ( int , I ( ) . split ( ) ) b [ r - 1 ] = b [ n + c - 1 ] = 0 if n % 2 and b [ n // 2 ] and b [ n + n // 2 ] : b [ n // 2 ] = 0 print ( sum ( b ) ) NEW_LINE


I = inputn , m = map ( int , I ( ) . split ( ) ) b = [ 1 ] * n * 2 b [ 0 ] = b [ n - 1 ] = b [ n ] = b [ 2 * n - 1 ] = 0 for i in range ( m ) : r , c = map ( int , I ( ) . split ( ) ) b [ r - 1 ] = b [ n + c - 1 ] = 0 if n % 2 and b [ n // 2 ] and b [ n + n // 2 ] : b [ n // 2 ] = 0 print ( sum ( b ) )       NEW_LINE


import java . io . * ; import java . util . * ;   public class icpc { public static void main ( String [ ] args ) throws IOException { Reader in = new Reader ( ) ;


import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . * ;     public class Chips {   public static void main ( String [ ] args ) {   InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader sc = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Solver solver = new Solver ( ) ;


import java . util . Scanner ;   public class RegBracketSeq { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int a = in . nextInt ( ) , b = in . nextInt ( ) , c = in . nextInt ( ) , d = in . nextInt ( ) ;   in . close ( ) ; System . out . println ( a == d ? c > 0 ? a > 0 ? 1 : 0 : 1 : 0 ) ; } }

cnt = [ ]   for i in range ( 4 ) : cnt . append ( int ( input ( ) ) ) if ( cnt [ 0 ] == cnt [ 3 ] and ( cnt [ 2 ] == 0 or cnt [ 0 ] > 0 ) ) : print ( 1 ) else : print ( 0 ) NEW_LINE


import sysimport mathimport itertoolsimport functoolsimport collectionsimport operatorimport fileinputimport copyfrom collections import * ORDA = 97 NEW_LINE


cnt1 = int ( input ( ) ) cnt2 = int ( input ( ) ) cnt3 = int ( input ( ) ) cnt4 = int ( input ( ) ) if cnt1 == cnt4 and ( cnt3 == 0 or cnt1 ) : print ( 1 ) else : print ( 0 ) NEW_LINE


import sys , mathsys . setrecursionlimit ( 10 ** 8 ) ''' def ▁ fun ( ) : ▁ ▁ ▁ ▁ for ▁ i ▁ in ▁ range ( 16 ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ for ▁ j ▁ in ▁ range ( 4 ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ i & (1 < < j ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ print ( j , end = ' ' ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ print ( ) import ▁ binarytreefrom ▁ collections ▁ import ▁ dequebst ▁ = ▁ binarytree . tree ( height = 4 , is _ perfect = True ) print ( bst ) def ▁ s ( bst ) : ▁ ▁ ▁ ▁ if ▁ bst : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ bst . left , bst . right ▁ = ▁ bst . right , bst . left ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ s ( bst . right ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ s ( bst . left ) s ( bst ) print ( bst ) ''' cnt1 = int ( input ( ) ) cnt2 = int ( input ( ) ) cnt3 = int ( input ( ) ) cnt4 = int ( input ( ) ) if cnt1 + cnt3 + cnt4 == 0 : print ( 1 ) elif ( cnt1 * 2 + cnt3 == cnt3 + cnt4 * 2 ) and cnt1 != 0 and cnt4 != 0 : print ( 1 ) else : print ( 0 ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Regular_B_Seq { 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 ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } } public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; long cnt1 = in . nextLong ( ) ; long cnt2 = in . nextLong ( ) ; long cnt3 = in . nextLong ( ) ; long cnt4 = in . nextLong ( ) ;   if ( cnt1 == cnt4 ) { if ( cnt3 > 0 ) { if ( cnt1 > 0 ) { System . out . println ( 1 ) ; } else { System . out . println ( 0 ) ; } } else { System . out . println ( 1 ) ; } } else { System . out . println ( 0 ) ; } } }


import java . util . * ; import java . lang . * ; import java . io . * ;   public class Main { PrintWriter out = new PrintWriter ( System . out ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer tok = new StringTokenizer ( " " ) ; String next ( ) throws IOException { if ( ! tok . hasMoreTokens ( ) ) { tok = new StringTokenizer ( in . readLine ( ) ) ; } return tok . nextToken ( ) ; } int ni ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; } long nl ( ) throws IOException { return Long . parseLong ( next ( ) ) ; } long mod = 1000000007 ; void solve ( ) throws IOException { int a = ni ( ) , b = ni ( ) , c = ni ( ) , d = ni ( ) ; if ( a == d && ( c == 0 || a > 0 ) ) out . println ( 1 ) ; else out . println ( 0 ) ; out . flush ( ) ; } int gcd ( int a , int b ) { return ( b == 0 ? a : gcd ( b , a % b ) ) ; } long gcd ( long a , long b ) { return ( b == 0 ? a : gcd ( b , a % b ) ) ; } long mp ( long a , long p ) { long r = 1 ; while ( p > 0 ) { if ( ( p & 1 ) == 1 ) r = ( r * a ) % mod ; p >>= 1 ; a = ( a * a ) % mod ; } return r ; } public static void main ( String [ ] args ) throws IOException { new Main ( ) . solve ( ) ; } }


import java . util . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class a { static int [ ] count , count1 ; static long [ ] arr ; static char [ ] ch , ch1 ; static int [ ] darr ; static Character [ ] [ ] mat , mat1 ; static int x , h ; static long maxl ; static double dec ; static String s ; static long minl ; static int mx = ( int ) 1e6 ; static long mod = 998244353l ;


import java . util . Scanner ;   public class B1447 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int R = in . nextInt ( ) ; int C = in . nextInt ( ) ; int sum = 0 ; int min = Integer . MAX_VALUE ; int negative = 0 ; for ( int r = 0 ; r < R ; r ++ ) { for ( int c = 0 ; c < C ; c ++ ) { int a = in . nextInt ( ) ; if ( a < 0 ) { negative ++ ; } a = Math . abs ( a ) ; sum += a ; min = Math . min ( min , a ) ; } } int answer = ( negative % 2 == 0 ) ? sum : ( sum - 2 * min ) ; System . out . println ( answer ) ; } }   }

for _ in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) ) NEW_LINE d = list ( ) NEW_LINE s = 0 NEW_LINE ans = 0 NEW_LINE l = list ( ) NEW_LINE for i in range ( n ) : a = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE for k in a : if NEW_LINE k < 0 : ans += 1 NEW_LINE s += abs ( k ) NEW_LINE l . append ( abs ( k ) ) NEW_LINE if ans % 2 == 1 : s = s - 2 * min ( l ) NEW_LINE print ( s ) NEW_LINE


def solve ( ) : pass NEW_LINE   t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n , m = map ( int , input ( ) . split ( ) ) NEW_LINE cnt_negative , min_value , sm = 0 , 100 , 0 NEW_LINE for i in range ( n ) : for NEW_LINE x in map ( int , input ( ) . split ( ) ) : min_value = min ( min_value , abs ( x ) ) NEW_LINE sm += abs ( x ) NEW_LINE if x < 0 : cnt_negative += 1 NEW_LINE if cnt_negative % 2 == 0 : NEW_LINE INDENT print ( sm ) else : NEW_LINE print ( sm - 2 * min_value ) NEW_LINE DEDENT


R = lambda : map ( int , input ( ) . split ( ) ) NEW_LINE t , = R ( ) NEW_LINE for _ in [ 0 ] * t : n , m = R ( ) ; a = [ ] ; f = 0 NEW_LINE for _ in [ 0 ] * n : for NEW_LINE x in R ( ) : a += abs ( x ) , ; NEW_LINE f ^= x < 0 NEW_LINE print ( sum ( a ) - 2 * min ( a ) * f ) NEW_LINE


t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n , m = map ( int , input ( ) . split ( ) ) NEW_LINE c = 0 NEW_LINE s = 0 NEW_LINE min1 = 999999 NEW_LINE for i in range ( n ) : a = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE for j in a : if NEW_LINE INDENT ( j < 0 ) : c += 1 NEW_LINE DEDENT s += abs ( j ) NEW_LINE min1 = min ( min1 , abs ( j ) ) NEW_LINE


import java . util . Scanner ;   public class _0712NumbersBox {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int cases = sc . nextInt ( ) ; while ( cases > 0 ) { int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; long min = Long . MAX_VALUE ; long sum = 0 ; long pos = 0 ; long neg = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { long temp = sc . nextLong ( ) ; if ( temp > 0 ) { pos ++ ; } else { neg ++ ; } sum += Math . abs ( temp ) ; min = Math . min ( min , Math . abs ( temp ) ) ; } } if ( neg % 2 != 0 ) { sum -= 2 * min ; } System . out . println ( sum ) ; cases -- ; } } }


import java . util . * ; import static java . lang . Math . abs ; import static java . lang . Math . min ;   public class Test { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int t = input . nextInt ( ) ;   while ( t -- > 0 ) {   int n = input . nextInt ( ) ; int m = input . nextInt ( ) ; int [ ] [ ] a = new int [ n ] [ m ] ;   for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { a [ i ] [ j ] = input . nextInt ( ) ; } }   int sum = 0 , neg = 0 , min = abs ( a [ 0 ] [ 0 ] ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) {   if ( a [ i ] [ j ] < 0 ) { neg ++ ; } min = min ( abs ( a [ i ] [ j ] ) , min ) ; sum += abs ( a [ i ] [ j ] ) ; } } System . out . println ( ( neg % 2 == 0 ) ? sum : sum - 2 * min ) ; } } }


import java . io . * ; import java . util . StringTokenizer ;


import java . util . * ; import java . io . * ;   public class AlyonaAndTree { static int n ; static int [ ] a ; static ArrayList < Edge > [ ] tree ;   static int [ ] [ ] lift ; static long [ ] depth ; static int d ; static int [ ] add ; static int [ ] low ; static int [ ] hig ; static int [ ] ans ;   public static void main ( String [ ] args ) { JS scan = new JS ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; n = scan . nextInt ( ) ; a = new int [ n ] ; tree = new ArrayList [ n ] ; add = new int [ n ] ; low = new int [ n ] ; hig = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = scan . nextInt ( ) ; tree [ i ] = new ArrayList < Edge > ( ) ; } d = Integer . numberOfTrailingZeros ( Integer . highestOneBit ( n ) ) + 1 ; depth = new long [ n ] ; lift = new int [ d ] [ n ] ; for ( int k = 0 ; k < d ; k ++ ) Arrays . fill ( lift [ k ] , - 1 ) ; for ( int i = 1 ; i < n ; i ++ ) { int p = scan . nextInt ( ) - 1 ; int w = scan . nextInt ( ) ; tree [ p ] . add ( new Edge ( i , w ) ) ; } dfs ( 0 ) ; for ( int k = 1 ; k < d ; k ++ ) for ( int i = 0 ; i < n ; i ++ ) if ( lift [ k - 1 ] [ i ] != - 1 ) lift [ k ] [ i ] = lift [ k - 1 ] [ lift [ k - 1 ] [ i ] ] ; for ( int i = 0 ; i < n ; i ++ ) { int lo = 0 ; int hi = d - 1 ; int at = i ; int count = 0 ;

from itertools import accumulatefrom math import * import os , sysimport threadingfrom io import BytesIOfrom bisect import bisect_left   input = BytesIO ( os . read ( 0 , os . fstat ( 0 ) . st_size ) ) . readline   n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) e = { } g = [ [ ] for i in range ( n ) ] d = [ 0 ] * ( n + 5 ) ans = [ 0 ] * np = [ 0 ] * ( n + 5 ) for i in range ( n - 1 ) : c , w = map ( int , input ( ) . split ( ) ) c -= 1 g [ c ] . append ( i + 1 ) e [ i + 1 ] = w def dfs ( i , h ) : global ans , a , e , g , d , p p [ h ] = 0 for j in g [ i ] : d [ h + 1 ] = d [ h ] + e [ j ] dfs ( j , h + 1 ) x = bisect_left ( d , d [ h ] - a [ i ] , 0 , h + 1 ) NEW_LINE


import sysimport threadingfrom bisect import bisect_left   n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) e = { } g = [ [ ] for i in range ( n ) ] d = [ 0 ] * ( n + 5 ) ans = [ 0 ] * np = [ 0 ] * ( n + 5 )   for i in range ( n - 1 ) : c , w = map ( int , input ( ) . split ( ) ) c -= 1 g [ c ] . append ( i + 1 ) e [ i + 1 ] = w   def dfs ( i , h ) : global ans , a , e , g , d , p p [ h ] = 0 for j in g [ i ] : d [ h + 1 ] = d [ h ] + e [ j ] dfs ( j , h + 1 ) x = bisect_left ( d , d [ h ] - a [ i ] , 0 , h + 1 ) NEW_LINE


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 alpha1b {

n , k = [ int ( j ) for j in input ( ) . split ( ) ] nums = [ int ( j ) for j in input ( ) . split ( ) ] s = sum ( nums [ : k ] ) tot = sp1 , p2 = 0 , kfor j in range ( n - k ) : s -= nums [ p1 ] s += nums [ p2 ] tot += s p1 += 1 p2 += 1 print ( tot / ( n - k + 1 ) ) NEW_LINE


n , k = list ( map ( int , input ( ) . split ( ) ) ) a = list ( map ( int , input ( ) . split ( ) ) ) r , s , x = n - k + 1 , 0 , [ ] x . append ( a [ 0 ] ) for i in range ( 1 , n + 1 ) : x . append ( x [ i - 1 ] + a [ i - 1 ] ) for i in range ( k , n + 1 ) : s += x [ i ] - x [ i - k ] print ( s / r ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) )   A = list ( map ( int , input ( ) . split ( ) ) )   acc = sum ( [ min ( i + 1 , n - i , n - k + 1 , k ) * A [ i ] for i in range ( n ) ] )   print ( acc / ( n - k + 1 ) ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) x = list ( map ( int , input ( ) . split ( ) ) )   ss = 0 c = 0 l = 0 f = 0 for i in range ( len ( x ) ) : ss += x [ i ] if ( i == m - 1 and l == 0 ) : c += ss l = 1 elif ( l == 1 ) : ss -= x [ f ] c += ss f += 1                     print ( c / ( n - m + 1 ) ) NEW_LINE


n , k = list ( map ( int , input ( ) . split ( " ▁ " ) ) )   li = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) sum = 0 for x in range ( k ) : sum = sum + li [ x ]   i = 0j = kres = sumfor x in range ( n - k ) : sum = sum - li [ i ] + li [ j ] res = res + sum   i += 1 j += 1     print ( res / ( n - k + 1 ) ) 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 pca2 {   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 ) ) ) ; public static void main ( String args [ ] ) {   int tc = 1 ;


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


import java . util . Locale ; import java . util . Scanner ;   public class B808 {   public static void main ( String [ ] args ) { Locale . setDefault ( Locale . US ) ; Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; int K = in . nextInt ( ) ; double sum = 0 ; for ( int n = 1 ; n <= N ; n ++ ) { int a = in . nextInt ( ) ; double count = Math . min ( Math . min ( n , N + 1 - n ) , Math . min ( K , N - K + 1 ) ) ; sum += a * count ; } sum /= N - K + 1 ; System . out . println ( sum ) ; }   }


import java . util . * ; import java . io . * ; import java . lang . * ;    public class graph { static long mod = 10000_00007 ; public static void main ( String [ ] args ) throws Exception { InputStreamReader ip = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( ip ) ;

n , m , k = map ( int , input ( ) . split ( ) ) e = [ tuple ( map ( int , input ( ) . split ( ) ) ) for _ in range ( m ) ] if k : a = set ( map ( int , input ( ) . split ( ) ) ) else : a = set ( ) ans = - 1 for i in e : if i [ 0 ] in a and i [ 1 ] not in a or i [ 1 ] in a and i [ 0 ] not in a : if ans == - 1 : ans = i [ 2 ] else : ans = min ( ans , i [ 2 ] ) print ( ans ) NEW_LINE


n , m , k = map ( int , input ( ) . split ( ) ) if k == 0 : print ( - 1 ) else : city = [ 0 ] * ( n + 1 ) a = [ ] for i in range ( m ) : a . append ( list ( map ( int , input ( ) . split ( ) ) ) ) b = list ( map ( int , input ( ) . split ( ) ) ) for i in range ( k ) : city [ b [ i ] ] = 1 mini = 10000000000 for i in range ( m ) : if city [ a [ i ] [ 0 ] ] == 1 and city [ a [ i ] [ 1 ] ] == 0 : if a [ i ] [ 2 ] < mini : mini = a [ i ] [ 2 ] elif city [ a [ i ] [ 0 ] ] == 0 and city [ a [ i ] [ 1 ] ] == 1 : if a [ i ] [ 2 ] < mini : mini = a [ i ] [ 2 ] if mini == 10000000000 : print ( - 1 ) else : print ( mini ) NEW_LINE


import sysinput = sys . stdin . readline   x , y , z = map ( int , input ( ) . split ( ) ) dict1 = { } for _ in range ( y ) : a , b , c = map ( int , input ( ) . split ( ) ) if a in dict1 . keys ( ) : dict1 [ a ] . append ( [ b , c ] ) else : dict1 [ a ] = [ [ b , c ] ] if b in dict1 . keys ( ) : dict1 [ b ] . append ( [ a , c ] ) else : dict1 [ b ] = [ [ a , c ] ] ans = 1e18 if z : * li , = map ( int , input ( ) . split ( ) ) li = set ( li ) for i in dict1 . keys ( ) : for j in dict1 [ i ] : if i in li and j [ 0 ] in li : continue elif i in li or j [ 0 ] in li : ans = min ( ans , j [ 1 ] ) print ( - 1 if ans == 1e18 else ans ) NEW_LINE