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 = true ; static boolean memory = true ; static FastScanner f ; static PrintWriter pw ; static double eps = ( double ) 1e-6 ; static int oo = ( int ) 2e9 ;


n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) cnt = [ 0 ] * ( 10 ** 6 + 100 ) for i in l : cnt [ i ] += 1 s = 0 ans = 0 for i in cnt : s += i ans += s % 2 s //= 2 print ( ans ) NEW_LINE


import sysreadline = sys . stdin . readline   N = int ( readline ( ) ) A = list ( map ( int , readline ( ) . split ( ) ) ) K = 100 + max ( A ) L = [ 0 ] * Kfor a in A : L [ a ] += 1   for i in range ( K ) : if L [ i ] > 1 : L [ i + 1 ] += L [ i ] // 2 L [ i ] = L [ i ] % 2 print ( sum ( L ) ) NEW_LINE


import osimport sysfrom io import BytesIO , IOBaseBUFSIZE = 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


import java . util . * ; public class Solution { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String args [ ] ) { int n = sc . nextInt ( ) ; int a = n / 2 ; int b = n / 2 + ( n % 2 ) ; int ans = ( a + 1 ) * ( b + 1 ) ; if ( n % 2 != 0 ) ans *= 2 ; System . out . println ( ans ) ; } }

n = int ( input ( ) ) NEW_LINE if ( n % 2 == 0 ) : NEW_LINE INDENT print ( int ( ( n / 2 + 1 ) ** 2 ) ) else : NEW_LINE n = ( n + 1 ) / 2 NEW_LINE DEDENT print ( int ( 4 + ( ( n - 1 ) * ( 2 * 8 + ( n - 2 ) * 4 ) ) / 2 ) ) NEW_LINE


n = int ( input ( ) ) NEW_LINE m = n // 2 l = n - mans = ( m + 1 ) * ( l + 1 ) NEW_LINE if n % 2 == 1 : ans *= 2 NEW_LINE print ( ans ) NEW_LINE


n = int ( input ( ) ) NEW_LINE res = 0 NEW_LINE if n % 2 : NEW_LINE INDENT res = ( 2 + n // 2 ) * ( n + 1 ) else : NEW_LINE res = ( 1 + n // 2 ) ** 2 NEW_LINE DEDENT print ( res ) NEW_LINE


n = int ( input ( ) )   if n % 2 == 0 : NEW_LINE INDENT print ( int ( ( ( n / 2 ) + 1 ) * ( ( n / 2 ) + 1 ) ) ) else : NEW_LINE print ( int ( ( 2 + ( n - 1 ) / 2 ) * ( 2 * ( ( n - 1 ) / 2 + 1 ) ) ) ) NEW_LINE DEDENT


import java . util . Scanner ;   public class T0406 {   public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; System . out . println ( f ( n ) ) ;   }   private static int f ( int n ) { if ( n == 1 ) { return 4 ; } if ( n == 2 ) { return 4 ; } if ( n == 3 ) { return 12 ; } if ( n % 2 == 0 ) { return ( n / 2 + 1 ) * ( n / 2 + 1 ) ; } else { return ( n / 2 + 2 ) * ( n / 2 + 1 ) * 2 ; } }   }


import java . util . Scanner ; public class suanfa5 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = 0 ; if ( n % 2 == 0 ) { int res = ( n / 2 + 1 ) ; m = res * res ; } else { m = ( n + 3 ) * ( n + 1 ) / 2 ; } System . out . println ( m ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Main { public static void main ( String [ ] args ) throws IOException { int n = Reader . nextInt ( ) ; int res = 4 ; if ( ( n & 1 ) == 0 ) { while ( n > 2 ) { res += n + 1 ; n -= 2 ; } } else { while ( n > 1 ) { res += 2 * ( n + 1 ) ; n -= 2 ; } } System . out . println ( res ) ; }   static class Reader { static BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; static StringTokenizer tokenizer = new StringTokenizer ( " " ) ;   static String next ( ) throws IOException { while ( ! tokenizer . hasMoreTokens ( ) ) { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } return tokenizer . nextToken ( ) ; }   static int nextInt ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; } } }


import java . util . Scanner ;   public class B1459 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; int answer ; if ( N % 2 == 0 ) { answer = ( N / 2 + 1 ) * ( N / 2 + 1 ) ; } else { answer = ( N + 2 ) * ( N + 2 ) / 2 ; } System . out . println ( answer ) ; }   }


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

d , L , v1 , v2 = map ( int , input ( ) . split ( ) ) ans = float ( ( L - d ) / ( v1 + v2 ) ) print ( ans ) NEW_LINE


d , l , v1 , v2 = map ( int , input ( ) . split ( ) ) print ( ( l - d ) / ( v1 + v2 ) ) NEW_LINE


d , l , v1 , v2 = list ( map ( int , input ( ) . split ( ) ) ) print ( ( l - d ) / ( v1 + v2 ) ) NEW_LINE


d , l , v1 , v2 = map ( int , ( input ( ) . split ( ) ) )   ans = ( l - d ) / ( v1 + v2 )   print ( ans ) NEW_LINE


d , L , v1 , v2 = map ( int , input ( ) . split ( ) ) print ( ( L - d ) / ( v1 + v2 ) ) NEW_LINE


import java . util . * ; public class Code { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int d = in . nextInt ( ) ; int L = in . nextInt ( ) ; int v1 = in . nextInt ( ) ; int v2 = in . nextInt ( ) ; System . out . println ( ( double ) ( L - d ) / ( v1 + v2 ) ) ; } }


import java . util . * ; import java . io . * ;   public class HelloWorld {   public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; double n1 = ( double ) scanner . nextInt ( ) ; int n2 = scanner . nextInt ( ) ; int n3 = scanner . nextInt ( ) ; int n4 = scanner . nextInt ( ) ; double ans = ( n2 - n1 ) / ( n3 + n4 ) ; System . out . println ( ans ) ; } }


import java . util . Scanner ;     public class submission { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int d = in . nextInt ( ) ; int l = in . nextInt ( ) ; int v1 = in . nextInt ( ) ; int v2 = in . nextInt ( ) ; double distance = l - d ; double v = v1 + v2 ; double t = distance / v ; System . out . println ( t ) ; } }


import java . util . Scanner ;   public class SaveLuke { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; double d = in . nextDouble ( ) , l = in . nextDouble ( ) , v1 = in . nextDouble ( ) , v2 = in . nextDouble ( ) ;   in . close ( ) ; System . out . println ( ( l - d ) / ( v1 + v2 ) ) ; } }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double a = ( Math . sqrt ( 8 * sc . nextInt ( ) + 1 ) - 1 ) / 2 ; if ( a == ( int ) a ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }

n = int ( input ( ) ) encontrado = Falsenum = n * 2 a = 0 b = 1   while a * b <= num : if a * b == num : encontrado = True break a = a + 1 b = b + 1   if encontrado : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


n = int ( input ( ) ) f = False   for i in range ( 32 ) : if i * ( i + 1 ) / 2 == n : f = True break print ( ' YES ' if f else ' NO ' ) NEW_LINE


n = int ( input ( ) )   def tri_nums ( ) : arr = [ 0 ] a = 1 for i in range ( 31 ) : arr . append ( arr [ i ] + a ) a += 1 return ( arr )   tri_num = tri_nums ( )   if ( n in tri_num ) : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; check ( n ) ; } public static void check ( int n ) { int t = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { t += i ; if ( t == n ) { System . out . println ( " YES " ) ; return ; } } System . out . println ( " NO " ) ; } }


import java . io . * ; import java . util . * ; 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 ; } } static FastReader sc = new FastReader ( ) ; static long mod = ( long ) ( 1e9 + 7 ) ; public static void main ( String [ ] args ) throws Exception { PrintWriter out = new PrintWriter ( System . out ) ; int t = 1 ;

n = int ( input ( ) )   import sysdef get_ints ( ) : return list ( map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) )   arr = get_ints ( )   arr = sorted ( arr ) arr = arr [ : : - 1 ] maxs = arr [ 0 ] times = 0 for index , elem in enumerate ( arr ) : if index == n - 1 : break times += maxs - elem     lastelem = arr [ - 1 ] NEW_LINE


def binSearch ( ) : l , r = max_ , min_ + max_ while l < r : games = l + ( r - l ) // 2 if games * n - total > games : r = games elif games * n - total < games : l = games + 1 else : return games return l     n = int ( input ( ) ) rounds = list ( map ( int , input ( ) . split ( ) ) ) max_ , min_ , total = 0 , float ( ' inf ' ) , 0 for i in range ( n ) : max_ = max ( max_ , rounds [ i ] ) min_ = min ( min_ , rounds [ i ] ) total += rounds [ i ]   print ( binSearch ( ) ) NEW_LINE


n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) s = sum ( l ) q = s // ( n - 1 ) r = s % ( n - 1 ) if ( r ) : q += 1 print ( max ( max ( l ) , q ) ) NEW_LINE


import sys , os , ioimport math , bisect , operatorinf , mod = float ( ' inf ' ) , 10 ** 9 + 7 NEW_LINE


import math , sys , bisect , heapq , osfrom collections import defaultdict , Counter , dequefrom itertools import groupby , accumulatefrom functools import lru_cache NEW_LINE


n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) s = sum ( l ) q = s


import java . util . * ;   public class A_Mafia { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int i = 0 ; long ar [ ] = new long [ n ] ; long max = 0 ; long s = 0 ; for ( i = 0 ; i < n ; i ++ ) { ar [ i ] = sc . nextLong ( ) ; s += ar [ i ] ; max = Math . max ( max , ar [ i ] ) ; } long ans = Math . max ( ( ( s - 1 ) / ( n - 1 ) ) + 1 , max ) ; System . out . println ( ans ) ; } }


import java . util . * ; import java . io . * ; import java . math . * ;


import java . util . Scanner ;   public class TestBetter { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ;   int [ ] freqX = new int [ 109 ] , freqY = new int [ 109 ] ; int n ; n = input . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int x , y ; x = input . nextInt ( ) ; y = input . nextInt ( ) ; freqX [ x ] ++ ; freqY [ y ] ++ ; } int cntX = 0 ; int cntY = 0 ; for ( int i = 0 ; i <= 100 ; i ++ ) cntX += Boolean . compare ( ( freqX [ i ] > 0 ) , false ) ; for ( int i = 0 ; i <= 100 ; i ++ ) cntY += Boolean . compare ( ( freqY [ i ] > 0 ) , false ) ; System . out . println ( Math . min ( cntX , cntY ) ) ; } }

n = int ( input ( ) ) x = [ ] y = [ ] for i in range ( n ) : xt , yt = list ( map ( int , input ( ) . split ( ) ) ) x . append ( xt ) y . append ( yt ) x = list ( set ( x ) ) y = list ( set ( y ) )   print ( min ( len ( x ) , len ( y ) ) ) NEW_LINE


a = int ( input ( ) ) b = [ ] c = [ ] for i in range ( a ) : x , y = map ( int , input ( ) . split ( ) ) b . append ( x ) c . append ( y ) print ( min ( len ( set ( b ) ) , len ( set ( c ) ) ) ) NEW_LINE


n = int ( input ( ) ) x = { } y = { } for i in range ( n ) : a , b = [ int ( i ) for i in input ( ) . split ( ) ] x [ a ] = 0 y [ b ] = 0 print ( len ( x ) if len ( x ) <= len ( y ) else len ( y ) ) NEW_LINE


n = int ( input ( ) ) dr = { } dc = { } for i in range ( n ) : li = [ int ( x ) for x in input ( ) . split ( ) ] x , y = li [ 0 ] , li [ 1 ] if ( x in dr ) : dr [ x ] += 1 else : dr [ x ] = 1 if ( y in dc ) : dc [ y ] += 1 else : dc [ y ] = 1 print ( min ( len ( dr ) , len ( dc ) ) ) NEW_LINE


n = int ( input ( ) ) row = set ( ) col = set ( ) for _ in range ( n ) : a , b = list ( map ( int , input ( ) . split ( ) ) ) row . add ( a ) col . add ( b ) print ( min ( len ( row ) , len ( col ) ) ) NEW_LINE


import java . util . HashSet ; import java . util . Scanner ;   public class InnaandAlarmClock {   public static void main ( String args [ ] ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; HashSet < Integer > a = new HashSet < Integer > ( ) ; HashSet < Integer > b = new HashSet < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { a . add ( scan . nextInt ( ) ) ; b . add ( scan . nextInt ( ) ) ; } System . out . println ( Math . min ( a . size ( ) , b . size ( ) ) ) ; }   }


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 ) ; Set < Integer > X = new HashSet < Integer > ( ) ; Set < Integer > Y = new HashSet < Integer > ( ) ; int n = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { X . add ( sc . nextInt ( ) ) ; Y . add ( sc . nextInt ( ) ) ; } System . out . println ( Math . min ( X . size ( ) , Y . size ( ) ) ) ; } }


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 ( ) ; HashMap < Integer , Integer > map1 = new HashMap < > ( ) ; HashMap < Integer , Integer > map2 = new HashMap < > ( ) ; while ( n -- > 0 ) { int a = s . nextInt ( ) ; int b = s . nextInt ( ) ; if ( map1 . containsKey ( a ) ) { map1 . replace ( a , 1 ) ; } else map1 . put ( a , 1 ) ;   if ( map2 . containsKey ( b ) ) { map2 . replace ( b , 1 ) ; } else map2 . put ( b , 1 ) ; } System . out . println ( Math . min ( map1 . size ( ) , map2 . size ( ) ) ) ;   } }


import java . util . * ;   public class Solution {   static class Node { int x , y ;   Node ( int p ) { x = p ; y = p ; }   Node ( int p , int q ) { x = p ; y = q ; } }   public static long sum ( Queue < Node > queue , int x ) { long result = 0 ; boolean isRobotShutdown = false ; while ( ! queue . isEmpty ( ) ) { Node currNode = queue . remove ( ) ; if ( isRobotShutdown ) { result += currNode . y ; continue ; } if ( currNode . x % x == 0 ) { result += currNode . y ; currNode . x /= x ; queue . add ( currNode ) ; } else { result += currNode . y ; isRobotShutdown = true ; } } return result ; }   public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; int testCases = in . nextInt ( ) ; in . nextLine ( ) ; for ( int i = 0 ; i < testCases ; i ++ ) { int n = in . nextInt ( ) ; int x = in . nextInt ( ) ; in . nextLine ( ) ; Queue < Node > input = new LinkedList < Node > ( ) ; for ( int j = 0 ; j < n ; j ++ ) { input . add ( new Node ( in . nextInt ( ) ) ) ; } in . nextLine ( ) ; System . out . println ( sum ( input , x ) ) ; } } }

from collections import Countert = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n , x = map ( int , input ( ) . split ( ) ) NEW_LINE ali = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE li = ali . copy ( ) NEW_LINE ans = sum ( ali ) NEW_LINE i = 0 NEW_LINE while ( ali [ i ] % x == 0 ) : ali [ i ] = ali [ i ] // x NEW_LINE ans += li [ i ] NEW_LINE i = ( i + 1 ) % n NEW_LINE


def strange_list ( arr , n , x ) : S = 0 NEW_LINE   minK = mk ( arr [ 0 ] , x ) NEW_LINE minKInd = 0   for i in range ( n ) : k = mk ( arr [ i ] , x ) NEW_LINE if k < minK : minK = k NEW_LINE minKInd = i   for i in range ( n ) : qmk = minK + 1 if i < minKInd else minK NEW_LINE S += arr [ i ] * ( qmk + 1 )   return S   NEW_LINE def mk ( q , x ) : k = 0 NEW_LINE while q % x == 0 : k += 1 NEW_LINE q = q / x NEW_LINE return k   if __name__ == " _ _ main _ _ " : t = int ( input ( ) ) NEW_LINE for i in range ( t ) : inps = input ( ) . split ( " ▁ " ) NEW_LINE n = int ( inps [ 0 ] ) NEW_LINE x = int ( inps [ 1 ] )   arr = list ( map ( lambda x : int ( x ) , input ( ) . split ( " ▁ " ) ) )   print ( " { 0 } " . format ( int ( strange_list ( arr , n , x ) ) ) )   NEW_LINE


def strange_list ( arr , n , x ) : S = 0 NEW_LINE   minK = mk ( arr [ 0 ] , x ) NEW_LINE minKInd = 0   for i in range ( n ) : k = mk ( arr [ i ] , x ) NEW_LINE if k < minK : minK = k NEW_LINE minKInd = i   for i in range ( n ) : qmk = minK + 1 if i < minKInd else minK NEW_LINE S += arr [ i ] * ( qmk + 1 )   return S   NEW_LINE def mk ( q , x ) : k = 0 NEW_LINE while q % x == 0 : k += 1 NEW_LINE q = q / x NEW_LINE return k   if __name__ == " _ _ main _ _ " : t = int ( input ( ) ) NEW_LINE for i in range ( t ) : inps = input ( ) . split ( " ▁ " ) NEW_LINE n = int ( inps [ 0 ] ) NEW_LINE x = int ( inps [ 1 ] )   arr = list ( map ( lambda x : int ( x ) , input ( ) . split ( " ▁ " ) ) )   print ( " { 0 } " . format ( int ( strange_list ( arr , n , x ) ) ) ) NEW_LINE


import java . util . Scanner ;   public class B1471 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int N = in . nextInt ( ) ; int X = in . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int n = 0 ; n < N ; n ++ ) { A [ n ] = in . nextInt ( ) ; } long sum = 0 ; long factor = 1 ; main : while ( true ) { for ( int n = 0 ; n < N ; n ++ ) { if ( A [ n ] % factor == 0 ) { sum += A [ n ] ; } else { break main ; } } factor *= X ; } System . out . println ( sum ) ; } }   }


import java . util . * ;   public class codechef {   public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = scanner . nextInt ( ) ; while ( t -- > 0 ) { int d = scanner . nextInt ( ) ; int k1 = scanner . nextInt ( ) ; int k2 = scanner . nextInt ( ) ;   int a [ ] = new int [ k1 ] ; int [ ] b = new int [ k2 ] ; for ( int i = 0 ; i < k1 ; i ++ ) a [ i ] = scanner . nextInt ( ) ; for ( int i = 0 ; i < k2 ; i ++ ) b [ i ] = scanner . nextInt ( ) ;   Arrays . sort ( a ) ; Arrays . sort ( b ) ; if ( a [ a . length - 1 ] > b [ b . length - 1 ] ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } } }

t = int ( input ( ) ) for i in range ( t ) : temp = [ int ( x ) for x in input ( ) . split ( ) ] n = temp [ 0 ] k1 = temp [ 1 ] k2 = temp [ 2 ] a = [ int ( x ) for x in input ( ) . split ( ) ] b = [ int ( x ) for x in input ( ) . split ( ) ] if max ( a ) > max ( b ) : print ( ' yes ' ) else : print ( ' no ' ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n , k1 , k2 = map ( int , input ( ) . split ( ) ) fir = sorted ( [ int ( i ) for i in input ( ) . split ( ) ] , reverse = True ) sec = sorted ( [ int ( i ) for i in input ( ) . split ( ) ] , reverse = True ) print ( ' YES ' if fir [ 0 ] > sec [ 0 ] else ' NO ' ) NEW_LINE


import sys   def main ( ) : l = sys . stdin . read ( ) . strip ( ) . split ( ' \n ' ) out = [ ] for i in range ( 2 , len ( l ) , 3 ) : m1 = max ( map ( int , l [ i ] . split ( ) ) ) m2 = max ( map ( int , l [ i + 1 ] . split ( ) ) ) out . append ( ( ' NO ' , ' YES ' ) [ m1 > m2 ] ) return out   print ( * main ( ) , sep = ' \n ' ) NEW_LINE


t = int ( input ( ) ) for i in range ( t ) : n , k1 , k2 = map ( str , input ( ) . split ( ) ) s1 , s2 = input ( ) . split ( ) , input ( ) . split ( ) if n in s1 : print ( " Yes " ) else : print ( " No " ) NEW_LINE


import java . io . * ; import java . util . * ;   public class bacteria { public static void main ( String args [ ] ) { FScanner in = new FScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int t = in . nextInt ( ) ; while ( t -- > 0 ) { int n = in . nextInt ( ) ; int k1 = in . nextInt ( ) ; int k2 = in . nextInt ( ) ; int a [ ] = in . readArray ( k1 ) ; int b [ ] = in . readArray ( k2 ) ; int max1 = Integer . MIN_VALUE ; int max2 = Integer . MIN_VALUE ; for ( int i = 0 ; i < k1 ; i ++ ) { if ( a [ i ] > max1 ) max1 = a [ i ] ;   } for ( int i = 0 ; i < k2 ; i ++ ) { if ( b [ i ] > max2 ) max2 = b [ i ] ;   } if ( max1 > max2 ) out . println ( " YES " ) ; else out . println ( " NO " ) ; } out . close ( ) ; }   static class FScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer sb = new StringTokenizer ( " " ) ; String next ( ) { while ( ! sb . hasMoreTokens ( ) ) { try { sb = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { } } return sb . nextToken ( ) ; } String nextLine ( ) { try { return br . readLine ( ) ; } catch ( IOException e ) { } return " " ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } int [ ] readArray ( int n ) { int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } float nextFloat ( ) { return Float . parseFloat ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } } }


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 . io . * ; import java . lang . ref . SoftReference ; import java . math . BigInteger ; import java . util . * ;

t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n , k = map ( int , input ( ) . split ( ) ) NEW_LINE ali = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE ans = - 1 NEW_LINE for i in range ( k ) : flag = 0 NEW_LINE for j in range ( n - 1 ) : if NEW_LINE INDENT ( ali [ j ] < ali [ j + 1 ] ) : ali [ j ] = ali [ j ] + 1 NEW_LINE DEDENT ans = j NEW_LINE flag = 1 NEW_LINE break NEW_LINE


t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n , k = [ int ( s ) for s in input ( ) . split ( " ▁ " ) ] NEW_LINE a = [ int ( s ) for s in input ( ) . split ( " ▁ " ) ] NEW_LINE mx = max ( a ) NEW_LINE if mx * n < k : NEW_LINE INDENT ans = - 1 else : NEW_LINE ans = n + 1 NEW_LINE DEDENT for i in range ( k ) : pos = - 2 NEW_LINE for i in range ( n - 1 ) : if NEW_LINE a [ i ] < a [ i + 1 ] : pos = i NEW_LINE break NEW_LINE ans = pos + 1 NEW_LINE if pos == - 2 : break NEW_LINE a [ pos ] += 1 NEW_LINE print ( ans ) NEW_LINE


t = int ( input ( ) ) NEW_LINE for i in range ( t ) : n , K = map ( int , input ( ) . split ( ) ) NEW_LINE arr = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE if n == 1 : print ( - 1 ) NEW_LINE continue NEW_LINE ans = 0 NEW_LINE for j in range ( K ) : k = 0 NEW_LINE while k < n - 1 : if NEW_LINE arr [ k ] < arr [ k + 1 ] : arr [ k ] += 1 NEW_LINE ans = k NEW_LINE break NEW_LINE k += 1 NEW_LINE if k == n - 1 : print ( - 1 ) NEW_LINE break NEW_LINE if k != n - 1 : print ( ans + 1 )   NEW_LINE


t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : a , b = [ int ( i ) for i in input ( ) . split ( ) ] NEW_LINE c = [ int ( i ) for i in input ( ) . split ( ) ] NEW_LINE ans = 0 NEW_LINE flag = 0 NEW_LINE for i in range ( 0 , len ( c ) - 1 ) : if NEW_LINE INDENT ( c [ i ] >= c [ i + 1 ] ) : NEW_LINE DEDENT pass else : flag = 1 NEW_LINE if ( flag == 0 ) : NEW_LINE INDENT print ( - 1 ) else : NEW_LINE for NEW_LINE DEDENT j in range ( b ) : s = 0 NEW_LINE for k in range ( 0 , len ( c ) - 1 ) : if NEW_LINE INDENT ( c [ k ] >= c [ k + 1 ] ) : s += 1 else : c [ k ] += 1 NEW_LINE DEDENT ans = k + 1 NEW_LINE break NEW_LINE if ( s == a - 1 ) : break NEW_LINE if ( j <= b - 1 and s == a - 1 ) : NEW_LINE INDENT print ( - 1 ) else : NEW_LINE print ( ans ) NEW_LINE DEDENT


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


import java . util . Scanner ;   public class B1481 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int N = in . nextInt ( ) ; int K = in . nextInt ( ) ; int [ ] H = new int [ N ] ; for ( int n = 0 ; n < N ; n ++ ) { H [ n ] = in . nextInt ( ) ; } int pos = - 1 ; main : for ( int k = 0 ; k < K ; k ++ ) { pos = 0 ; while ( true ) { if ( pos == N - 1 ) { pos = - 1 ; break main ;


import java . math . BigInteger ; import java . util . * ;   public class Main {   static Scanner input = new Scanner ( System . in ) ;   public static void main ( String [ ] args ) { String s = input . next ( ) ; long len = s . length ( ) ; long res = Long . parseLong ( s ) ; long sumofDigits = getSum ( res ) ; for ( int i = 0 ; i < len - 1 ; i ++ ) { if ( s . charAt ( i ) == '0' ) continue ; long number = Long . parseLong ( s ) ; number -= Long . parseLong ( s . substring ( i + 1 ) ) + 1 ; if ( getSum ( number ) == sumofDigits && number > res || ( getSum ( number ) ) > sumofDigits ) { res = number ; sumofDigits = getSum ( number ) ; } } System . out . println ( res ) ; }   private static long getSum ( long number ) { long sum = 0 ; while ( number != 0 ) { sum += number % 10 ; number /= 10 ; } return sum ; }   }

x = input ( ) n = len ( x ) if n == 1 : print ( x ) exit ( 0 ) ans = " " s = 0 ps = 0 pn = " " for i in range ( n ) : ts = ps + int ( x [ i ] ) - 1 + 9 * ( n - i - 1 ) if ts >= s : ans = pn + str ( int ( x [ i ] ) - 1 ) + "9" * ( n - i - 1 ) s = ts ps += int ( x [ i ] ) pn += x [ i ] if ps >= s : ans = pnprint ( int ( ans ) ) NEW_LINE


def f ( z ) : return sum ( int ( i ) for i in z )     x = input ( ) k = len ( x ) m = f ( x ) ans = - 1 for i in range ( 1 , k + 1 ) : a = int ( x [ : i ] ) b = x [ i : ] if not all ( j == "9" for j in b ) : a -= 1 b = "9" * len ( b ) w = str ( a ) + b if f ( w ) >= m : m = f ( w ) ans = str ( a ) + bprint ( int ( ans ) ) NEW_LINE


a = input ( ) ans = [ sum ( map ( int , a ) ) , a ] for i in range ( len ( a ) - 1 , - 1 , - 1 ) : b = a [ : i ] + str ( int ( a [ i ] ) - 1 ) + '9' * len ( a [ i + 1 : ] ) if a [ i ] != '0' and sum ( map ( int , b ) ) > ans [ 0 ] : ans = [ sum ( map ( int , b ) ) , b ] print ( ans [ 1 ] . strip ( '0' ) ) NEW_LINE


import java . math . BigInteger ; import java . util . * ;   public class Main {   static Scanner input = new Scanner ( System . in ) ;   public static void main ( String [ ] args ) { String s = input . next ( ) ; long len = s . length ( ) ; long res = Long . parseLong ( s ) ; long sum = getSum ( res ) ; for ( int i = 0 ; i < len - 1 ; i ++ ) { if ( s . charAt ( i ) == '0' ) continue ; long number = Long . parseLong ( s ) ; number = number - ( Long . parseLong ( s . substring ( i + 1 ) ) + 1 ) ; if ( getSum ( number ) == sum && number > res || ( getSum ( number ) > sum ) ) { res = number ; sum = getSum ( number ) ; } } System . out . println ( res ) ; }   private static long getSum ( long number ) { long sum = 0 ; while ( number != 0 ) { sum += number % 10 ; number /= 10 ; } return sum ; }   }


import java . io . * ; import java . util . * ; public class Main {   public static long sod ( String num ) { long sum = 0 ; char [ ] arr = num . toCharArray ( ) ; for ( char i : arr ) sum += Character . getNumericValue ( i ) ; return sum ; }    public static void main ( String [ ] args ) { InputReader sc = new InputReader ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; Random gen = new Random ( ) ; int test = 1 ;


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


a = input ( ) b = input ( ) x = a . count ( '1' ) x = x + x % 2 x -= b . count ( '1' ) print ( " NO " if x < 0 else " YES " )

def play ( s , t ) : count1 , count2 = 0 , 0 for elem in s : if elem == '1' : count1 += 1 for elem in t : if elem == '1' : count2 += 1 if count2 - count1 > 1 or ( count2 - count1 == 1 and count1 % 2 == 0 ) : return " NO " return " YES "     a = input ( ) b = input ( ) print ( play ( a , b ) ) NEW_LINE


A = list ( input ( ) ) B = list ( input ( ) )   zA = A . count ( '1' ) zA += zA & 1   if zA >= B . count ( '1' ) : print ( " YES " ) else : print ( " NO " ) NEW_LINE


alice = input ( ) bob = input ( )   a = alice . count ( '1' ) b = bob . count ( '1' ) a += ( a % 2 ) NEW_LINE


a = input ( ) b = input ( ) x = a . count ( '1' ) x = x + x % 2 x -= b . count ( '1' ) print ( " NO " if x < 0 else " YES " ) NEW_LINE


import java . util . * ; import java . io . * ;   public class P297A {   private static void solve ( ) { char [ ] c1 = next ( ) . toCharArray ( ) ; char [ ] c2 = next ( ) . toCharArray ( ) ;   int cnt1 = 0 ; for ( int i = 0 ; i < c1 . length ; i ++ ) { if ( c1 [ i ] == '1' ) cnt1 ++ ; }   int cnt2 = 0 ; for ( int i = 0 ; i < c2 . length ; i ++ ) { if ( c2 [ i ] == '1' ) cnt2 ++ ; }   if ( ( cnt1 % 2 == 0 && cnt2 > cnt1 ) || ( cnt1 % 2 != 0 && cnt2 > cnt1 + 1 ) ) { System . out . println ( " NO " ) ; } else { System . out . println ( " YES " ) ; } }   private static void run ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; out = new PrintWriter ( System . out ) ;   solve ( ) ;   out . close ( ) ; }   private static StringTokenizer st ; private static BufferedReader br ; private static PrintWriter out ;   private static String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { String s ; try { s = br . readLine ( ) ; } catch ( IOException e ) { return null ; } st = new StringTokenizer ( s ) ; } return st . nextToken ( ) ; }   private static int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   private static long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   public static void main ( String [ ] args ) { run ( ) ; } }


import java . io . BufferedReader ; import java . io . File ; import java . io . FileInputStream ; import java . io . FileNotFoundException ; import java . io . FileOutputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . BitSet ; import java . util . Calendar ; import java . util . Collections ; import java . util . Comparator ; import java . util . HashMap ; import java . util . HashSet ; import java . util . LinkedList ; import java . util . PriorityQueue ; import java . util . SortedSet ; import java . util . Stack ; import java . util . StringTokenizer ; import java . util . TreeMap ; import java . util . TreeSet ;   public class A_Round_180_Div1 {   public static long MOD = 998244353 ; static long [ ] [ ] [ ] dp ;   public static void main ( String [ ] args ) throws FileNotFoundException {


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Test20200817 {   public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] paras = br . readLine ( ) . split ( " ▁ " ) ; String [ ] nums = br . readLine ( ) . split ( " ▁ " ) ; int temp = Integer . parseInt ( paras [ 0 ] ) ; int num = Integer . parseInt ( paras [ 1 ] ) ; int result = 0 ; boolean mark = false ; for ( int i = 0 ; i < temp ; i ++ ) { if ( Integer . parseInt ( nums [ i ] ) < num ) { result ++ ; } if ( Integer . parseInt ( nums [ i ] ) == num ) { mark = true ; } }   result = num - result ; result = mark ? result + 1 : result ; System . out . println ( result ) ; } }

n , x = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) exist = [ False ] * 101 for e in a : exist [ e ] = Trueans = 0 if exist [ x ] : ans += 1 for i in range ( x ) : if not exist [ i ] : ans += 1 print ( ans ) NEW_LINE


from sys import stdinn , x = map ( int , stdin . readline ( ) . split ( ) ) a = list ( map ( int , stdin . readline ( ) . split ( ) ) ) d = [ 0 ] * 101 for i in a : d [ i ] = 1 print ( x - sum ( d [ : x ] ) + d [ x ] ) NEW_LINE


try : n , x = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( ) z = 0 if a . __contains__ ( x ) : z += 1 for i in range ( x ) : if not a . __contains__ ( i ) : z += 1 print ( z ) except : pass NEW_LINE


n , x = map ( int , input ( ) . split ( ' ▁ ' ) ) evil = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) current = ans = 0 for i in range ( x ) : if i not in evil : ans += 1 ans += 1 if x in evil else 0 print ( ans ) NEW_LINE


n , x = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) ans = 0 if x in a : ans += 1 for i in range ( x ) : if i not in a : ans += 1 print ( ans ) NEW_LINE


import java . util . Arrays ; import java . util . Scanner ;   public class Exam9 { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int x = scan . nextInt ( ) ; int count = 0 , flag = 0 ;   for ( int i = 0 ; i < n ; i ++ ) { int t = scan . nextInt ( ) ; if ( t <= x ) { if ( t == x ) flag = 1 ; count ++ ; } }   if ( count != 0 ) { if ( flag == 0 ) { System . out . println ( x - count ) ; } else System . out . println ( x - count + 2 ) ; } else { if ( flag == 0 ) System . out . println ( x ) ; else System . out . println ( x + 1 ) ; } } }


import java . util . Scanner ;   public class MahmoudEhabMEX { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , x = in . nextInt ( ) , i , j = 0 , a [ ] = new int [ 101 ] , c = 0 ;   for ( i = 0 ; i < n ; i ++ ) a [ in . nextInt ( ) ] ++ ; in . close ( ) ;   for ( i = 0 ; i < x ; i ++ ) c += a [ i ] ; System . out . println ( a [ x ] == 1 ? x - c + 1 : x - c ) ; } }


import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { PrintWriter out ; FastReader sc ; long mod = ( long ) ( 1e9 + 7 ) ; long maxlong = Long . MAX_VALUE ; long minlong = Long . MIN_VALUE ; public void sol ( ) { int n = ni ( ) ; int [ ] c = new int [ n ] , d = new int [ n ] ;

n = int ( input ( ) ) ent = list ( map ( int , input ( ) . strip ( ) . split ( ) ) ) [ : n ] sai = list ( map ( int , input ( ) . strip ( ) . split ( ) ) ) [ : n ]   res = 0   i = 0j = 0   ver = [ ]   for k in range ( 0 , n ) : ver . append ( 0 )   while i < n and j < n : if ver [ ent [ i ] - 1 ] == 1 : i += 1   elif ent [ i ] == sai [ j ] : ver [ ent [ i ] - 1 ] = 1 i += 1 j += 1   else : ver [ sai [ j ] - 1 ] = 1 res += 1 j += 1                                   print ( res ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) b = list ( map ( int , input ( ) . split ( ) ) ) entered , left = [ ] , [ ] j , l , count = 0 , 0 , 0 for _ in range ( n ) : left . append ( 0 ) for i in range ( n ) : entered . append ( a [ i ] ) while left [ entered [ j ] - 1 ] == 1 : j = j + 1 if entered [ j ] == b [ i ] : j = j + 1 else : count = count + 1 left [ b [ i ] - 1 ] = 1 print ( count )   NEW_LINE


numCars = int ( input ( ) ) tEntrance = [ int ( num ) for num in input ( ) . split ( ) ] tExit = [ int ( num ) for num in input ( ) . split ( ) ]   fines = 0j = 0 occurred = set ( ) for i in range ( numCars ) : if tEntrance [ i ] in occurred : continue while tExit [ j ] != tEntrance [ i ] : occurred . add ( tExit [ j ] ) fines += 1 j += 1 occurred . add ( tExit [ j ] ) j += 1 print ( fines ) NEW_LINE


n = int ( input ( ) ) before = input ( ) . split ( ) after = input ( ) . split ( ) finedCars = 0 removedCar = - 1 positions = { } for i in range ( len ( before ) ) : positions [ before [ i ] ] = iindex = 0 for i in range ( n ) : for j in range ( index , n ) : if ( before [ j ] ) == - 1 : index = j + 1 elif ( after [ i ] != before [ j ] ) : finedCars += 1 before [ positions [ after [ i ] ] ] = - 1 break else : index = j + 1 breakprint ( finedCars ) NEW_LINE


n = int ( input ( ) ) first = list ( input ( ) . strip ( ) . split ( ) ) second = list ( input ( ) . strip ( ) . split ( ) ) toDict = dict ( zip ( second , range ( n ) ) ) bef , aft = 0 , 0 for item in first : if toDict . get ( item ) >= aft : aft = toDict . get ( item ) continue bef += 1   print ( bef ) NEW_LINE


import java . util . Scanner ; public class B { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , a [ ] = new int [ n ] , b [ ] = new int [ n + 1 ] , x = - 1 , c = 0 ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) b [ sc . nextInt ( ) ] = i + 1 ; for ( int i : a ) if ( x == ( x = Math . max ( x , b [ i ] ) ) ) c ++ ; System . out . println ( c ) ; } }


import java . awt . * ; import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ;


import java . awt . Desktop ;    import java . io . BufferedReader ;    import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . net . URI ; import java . net . URISyntaxException ; import java . sql . Array ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Comparator ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Iterator ; import java . util . LinkedHashMap ; import java . util . LinkedHashSet ; import java . util . LinkedList ; import java . util . List ; import java . util . Map ; import java . util . PriorityQueue ; import java . util . Queue ; import java . util . Scanner ; import java . util . Set ; import java . util . Stack ; import java . util . StringTokenizer ; import java . util . TreeSet ; import java . util . Vector ;     public class codechef3 { static class comp implements Comparator < Integer > {   @ Override public int compare ( Integer o1 , Integer o2 ) { if ( Math . abs ( o1 ) > Math . abs ( o2 ) ) return - 1 ; else return 1 ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   public class Practice {   public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int t = s . nextInt ( ) ; while ( t -- > 0 ) { int n = s . nextInt ( ) ; int [ ] [ ] arr = new int [ n ] [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String str = s . next ( ) ; for ( int j = 0 ; j < n ; j ++ ) { arr [ i ] [ j ] = str . charAt ( j ) ; } } getAns ( n , arr ) ; } }   private static void getAns ( int n , int [ ] [ ] arr ) {

import matht = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n = int ( input ( ) ) NEW_LINE li = [ ] NEW_LINE for i in range ( n ) : ali = input ( ) NEW_LINE ali = list ( ali ) NEW_LINE li . append ( ali ) NEW_LINE


import reimport NEW_LINE sysexit = sys . exitfrom NEW_LINE bisect NEW_LINE import bisect_left as bsl , bisect_right as bsrfrom NEW_LINE collections NEW_LINE import Counter , defaultdict as ddict , dequefrom NEW_LINE functools NEW_LINE import lru_cachecache = lru_cache ( None ) NEW_LINE from heapq import * NEW_LINE from itertools import * NEW_LINE from math import inffrom NEW_LINE pprint NEW_LINE import pprint as ppenum = enumerateri = lambda : int ( rln ( ) ) NEW_LINE ris = lambda : list ( map ( int , rfs ( ) ) ) NEW_LINE rln = sys . stdin . readlinerl = lambda : rln ( ) . rstrip ( ' \n ' ) NEW_LINE rfs = lambda : rln ( ) . split ( ) NEW_LINE mod = 1000000007 NEW_LINE d4 = [ ( 0 , - 1 ) , ( 1 , 0 ) , ( 0 , 1 ) , ( - 1 , 0 ) ] NEW_LINE d8 = [ ( - 1 , - 1 ) , ( 0 , - 1 ) , ( 1 , - 1 ) , ( - 1 , 0 ) , ( 1 , 0 ) , ( - 1 , 1 ) , ( 0 , 1 ) , ( 1 , 1 ) ] NEW_LINE


t = int ( input ( ) ) NEW_LINE while t > 0 : n = int ( input ( ) ) NEW_LINE grid = [ ] NEW_LINE for i in range ( n ) : a = input ( ) NEW_LINE grid . append ( a ) NEW_LINE lol = [ grid [ 0 ] [ 1 ] , grid [ 0 ] [ 2 ] , grid [ 1 ] [ 0 ] , grid [ 2 ] [ 0 ] , grid [ 1 ] [ 1 ] ] NEW_LINE ans1 = [ '0' , '1' , '0' , '1' , '1' ] NEW_LINE ans2 = [ '1' , '0' , '1' , '0' , '0' ] NEW_LINE count = 0 NEW_LINE l = [ ] NEW_LINE for i in range ( 5 ) : if NEW_LINE ans1 [ i ] == lol [ i ] : l . append ( '0' ) else : count += 1 NEW_LINE l . append ( '1' )   if count < 3 : print ( count ) NEW_LINE if l [ 0 ] == '1' : print ( "1 ▁ 2" ) NEW_LINE if l [ 1 ] == '1' : print ( "1 ▁ 3" ) NEW_LINE if l [ 2 ] == '1' : print ( "2 ▁ 1" ) NEW_LINE if l [ 3 ] == '1' : print ( "3 ▁ 1" ) NEW_LINE if l [ 4 ] == '1' : NEW_LINE INDENT print ( "2 ▁ 2" ) else : NEW_LINE print ( 5 - count ) NEW_LINE DEDENT if l [ 0 ] == '0' : print ( "1 ▁ 2" ) NEW_LINE if l [ 1 ] == '0' : print ( "1 ▁ 3" ) NEW_LINE if l [ 2 ] == '0' : print ( "2 ▁ 1" ) NEW_LINE if l [ 3 ] == '0' : print ( "3 ▁ 1" ) NEW_LINE if l [ 4 ] == '0' : print ( "2 ▁ 2" ) NEW_LINE t -= 1 NEW_LINE


import sys , functools , collections , bisect , math , NEW_LINE INDENT heapqinput = sys . stdin . readline NEW_LINE DEDENT


for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE mat = [ ] NEW_LINE for i in range ( n ) : mat . append ( input ( ) ) NEW_LINE s1 = mat [ 0 ] [ 1 ] NEW_LINE s2 = mat [ 1 ] [ 0 ] NEW_LINE s3 = mat [ - 2 ] [ - 1 ] NEW_LINE s4 = mat [ - 1 ] [ - 2 ] NEW_LINE if s1 == s2 == s3 == s4 : print ( 2 ) NEW_LINE print ( 1 , 2 ) NEW_LINE print ( 2 , 1 ) elif s1 == s2 == s3 : print ( 1 ) NEW_LINE print ( n - 1 , n ) elif s1 == s2 == s4 : print ( 1 ) NEW_LINE print ( n , n - 1 ) elif s1 == s4 == s3 : print ( 1 ) NEW_LINE print ( 1 , 2 ) elif s4 == s2 == s3 : print ( 1 ) NEW_LINE print ( 2 , 1 ) elif s1 == s3 : print ( 2 ) NEW_LINE print ( 1 , 2 ) NEW_LINE print ( n , n - 1 ) elif s1 == s4 : print ( 2 ) NEW_LINE print ( 1 , 2 ) NEW_LINE print ( n - 1 , n ) else : print ( 0 ) NEW_LINE


import java . awt . Point ; import java . io . File ; import java . io . IOException ; import java . io . PrintWriter ; import java . util . * ; import java . util . Map . Entry ;   public class Main {      public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ;   int n = input . nextInt ( ) ; HashMap < Point , Integer > same = new HashMap < Point , Integer > ( ) ; TreeMap < Integer , Integer > mapx = new TreeMap < > ( ) ; TreeMap < Integer , Integer > mapy = new TreeMap < > ( ) ; int count = 0 , extra = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x = input . nextInt ( ) ; int y = input . nextInt ( ) ; Point p = new Point ( x , y ) ; same . put ( p , same . getOrDefault ( p , 0 ) + 1 ) ; mapx . put ( x , mapx . getOrDefault ( x , 0 ) + 1 ) ; mapy . put ( y , mapy . getOrDefault ( y , 0 ) + 1 ) ;    }

n = int ( input ( ) ) fx , fy = { } , { } f = { } for i in range ( n ) : x , y = map ( int , input ( ) . split ( ) ) fx [ x ] = fx . get ( x , 0 ) + 1 fy [ y ] = fy . get ( y , 0 ) + 1 pt = ( x , y ) f [ pt ] = f . get ( pt , 0 ) + 1 res = 0 for k , v in fx . items ( ) : res += v * ( v - 1 ) // 2 for k , v in fy . items ( ) : res += v * ( v - 1 ) // 2 for k , v in f . items ( ) : res -= v * ( v - 1 ) // 2 print ( res ) NEW_LINE


from math import * from sys import stdininput = stdin . readlineli1 = { } ; li2 = { } ; li3 = { } for _ in range ( int ( input ( ) ) ) : x , y = map ( int , input ( ) . split ( ) ) li1 [ x ] = li1 . get ( x , 0 ) + 1 li2 [ y ] = li2 . get ( y , 0 ) + 1 li3 [ ( x , y ) ] = li3 . get ( ( x , y ) , 0 ) + 1 sum = 0 for x in [ * li1 . values ( ) ] + [ * li2 . values ( ) ] : sum += ( x * ( x - 1 ) ) // 2 for x in [ * li3 . values ( ) ] : sum -= ( x * ( x - 1 ) ) // 2 print ( sum ) NEW_LINE


n = int ( input ( ) )   fx , fy = { } , { } f = { }   for i in range ( n ) : x , y = map ( int , input ( ) . split ( ) ) fx [ x ] = fx . get ( x , 0 ) + 1 fy [ y ] = fy . get ( y , 0 ) + 1 pt = ( x , y ) f [ pt ] = f . get ( pt , 0 ) + 1   res = 0   for k , v in fx . items ( ) : res += v * ( v - 1 ) // 2 for k , v in fy . items ( ) : res += v * ( v - 1 ) // 2   for k , v in f . items ( ) : res -= v * ( v - 1 ) // 2   print ( res ) NEW_LINE


import java . awt . Point ; import java . util . HashMap ; import java . util . Scanner ;   public class B {    public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; HashMap < Point , Integer > ps = new HashMap < Point , Integer > ( ) ; HashMap < Integer , Integer > xs = new HashMap < Integer , Integer > ( ) ; HashMap < Integer , Integer > ys = new HashMap < Integer , Integer > ( ) ; long sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; Point p = new Point ( x , y ) ; if ( ps . containsKey ( p ) ) { sum -= ps . get ( p ) ; ps . put ( p , ps . get ( p ) + 1 ) ; } else { ps . put ( p , 1 ) ; } if ( xs . containsKey ( x ) ) { sum += xs . get ( x ) ; xs . put ( x , xs . get ( x ) + 1 ) ; } else { xs . put ( x , 1 ) ; } if ( ys . containsKey ( y ) ) { sum += ys . get ( y ) ; ys . put ( y , ys . get ( y ) + 1 ) ; } else { ys . put ( y , 1 ) ; } } System . out . println ( sum ) ; } }


# include < cmath > # include < cstdio > # include < cstdlib > # include < cassert > # include < cstring > # include < set > # include < map > # include < list > # include < queue > # include < string > # include < iostream > # include < algorithm > # include < functional > # include < stack > using namespace std ; typedef long long ll ; # define T int t_ ; Read ( t_ ) ; while ( t_ -- ) # define dight ( chr ) ( chr >= '0' && chr <= '9' ) # define alpha ( chr ) ( chr >= ' a ' && chr <= ' z ' ) # define INF ( 0x3f3f3f3f ) # define maxn ( 200005 ) # define hashmod 100000007 # define ull unsigned long long # define repne ( x , y , i ) for ( i = x ; i < y ; ++ i ) # define repe ( x , y , i ) for ( i = x ; i <= y ; ++ i ) # define ri register intvoid Read ( int & n ) { char chr = getchar ( ) , sign = 1 ; for ( ; ! dight ( chr ) ; chr = getchar ( ) ) if ( chr == ' - ' ) sign = - 1 ; for ( n = 0 ; dight ( chr ) ; chr = getchar ( ) ) n = n * 10 + chr - '0' ; n *= sign ; } void Read ( ll & n ) { char chr = getchar ( ) , sign = 1 ; for ( ; ! dight ( chr ) ; chr = getchar ( ) ) if ( chr == ' - ' ) sign = - 1 ; for ( n = 0 ; dight ( chr ) ; chr = getchar ( ) ) n = n * 10 + chr - '0' ; n *= sign ; } int x [ maxn ] , y [ maxn ] , n ; map < pair < int , int > , int > ma ; pair < int , int > pa ; int main ( ) {


import java . util . * ; public class Main { static char a [ ] [ ] ; static int t [ ] [ ] ; static int n ; static int k ; static int w = 1 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ; k = sc . nextInt ( ) ; a = new char [ 2 ] [ n + k + 10 ] ; t = new int [ 2 ] [ n + k + 10 ] ; for ( int i = 0 ; i < 2 ; i ++ ) { char c [ ] = sc . next ( ) . toCharArray ( ) ; a [ i ] [ 0 ] = ' X ' ; for ( int j = 0 ; j < c . length ; j ++ ) { a [ i ] [ j + 1 ] = c [ j ] ; } }

n , k = map ( int , input ( ) . split ( ) ) l = input ( ) r = input ( ) data = [ 0 , ' ▁ ' + l , ' ▁ ' + r ] dist = [ [ 1000000 ] * 100005 for _ in range ( 3 ) ] visited = [ [ False ] * 100005 for _ in range ( 3 ) ] dist [ 1 ] [ 1 ] = 0 visited [ 1 ] [ 1 ] = Trueqx , qy = [ 1 ] , [ 1 ] while qy : x , y = qx . pop ( ) , qy . pop ( ) if dist [ x ] [ y ] >= y : continue if x == 1 : poss = [ [ 1 , y + 1 ] , [ 1 , y - 1 ] , [ 2 , y + k ] ] else : poss = [ [ 2 , y + 1 ] , [ 2 , y - 1 ] , [ 1 , y + k ] ] for i , e in enumerate ( poss ) : newx , newy = e [ 0 ] , e [ 1 ] if newy > n : print ( ' YES ' ) from sys import exit exit ( ) if 0 < newy <= n and not visited [ newx ] [ newy ] and data [ newx ] [ newy ] == ' - ' : visited [ newx ] [ newy ] = True dist [ newx ] [ newy ] = dist [ x ] [ y ] + 1 qx = [ newx ] + qx qy = [ newy ] + qyprint ( ' NO ' ) NEW_LINE


def bfs ( n ) : visited = [ False ] * ( 2 * n ) queue = [ ] queue2 = [ ] queue . append ( 0 ) queue2 . append ( 0 ) visited [ 0 ] = True flag = True water = 0 while queue and flag : s = queue . pop ( 0 ) water = queue2 . pop ( 0 ) for i in graph [ s ] : if not visited [ i ] : a = 0 NEW_LINE


import java . util . * ; public class Main { static boolean [ ] [ ] r ; static int h , j ; static boolean b = false ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; h = sc . nextInt ( ) ; j = sc . nextInt ( ) ; r = new boolean [ 2 ] [ h ] ; for ( int i = 0 ; i < 2 ; i ++ ) { String s = sc . next ( ) ; for ( int j = 0 ; j < h ; j ++ ) { if ( s . charAt ( j ) == ' X ' ) r [ i ] [ j ] = false ; else r [ i ] [ j ] = true ; } }


import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . LinkedHashMap ; import java . util . Map ; import java . util . Scanner ; import java . util . * ; import java . util . stream . Collectors ;   public class absolute {   public static void main ( String [ ] args ) {

def fact ( x ) : if ( x == 1 ) : return ( 1 ) else : return ( fact ( x - 1 ) * x ) a , b = [ int ( x ) for x in input ( ) . split ( ' ▁ ' ) ] print ( fact ( min ( a , b ) ) ) NEW_LINE


import sys , math   a , b = list ( map ( int , sys . stdin . readline ( ) . rstrip ( ) . split ( ) ) ) print ( math . factorial ( min ( a , b ) ) ) NEW_LINE


from math import factorial   A , B = map ( int , input ( ) . split ( ) ) print ( factorial ( min ( A , B ) ) )     NEW_LINE


import mathprint ( math . factorial ( min ( map ( int , input ( ) . split ( ) ) ) ) ) NEW_LINE


import mathn , m = map ( int , input ( ) . split ( ) ) fac1 = 1 fac2 = 1 i1 = 1 i2 = 1 while ( i1 <= n and i2 <= m ) : fac1 = fac1 * i1 fac2 = fac2 * i2 i1 = i1 + 1 i2 = i2 + 1   print ( math . gcd ( fac1 , fac2 ) ) NEW_LINE


import java . util . Scanner ; import java . util . Arrays ; import java . util . Vector ; import java . util . Collections ;    public class Problem_Solving1 { public static long fac ( long n ) { long f = 1 ; for ( int i = 2 ; i <= n ; i ++ ) { f *= i ; } return f ; }   public static void main ( String [ ] args ) {


import java . io . * ;   public class A {   static BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;   public static void main ( String [ ] args ) throws IOException {   int a , b ; String [ ] input = new String [ 2 ] ; input = br . readLine ( ) . split ( " ▁ " ) ; a = Integer . parseInt ( input [ 0 ] ) ; b = Integer . parseInt ( input [ 1 ] ) ; int min = Math . min ( a , b ) ; int ans = 1 ; for ( int i = 1 ; i <= min ; i ++ ) { ans = ans * i ; } System . out . println ( ans ) ; } }


import java . io . * ; import java . util . * ;   public class A_822 { static PrintWriter pw = new PrintWriter ( System . out ) ;   public static void main ( String arg [ ] ) throws IOException { InputStreamReader isr = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( isr ) ; StringTokenizer token = new StringTokenizer ( " ▁ " ) ;   int n = 0 ; int m = 0 ;   token = new StringTokenizer ( br . readLine ( ) ) ;   m = Integer . parseInt ( token . nextToken ( ) ) ; n = Integer . parseInt ( token . nextToken ( ) ) ;    pw . println ( getResult ( m , n ) ) ;   pw . close ( ) ;   }   private static long getResult ( int m , int n ) {   return getFactorial ( Math . min ( m , n ) ) ;   }   private static long getFactorial ( int n ) { int i = 0 ; long fact = 1 ;   for ( i = 1 ; i <= n ; i ++ ) fact = fact * i ;   return fact ; } }


import java . util . * ;   public class Main {   public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; long a = scanner . nextLong ( ) , b = scanner . nextLong ( ) ; long min = Math . min ( a , b ) ; long ans = 1 ; for ( long i = 1 ; i <= min ; i ++ ) { ans *= i ; } System . out . println ( ans ) ; } }


import java . util . * ; public class Main { final static int maxn = ( int ) 1e5 + 10 ; static int b [ ] = new int [ maxn ] ; static int g [ ] = new int [ maxn ] ; public static void main ( String args [ ] ) {

I = lambda : map ( int , input ( ) . split ( ) ) n , m = I ( ) a , b = sorted ( I ( ) , reverse = 1 ) , sorted ( I ( ) ) s = sum ( b ) for i in range ( 1 , n ) : s += a [ i ] * mif a [ 0 ] > b [ 0 ] : s = - 1 elif a [ 0 ] != b [ 0 ] : s += a [ 0 ] - a [ 1 ] print ( s ) NEW_LINE


nBoys , nGirls = map ( int , input ( ) . split ( ) ) boys = sorted ( map ( int , input ( ) . split ( ) ) , reverse = True ) girls = sorted ( map ( int , input ( ) . split ( ) ) ) if boys [ 0 ] > girls [ 0 ] : print ( - 1 ) exit ( ) ret = sum ( girls ) for i in range ( 1 , nBoys ) : ret += boys [ i ] * nGirlsif boys [ 0 ] != girls [ 0 ] : ret -= girls [ 0 ] - boys [ 0 ] ret += girls [ 0 ] - boys [ 1 ] print ( ret ) NEW_LINE


import sysinput = sys . stdin . readline   n , m = map ( int , input ( ) . split ( ) ) b = list ( map ( int , input ( ) . split ( ) ) ) g = list ( map ( int , input ( ) . split ( ) ) ) b . sort ( ) g . sort ( )   if b [ - 1 ] > g [ 0 ] : print ( - 1 ) exit ( )   if b [ - 1 ] == g [ 0 ] : ans = 0 for i in range ( n - 1 ) : ans += b [ i ] * m ans += sum ( g ) print ( ans ) else : ans = 0 for i in range ( n - 2 ) : ans += b [ i ] * m ans += g [ 0 ] + b [ n - 2 ] * ( m - 1 ) ans += b [ - 1 ] + sum ( g [ 1 : ] )   print ( ans ) NEW_LINE


I = lambda : map ( int , input ( ) . split ( ) ) n , m = I ( ) a , b = sorted ( I ( ) , reverse = 1 ) , sorted ( I ( ) ) s = sum ( b ) for i in range ( 1 , n ) : s += a [ i ] * mif a [ 0 ] > min ( b ) : s = - 1 elif a [ 0 ] != b [ 0 ] : s += a [ 0 ] - a [ 1 ] print ( s ) NEW_LINE


# include < iostream > # include < cstdio > # include < cstdlib > # include < cstring > # include < string > # include < stack > # include < map > # include < queue > # include < algorithm > # include < cmath > typedef long long LL ; using namespace std ;  # define MAX 100000 + 10   int n , m ; LL ans ;   LL a [ MAX ] , b [ MAX ] ;   bool cmp ( LL a , LL b ) { return a > b ; }   int main ( ) { cin >> n >> m ;   for ( int i = 0 ; i < n ; i ++ ) scanf ( " % lld " , a + i ) ; for ( int i = 0 ; i < m ; i ++ ) scanf ( " % lld " , b + i ) ;   sort ( a , a + n , cmp ) ; sort ( b , b + m , cmp ) ;   if ( a [ 0 ] > b [ m - 1 ] ) cout << - 1 << endl ; else { int flag = 0 ; ans += a [ 0 ] ; for ( int i = 0 ; i < m - 1 ; i ++ ) ans += b [ i ] ;   if ( b [ m - 1 ] == a [ 0 ] ) flag = 1 ;   if ( flag ) { for ( int i = 1 ; i < n ; i ++ ) ans += a [ i ] * m ; } else { for ( int i = 1 ; i < n ; i ++ ) ans += a [ i ] * m ;   ans += b [ m - 1 ] - a [ 1 ] ; }   cout << ans << endl ; }   return 0 ; }


import java . util . * ; public class functions { public static void main ( String [ ] args ) { int t ; String n ; Scanner sc = new Scanner ( System . in ) ;   t = sc . nextInt ( ) ;   while ( t -- > 0 ) { n = sc . next ( ) ;   System . out . println ( n . length ( ) ) ; } } }

for _ in range ( int ( input ( ) ) ) : n = input ( ) NEW_LINE fx = n [ : : - 1 ] NEW_LINE ffx = fx [ : : - 1 ] NEW_LINE if int ( ffx ) == int ( n ) : NEW_LINE INDENT print ( len ( n ) ) else : NEW_LINE print ( len ( fx ) ) NEW_LINE DEDENT


for t in range ( int ( input ( ) ) ) : n = input ( ) NEW_LINE print ( len ( n ) ) NEW_LINE


num = int ( input ( ) ) NEW_LINE for _ in range ( num ) : string = str ( input ( ) ) NEW_LINE print ( len ( string ) ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : print ( len ( input ( ) ) ) NEW_LINE


import java . util . Scanner ;   public class kick {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n ; n = in . nextInt ( ) ; in . nextLine ( ) ; String a ; while ( n -- != 0 ) { a = in . nextLine ( ) ; System . out . println ( a . length ( ) ) ; } } }


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


import java . util . Scanner ;   public class A1455 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { String S = in . next ( ) ; System . out . println ( S . length ( ) ) ; } }   }


import java . util . Scanner ;   public class A1455 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = scanner . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { String n = scanner . next ( ) ; System . out . println ( n . length ( ) ) ; } } }


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

n = input ( ) print ( '0 ▁ ' + '0 ▁ ' + n ) NEW_LINE


n = int ( input ( ) ) print ( 0 , 0 , n ) NEW_LINE


n = int ( input ( ) ) fibs = [ 0 , 1 ]   while fibs [ - 1 ] < n : fibs . append ( sum ( fibs [ - 2 : ] ) ) if n <= 3 : print ( " ▁ " . join ( [ "0" ] * ( 3 - n ) + [ "1" ] * n ) ) else : print ( fibs [ - 5 ] , fibs [ - 4 ] , fibs [ - 2 ] ) NEW_LINE


import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int n = scn . nextInt ( ) ; int a = 0 ; int b = 1 ; int c = 0 ; int a1 = 0 ; int b1 = 1 ; int c1 = 0 ; int count = 0 ; while ( c != n ) { c = a + b ; a = b ; b = c ; count ++ ; } int [ ] arr = new int [ count + 2 ] ; arr [ 0 ] = a1 ; arr [ 1 ] = b1 ; for ( int i = 2 ; i < arr . length ; i ++ ) { c1 = a1 + b1 ; a1 = b1 ; b1 = c1 ; arr [ i ] = c1 ; } int ans1 = 0 ; int ans2 = 0 ; if ( arr . length - 3 >= 0 ) { ans1 = arr [ arr . length - 3 ] ; } if ( arr . length - 2 >= 0 ) { ans2 = arr [ arr . length - 2 ] ; } System . out . println ( arr [ 0 ] + " ▁ " + ans1 + " ▁ " + ans2 ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   public class experiment { static int M = 1_000_000_007 ; static int INF = Integer . MAX_VALUE ; static final FastScanner fs = new FastScanner ( ) ;


import java . util . Scanner ;   public class Hexadecimaltheorem { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; System . out . println ( 0 + " ▁ " + 0 + " ▁ " + n ) ; } }


import java . io . BufferedReader ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Scanner ; import java . util . StringTokenizer ;    public class relative {   public static void main ( String [ ] args ) {

n = int ( input ( ) ) m1 = { } m2 = { } for x in range ( 367 ) : m1 [ x ] = 0 for y in range ( 367 ) : m2 [ y ] = 0 for friend in range ( n ) : g , a , b = input ( ) . split ( ) for bruh in range ( int ( a ) , int ( b ) + 1 ) : if g == " M " : m1 [ bruh ] += 1 elif g == " F " : m2 [ bruh ] += 1 attendees = [ ] for day in range ( 367 ) : attendees . append ( min ( m1 [ day ] , m2 [ day ] ) )   print ( max ( attendees ) * 2 )     NEW_LINE


import sysdef input ( ) : return sys . stdin . readline ( ) . strip ( ) def iinput ( ) : return int ( input ( ) ) def minput ( ) : return map ( int , input ( ) . split ( ) ) def listinput ( ) : return list ( map ( int , input ( ) . split ( ) ) ) Male , Female = [ ] , [ ] days = [ [ 0 , 0 ] for _ in range ( 366 ) ] for _ in range ( iinput ( ) ) : a , b , c = map ( str , input ( ) . split ( ) ) if a == ' M ' : for i in range ( int ( b ) - 1 , int ( c ) ) : days [ i ] [ 0 ] += 1 else : for i in range ( int ( b ) - 1 , int ( c ) ) : days [ i ] [ 1 ] += 1 answer = - 1 for j in days : answer = max ( answer , min ( j ) * 2 ) print ( answer )   NEW_LINE


t = int ( input ( ) ) lst1 = [ ] lstm = [ 0 ] * 367 lstf = [ 0 ] * 367 lst2 = [ ] lst4 = [ ] count = 0 for k in range ( t ) : x , y , z = input ( ) . split ( ) for i in range ( int ( y ) , int ( z ) + 1 ) : if ( x == ' M ' ) : lstm [ i ] = lstm [ i ] + 1 elif ( x == ' F ' ) : lstf [ i ] = lstf [ i ] + 1 maxx = 0 for l in range ( 1 , 367 ) : num = 2 * min ( lstf [ l ] , lstm [ l ] ) if ( num >= maxx ) : maxx = numprint ( maxx )                   NEW_LINE


class friends : def __init__ ( self , gender , start , end ) : self . gender = gender self . start = start self . end = end   n = int ( input ( ) ) obj = [ ] for _ in range ( n ) : gender , start , end = input ( ) . split ( ) obj . append ( friends ( gender , int ( start ) , int ( end ) ) ) obj . sort ( key = lambda x : x . start ) invit = [ ]   m = [ 0 ] * 367 f = [ 0 ] * 367 for i in obj :   for j in range ( i . start , i . end + 1 ) : if i . gender == ' M ' : m [ j ] += 1 elif i . gender == ' F ' : f [ j ] += 1 maxx = 0   for i in range ( 367 ) : num = 2 * min ( m [ i ] , f [ i ] ) maxx = num if num > maxx else maxx   print ( maxx )             NEW_LINE


M = [ 0 for i in range ( 367 ) ] F = [ 0 for i in range ( 367 ) ] n = int ( input ( ) ) for _ in range ( n ) : g , n1 , n2 = input ( ) . split ( ) b = int ( n1 ) c = int ( n2 ) for j in range ( b , c + 1 ) : if g == ' M ' : M [ j ] += 1 else : F [ j ] += 1 k = 0 for i in range ( 367 ) : m = min ( M [ i ] , F [ i ] ) if m > k : k = mprint ( k * 2 )   NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ; import static java . util . Arrays . sort ; import javafx . util . Pair ;   public class Main { public static void main ( String [ ] args ) {   FastScanner input = new FastScanner ( ) ; int n = input . nextInt ( ) ; int male [ ] = new int [ 367 ] ; int female [ ] = new int [ 367 ] ; for ( int i = 0 ; i < n ; i ++ ) { char ch = input . next ( ) . charAt ( 0 ) ; int a = input . nextInt ( ) ; int b = input . nextInt ( ) ; if ( ch == ' M ' ) { for ( int j = a ; j <= b ; j ++ ) { male [ j ] ++ ; } } else { for ( int j = a ; j <= b ; j ++ ) { female [ j ] ++ ; } } } int ans = Integer . MIN_VALUE ; for ( int i = 1 ; i < 367 ; i ++ ) { ans = Math . max ( ans , Math . min ( male [ i ] , female [ i ] ) ) ; } System . out . println ( ans * 2 ) ; }   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 . * ;   public class DoggoRecoloring { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Task solver = new Task ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class Task { public void solve ( int testNumber , InputReader in , PrintWriter out ) { int N = in . nextInt ( ) ; String s = in . next ( ) ; Map < Character , Integer > hm = new HashMap ( ) ; int cnt = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; hm . put ( c , hm . getOrDefault ( c , 0 ) + 1 ) ; } for ( Integer i : hm . values ( ) ) if ( i == 1 ) cnt ++ ; if ( cnt == N && N != 1 ) out . println ( " NO " ) ; else out . println ( " YES " ) ; } }

n = int ( input ( ) ) s = input ( ) a = [ 0 ] * 26 for i in s : a [ ord ( i ) - ord ( ' a ' ) ] += 1 a . sort ( reverse = True ) if a [ 0 ] > 1 or n == 1 : print ( " Yes " ) else : print ( " No " ) NEW_LINE


numTests = int ( input ( ) ) string = input ( )     if numTests > 26 or numTests == 1 : print ( " Yes " ) else : temp = [ ] result = " No " for x in string : if x in temp : result = " Yes " break else : temp . append ( x ) print ( result ) NEW_LINE


n = int ( input ( ) ) s = input ( ) if n == 1 : print ( " YES " ) elif len ( set ( s ) ) == len ( s ) : print ( " NO " ) else : print ( " YES " ) NEW_LINE


num = int ( input ( ) ) pup = input ( )   lst = [ ] for i in range ( num ) : lst . append ( pup [ i ] )   lst . sort ( )   if num > 1 : for i in range ( num ) : if i < num - 1 : if lst [ i ] == lst [ i + 1 ] : print ( " YES " ) break   if i == ( num - 1 ) : print ( " NO " )   elif num == 1 : print ( " YES " ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   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 scan = new FastReader ( ) ; PrintWriter rt = new PrintWriter ( System . out ) ;   int y = scan . nextInt ( ) ; String s = scan . next ( ) ;   if ( y == 1 ) { rt . print ( " Yes " ) ; rt . close ( ) ; return ; }   else {   int arr [ ] = new int [ 27 ] ;   for ( int i = 0 ; i < s . length ( ) ; i ++ ) { arr [ s . charAt ( i ) - 97 ] ++ ;   if ( arr [ s . charAt ( i ) - 97 ] == 2 ) { rt . print ( " YES " ) ; rt . close ( ) ; return ; } } } rt . print ( " NO " ) ; rt . close ( ) ; return ; } }


import java . io . * ; import java . util . * ;   public class test {   static String pangrams ( String s ) { if ( s . length ( ) == 1 ) return " Yes " ; ArrayList < Character > alphas = new ArrayList < > ( ) ; ArrayList < Character > alphac = new ArrayList < > ( ) ; for ( int i = ' A ' ; i <= ' Z ' ; i ++ ) { alphas . add ( ( char ) i ) ; } for ( int i = ' a ' ; i <= ' z ' ; i ++ ) { alphac . add ( ( char ) i ) ; } int [ ] c = new int [ alphac . size ( ) ] ; Arrays . fill ( c , 0 ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { int indexs = alphas . indexOf ( s . charAt ( i ) ) ; int indexc = alphac . indexOf ( s . charAt ( i ) ) ; if ( indexc >= 0 ) c [ indexc ] ++ ; if ( indexs >= 0 ) c [ indexs ] ++ ; } for ( int i : c ) { if ( i > 1 ) return " Yes " ; } return " No " ; }   private static final Scanner scanner = new Scanner ( System . in ) ;   public static void main ( String [ ] args ) throws IOException { scanner . nextLine ( ) ; String s = scanner . nextLine ( ) ;   String result = pangrams ( s ) ;   System . out . println ( result ) ;   scanner . close ( ) ; } }


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . StringTokenizer ; import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . InputStream ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; ADoggoRecoloring solver = new ADoggoRecoloring ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class ADoggoRecoloring { public void solve ( int testNumber , InputReader in , PrintWriter out ) { int n = in . nextInt ( ) ; int [ ] count = new int [ ' z ' + 1 ] ; String s = in . next ( ) ; for ( int i = 0 ; i < n ; i ++ ) { count [ s . charAt ( i ) ] ++ ; if ( count [ s . charAt ( i ) ] > 1 ) { out . println ( " Yes " ) ; return ; } } out . println ( n == 1 ? " Yes " : " No " ) ; }   }   static class InputReader { private BufferedReader reader ; private StringTokenizer tokenizer ;   public InputReader ( InputStream inputStream ) { reader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; }   public String next ( ) { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { try { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return tokenizer . nextToken ( ) ; }   public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   } }


import java . util . Scanner ;   public class Slava {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int p = 0 ; String s = sc . next ( ) ; for ( int i = 0 ; i < s . length ( ) - 1 ; i ++ ) { for ( int j = i + 1 ; j < s . length ( ) ; j ++ ) { if ( s . charAt ( i ) != s . charAt ( j ) ) { continue ; } else { p ++ ; break ; } } } if ( n == 1 ) { System . out . println ( " YES " ) ; } else { System . out . println ( p > 0 ? " YES " : " NO " ) ; } }   }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . util . StringTokenizer ;   public class Gym {   static Map < Integer , Long > map = new HashMap < > ( ) ;   public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; OutputStream outputStream = System . out ; PrintWriter out = new PrintWriter ( outputStream ) ; int t = 1 ;

n = int ( input ( ) ) a = [ int ( x ) for x in input ( ) . split ( ) ] a . sort ( ) flag = 0 for i in range ( 1 , n ) : if a [ i ] % a [ 0 ] : flag = 1 breakif flag : print ( - 1 ) else : print ( a [ 0 ] ) NEW_LINE


import mathn = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) gc = l [ 0 ] for i in range ( 1 , n ) : gc = math . gcd ( gc , l [ i ] ) print ( gc if gc in l else " - 1" ) NEW_LINE


from sys import stdininput = stdin . readline   n = int ( input ( ) ) a = [ int ( x ) for x in input ( ) . split ( ) ] x = min ( a ) for i in a : if i % x > 0 : print ( - 1 ) breakelse : print ( x ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) m = min ( a ) for i in range ( n ) : if a [ i ] % m != 0 : print ( - 1 ) exit ( ) print ( m ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) k = min ( a ) for i in a : if i % k != 0 : exit ( print ( - 1 ) ) print ( k )                                   NEW_LINE


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; int ans = Integer . MAX_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } Arrays . sort ( arr ) ; boolean found = true ; int i = 0 ; for ( i = 1 ; i < n ; i ++ ) { if ( arr [ i ] % arr [ 0 ] == 0 ) found = true ; else { found = false ; break ; } } if ( found ) System . out . println ( arr [ 0 ] ) ; else System . out . println ( - 1 ) ; } }


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


import java . io . * ; import java . util . * ;   public class A_299 { static PrintWriter pw = new PrintWriter ( System . out ) ;   public static void main ( String arg [ ] ) throws IOException { InputStreamReader isr = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( isr ) ; StringTokenizer token = new StringTokenizer ( " ▁ " ) ;   int n = 0 ; int arr [ ] ; int i = 0 ; int j = 0 ; int min = Integer . MAX_VALUE ;   n = Integer . parseInt ( br . readLine ( ) ) ; arr = new int [ n ] ;   token = new StringTokenizer ( br . readLine ( ) ) ;   for ( j = 0 ; j <= n - 1 ; j ++ ) { arr [ j ] = Integer . parseInt ( token . nextToken ( ) ) ; if ( arr [ j ] < min ) min = arr [ j ] ; }   pw . println ( getResult ( arr , n , min ) ) ; pw . close ( ) ;   }   private static long getResult ( int arr [ ] , int n , int min ) { int i = 0 ;   for ( i = 0 ; i <= n - 1 ; i ++ ) if ( arr [ i ] % min != 0 ) return - 1 ;   return min ;   } }


import java . util . Scanner ;   public class incARG { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; String s = in . next ( ) ;   in . close ( ) ; System . out . println ( s . indexOf ( '0' ) >= 0 ? s . indexOf ( '0' ) + 1 : n ) ; } }

INDENT n = int ( input ( ) ) a = input ( ) flag = 0   for i in range ( n ) : if ( a [ i ] == '0' ) : print ( i + 1 ) flag = 1 breakif ( flag == 0 ) : print ( n ) NEW_LINE DEDENT


n = int ( input ( ) ) s = str ( input ( ) ) y = s [ : : - 1 ] t = 0j = 1 for i in range ( n ) : if y [ n - j ] == '1' : t += 1 j += 1 else : print ( t + 1 ) exit ( ) print ( t ) NEW_LINE


n = int ( input ( ) ) s = input ( ) x = 1 for i in range ( n ) : if ( s [ i ] != '1' ) : break x += 1 if x > n : x = nprint ( x )                       NEW_LINE


counter = 0 num = int ( input ( ) ) binary = input ( ) for i in range ( num ) : if ( binary [ i ] == '1' ) : counter += 1 else : breakif ( num > counter + 1 ) : print ( counter + 1 ) else : print ( num ) NEW_LINE


n = int ( input ( ) ) s = input ( ) c = 1 changes = 0 if ( n >= 1 and n <= 100 ) : for i in range ( n ) : if ( s [ i ] == '1' and c == 1 ) : c = 1 changes += 1 elif ( s [ i ] == '0' and c == 1 ) : c = 0 changes += 1 elif ( s [ i ] == '1' and c == 0 ) : c = 0 else : c = 0 print ( changes ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   import static java . lang . Integer . lowestOneBit ; import static java . lang . Integer . parseInt ;   public class Example {   public static void main ( String [ ] args ) {        Scanner sc = new Scanner ( System . in ) ;    int t = sc . nextInt ( ) ; String s = sc . next ( ) ; int ans = 0 ; int i = 0 ; while ( s . charAt ( i ) != '0' ) { ans ++ ; i ++ ; if ( i == s . length ( ) ) { break ; } } if ( ans + 1 >= s . length ( ) ) { System . out . println ( s . length ( ) ) ; } else { System . out . println ( ans + 1 ) ; }    } }


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


import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { int n ; String cells ; Scanner sc = new Scanner ( System . in ) ; int affectedCells = 0 ;   n = sc . nextInt ( ) ; cells = sc . next ( ) ;   for ( int i = 0 ; i < n ; i ++ ) { if ( cells . charAt ( i ) == '1' ) { affectedCells ++ ; } else { affectedCells ++ ; break ; }   }   System . out . println ( affectedCells ) ;   } }


import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; List < Integer > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; ++ i ) { list . add ( scanner . nextInt ( ) ) ; }

n = int ( input ( ) ) ar = list ( map ( int , input ( ) . split ( ) ) ) ar = sorted ( ar ) print ( ar [ ( n + 1 ) // 2 - 1 ] )     NEW_LINE


n = int ( input ( ) ) nums = list ( map ( int , input ( ) . split ( ) ) ) nums = sorted ( nums ) if n % 2 == 0 : print ( nums [ int ( n / 2 ) - 1 ] ) else : print ( nums [ n // 2 ] ) NEW_LINE


if __name__ == " _ _ main _ _ " : n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) arr . sort ( ) print ( arr [ ( 1 + n ) // 2 - 1 ] ) NEW_LINE


if __name__ == " _ _ main _ _ " : n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) arr . sort ( ) print ( arr [ ( 1 + n ) // 2 - 1 ] )   NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( ) print ( a [ ( n - 1 ) // 2 ] ) NEW_LINE


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Collections ; import java . util . List ;   public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; String [ ] s = br . readLine ( ) . split ( " ▁ " ) ; List < Integer > arr = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { arr . add ( Integer . parseInt ( s [ i ] ) ) ; } Collections . sort ( arr ) ; System . out . println ( arr . get ( ( n + 1 ) / 2 - 1 ) ) ; } }


import java . util . Scanner ;   public class Middle { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; long [ ] arr = new long [ n ] ; in . nextLine ( ) ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = in . nextInt ( ) ; } mergeSort ( arr , 0 , n - 1 ) ; long res = findMiddle ( arr , n ) ; System . out . printf ( String . valueOf ( res ) ) ; }   public static void mergeSort ( long [ ] arr , int start , int end ) {


import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ;    public class mindist { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int [ ] x = new int [ n ] ; List < Integer > list = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { list . add ( scanner . nextInt ( ) ) ; } Collections . sort ( list ) ;   System . out . println ( list . get ( n / 2 + n % 2 - 1 ) ) ; } }


import java . util . * ;   public class CodeForces710B { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; Integer [ ] a = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = input . nextInt ( ) ; }   Arrays . sort ( a ) ; System . out . println ( n % 2 == 0 ? a [ n / 2 - 1 ] : a [ n / 2 ] ) ;   } }


import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int a = s . nextInt ( ) ; int x = s . nextInt ( ) ; int b = s . nextInt ( ) ; int y = s . nextInt ( ) ; int found = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { a = a + 1 ; if ( a == n + 1 ) a = a % n ; b = b - 1 ; if ( b == 0 ) b = n ; if ( a == x || b == y ) { boolean v = check ( a , b ) ; if ( v == true ) found = 1 ; break ; } boolean v1 = check ( a , b ) ; if ( v1 == true ) { found = 1 ; break ; } } if ( found == 1 ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } public static boolean check ( int a , int b ) { boolean c = false ; if ( a == b ) c = true ; return c ; } }

s = " NO " n , a , x , b , y = map ( int , input ( ) . split ( ) ) while a != x and b != y : a += 1 b -= 1 if a > n : a = 1 if b < 1 : b = n if a == b : s = " YES " breakprint ( s ) NEW_LINE


n , a , x , b , y = map ( int , input ( ) . split ( ) ) for i in range ( n ) : if a == b : print ( ' YES ' ) exit ( 0 ) if a == x or b == y : break a = ( a + 1 ) % n if a == 0 : a = n b = ( b - 1 ) if b <= 0 : b = n + bprint ( ' NO ' ) NEW_LINE


n , a , x , b , y = map ( int , input ( ) . split ( ) ) flag = 0 while a != x and b != y : a += 1 b -= 1 if a == n + 1 : a = 1 if b == 0 : b = n if a == b : flag = 1 breakif flag == 0 : print ( ' NO ' ) else : print ( ' YES ' ) NEW_LINE


no_of_station , Daniel_start , Daniel_finish , Vlad_start , Vlad_finish = map ( int , input ( ) . split ( ) ) station_of_daniel = Daniel_start station_of_vlad = Vlad_startflag = 0     while True : if ( station_of_vlad == station_of_daniel ) : print ( " YES " ) flag = 1 break if ( station_of_daniel == Daniel_finish or station_of_vlad == Vlad_finish ) : break if ( station_of_daniel + 1 <= no_of_station ) : station_of_daniel += 1 else : station_of_daniel = 1 if ( station_of_vlad - 1 > 0 ) : station_of_vlad -= 1 else : station_of_vlad = no_of_station if ( flag == 0 ) : print ( " NO " ) NEW_LINE


import java . util . * ;   public class Absolutezero { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int p1 = a ; int p2 = b ;   List < Integer > st1 = new ArrayList < > ( ) ; List < Integer > st2 = new ArrayList < > ( ) ; while ( p1 != x ) { st1 . add ( p1 ) ; p1 ++ ; if ( p1 == ( n + 1 ) ) { p1 = 1 ; } } st1 . add ( p1 ) ; while ( p2 != y ) { st2 . add ( p2 ) ; p2 -- ; if ( p2 == ( 0 ) ) { p2 = n ; } } st2 . add ( p2 ) ; for ( int i = 0 ; i < Math . min ( st1 . size ( ) , st2 . size ( ) ) ; i ++ ) { if ( st1 . get ( i ) . equals ( st2 . get ( i ) ) ) { System . out . println ( " YES " ) ; return ; } } System . out . println ( " NO " ) ;    }   static int countSetBits ( int n ) { int count = 0 ; while ( n > 0 ) { count += n & 1 ; n >>= 1 ; } return count ; }   public List < Integer > getDivisors ( int n ) { List < Integer > list = new ArrayList < > ( ) ; for ( int d = 2 ; d * d <= n ; d ++ ) { while ( n % d == 0 ) { list . add ( d ) ; n /= d ; } } if ( n > 1 ) { list . add ( n ) ; } return list ; }   public int lcm ( int n1 , int n2 ) { int gcd = 1 ; for ( int i = 1 ; i <= n1 && i <= n2 ; ++ i ) {


import java . util . * ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; a -- ; b -- ; x -- ; y -- ; while ( true ) { if ( a == b ) { System . out . println ( " YES " ) ; break ; } if ( a == x || b == y ) { System . out . println ( " NO " ) ; break ; } a = ( a + 1 ) % n ; b = ( b - 1 + n ) % n ; } } }


import java . io . Writer ; import java . io . BufferedWriter ; import java . io . OutputStreamWriter ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . io . IOException ; import java . io . InputStream ; import java . math . BigInteger ; import java . util . Arrays ; import java . util . ArrayList ; import java . util . InputMismatchException ; import java . util . * ; import java . io . * ; import java . math . * ; import java . util . concurrent . TimeUnit ;   public class C1013 { static class pair { int val , idx ; pair ( int a , int b ) { val = a ; idx = b ; } public String toString ( ) { return " ( val : ▁ " + val + " ▁ idx : ▁ " + idx + " ) " ; } }    static class ProblemSolver { public void solveTheProblem ( InputReader in , OutputWriter out , NumberTheory nt , Debug dbg ) { dbg . setLocal ( 1 ) ; int test = 1 ;

n = int ( input ( ) ) ls = list ( map ( int , input ( ) . split ( ) ) ) ls . sort ( ) x = ls [ len ( ls ) - 1 ] - ls [ 0 ] y = 0x7fffffffff or i in range ( 1 , n ) : tep = ls [ i + n - 1 ] - ls [ i ] if tep < y : y = tepans = x * yx = ls [ n - 1 ] - ls [ 0 ] y = ls [ len ( ls ) - 1 ] - ls [ n ] ans = min ( ans , x * y ) print ( ans ) NEW_LINE


n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) l . sort ( ) ans = ( l [ n - 1 ] - l [ 0 ] ) * ( l [ 2 * n - 1 ] - l [ n ] ) for i in range ( 1 , n ) : ans = min ( ans , ( l [ n + i - 1 ] - l [ i ] ) * ( l [ 2 * n - 1 ] - l [ 0 ] ) ) print ( ans ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( ) minn = 10000000000000 for i in range ( n ) : minn = min ( minn , a [ i + n - 1 ] - a [ i ] ) if n == 1 : print ( 0 ) else : print ( min ( ( ( a [ 2 * n - 1 ] - a [ 0 ] ) * ( minn ) ) , ( a [ n - 1 ] - a [ 0 ] ) * ( a [ 2 * n - 1 ] - a [ n ] ) ) ) NEW_LINE


import java . util . * ; import java . io . * ; import java . net . URI ; public class b {   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 ( final String [ ] args ) throws IOException { FastReader sc = new FastReader ( ) ; int n = sc . nextInt ( ) ; n = 2 * n ;   long [ ] x = new long [ n ] ;   for ( int i = 0 ; i < n ; i ++ ) x [ i ] = sc . nextLong ( ) ;   Arrays . sort ( x ) ;   long area = Math . abs ( x [ 0 ] - x [ n / 2 - 1 ] ) * Math . abs ( x [ n / 2 ] - x [ n - 1 ] ) ;   long z = Integer . MAX_VALUE ;   for ( int i = 1 ; i < n / 2 ; i ++ ) z = Math . min ( z , Math . abs ( x [ i ] - x [ i + ( n / 2 ) - 1 ] ) ) ;   long sarea = z * Math . abs ( x [ 0 ] - x [ n - 1 ] ) ;   System . out . println ( Math . min ( area , sarea ) ) ;    } }


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class Problem500A { public static void main ( String [ ] args ) throws Exception { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter writer = new PrintWriter ( System . out ) ;   int n = Integer . parseInt ( reader . readLine ( ) ) ; StringTokenizer tokenizer = new StringTokenizer ( reader . readLine ( ) ) ;   Long [ ] coords = new Long [ 2 * n ] ; for ( int i = 0 ; i < 2 * n ; i ++ ) { coords [ i ] = ( long ) Integer . parseInt ( tokenizer . nextToken ( ) ) ; }   Arrays . sort ( coords ) ;   long minCoord = coords [ 0 ] ; long maxCoord = coords [ coords . length - 1 ] ;   long minArea = ( coords [ n - 1 ] - coords [ 0 ] ) * ( coords [ 2 * n - 1 ] - coords [ n ] ) ; for ( int i = 1 ; i < n ; i ++ ) { minArea = Math . min ( minArea , ( maxCoord - minCoord ) * ( coords [ i + n - 1 ] - coords [ i ] ) ) ; }   writer . println ( minArea ) ;    reader . close ( ) ; writer . close ( ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ; import static java . util . Arrays . sort ; import javafx . util . Pair ;   public class Main {   public static void main ( String [ ] args ) {   FastScanner input = new FastScanner ( ) ; String s = input . next ( ) ; int letter [ ] = new int [ 26 ] ;   for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == ' a ' ) { letter [ 0 ] ++ ; } else { for ( int j = 0 ; j < s . charAt ( i ) - ' a ' ; j ++ ) { if ( letter [ j ] == 0 ) { System . out . println ( " NO " ) ; return ; } } letter [ s . charAt ( i ) - ' a ' ] ++ ; } } System . out . println ( " YES " ) ; }   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 ( ) ; } }   }

s = input ( ) st = [ ' a ' , ' b ' , ' c ' , ' d ' , ' e ' , ' f ' , ' g ' , ' h ' , ' i ' , ' j ' , ' k ' , ' l ' , ' m ' , ' n ' , ' o ' , ' p ' , ' q ' , ' r ' , ' s ' , ' t ' , ' u ' , ' v ' , ' w ' , ' x ' , ' y ' , ' z ' ] f = Trueuse = set ( ) last = - 1 for i in range ( len ( s ) ) : if s [ i ] in use : pass elif s [ i ] != st [ last + 1 ] : f = False break else : use . add ( s [ i ] ) last += 1 if f : print ( " YES " ) else : print ( " NO " ) NEW_LINE


s = input ( ) a = " abcdefghijklmnopqrstuvwxyz " x = [ i for i in s ] y = [ ] for i in x : if i in y : continue else : y . append ( i ) l = len ( y ) j = " " . join ( y ) if a [ : l ] == j : print ( " YES " ) else : print ( " NO " ) NEW_LINE


import string   def solve ( seq ) : ref = list ( string . ascii_lowercase ) index = 0 for x in seq : if x > ref [ index ] : return " NO " elif x == ref [ index ] : if index == 25 : continue index += 1 return " YES " print ( solve ( input ( ) ) )                                         NEW_LINE


import string   obf = [ x for x in input ( ) ] obf = [ x for i , x in enumerate ( obf ) if x not in obf [ : i ] ] n = len ( obf )   letters = list ( string . ascii_lowercase ) letters = letters [ : n ]   if obf == letters : print ( ' Yes ' ) else : print ( ' No ' )   NEW_LINE


import java . util . * ; import java . util . stream . Collectors ; import java . lang . * ; import java . io . * ; public class Problem { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; String temp = " a " ; String ans = " YES " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( temp . indexOf ( s . charAt ( i ) ) != - 1 ) continue ; if ( s . charAt ( i ) == temp . charAt ( temp . length ( ) - 1 ) + 1 && i > 0 ) { temp += s . charAt ( i ) + " " ; } else { ans = " NO " ; break ; } } System . out . println ( ans ) ; }   }


import java . util . Scanner ;   public class GeraldHexagonC313Q1 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int [ ] arr = new int [ 6 ] ; for ( int i = 0 ; i < 6 ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } int a1 = arr [ 0 ] ; int a2 = arr [ 1 ] ; int a3 = arr [ 2 ] ; int a5 = arr [ 4 ] ; System . out . println ( ( a1 + a2 + a3 ) * ( a1 + a2 + a3 ) - a1 * a1 - a3 * a3 - a5 * a5 ) ; sc . close ( ) ; } }

import math , sys , bisect , heapq , osfrom collections import defaultdict , Counter , dequefrom itertools import groupby , accumulatefrom functools import lru_cache NEW_LINE


a , b , c , d , e , f = list ( map ( int , input ( ) . split ( ) ) ) print ( ( a + b + c ) ** 2 - a * a - e * e - c * c ) NEW_LINE


sides = input ( ) seperate = sides . split ( " ▁ " ) a , b , c , d , e , f = seperatea = int ( a ) b = int ( b ) c = int ( c ) d = int ( d ) e = int ( e ) f = int ( f ) area1 = 0 area2 = 0 area3 = 0 if b == f and c == e : for i in range ( b ) : area1 += ( 2 * a ) + 1 a += 1 for i in range ( e ) : area2 += ( 2 * d ) + 1 d += 1 else : if b > f : for i in range ( f ) : area1 += ( 2 * a ) + 1 a += 1 b = b - f for i in range ( b ) : area2 += ( 2 * a ) e = e - b for i in range ( c ) : area3 += ( 2 * d ) + 1 d += 1   elif b < f : for i in range ( b ) : area1 += ( 2 * a ) + 1 a += 1 f = f - b for i in range ( f ) : area2 += ( 2 * a ) c = c - f for i in range ( e ) : area3 += ( 2 * d ) + 1 d += 1 print ( ( area1 + area3 + area2 ) )   NEW_LINE


import java . io . File ; import java . util . Scanner ; import java . util . StringTokenizer ;   public class p006 { public static void main ( String args [ ] ) throws Exception { StringTokenizer stok = new StringTokenizer ( new Scanner ( System . in ) . useDelimiter ( " \\ A " ) . next ( ) ) ; StringBuilder sb = new StringBuilder ( ) ; int a1 = Integer . parseInt ( stok . nextToken ( ) ) ; int a2 = Integer . parseInt ( stok . nextToken ( ) ) ; int a3 = Integer . parseInt ( stok . nextToken ( ) ) ; int a4 = Integer . parseInt ( stok . nextToken ( ) ) ; int a5 = Integer . parseInt ( stok . nextToken ( ) ) ; int a6 = Integer . parseInt ( stok . nextToken ( ) ) ; int v = a1 ; long tot = 0 ; for ( int i = 0 ; i < Math . min ( a2 , a6 ) ; i ++ , v ++ ) tot += v * 2 + 1 ; for ( int i = Math . min ( a2 , a6 ) ; i < Math . max ( a2 , a6 ) ; i ++ ) tot += 2 * v ; for ( int i = Math . max ( a2 , a6 ) ; i < a2 + a3 ; i ++ , v -- ) tot += 2 * v - 1 ; System . out . println ( tot ) ; } }


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


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

import mathk , n , s , p = [ int ( x ) for x in input ( ) . split ( ) ] x = math . ceil ( n / s ) y = math . ceil ( x * k / p ) print ( y ) NEW_LINE


k , n , s , p = map ( int , input ( ) . split ( ) ) x = ( n + s - 1 ) // sx *= kprint ( ( x + p - 1 ) // p )     NEW_LINE


k , n , s , p = map ( int , input ( ) . split ( ' ▁ ' ) ) if ( 1 * n ) % s == 0 : need = ( 1 * n ) // s if need == 0 and k % p == 0 : print ( k // p ) elif ( k * need ) % p == 0 : print ( ( k * need ) // p ) else : print ( ( ( k * need ) // p ) + 1 ) else : need = ( ( 1 * n ) // s ) + 1 if need == 0 and k % p == 0 : print ( k // p ) elif ( k * need ) % p == 0 : print ( ( k * need ) // p ) else : print ( ( ( k * need ) // p ) + 1 ) NEW_LINE


k , n , s , p = map ( int , input ( ) . split ( ) )   paper_person = ( n + s - 1 ) // s   total_needed = paper_person * k   ans = ( total_needed + p - 1 ) // p   print ( ans )     NEW_LINE


import mathk , n , s , p = map ( int , input ( ) . split ( ) ) sheets = math . ceil ( n / s ) * kprint ( math . ceil ( sheets / p ) ) 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 . Collection ; import java . util . List ; import java . util . Scanner ; import java . util . function . Function ; import java . util . stream . Collectors ; public class _p000965A { static public void main ( final String [ ] args ) throws IOException { p000965A . _main ( args ) ; }


import java . util . Scanner ;   public class PaperAirplanes { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; double k = in . nextDouble ( ) , n = in . nextDouble ( ) , s = in . nextDouble ( ) , p = in . nextDouble ( ) ;   in . close ( ) ; System . out . println ( ( int ) Math . ceil ( Math . ceil ( n / s ) * k / p ) ) ; } }


import java . util . * ; import java . io . * ;   public class tr0 { static PrintWriter out ; static StringBuilder sb ; static int mod = ( int ) 1e9 + 7 ; static long inf = ( long ) 1e14 ; static int n , m , c ; static int [ ] [ ] ad ; static int [ ] [ ] [ ] memo ; static boolean f ; static boolean vis [ ] ; static int [ ] px , Q [ ] ; static HashMap < Integer , Integer > hm ;   public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; out = new PrintWriter ( System . out ) ; int k = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int s = sc . nextInt ( ) ; int p = sc . nextInt ( ) ; long lo = 0 ; long hi = ( long ) 1e9 ; long ans = 0 ; while ( lo <= hi ) { long i = lo + hi >> 1 ; long paper = p * 1l * i ; long in = paper / k ; long kk = in * 1l * s ;