import java . io . * ; import java . util . * ;   final public class A {   public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder sb = new StringBuilder ( ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; Double [ ] arr = new Double [ 2 * n ] ; int non_int = 0 ; double sum_before = 0 , sum = 0 ; for ( int i = 0 ; i < 2 * n ; i ++ ) { double num = Double . parseDouble ( st . nextToken ( ) ) ; sum_before += num ; if ( num != Math . floor ( num ) ) non_int ++ ; sum += Math . floor ( num ) ; arr [ i ] = num ; } double max_sum = Math . min ( n , non_int ) + sum ; double min_sum = Math . max ( 0 , non_int - n ) + sum ; double ans ; if ( min_sum > sum_before ) ans = ( min_sum - sum_before ) ; else if ( max_sum < sum_before ) ans = ( sum_before - max_sum ) ; else { double x = sum_before - Math . floor ( sum_before ) ; ans = Math . min ( 1 - x , x ) ; } System . out . printf ( " % .3f " , ans ) ; } }

import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . FileNotFoundException ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class Main { public static void main ( String [ ] args ) throws FileNotFoundException , IOException {

import java . io . ByteArrayInputStream ; import java . io . File ; import java . io . FileInputStream ; import java . io . FileNotFoundException ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . nio . charset . StandardCharsets ; import java . util . Arrays ; import java . util . InputMismatchException ;   public class A351 { static class Solver { int N , M , Z , down [ ] , sum , best ; boolean used [ ] ; void solve ( int testNumber , FastScanner s , PrintWriter out ) { N = s . nextInt ( ) ; down = new int [ 2 * N ] ; for ( int i = 0 ; i < 2 * N ; i ++ ) { int spl = Integer . parseInt ( s . next ( ) . split ( " \\ . " ) [ 1 ] ) ; if ( spl == 0 ) Z ++ ; else sum += ( down [ M ++ ] = spl ) ; } int lo = max ( N - Z , 0 ) , hi = min ( N , 2 * N - Z ) ; best = 69_420_1337 ; for ( int i = lo ; i <= hi ; i ++ ) best = min ( best , Math . abs ( sum - 1000 * i ) ) ;

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigDecimal ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class Solution2 { private static int MIN = Integer . MIN_VALUE + 5 , MAX = Integer . MAX_VALUE - 5 ; public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( reader . readLine ( ) ) ; int N = 2 * n ; StringTokenizer sToken = new StringTokenizer ( reader . readLine ( ) ) ; int [ ] down = new int [ N ] ; int [ ] up = new int [ N ] ; BigDecimal d1000 = new BigDecimal ( "1000.0" ) ; for ( int i = 0 ; i < N ; i ++ ) { double x = Double . parseDouble ( sToken . nextToken ( ) ) ; BigDecimal decimal = new BigDecimal ( x ) ; BigDecimal d = decimal . multiply ( d1000 ) ; d = d . setScale ( 1 , BigDecimal . ROUND_HALF_UP ) ;

from sys import * import mathdef numline ( f = int ) : return map ( f , input ( ) . split ( ) ) n = int ( input ( ) ) a = list ( filter ( lambda x : x != 0 , numline ( lambda s : int ( s . split ( ' . ' ) [ 1 ] ) ) ) ) NEW_LINE

n = int ( input ( ) ) l = list ( map ( float , input ( ) . split ( ) ) ) l = sorted ( [ x - int ( x ) for x in l if x - int ( x ) != 0 ] ) o = 2 * n - len ( l ) su = sum ( l ) ans = 0xFFFFFFFFFFFFFFFf or i in range ( n + 1 ) : if i + o >= n : ans = min ( ans , abs ( i - su ) ) print ( " % .3f " % ans ) NEW_LINE

n = int ( input ( ) )   l = list ( map ( float , input ( ) . split ( ) ) )   l = sorted ( [ x - int ( x ) for x in l if x - int ( x ) != 0 ] )   o = 2 * n - len ( l )   su = sum ( l )   ans = 0xFFFFFFFFFFFFFFF   for i in range ( n + 1 ) :   if i + o >= n :   ans = min ( ans , abs ( i - su ) )   print ( " % .3f " % ans ) NEW_LINE

n = int ( input ( ) ) arr = list ( map ( float , input ( ) . split ( ) ) ) arr = sorted ( [ x - int ( x ) for x in arr if x - int ( x ) != 0 ] ) o = 2 * n - len ( arr ) arr_sum = sum ( arr ) res = int ( 2e9 ) for i in range ( n + 1 ) : if i + o >= n : res = min ( res , abs ( i - arr_sum ) ) print ( " % .3f " % res ) NEW_LINE


import java . util . * ; import java . io . * ; import java . math . * ;   public class x280A { public static void main ( String hi [ ] ) throws Exception { BufferedReader infile = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( infile . readLine ( ) ) ; double W = Double . parseDouble ( st . nextToken ( ) ) ; double H = Double . parseDouble ( st . nextToken ( ) ) ; if ( W < H ) { double t = W ; W = H ; H = t ; } int alpha = Integer . parseInt ( st . nextToken ( ) ) ; if ( alpha == 0 || alpha == 180 ) System . out . println ( W * H ) ; else if ( alpha == 90 ) System . out . println ( H * H ) ; else { alpha = Math . min ( alpha , 180 - alpha ) ; double a = rad ( 1.0 * alpha ) ; double b = Math . atan ( 2 * W * H / ( W * W - H * H ) ) ; if ( a >= b ) System . out . println ( H / Math . sin ( a ) * H ) ; else { double ca = Math . cos ( a ) ; double sa = Math . sin ( a ) ; double aa = ( H * ca * ( ca + 1 ) - W * sa * ca ) / ( ( ca + 1 ) * ( ca + 1 ) - sa * sa ) ; double c = H - aa * ( 1 + 1 / ca ) ; double d = c * ca / sa ; double e = c / sa ; double f = aa * sa / ca ; double t1 = aa * f ; double t2 = c * d ; System . out . println ( W * H - t1 - t2 ) ; } } } public static double rad ( double deg ) { return deg * Math . PI / 180 ; } }

from math import cos , pi , sin , atanW , H , b = map ( float , input ( ) . split ( ) ) a = ( b / 180 ) * pi   if ( W < H ) : X = W W = H H = X   if ( a > 0.5 * pi ) : a = 0.5 * pi - ( a - 0.5 * pi )   opp = W * Hif ( a == 0 ) : eindopp = W * Helse : if a > ( atan ( H / W ) * 2 ) : Schuin = H / sin ( a ) eindopp = Schuin * H else : y = - 2 * cos ( a ) - cos ( a ) * * 2 - 1 + sin ( a ) * * 2 hks = ( W * sin ( a ) - H * cos ( a ) - H ) / y hgs = ( H - hks - hks * cos ( a ) ) / sin ( a ) eindopp = opp - hks * sin ( a ) * hks * cos ( a ) - hgs * sin ( a ) * hgs * cos ( a )    print ( round ( eindopp , 9 ) )

import java . io . * ; import java . util . * ;   public class practice { 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 scn = new FastReader ( ) ; double l = scn . nextDouble ( ) , b = scn . nextDouble ( ) , a = scn . nextDouble ( ) , sol , t , pi = Math . acos ( - 1.0 ) ; if ( l > b ) { t = l ; l = b ; b = t ; } if ( a == 90 ) { sol = l * l ; System . out . println ( sol ) ; return ; } sol = l * b ; l = l / 2.0 ; b = b / 2.0 ; if ( a > 90 ) a = 180.0 - a ; a = a * pi / 180.0 ; double c = ( pi - a ) / 2 ; double t1 = l - b / Math . tan ( c ) ; sol -= t1 * t1 * Math . tan ( a ) ; double t2 = b - l / Math . tan ( c ) ; sol -= t2 * t2 * Math . tan ( a ) ; if ( t1 < 0 ) { sol = ( l / Math . tan ( a ) + l / Math . tan ( c ) ) * l * 4.0 ; } System . out . println ( sol ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . text . DecimalFormat ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashSet ; import java . util . StringTokenizer ;   public class _501 {   public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; double w = fs . nextInt ( ) , h = fs . nextInt ( ) ; int aDeg = fs . nextInt ( ) ; if ( aDeg == 0 || aDeg == 180 ) { System . out . println ( w * h ) ; return ; } if ( aDeg == 90 ) { System . out . println ( Math . min ( w , h ) * Math . min ( h , w ) ) ; return ; } if ( aDeg > 90 ) { aDeg = 180 - aDeg ; }   Seg top = new Seg ( new Vec ( - w / 2 , h / 2 ) , new Vec ( w / 2 , h / 2 ) ) ; Seg bottom = new Seg ( new Vec ( - w / 2 , - h / 2 ) , new Vec ( w / 2 , - h / 2 ) ) ; Seg left = new Seg ( new Vec ( - w / 2 , - h / 2 ) , new Vec ( - w / 2 , h / 2 ) ) ; Seg right = new Seg ( new Vec ( w / 2 , - h / 2 ) , new Vec ( w / 2 , h / 2 ) ) ; Seg [ ] segs = { top , left , bottom , right } ; ArrayList < Vec > all = new ArrayList < > ( ) ; for ( Seg s : segs ) { for ( Seg t : segs ) {

import sysimport math     def read_input ( input_path = None ) : if input_path is None : f = sys . stdin else : f = open ( input_path , ' r ' )   w , h , a = map ( int , f . readline ( ) . split ( ) )   return w , h , a     def sol ( w , h , a ) : if h > w : w , h = h , w   if a > 90 : a = 90 - ( a - 90 )   a = math . radians ( a )   if a < 2 * math . atan2 ( h , w ) : area = w * h   s = ( w / 2 ) - ( h / 2 * math . tan ( a / 2 ) ) bigger_area = 0.5 * s * s * math . tan ( a )   s = ( h / 2 ) - ( w / 2 * math . tan ( a / 2 ) ) lower_area = 0.5 * s * s * math . tan ( a )   res = area - 2 * bigger_area - 2 * lower_area else : res = h * h / math . sin ( a )   return [ f " { res } " ]     def solve ( input_path = None ) : return sol ( * read_input ( input_path ) )     def main ( ) : for line in sol ( * read_input ( ) ) : print ( f " { line } " )     if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE

from math import * w , h , alpha = [ int ( x ) for x in input ( ) . strip ( ) . split ( ) ] if alpha > 90 : alpha = 180 - alphaif w < h : w , h = h , wc = cos ( alpha * pi / 180.0 ) s = sin ( alpha * pi / 180.0 ) t = tan ( alpha * pi / 360.0 ) print ( h * h / s ) if t > h / w else print ( ( w * h - ( w * w + h * h ) / 2 * tan ( alpha * pi / 360.0 ) ) / ( c ) ) NEW_LINE

from math import cos , pi , sin , atanW , H , b = map ( float , input ( ) . split ( ) ) a = ( b / 180 ) * pi   if ( W < H ) : X = W W = H H = X   if ( a > 0.5 * pi ) : a = 0.5 * pi - ( a - 0.5 * pi )   opp = W * Hif ( a == 0 ) : eindopp = W * Helse : if a > ( atan ( H / W ) * 2 ) : Schuin = H / sin ( a ) eindopp = Schuin * H else : y = - 2 * cos ( a ) - cos ( a ) ** 2 - 1 + sin ( a ) ** 2 hks = ( W * sin ( a ) - H * cos ( a ) - H ) / y hgs = ( H - hks - hks * cos ( a ) ) / sin ( a ) eindopp = opp - hks * sin ( a ) * hks * cos ( a ) - hgs * sin ( a ) * hgs * cos ( a )     print ( round ( eindopp , 9 ) ) NEW_LINE


import java . util . Arrays ; import java . util . Scanner ;   public class _0715Ehabandsubtraction {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } Arrays . sort ( arr ) ; int sum = 0 ; for ( int i = 0 ; i < n && k > 0 ; i ++ ) { arr [ i ] = arr [ i ] - sum ; if ( arr [ i ] == 0 ) { continue ; } else { System . out . println ( arr [ i ] ) ; sum += arr [ i ] ; k -- ; } } while ( k > 0 ) { System . out . println ( 0 ) ; k -- ; } }   }

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

import java . util . * ;   public class Check2 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; boolean flag = false ; int [ ] ar = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { ar [ i ] = sc . nextInt ( ) ;   } Arrays . sort ( ar ) ; long [ ] ar1 = new long [ n ] ; ar1 [ 0 ] = ar [ 0 ] ; long sum = ar [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) {   ar1 [ i ] = ar [ i ] - sum ; sum += ar1 [ i ] ; } List < Long > list = new ArrayList < > ( ) ;   if ( k <= n ) {

import java . io . * ; import java . util . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastReader in = new FastReader ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; int n = in . nextInt ( ) , k = in . nextInt ( ) ; ArrayList < Long > list = new ArrayList < > ( ) ; HashSet < Long > set = new HashSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { Long a = in . nextLong ( ) ; if ( set . contains ( a ) ) continue ; list . add ( a ) ; set . add ( a ) ; } pw . println ( solve ( list , list . size ( ) , k ) ) ; pw . close ( ) ; }   static StringBuilder solve ( ArrayList < Long > arr , int n , int k ) { StringBuilder sb = new StringBuilder ( ) ; long prev = 0 ;

n , k = map ( int , input ( ) . split ( ) ) a = [ int ( x ) for x in input ( ) . split ( ) ] a . insert ( 0 , 0 ) a = sorted ( list ( set ( a ) ) ) for i in range ( min ( k , len ( a ) - 1 ) ) : print ( a [ i + 1 ] - a [ i ] ) for i in range ( max ( k - len ( a ) + 1 , 0 ) ) : print ( 0 ) NEW_LINE

n , k = map ( int , input ( ) . split ( ) ) a = sorted ( list ( map ( int , input ( ) . split ( ) ) ) ) subtract = 0 i = 0 for kk in range ( k ) : if i < n : print ( a [ i ] - subtract ) subtract += a [ i ] - subtract while i < n and a [ i ] <= subtract : i += 1 else : print ( 0 ) NEW_LINE

n , k = map ( int , input ( ) . split ( ) ) a = sorted ( list ( set ( map ( int , input ( ) . split ( ) ) ) ) ) for i in range ( k ) : if i == 0 : print ( a [ i ] ) elif i < len ( a ) : print ( a [ i ] - a [ i - 1 ] ) else : print ( 0 ) NEW_LINE

n , k = map ( int , input ( ) . split ( ) ) a = sorted ( list ( set ( map ( int , input ( ) . split ( ) ) ) ) + [ 0 ] ) for i in range ( 1 , k + 1 ) : if i < len ( a ) : print ( a [ i ] - a [ i - 1 ] ) else : print ( 0 ) NEW_LINE


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

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . lang . reflect . Array ; import java . util . Arrays ; import java . util . HashSet ; import java . util . StringTokenizer ; import java . util . TreeSet ;    public class Main { public static double fun1 ( int v , int k ) { double x = Math . log10 ( ( double ) v ) / Math . log10 ( ( double ) k ) ; int end = ( int ) ( ( x == ( int ) x ) ? x + 1 : ( int ) ( Math . ceil ( x ) ) ) ; int res = 0 ; for ( int i = 0 ; i < end ; i ++ ) { res += v / ( int ) ( Math . pow ( k , i ) ) ; } return res ; } public static int solve ( int n , int k ) { int start = 1 ; int end = ( int ) 1e9 ; int middle ; while ( start <= end ) { middle = ( start + end ) / 2 ; if ( fun1 ( middle , k ) == n ) { return middle ; } else if ( fun1 ( middle , k ) > n ) { if ( fun1 ( middle - 1 , k ) > n || fun1 ( middle - 1 , k ) == n ) { end = middle - 1 ; } else return middle ; } else start = middle + 1 ; } return - 1 ; } public static void main ( String [ ] args ) throws IOException { BufferedReader bf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String in = bf . readLine ( ) ; StringTokenizer st = new StringTokenizer ( in ) ; int n = Integer . parseInt ( st . nextToken ( ) ) ; int k = Integer . parseInt ( st . nextToken ( ) ) ; System . out . println ( solve ( n , k ) ) ; }   }

import java . util . * ; import java . io . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastScanner in = new FastScanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; new Main ( ) . run ( in , out ) ; out . close ( ) ; }   public static long mod = 17352642619633L ;   int N ; int K ; void run ( FastScanner in , PrintWriter out ) {   N = in . nextInt ( ) ; K = in . nextInt ( ) ;   int lo = 1 ; int hi = N + 1 ; int can = - 1 ; while ( lo < hi ) {   int m = ( lo + hi ) >> 1 ; long cnt = cnt ( m ) ; if ( cnt >= N ) { can = m ; hi = m ; } else { lo = m + 1 ; } } out . println ( can ) ; }   long cnt ( int m ) { long ret = 0 ; while ( m > 0 ) { ret += m ; m /= K ; } return ret ; }   static class FastScanner { BufferedReader br ; StringTokenizer st ;   public FastScanner ( InputStream in ) { br = new BufferedReader ( new InputStreamReader ( in ) ) ; st = null ; }   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 ( ) ) ; } } }

import java . util . * ; import java . io . * ; public class ayaa { public static long fun ( long n , int k ) { long sum = n ; while ( n > 0 ) { n = n / k ; sum += n ; } return sum ; } public static long search ( long n , int k ) { long start = 1 ; long end = n ; long mid = ( start + end ) / 2 ; while ( start <= end ) { if ( fun ( mid , k ) < n ) { start = mid + 1 ; } else { end = mid - 1 ; } mid = ( start + end ) / 2 ; } return start ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; long n = sc . nextLong ( ) ; int k = sc . nextInt ( ) ; System . out . println ( search ( n , k ) ) ; } }

n , k = list ( map ( int , input ( ) . split ( ) ) ) a = n / 2 v = round ( a ) while round ( a ) > 0 : b = 0 m = 0 while v // ( k ** b ) > 0 : m += v // ( k ** b ) b += 1 if m < n : v += round ( a / 2 ) else : v -= round ( a / 2 ) a /= 2 b = 0 m = 0 while v // ( k ** b ) > 0 : m += v // ( k ** b ) b += 1 if m < n : v += 1 print ( v ) NEW_LINE

n , k = [ int ( x ) for x in input ( ) . split ( ) ] import mathdef solve ( num , k ) : divisor = k ans = num while True : temp = math . floor ( num / divisor ) if temp == 0 : break ans += temp divisor *= k return ans   def bs_first_greater ( start , end , n ) : if start > end : return - 1 mid = ( start + end ) // 2 if solve ( mid , k ) >= n : if mid == start : return mid elif solve ( mid - 1 , k ) < n : return mid else : return bs_first_greater ( start , mid - 1 , n )   else : return bs_first_greater ( mid + 1 , end , n )   print ( bs_first_greater ( 1 , n , n ) ) NEW_LINE

def geo_sum ( v , k ) : res = 0 aux = v while aux : res += aux aux //= k return res   def find_v ( n , k ) : st , end = 1 , n while st < end : mid = ( st + end ) // 2 s = geo_sum ( mid , k ) if s == n : return mid if s < n : st = mid + 1 else : end = mid return end   def solve ( ) : n , k = map ( int , input ( ) . split ( ) ) v = find_v ( n , k ) print ( v )   if __name__ == ' _ _ main _ _ ' : solve ( ) NEW_LINE

def valid ( v ) : ans = 0 while v != 0 :   ans += v v = v // k return ans >= n     def BSfindFirst ( start , end ) : while start + 1 < end : mid = ( end + start ) // 2 if valid ( mid ) : end = mid else : start = mid return end     n , k = map ( int , input ( ) . split ( ) ) print ( BSfindFirst ( 0 , 1000000000 ) ) NEW_LINE

def possible ( v , k ) : ans = v prev = k while v // k > 0 : ans += ( v // k ) k *= prev return ansn , k = map ( int , input ( ) . split ( ) ) low = khigh = nans = float ( " inf " ) while low < high : mid = low + ( ( high - low ) // 2 ) if possible ( mid , k ) >= n : high = mid else : low = mid + 1 print ( high ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;    public class Main {   public static void main ( String [ ] args ) throws IOException { InputStreamReader r = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( r ) ; String si = br . readLine ( ) ; String [ ] sa = si . split ( " ▁ " ) ; int n = Integer . valueOf ( sa [ 0 ] ) ; int m = Integer . valueOf ( sa [ 1 ] ) ; StringBuffer str = new StringBuffer ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String s = br . readLine ( ) ; for ( int j = 0 ; j < m ; j ++ ) { if ( s . charAt ( j ) == ' - ' ) { str . append ( " - " ) ; } else { if ( ( i + j ) % 2 == 0 ) { str . append ( " B " ) ; } else { str . append ( " W " ) ; } } } str . append ( " \n " ) ; }   System . out . print ( str . toString ( ) ) ;   }   }

import java . util . Scanner ;   public class Main {   public static char [ ] [ ] array ; public static char [ ] [ ] pos = new char [ ] [ ] { { ' B ' , ' W ' } , { ' W ' , ' B ' } } ; public static void main ( String [ ] args ) {

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . StreamTokenizer ; import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; char [ ] [ ] ch = new char [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { String s = sc . next ( ) ; for ( int j = 0 ; j < m ; j ++ ) { if ( s . charAt ( j ) == ' - ' ) { ch [ i ] [ j ] = s . charAt ( j ) ; } else { if ( ( i + j ) % 2 == 0 ) { ch [ i ] [ j ] = ' B ' ; } else { ch [ i ] [ j ] = ' W ' ; } } } } for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { System . out . print ( ch [ i ] [ j ] ) ; } System . out . println ( ) ; }   }   }

import java . util . Scanner ;   public class Main {   static int count = 0 ; static int n , m ; static int q = 0 ; static boolean bl ;   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; n = scan . nextInt ( ) ; m = scan . nextInt ( ) ; scan . nextLine ( ) ; char [ ] [ ] arr = new char [ n ] [ m ] ; boolean [ ] [ ] visited = new boolean [ n ] [ m ] ; String str = " " ; for ( int i = 0 ; i < n ; i ++ ) { str = scan . nextLine ( ) ; for ( int j = 0 ; j < m ; j ++ ) { arr [ i ] [ j ] = str . charAt ( j ) ; } } f ( arr , visited , 0 , 0 , false ) ; for ( int i = 0 ; i < n ; ++ i ) { for ( int j = 0 ; j < m ; ++ j ) { System . out . print ( arr [ i ] [ j ] ) ; } System . out . println ( ) ; } }   private static void f ( char [ ] [ ] arr , boolean [ ] [ ] visited , int i , int j , boolean flag ) { if ( i == n || j == m )

import java . util . * ; import java . io . * ; import java . io . FileInputStream ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . * ; import java . io . FileInputStream ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ; import java . math . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;    public class Sol { public static void main ( String [ ] args ) throws IOException {   Scanner sc = new Scanner ( System . in ) ; int r = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; char [ ] [ ] mat = new char [ r ] [ c ] ; for ( int i = 0 ; i < r ; i ++ ) { String s = sc . next ( ) ; for ( int j = 0 ; j < c ; j ++ ) { mat [ i ] [ j ] = s . charAt ( j ) ; } } for ( int i = 0 ; i < r ; i ++ ) { for ( int j = 0 ; j < c ; j ++ ) { if ( i % 2 == 0 && mat [ i ] [ j ] == ' . ' ) { if ( j % 2 == 0 ) { mat [ i ] [ j ] = ' B ' ; } else { mat [ i ] [ j ] = ' W ' ; } } else if ( i % 2 != 0 && mat [ i ] [ j ] == ' . ' ) { if ( j % 2 == 0 ) { mat [ i ] [ j ] = ' W ' ; } else { mat [ i ] [ j ] = ' B ' ; } } } } for ( int i = 0 ; i < r ; i ++ ) { for ( int j = 0 ; j < c ; j ++ ) { System . out . print ( mat [ i ] [ j ] ) ; } System . out . println ( ) ; } } }

n , m = map ( int , input ( ) . split ( ) ) ans = [ ] for i in range ( n ) : if i % 2 == 0 : x = ' B ' else : x = ' W ' s = input ( ) a = ' ' for j in range ( len ( s ) ) : if s [ j ] == ' . ' : a += x else : a += ' - ' if x == ' B ' : x = ' W ' else : x = ' B ' ans . append ( a ) for i in ans : print ( i ) NEW_LINE

import sysdef get_ints ( ) : return map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) def get_ints_lists ( ) : return list ( map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) ) def get_string ( ) : return sys . stdin . readline ( ) . strip ( ) n , m = get_ints ( ) for j in range ( n ) : s = get_string ( ) w = " W " b = " B " c = " - " if j % 2 == 0 : if m == 1 : if s [ 0 ] == " . " : print ( b ) else : print ( c ) else : for i in range ( m ) : if s [ i ] == c : print ( c , end = " " ) else : if i % 2 == 0 : print ( b , end = " " ) else : print ( w , end = " " ) print ( ) elif j % 2 == 1 : if m == 1 : if s [ 0 ] == " . " : print ( w ) else : print ( c ) else : for i in range ( m ) : if s [ i ] == c : print ( c , end = " " ) else : if i % 2 == 0 : print ( w , end = " " ) else : print ( b , end = " " ) print ( ) NEW_LINE

r , c = map ( int , input ( ) . split ( ) ) g = [ ]   for _ in range ( r ) : g . append ( list ( input ( ) ) )   for ri in range ( r ) : for ci in range ( c ) : if g [ ri ] [ ci ] == " - " : continue   cm = 1 if ( ri + 1 ) % 2 == 0 : cm *= - 1   if ( ci + 1 ) % 2 == 0 : cm *= - 1   g [ ri ] [ ci ] = " B " if cm == 1 else " W "   print ( " " . join ( g [ ri ] ) ) NEW_LINE

def answer ( n , m , a ) : ctr = 0 for s in a : ans = [ ] for c in s : if c == ' . ' : if ctr % 2 == 0 : ans . append ( ' B ' ) else : ans . append ( ' W ' ) else : ans . append ( ' - ' ) ctr += 1 print ( ' ' . join ( ans ) ) return   def answer2 ( n , m , a ) : for r in range ( n ) : ans = [ ] for c in range ( m ) : if ( r + c ) % 2 == 0 and a [ r ] [ c ] == ' . ' : ans . append ( ' B ' ) elif ( r + c ) % 2 == 1 and a [ r ] [ c ] == ' . ' : ans . append ( ' W ' ) else : ans . append ( ' - ' ) print ( ' ' . join ( ans ) )   def main ( ) : n , m = [ int ( i ) for i in input ( ) . split ( ) ] a = [ 0 ] * n for j in range ( n ) : a [ j ] = input ( ) answer2 ( n , m , a )   returnmain ( ) NEW_LINE

rows , cols = map ( int , input ( ) . split ( ) ) grid = [ input ( ) for _ in range ( rows ) ]   for i in range ( rows ) : for j in range ( cols ) : if grid [ i ] [ j ] == ' . ' : colors = [ ' B ' , ' W ' ] print ( colors [ i % 2 ^ j % 2 ] , end = ' ' ) else : print ( ' - ' , end = ' ' ) print ( ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Collections ; import java . util . StringTokenizer ; import java . util . StringJoiner ; import java . util . stream . IntStream ; import java . io . PrintWriter ;

import java . util . * ; import java . lang . * ; import java . io . * ;   public final class new_year { public static void main ( String [ ] args ) throws java . lang . Exception { Reader r = new Reader ( ) ; r . init ( System . in ) ; int n = r . nextInt ( ) ; int [ ] x = new int [ n ] ; int [ ] y = new int [ n ] ; int [ ] a = new int [ n ] ; int [ ] b = new int [ n ] ;

import java . util . * ; import java . io . * ; public class tre { public static void main ( String [ ] Args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long x = 0 , y = 0 ; for ( int i = 0 ; i < 2 * n ; i ++ ) { x += sc . nextLong ( ) ; y += sc . nextLong ( ) ;    } System . out . println ( x / n + " ▁ " + y / n ) ;   }   }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { FastScanner sc = new FastScanner ( ) ;

import sysfrom os import pathif ( path . exists ( ' input . txt ' ) and path . exists ( ' output . txt ' ) ) : sys . stdout = open ( ' output . txt ' , ' w ' ) sys . stdin = open ( ' input . txt ' , ' r ' )   def main ( ) : n = int ( input ( ) ) clues = [ [ int ( i ) for i in input ( ) . split ( ) ] for i in range ( n ) ] dirs = [ [ int ( i ) for i in input ( ) . split ( ) ] for i in range ( n ) ] sum_x = 0 sum_y = 0 sum_a = 0 sum_b = 0 for i in range ( n ) : sum_x += clues [ i ] [ 0 ] sum_y += clues [ i ] [ 1 ] sum_a += dirs [ i ] [ 0 ] sum_b += dirs [ i ] [ 1 ] x = ( sum_x + sum_a ) // n y = ( sum_y + sum_b ) // n print ( x , y ) main ( ) NEW_LINE

def solve ( n , pillar , clues ) : index = 0 dup_clues = set ( clues ) while index < n : found = True x = pillar [ 0 ] [ 0 ] + clues [ index ] [ 0 ] y = pillar [ 0 ] [ 1 ] + clues [ index ] [ 1 ] for x1 , y1 in pillar : if ( x - x1 , y - y1 ) in dup_clues : continue else : found = False break if found : print ( x , y ) index += 1 NEW_LINE

n = int ( input ( ) ) l1 = [ ] for i in range ( n ) : l1 . append ( [ int ( j ) for j in input ( ) . split ( ) ] ) l2 = [ ] for i in range ( n ) : l2 . append ( [ int ( j ) for j in input ( ) . split ( ) ] ) l1 . sort ( ) l2 . sort ( ) x = l1 [ 0 ] [ 0 ] + l2 [ - 1 ] [ 0 ] y = l1 [ 0 ] [ 1 ] + l2 [ - 1 ] [ 1 ] print ( x , y ) NEW_LINE

'''   ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ Online ▁ Python ▁ Compiler . ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ Code , ▁ Compile , ▁ Run ▁ and ▁ Debug ▁ python ▁ program ▁ online . Write ▁ your ▁ code ▁ in ▁ this ▁ editor ▁ and ▁ press ▁ " Run " ▁ button ▁ to ▁ execute ▁ it .   '''   n = int ( input ( ) ) k = n * 2 l = [ ] m = [ ] for i in range ( 2 * n ) : a , b = map ( int , input ( ) . split ( ) ) if ( i < k // 2 ) : l . append ( ( a , b ) ) else : m . append ( ( a , b ) ) l . sort ( ) m . sort ( reverse = True ) print ( l [ 0 ] [ 0 ] + m [ 0 ] [ 0 ] , l [ 0 ] [ 1 ] + m [ 0 ] [ 1 ] ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . * ; public class er103b {

import java . util . * ; public class Problem1444a { static long pi ; static long qi ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { pi = sc . nextLong ( ) ; qi = sc . nextLong ( ) ; long tmpp = pi ; long tmpq = qi ; long ans = 0 ; for ( int i = 2 ; i <= ( long ) ( Math . sqrt ( tmpq ) ) ; i ++ ) { tmpp = pi ; while ( tmpq % i == 0 ) { if ( tmpp % qi != 0 ) { ans = Math . max ( ans , tmpp ) ; } else if ( tmpp % i != 0 ) { } else { tmpp /= i ; continue ; } tmpq /= i ; } } if ( tmpq >= 2 ) { long x = pi ; while ( true ) { if ( x % qi != 0 ) { ans = Math . max ( ans , x ) ; break ; } if ( x % tmpq != 0 ) { break ; } else x /= tmpq ; } } System . out . println ( ans ) ; } } }

import java . util . * ; import java . io . * ; public class Main2 { 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 ( ) ; public static void main ( String [ ] args ) { PrintWriter out = new PrintWriter ( System . out ) ; int t = 1 ; t = sc . nextInt ( ) ; while ( t -- > 0 ) { long p = sc . nextLong ( ) ; long q = sc . nextLong ( ) ; if ( p < q || p % q != 0 ) { out . write ( p + " \n " ) ; continue ; } long j = 2L ; ArrayList < Long > a = new ArrayList < > ( ) ; long ans = q ; while ( j * j <= q ) { if ( ans % j == 0 ) { a . add ( j ) ; while ( ans % j == 0 ) ans /= j ; } j ++ ; } if ( ans > 1 ) { a . add ( ans ) ; ans = 1 ; } for ( long l : a ) { long k = p ; while ( k % q == 0 ) k /= l ; ans = Math . max ( k , ans ) ; } out . write ( ans + " \n " ) ; } out . close ( ) ; } }

from math import ceilfor NEW_LINE ad in range ( int ( input ( ) ) ) : NEW_LINE

from sys import stdin , stdoutstdin . readlinedef NEW_LINE mp ( ) : NEW_LINE return list ( map ( int , stdin . readline ( ) . strip ( ) . split ( ) ) ) NEW_LINE def it ( ) : return int ( stdin . readline ( ) . strip ( ) ) NEW_LINE from collections import defaultdict as dd , Counter as C   NEW_LINE def pf ( n ) : v = [ ] NEW_LINE d = dd ( lambda : 0 ) NEW_LINE while n % 2 == 0 : d [ 2 ] += 1 NEW_LINE n //= 2 NEW_LINE i = 3 NEW_LINE while i * i <= n : if NEW_LINE n % i == 0 : d [ i ] += 1 NEW_LINE n //= i else : i += 1 NEW_LINE if n > 2 : d [ n ] += 1 NEW_LINE return dict ( d )   for _ in range ( it ( ) ) : p , q = mp ( ) NEW_LINE d = pf ( q ) NEW_LINE ans = q NEW_LINE ans = 1 NEW_LINE for i , j in d . items ( ) : k = p NEW_LINE while k % q == 0 : k //= i NEW_LINE ans = max ( ans , k ) NEW_LINE print ( ans ) NEW_LINE


import java . util . * ; import java . util . stream . * ; public class Solution { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; scan . nextLine ( ) ; String [ ] words = scan . nextLine ( ) . split ( " ▁ " ) ; Set < Set < Character > > roots = new HashSet < > ( ) ; for ( String w : words ) { Set < Character > root = new HashSet < > ( ) ; for ( int i = 0 ; i < w . length ( ) ; i ++ ) { root . add ( w . charAt ( i ) ) ; } roots . add ( root ) ; } System . out . println ( roots . size ( ) ) ; } }

import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; s . nextLine ( ) ; String s2 = s . nextLine ( ) ; String [ ] s1 = s2 . split ( " ▁ " ) ; ArrayList < String > a = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String s3 = " " ; char [ ] ch = s1 [ i ] . toCharArray ( ) ; Arrays . sort ( ch ) ; for ( int j = 0 ; j < s1 [ i ] . length ( ) ; j ++ ) { char c = ch [ j ] ; if ( s3 . indexOf ( c ) < 0 ) s3 = s3 + c ; } a . add ( s3 ) ; } HashSet < String > h = new HashSet < > ( a ) ; System . out . println ( h . size ( ) ) ; } }

n = int ( input ( ) ) s = list ( str ( input ( ) ) . split ( " ▁ " ) ) k = set ( [ frozenset ( i ) for i in s ] ) print ( len ( k ) ) NEW_LINE

if __name__ == ' _ _ main _ _ ' : n = int ( input ( ) ) l = input ( ) . split ( ) d = dict ( ) for i in l : s = sorted ( set ( i ) ) j = ' ' for i in range ( len ( s ) ) : j += s [ i ] d . setdefault ( j , 0 ) d [ j ] += 1 print ( len ( d ) ) NEW_LINE

input ( ) print ( len ( set ( map ( frozenset , input ( ) . split ( ) ) ) ) ) NEW_LINE

n = int ( input ( ) )   x = list ( input ( ) . split ( ) )   ans = [ ] for i in range ( n ) : y = list ( x [ i ] . strip ( ) ) y . sort ( ) y = set ( y ) y = ' ' . join ( y ) if y in ans : pass else : ans . append ( y ) print ( len ( ans ) ) NEW_LINE


import java . util . * ;   public class Solve {   static Scanner scan = new Scanner ( System . in ) ;   public static void solve ( long n , long m ) {   long count = 0 , temp ;   if ( m % n == 0 ) { temp = m / n ; while ( temp % 2 == 0 ) { count ++ ; temp /= 2 ; } while ( temp % 3 == 0 ) { count ++ ; temp /= 3 ; } if ( temp == 1 ) { System . out . println ( count ) ; } else { System . out . println ( - 1 ) ; } } else { System . out . println ( - 1 ) ; } }   public static void main ( String [ ] args ) {   long n = scan . nextLong ( ) ; long m = scan . nextLong ( ) ;   solve ( n , m ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import static java . lang . Math . * ; import static java . lang . System . out ; import java . util . * ; import java . io . PrintStream ; import java . io . PrintWriter ; public class A { static final int N = ( int ) ( 1e5 + 100 ) ; static final int mod = 1000000007 ; static final long temp = 998244353 ; static final long MOD = 1000000007 ; static final long M = ( long ) 1e9 + 7 ; static class Pair implements Comparable < Pair > { long first , second ; public Pair ( long aa , long bb ) { first = aa ; second = bb ; } public int compareTo ( Pair o ) { return ( int ) ( o . first - this . first ) ; } } static class Tuple implements Comparable < Tuple > { long first , second , third ; public Tuple ( long first , long second , long third ) { this . first = first ; this . second = second ; this . third = third ; } public int compareTo ( Tuple o ) { return ( int ) ( o . third - this . third ) ; } } public static class DSU { int [ ] parent ; int [ ] rank ;

import java . util . * ; public class Main { public static void main ( String [ ] args ) { int n , m , sum = 0 , a ; Scanner in = new Scanner ( System . in ) ; n = in . nextInt ( ) ; m = in . nextInt ( ) ; if ( m % n != 0 ) { System . out . println ( - 1 ) ; } else { a = m / n ; while ( a % 2 == 0 || a % 3 == 0 ) { if ( a % 2 == 0 ) { sum ++ ; a = a / 2 ; } if ( a % 3 == 0 ) { sum ++ ; a = a / 3 ; } } if ( a == 1 ) { System . out . println ( sum ) ; } else System . out . println ( - 1 ) ; } }   }

import java . util . * ; public class game23 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int c = 0 ; while ( n < x ) { if ( x % ( 3 * n ) == 0 ) { n *= 3 ; ++ c ; } else if ( x % ( 2 * n ) == 0 ) { n *= 2 ; ++ c ; } else { System . out . print ( - 1 ) ; return ; } } System . out . print ( c ) ; } }

n , m = map ( int , input ( ) . split ( ) ) z = m / n NEW_LINE

n , m = map ( int , input ( ) . split ( ) ) if n == m : print ( 0 ) elif m % n != 0 : print ( - 1 ) else : s = 0 x = m // n while x % 2 == 0 or x % 3 == 0 : if x % 2 == 0 : x = x // 2 s = s + 1 if x % 3 == 0 : x = x // 3 s = s + 1 if x == 1 and s != 0 : print ( s ) else : print ( - 1 ) NEW_LINE

def solution ( n , m ) :     if m % n == 0 : t = m / n i = 0   while t > 1 :   if t % 2 == 0 : i += 1 t = t / 2 continue   elif t % 3 == 0 : i += 1 t = t / 3 continue   else : return - 1   return i else : return - 1       nd = input ( ) . split ( ) ind = list ( map ( int , nd ) ) print ( solution ( ind [ 0 ] , ind [ 1 ] ) ) NEW_LINE

n , m = map ( int , input ( ) . split ( ) ) ch = m / nk = 0 if n == m : k = 0 else : while ch != 1 : if ch % 3 == 0 : ch = ch / 3 k += 1 elif ch % 2 == 0 : ch = ch / 2 k += 1 else : k = - 1 ch = 1 print ( k ) NEW_LINE


import java . util . * ; public class Omkar_and_Password { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int c = 0 , sum = y ; for ( int i = 1 ; i < n ; i ++ ) { int x = sc . nextInt ( ) ; if ( x != sum ) { sum = sum + x ; c ++ ; } } if ( c > 0 ) System . out . println ( 1 ) ; else System . out . println ( n ) ; } } }

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

import java . util . * ; import java . io . * ; public class _practise { public static void main ( String args [ ] ) { FastReader in = new FastReader ( ) ; PrintWriter so = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; int t = in . nextInt ( ) ; while ( t -- > 0 ) { int n = in . nextInt ( ) ; int a [ ] = new int [ n ] ; int c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = in . nextInt ( ) ; if ( i > 0 && a [ i ] != a [ i - 1 ] ) c ++ ; } if ( c > 0 ) so . println ( "1" ) ; else so . println ( n ) ; } so . flush ( ) ; } 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 ( ) ) ; } int [ ] readIntArray ( int n ) { int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } long [ ] readLongArray ( int n ) { long a [ ] = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextLong ( ) ; return a ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Collections ; import java . util . HashSet ; import java . util . StringTokenizer ; public class A { public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; int t = fs . nextInt ( ) ; while ( t -- > 0 ) { int n = fs . nextInt ( ) ; HashSet < Integer > a = new HashSet < > ( ) ; int ans = 1 ; for ( int i = 0 ; i < n ; i ++ ) { int b = fs . nextInt ( ) ; a . add ( b ) ; } if ( a . size ( ) == 1 ) ans = n ; System . out . println ( ans ) ; } } static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } } }

from collections import Counter NEW_LINE t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : NEW_LINE INDENT n = int ( input ( ) ) NEW_LINE ali = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE q = ali . count ( ali [ 0 ] ) NEW_LINE if ( q == n ) : NEW_LINE INDENT print ( n ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( 1 ) NEW_LINE DEDENT DEDENT

for s in [ * open ( 0 ) ] [ 2 : : 2 ] : s = s . split ( ) ; print ( [ 1 , len ( s ) ] [ len ( { * s } ) < 2 ] ) NEW_LINE

for i in range ( int ( input ( ) ) ) : NEW_LINE INDENT n = int ( input ( ) ) NEW_LINE l = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE if ( min ( l ) == max ( l ) ) : NEW_LINE INDENT print ( n ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( 1 ) NEW_LINE DEDENT DEDENT

from itertools import accumulate as ac NEW_LINE from collections import Counter as cc NEW_LINE from bisect import bisect_left as bsl NEW_LINE from bisect import bisect as bs NEW_LINE from math import factorial as f NEW_LINE from collections import * NEW_LINE from itertools import * NEW_LINE from string import * NEW_LINE from bisect import * NEW_LINE from queue import * NEW_LINE from heapq import * NEW_LINE from math import * NEW_LINE from sys import * NEW_LINE from re import * NEW_LINE def fast ( ) : return stdin . readline ( ) . strip ( ) NEW_LINE def zzz ( ) : return [ int ( i ) for i in fast ( ) . split ( ) ] NEW_LINE z , zz = input , lambda : list ( map ( int , z ( ) . split ( ) ) ) NEW_LINE szz , graph , mod , szzz = lambda : sorted ( zz ( ) ) , { } , 10 ** 9 + 7 , lambda : sorted ( zzz ( ) ) NEW_LINE def lcd ( xnum1 , xnum2 ) : return ( xnum1 * xnum2 // gcd ( xnum1 , xnum2 ) ) NEW_LINE def output ( answer ) : stdout . write ( str ( answer ) ) NEW_LINE num = int ( z ( ) ) NEW_LINE for _ in range ( num ) : NEW_LINE INDENT n = int ( z ( ) ) NEW_LINE arr = szzz ( ) NEW_LINE if arr [ 0 ] == arr [ - 1 ] : NEW_LINE INDENT print ( n ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( 1 ) NEW_LINE DEDENT DEDENT


import java . util . * ; import javafx . util . Pair ;   public class practice { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; long n = scn . nextLong ( ) , a , b , c , val = 1 ; String l , r ; HashMap < String , Long > map = new HashMap < > ( ) ; HashMap < Pair , Long > like = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { l = scn . next ( ) ; r = scn . next ( ) ; r = scn . next ( ) ; if ( map . containsKey ( l ) == false ) map . put ( l , val ++ ) ; if ( map . containsKey ( r ) == false ) map . put ( r , val ++ ) ; like . put ( new Pair ( map . get ( l ) , map . get ( r ) ) , ( long ) 1 ) ; } a = scn . nextLong ( ) ; b = scn . nextLong ( ) ; c = scn . nextLong ( ) ; long t = 2187 , min = a + b + c , max = 0 ;

# include < stdio . h > # include < string . h > # include < math . h > # include < stdlib . h > # include < stdio . h > # include < string . h > # include < math . h > # include < stdlib . h > int min ( int a , int b ) { return ( a < b ) ? a : b ; } int max ( int a , int b ) { return ( b < a ) ? a : b ; } int n , a , b , c , k [ 100 ] [ 3 ] , kCnt = 0 , r = - 1 , arr [ 10 ] [ 10 ] , maxHappy = 0 ; int gr [ 3 ] [ 10 ] , s [ 3 ] ; void rec ( int warrior , int grouping ) { for ( int i = 0 ; i < 3 ; i ++ ) { if ( s [ i ] == k [ grouping ] [ i ] ) continue ; gr [ i ] [ s [ i ] ++ ] = warrior ; if ( warrior == 7 ) { int happy = 0 ; for ( int g = 0 ; g < 3 ; g ++ ) for ( int x = 0 ; x < s [ g ] ; x ++ ) for ( int y = 0 ; y < s [ g ] ; y ++ ) happy += arr [ gr [ g ] [ x ] ] [ gr [ g ] [ y ] ] ; if ( happy > maxHappy ) maxHappy = happy ; } else { rec ( warrior + 1 , grouping ) ; } s [ i ] -- ; } } int main ( ) {

import java . util . Scanner ;   public class Heroes { static boolean [ ] [ ] like = new boolean [ 7 ] [ 7 ] ;   static int [ ] [ ] mindiv = new int [ 3 ] [ 500 ] ; static int max = 0 ; static int divs = 0 ; static int id ( String name ) { if ( name . equals ( " Anka " ) ) return 0 ; else if ( name . equals ( " Chapay " ) ) return 1 ; else if ( name . equals ( " Cleo " ) ) return 2 ; else if ( name . equals ( " Troll " ) ) return 3 ; else if ( name . equals ( " Dracul " ) ) return 4 ; else if ( name . equals ( " Snowy " ) ) return 5 ; else if ( name . equals ( " Hexadecimal " ) ) return 6 ; return - 1 ; } static void rec ( int mem , String cur , boolean [ ] yip , int div ) { boolean debug = false ;

from itertools import product , permutations , combinationsn = int ( input ( ) ) NEW_LINE names = { } NEW_LINE nex = 0 NEW_LINE mama = 128 l NEW_LINE iking = [ 0 ] * mamalikes = [ [ 0 ] * 7 for _ in range ( 7 ) ] NEW_LINE def getName ( name ) : global nex NEW_LINE if name in names : return names [ name ] NEW_LINE names [ name ] = nex NEW_LINE nex += 1 NEW_LINE return names [ name ] NEW_LINE for _ in range ( n ) : a , b , c = input ( ) . split ( ) NEW_LINE likes [ getName ( a ) ] [ getName ( c ) ] = 1 NEW_LINE bosses = [ int ( x ) for x in input ( ) . split ( ) ] NEW_LINE part = [ ( 0 , 0 , 0 ) ] NEW_LINE dipart = 10 ** 10 NEW_LINE for i in range ( 1 , 4 ) : for NEW_LINE j in range ( i , 7 ) : k = 7 - i - j NEW_LINE if k < j : continue NEW_LINE for per in permutations ( bosses ) : aa = ( per [ 0 ] // i , per [ 1 ] // j , per [ 2 ] // k ) NEW_LINE difi = max ( aa ) - min ( aa ) NEW_LINE if difi < dipart : dipart = difi NEW_LINE part = [ ( i , j , k ) ] elif difi == dipart : part . append ( ( i , j , k ) ) NEW_LINE

import mathimport NEW_LINE itertools   if __name__ == ' _ _ main _ _ ' : N = int ( input ( ) ) NEW_LINE likes = [ input ( ) for i in range ( N ) ] NEW_LINE likes = [ line . split ( ) for line in likes ] NEW_LINE likes = [ ( words [ 0 ] , words [ 2 ] ) for words in likes ] NEW_LINE a , b , c = ( float ( val ) for val in input ( ) . split ( ) )   min_diff = max ( a , b , c ) NEW_LINE possible_groups = [ ] NEW_LINE for i in range ( 1 , 7 - 1 ) : for NEW_LINE j in range ( 1 , 7 - i ) : a_e = math . floor ( a / i ) NEW_LINE b_e = math . floor ( b / j ) NEW_LINE c_e = math . floor ( c / ( 7 - i - j ) ) NEW_LINE diff = max ( a_e , b_e , c_e ) - min ( a_e , b_e , c_e ) NEW_LINE if diff < min_diff : min_diff = diff NEW_LINE possible_groups = [ ( i , j ) ] elif diff == min_diff : possible_groups . append ( ( i , j ) ) NEW_LINE max_likes = 0 NEW_LINE for order in itertools . permutations ( [ ' Anka ' , ' Chapay ' , ' Cleo ' , ' Troll ' , ' Dracul ' , ' Snowy ' , ' Hexadecimal ' ] ) : for NEW_LINE i , j in possible_groups : likes_count = 0 NEW_LINE seta = set ( order [ : i ] ) NEW_LINE setb = set ( order [ i : ( i + j ) ] ) NEW_LINE setc = set ( order [ ( i + j ) : ] ) NEW_LINE for p , q in likes : if NEW_LINE p in seta and q in seta : likes_count += 1 NEW_LINE if p in setb and q in setb : likes_count += 1 NEW_LINE if p in setc and q in setc : likes_count += 1 NEW_LINE max_likes = max ( max_likes , likes_count ) NEW_LINE print ( f ' { min _ diff } ▁ { max _ likes } ' )   NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Collections ; import java . util . StringTokenizer ; public class RemoveDuplicates { public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; int T = 1 ; PrintWriter out = new PrintWriter ( System . out ) ; for ( int tt = 0 ; tt < T ; tt ++ ) { int n = fs . nextInt ( ) ; int arr [ ] = fs . readArray ( n ) ; int count [ ] = new int [ 1001 ] ; ArrayList < Integer > ans = new ArrayList < > ( ) ; for ( int i = n - 1 ; i >= 0 ; i -- ) { count [ arr [ i ] ] ++ ; if ( count [ arr [ i ] ] == 1 ) ans . add ( arr [ i ] ) ; } System . out . println ( ans . size ( ) ) ; Collections . reverse ( ans ) ; for ( int i : ans ) { System . out . print ( i + " ▁ " ) ; } System . out . println ( ) ; } out . close ( ) ; } static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; public String next ( ) { while ( ! st . hasMoreElements ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; } int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } } }

import java . util . * ; public class cc { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; ArrayList < Integer > a = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) a . add ( sc . nextInt ( ) ) ; Collections . reverse ( a ) ; Set < Integer > s = new LinkedHashSet < Integer > ( ) ; s . addAll ( a ) ; a . clear ( ) ; a . addAll ( s ) ; Collections . reverse ( a ) ; s . clear ( ) ; s . addAll ( a ) ; Iterator < Integer > i = s . iterator ( ) ; System . out . println ( s . size ( ) ) ; while ( i . hasNext ( ) ) { System . out . print ( i . next ( ) + " ▁ " ) ; } } }

import java . util . ArrayList ; import java . util . Scanner ;   public class duplicates {   public static void main ( String [ ] args ) { Scanner userInput = new Scanner ( System . in ) ; int n = userInput . nextInt ( ) ; int in [ ] = new int [ n ] ; ArrayList < Integer > out = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { in [ i ] = userInput . nextInt ( ) ; } for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( out . contains ( in [ i ] ) ) continue ; out . add ( 0 , in [ i ] ) ; } System . out . println ( out . size ( ) ) ; for ( Integer integer : out ) { System . out . print ( integer + " ▁ " ) ; } }   }

import java . util . * ; public class MyClass { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } LinkedHashSet h = new LinkedHashSet ( ) ; int [ ] arr1 = new int [ n ] ; int k = 0 ; for ( int i = n - 1 ; i >= 0 ; i -- ) { arr1 [ k ] = arr [ i ] ; k ++ ; } for ( int i = 0 ; i < n ; i ++ ) { if ( ! h . contains ( arr1 [ i ] ) ) h . add ( arr1 [ i ] ) ; } ArrayList < Integer > w = new ArrayList < Integer > ( h ) ; Collections . reverse ( w ) ; System . out . println ( w . size ( ) ) ; for ( int i : w ) System . out . print ( i + " ▁ " ) ; } }

import java . util . * ;   public class codeforces { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ;     int max = 0 ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; max = Math . max ( max , arr [ i ] ) ; } boolean [ ] bool = new boolean [ max + 1 ] ;   int [ ] indicies = new int [ max + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { if ( bool [ arr [ i ] ] == false ) { bool [ arr [ i ] ] = true ; indicies [ arr [ i ] ] = i ; } else { arr [ indicies [ arr [ i ] ] ] = - 1 ; indicies [ arr [ i ] ] = i ; } } int counter = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] != - 1 ) { counter ++ ; } } System . out . println ( counter ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] != - 1 ) { System . out . print ( arr [ i ] + " ▁ " ) ; } }    } }

from collections import Counter   n = int ( input ( ) )   arr = [ int ( i ) for i in input ( ) . split ( ) ] c = Counter ( arr )   for i in range ( len ( arr ) ) : if c [ arr [ i ] ] > 1 : c [ arr [ i ] ] -= 1 arr [ i ] = - 1   print ( len ( c ) )   for i in arr : if i != - 1 : print ( i , end = ' ▁ ' ) NEW_LINE

n = int ( input ( ) ) lst = list ( map ( int , input ( ) . split ( ) ) ) ans = [ ] lst = lst [ : : - 1 ] for i in lst : if i not in ans : ans . append ( i ) ans = ans [ : : - 1 ] print ( len ( ans ) ) for i in ans : print ( i , end = " ▁ " ) NEW_LINE

T = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) [ : T ] ) ) no_dupe = [ ] for i in range ( len ( arr ) ) : if arr [ i ] in no_dupe : no_dupe . remove ( arr [ i ] ) no_dupe . append ( arr [ i ] ) print ( len ( no_dupe ) ) print ( " ▁ " . join ( map ( str , no_dupe ) ) ) NEW_LINE


import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int t = s . nextInt ( ) ; while ( t -- != 0 ) { long n = s . nextLong ( ) ; long k = s . nextLong ( ) ; long times = n / k ; long ans = times * k ; long rem = n - ans ; ans += Math . min ( k / 2 , rem ) ; System . out . println ( ans ) ; } } }

import com . sun . security . jgss . GSSUtil ;   import java . lang . reflect . Array ; import java . math . BigInteger ; import java . util . * ;   public class Example { public static void main ( String [ ] args ) {   Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t > 0 ) { int n = sc . nextInt ( ) ;   int k = sc . nextInt ( ) ; if ( n % k == 0 ) { System . out . println ( n ) ; } else { int perk = n / k ; long ans = 0 ; int aex = ( int ) Math . floor ( ( double ) k / 2 ) ; if ( aex <= n % k ) { ans = perk * k + aex ; } else { ans = perk * k + n % k ; } System . out . println ( ans ) ;   } t -- ;      }   } }

import java . util . Arrays ; import java . util . Scanner ;   public class Candies { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int testcases = sc . nextInt ( ) ; sc . nextLine ( ) ;   for ( int i = 0 ; i < testcases ; i ++ ) { String array = sc . nextLine ( ) ; int [ ] stream = Arrays . stream ( array . split ( " ▁ " ) ) . mapToInt ( Integer :: parseInt ) . toArray ( ) ; System . out . println ( output ( stream ) ) ; } }   private static int output ( int [ ] stream ) { int out = 0 ; int a = stream [ 0 ] / stream [ 1 ] ; int left = stream [ 0 ] - ( stream [ 1 ] * a ) ; if ( left > stream [ 1 ] / 2 ) { left = stream [ 1 ] / 2 ; } return stream [ 1 ] * a + left ; } }

for _ in range ( int ( input ( ) ) ) : n , k = map ( int , input ( ) . split ( ) ) print ( min ( n // k * ( k // 2 + ( k % 2 == 1 ) ) + ( n // k + 1 ) * ( k // 2 ) , n ) ) NEW_LINE

import sysinput = sys . stdin . readline   t = int ( input ( ) ) for _ in range ( t ) : n , k = map ( int , input ( ) . split ( ) ) a = n // k ans = min ( n , a * k + k // 2 ) print ( ans ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n , k = map ( int , input ( ) . split ( ) ) res = 0 if n == 1 : print ( 1 ) elif n % k == 0 : print ( n ) else : tmp = n // k st = k // 2 n = n % k ex = min ( n , st ) res = ( tmp * k ) + ex print ( res )   NEW_LINE

cases = int ( input ( ) ) while cases : cases -= 1 NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ;    public class Template { private static BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; static String readln ( ) throws IOException { String line = input . readLine ( ) ; return line ; }   public static void main ( String [ ] args ) throws IOException {

import java . util . Scanner ; public class Cf { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int totalbags = n * n ; for ( int i = 1 ; i <= totalbags / 2 ; i ++ ) { System . out . println ( i + " ▁ " + ( ( totalbags - i ) + 1 ) ) ; } } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . * ; import java . math . * ; public class er10a {

import java . util . * ; import java . io . * ; public class A { static FastReader in = new FastReader ( ) ; static final Random random = new Random ( ) ; static long mod = 1000000007L ; public static void main ( String args [ ] ) throws IOException { int t = 1 ;

n = int ( input ( ) )   for i in range ( n * n // 2 ) : print ( i + 1 , n * n - i ) NEW_LINE

n = int ( input ( ) ) for i in range ( 1 , ( n * n ) // 2 + 1 ) : print ( i , ( n * n - i + 1 ) ) NEW_LINE

n = int ( input ( ) ) li = [ [ ] for _ in range ( n ) ] for i in range ( 1 , n * n // 2 + 1 ) : li [ ( i - 1 ) % n ] += [ i , n * n - i + 1 ] for line in li : print ( * line ) NEW_LINE

n = int ( input ( ) ) sq = n * nfor i in range ( 0 , int ( sq / 2 ) ) : print ( i + 1 , sq - i ) NEW_LINE

n = int ( input ( ) . strip ( ) ) for i in range ( n ) : a = [ ] for j in range ( n ) : a += [ j * n + ( j + i ) % n + 1 ] print ( * a ) NEW_LINE


import java . util . * ; public class Ideone { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int a = in . nextInt ( ) , b = in . nextInt ( ) ; if ( a < b ) System . out . print ( - 1 ) ; else System . out . printf ( " % .10f " , 1.0 * ( a + b ) / ( 2.0 * ( ( a + b ) / ( 2 * b ) ) ) ) ; } }

import java . io . PrintWriter ; import java . util . Scanner ;   public class H { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; int a = sc . nextInt ( ) , b = sc . nextInt ( ) ; if ( b > a ) out . println ( - 1 ) ; else if ( a == b ) out . println ( a ) ; else { double r = ( a + b ) / 2.0 ; double r2 = ( a - b ) / 2.0 ; double k = Math . floor ( ( a + b ) / ( 2.0 * b ) ) ; double k2 = Math . floor ( ( a - b ) / ( 2.0 * b ) ) ; out . println ( Math . min ( r / k , r2 / k2 ) ) ; } out . 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 ) ; AAProblemAboutPolyline solver = new AAProblemAboutPolyline ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class AAProblemAboutPolyline { public void solve ( int testNumber , InputReader in , PrintWriter out ) { int a = in . nextInt ( ) , b = in . nextInt ( ) ;   if ( b > a ) { out . println ( - 1 ) ; return ; }

def solve ( a , b ) :   if b > a : return - 1   if a == b : return a u = 2 * int ( ( a + b ) / ( 2 * b ) ) sol1 = ( a + b ) / u return sol1     if __name__ == ' _ _ main _ _ ' : a , b = map ( int , input ( ) . split ( ) ) result = solve ( a , b ) print ( result ) NEW_LINE

a , b = map ( int , input ( ) . split ( ) ) if a < b : print ( - 1 ) elif a == b : print ( a ) else : i1 = ( a + b ) // ( 2 * b ) i2 = ( a - b ) // ( 2 * b ) if i2 == 0 : print ( ( a + b ) / ( 2 * i1 ) ) else : p = ( a + b ) / 2 q = ( a - b ) / 2 print ( min ( p / i1 , q / i2 ) ) NEW_LINE

def solve ( a , b ) :   if b > a : return - 1   if a == b : return a   sol1 = ( a + b ) / ( 2 * int ( ( a + b ) / ( 2 * b ) ) ) u = ( 2 * int ( ( a - b ) / ( 2 * b ) ) ) sol2 = ( a - b ) / u if u != 0 else sol1 + 1 return min ( sol1 , sol2 )     if __name__ == ' _ _ main _ _ ' : a , b = map ( int , input ( ) . split ( ) ) result = solve ( a , b ) print ( result ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . io . PrintWriter ;   import java . util . * ;   public class A_GENERAL {

import java . util . Scanner ;   public class Main { static Scanner scanner = new Scanner ( System . in ) ; static boolean mark [ ] ; static int a [ ] ; static int n ; public static void main ( String [ ] args ) { n = scanner . nextInt ( ) ; a = new int [ n ] ; int b [ ] = new int [ n ] ; mark = new boolean [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = scanner . nextInt ( ) - 1 ; } int sum = 0 ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { b [ i ] = scanner . nextInt ( ) ; sum += b [ i ] ; } if ( sum % 2 == 0 ) { ans = 1 ; } int low = sDFS ( ) ; if ( low == 1 ) { System . out . println ( ans ) ; return ; } System . out . println ( low + ans ) ; } private static int sDFS ( ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ! mark [ i ] ) { sum ++ ; DFS ( i ) ; } } return sum ; } private static void DFS ( int x ) { mark [ x ] = true ; if ( ! mark [ a [ x ] ] ) { DFS ( a [ x ] ) ; } } }

import java . util . * ;   public class Barbecue { public static class Graph { public int V ; ArrayList < Integer > adjList [ ] ; public Graph ( int V ) { this . V = V ; adjList = new ArrayList [ V ] ;   for ( int i = 0 ; i < V ; i ++ ) { adjList [ i ] = new ArrayList < Integer > ( ) ; } } public void addEdge ( int src , int dest , boolean bidirectional ) { this . adjList [ src ] . add ( dest ) ; if ( bidirectional ) { this . adjList [ dest ] . add ( src ) ; } } public void printGraph ( ) { for ( int v = 0 ; v < this . V ; v ++ ) { System . out . println ( " Vertex ▁ " + v + " : " ) ; System . out . print ( " Conntected ▁ to ▁ " ) ; for ( Integer pCrawl : this . adjList [ v ] ) { System . out . print ( pCrawl + " ▁ " ) ; } System . out . println ( " \n " ) ; } } public boolean dfs ( int s , boolean [ ] visited , boolean [ ] recStack ) { if ( recStack [ s ] ) return true ; if ( visited [ s ] ) return false ; visited [ s ] = true ; recStack [ s ] = true ;

import java . util . Arrays ; import java . util . Scanner ;   public class PavelAndBarbeque { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; sc . nextLine ( ) ;

n = int ( input ( ) ) p = [ int ( i ) for i in input ( ) . split ( ) ] zeros = [ int ( i ) for i in input ( ) . split ( ) ]   ans = 0   if not sum ( zeros ) % 2 : ans += 1   visited = [ False for i in range ( n ) ]   ciclos = 0 for i in range ( n ) : if not visited [ i ] : ciclos += 1 j = i while not visited [ j ] : visited [ j ] = True j = p [ j ] - 1   if ciclos == 1 : ans += 0 else : ans += ciclos   print ( ans ) NEW_LINE

n = int ( input ( ) ) p = [ int ( i ) for i in input ( ) . split ( ) ] b = [ int ( i ) for i in input ( ) . split ( ) ] ans = 0 visited = [ False for i in range ( n ) ] for i in range ( n ) : if visited [ i ] : continue ans += 1 while not visited [ i ] : visited [ i ] = True i = p [ i ] - 1 if ans == 1 : ans = 0 ans += ( sum ( b ) + 1 ) % 2 print ( ans ) NEW_LINE

read = lambda : map ( int , input ( ) . split ( ) )   n = int ( input ( ) )   p = list ( read ( ) )   b = list ( read ( ) )   ans = ( b . count ( 1 ) + 1 ) % 2   was = [ 0 ] * n   cnt = 0   for i in range ( n ) :   if not was [ i ] :   cnt += 1   v = i   while not was [ v ] :   was [ v ] = 1   v = p [ v ] - 1   if cnt > 1 : ans += cnt   print ( ans )       NEW_LINE

import sys n = int ( input ( ) ) p = [ int ( i ) for i in input ( ) . split ( ) ] b = [ int ( i ) for i in input ( ) . split ( ) ] ans = 0 num_cycles = 0 checked = set ( ) for i in range ( n ) : if i in checked : continue checked . add ( i ) nxt = p [ i ] - 1 while nxt != i : checked . add ( nxt ) nxt = p [ nxt ] - 1 num_cycles += 1 ans += num_cycles if num_cycles != 1 else 0 ans += ( sum ( b ) % 2 ) == 0 print ( ans ) NEW_LINE


# include < cstdio > # include < algorithm > # include < queue > # include < set > # include < cstring >   using namespace std ;   typedef long long ll ; typedef pair < ll , int > pli ; const ll P = 1e9 + 7 ; const int N = 3e5 + 10 ;  # define mk make_pair # define pb push_back # define fr first # define sc second    int rd ( ) { int x = 0 , f = 1 ; char c = getchar ( ) ; while ( c > '9' || c < '0' ) f = c == ' - ' ? - 1 : 1 , c = getchar ( ) ; while ( c >= '0' && c <= '9' ) x = x * 10 + c - 48 , c = getchar ( ) ; return x * f ; }   int n , cnt , sl , sr , sum [ N ] ; char s [ N ] , tmp [ N ] ; int main ( ) {

import java . util . * ; import java . io . * ; public class cf1239b {   public static void main ( String [ ] args ) throws IOException { BufferedReader bf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ;

n = int ( input ( ) ) s = input ( ) r = 0 l = n - 1 root = [ ] buf = [ ] to_the_right = True for count in range ( n ) : if to_the_right : i = r r += 1 else : i = l l -= 1 b = s [ i ] if b == ' ( ' : if len ( buf ) == 0 or buf [ - 1 ] [ 0 ] != - 1 : buf . append ( [ - 1 , - 1 , [ ] ] ) buf [ - 1 ] [ 0 ] = i else : if len ( buf ) == 0 or buf [ - 1 ] [ 1 ] != - 1 : buf . append ( [ - 1 , - 1 , root ] ) root = [ ] to_the_right = False buf [ - 1 ] [ 1 ] = i if buf [ - 1 ] [ 0 ] != - 1 and buf [ - 1 ] [ 1 ] != - 1 : tmp = buf . pop ( ) if len ( buf ) : buf [ - 1 ] [ 2 ] . append ( tmp ) else : root . append ( tmp ) to_the_right = True sol = [ [ 0 , 1 , 1 ] ] if len ( buf ) == 0 : sol . append ( [ len ( root ) , 1 , 1 ] ) for child in root : sol . append ( [ len ( child [ 2 ] ) + 1 , child [ 0 ] + 1 , child [ 1 ] + 1 ] ) for gr_child in child [ 2 ] : sol . append ( [ len ( root ) + len ( gr_child [ 2 ] ) + 1 , gr_child [ 0 ] + 1 , gr_child [ 1 ] + 1 ] ) print ( ' % d \n % d ▁ % d ' % tuple ( max ( sol ) ) ) NEW_LINE


import java . util . Scanner ;   public class A1368 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = scanner . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int a = scanner . nextInt ( ) , c , k = 0 , b = scanner . nextInt ( ) , n = scanner . nextInt ( ) ; if ( a < b ) { c = a ; a = b ; b = c ; } do { if ( k % 2 == 0 ) { b += a ; c = b ; } else { a += b ; c = a ; } k ++ ; } while ( c <= n ) ; System . out . println ( k ) ; } } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Collections ; import java . util . StringTokenizer ;   public class A { public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; int t = fs . nextInt ( ) ; while ( t -- > 0 ) { int a = fs . nextInt ( ) ; int b = fs . nextInt ( ) ; int n = fs . nextInt ( ) ;

import java . util . Scanner ; public class A { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int t , a , b , n ; t = scan . nextInt ( ) ; while ( t -- > 0 ) { a = scan . nextInt ( ) ; b = scan . nextInt ( ) ; n = scan . nextInt ( ) ; int ctr = 0 ; while ( a <= n && b <= n ) { if ( a <= b ) a += b ; else b += a ; ++ ctr ; } System . out . println ( ctr ) ; } } }

import java . util . * ; import java . lang . String ; import java . lang . Math ; import java . util . Arrays ;   public class Capitalization2 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t ; t = sc . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int a , b , n ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; n = sc . nextInt ( ) ; int res = 0 ; while ( a <= n && b <= n ) { if ( a <= b ) a = a + b ; else b = b + a ; res ++ ; } System . out . println ( res ) ; } } }

import java . util . * ;   public class Runner { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int tests = sc . nextInt ( ) ; for ( int i = 0 ; i < tests ; i ++ ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int count = 0 ; while ( a <= n && b <= n ) { int smaller = getSmaller ( a , b ) ; if ( smaller == a ) { a += b ; } else { b += a ; } count ++ ; } System . out . println ( count ) ;   } } private static int getSmaller ( int a , int b ) { if ( a < b ) { return a ; } return b ; } private static int [ ] stringToIntArray ( String str ) { String [ ] strs = str . trim ( ) . split ( " ▁ " ) ; int [ ] intArr = new int [ strs . length ] ; for ( int i = 0 ; i < strs . length ; i ++ ) { intArr [ i ] = Integer . parseInt ( strs [ i ] ) ; } return intArr ; }   }

for _ in range ( int ( input ( ) ) ) : a , b , n = map ( int , input ( ) . split ( ) ) c = 0 while a <= n and b <= n : if a < b : a += b else : b += a c += 1 print ( c ) NEW_LINE

T = int ( input ( ) )   nums = [ ] final = [ ] counter = 0 for i in range ( T ) : counter = 0 nums = [ * map ( int , input ( ) . split ( " ▁ " ) ) ] while nums [ 0 ] <= nums [ 2 ] and nums [ 1 ] <= nums [ 2 ] : if nums [ 0 ] >= nums [ 1 ] : nums [ 1 ] += nums [ 0 ] else : nums [ 0 ] += nums [ 1 ] counter += 1 final . append ( counter )   for i in range ( len ( final ) ) : print ( final [ i ] ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : a , b , n = [ int ( x ) for x in input ( ) . split ( ) ] i = 0 while a <= n and b <= n : if a < b : a += b else : b += a i += 1 print ( i ) NEW_LINE

t = int ( input ( ) )   for x in range ( t ) : a , b , n = map ( int , input ( ) . split ( ) )   if a > b : b , a = a , b   operation = 0 while a <= n and b <= n : a += b a , b = b , a operation += 1   print ( operation ) NEW_LINE


import java . util . * ; import java . io . * ;   public class Main { private static final int N = ( int ) 1e6 + 10 ; public static void main ( String [ ] args ) throws IOException { int t , n , k ; int [ ] a = new int [ N ] ; StreamTokenizer cin = new StreamTokenizer ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; cin . nextToken ( ) ; t = ( int ) cin . nval ; while ( t -- > 0 ) { cin . nextToken ( ) ; n = ( int ) cin . nval ; int i ; for ( i = 1 ; i <= n ; i ++ ) { int x ; cin . nextToken ( ) ; x = ( int ) cin . nval ; if ( i % 2 == 1 ) System . out . print ( Math . abs ( x ) + " ▁ " ) ; else System . out . print ( - Math . abs ( x ) + " ▁ " ) ; } System . out . println ( ) ; }   }   }

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

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) for i in range ( len ( a ) ) : if i % 2 == 0 : print ( abs ( a [ i ] ) , end = ' ▁ ' ) else : print ( - abs ( a [ i ] ) , end = ' ▁ ' ) print ( ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) arr = [ abs ( int ( x ) ) for x in input ( ) . split ( ) ] out = [ ] for i in range ( len ( arr ) ) : if i % 2 == 0 : out . append ( arr [ i ] ) else : out . append ( arr [ i ] * - 1 ) print ( * out ) NEW_LINE

import sys , mathsys . setrecursionlimit ( 10 ** 8 ) ''' def ▁ fun ( ) : ▁ ▁ ▁ ▁ for ▁ i ▁ in ▁ range ( 16 ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ for ▁ j ▁ in ▁ range ( 4 ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ i & (1 < < j ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ print ( j , end = ' ' ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ print ( ) import ▁ binarytreefrom ▁ collections ▁ import ▁ dequebst ▁ = ▁ binarytree . tree ( height = 4 , is _ perfect = True ) print ( bst ) def ▁ s ( bst ) : ▁ ▁ ▁ ▁ if ▁ bst : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ bst . left , bst . right ▁ = ▁ bst . right , bst . left ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ s ( bst . right ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ s ( bst . left ) s ( bst ) print ( bst ) ''' t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) for i in range ( 0 , n ) : if i % 2 == 1 : if a [ i ] < 0 : a [ i ] = 0 - a [ i ] else : if a [ i ] > 0 : a [ i ] = 0 - a [ i ] print ( ' ▁ ' . join ( map ( str , a ) ) )   NEW_LINE

import sys   def answer ( n , a ) : b = [ ] for i in range ( n ) : if i % 2 == 0 : b . append ( abs ( a [ i ] ) ) else : b . append ( - abs ( a [ i ] ) )   return b NEW_LINE

import sysimport mathfrom math import factorial , inf , gcdfrom heapq import * from functools import * from itertools import * from collections import * from typing import * sys . setrecursionlimit ( 10 ** 5 ) NEW_LINE


import java . util . * ; import java . io . * ; public class Main2 { 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 int mod = ( int ) ( 1e9 + 7 ) ; static FastReader sc = new FastReader ( ) ; static PrintWriter out = new PrintWriter ( System . out ) ; public static void main ( String [ ] args ) { int z = 1 ; z = sc . nextInt ( ) ; while ( z -- > 0 ) { int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int l = x , h = x ; long ans = 1 ; while ( m -- > 0 ) { int u = sc . nextInt ( ) ; int v = sc . nextInt ( ) ; if ( u <= l && v >= l ) { l = Math . min ( u , l ) ; h = Math . max ( v , h ) ; } if ( u <= h && v >= h ) { l = Math . min ( u , l ) ; h = Math . max ( v , h ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ;    public class Solution { public static void main ( String [ ] args ) { FastScanner sc = new FastScanner ( ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int INF = ( int ) 1e9 ; int n = sc . nextInt ( ) , x = sc . nextInt ( ) , m = sc . nextInt ( ) , mini = x , maxi = x ; while ( m -- > 0 ) { int l = sc . nextInt ( ) , r = sc . nextInt ( ) ; if ( ( l <= maxi ) && ( r >= mini ) ) { maxi = Math . max ( maxi , r ) ; mini = Math . min ( mini , l ) ; } } System . out . println ( maxi - mini + 1 ) ; } } 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 [ ] readArray ( int n ) { Long [ ] a = new Long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextLong ( ) ; return a ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } } }

import java . io . * ; import java . util . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;    public class Main1 {      public static void main ( String [ ] args ) {   try {    FastScanner in = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ;    int t = in . nextInt ( ) ; while ( t -- > 0 ) { long n = in . nextLong ( ) ; long x = in . nextLong ( ) ; long m = in . nextLong ( ) ; long max = - 1 ; long min = Long . MAX_VALUE ;   boolean flag = false ;

t = int ( input ( ) )   for _ in range ( t ) : n , posof1 , m = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) res = 0 begin = posof1 end = posof1 for x in range ( m ) :   temp = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) if temp [ 0 ] <= begin <= temp [ 1 ] or temp [ 0 ] <= end <= temp [ 1 ] : begin = min ( begin , temp [ 0 ] ) end = max ( end , temp [ 1 ] )   print ( end - begin + 1 )       NEW_LINE

tt = int ( input ( ) ) for i in range ( 0 , tt ) : n , x , m = map ( int , input ( ) . split ( ) ) l , r = x , x for x in range ( m ) : L , R = map ( int , input ( ) . split ( ) ) if max ( l , L ) <= min ( r , R ) : l = min ( l , L ) r = max ( r , R ) print ( r - l + 1 ) NEW_LINE

import sys   input = sys . stdin . readline   for i in range ( int ( input ( ) ) ) :     n , x , m = map ( int , input ( ) . split ( ) )           a = x b = x for j in range ( m ) : l , r = map ( int , input ( ) . split ( ) )       if l <= a <= r or l <= b <= r : a = min ( a , l ) b = max ( b , r ) print ( b - a + 1 ) NEW_LINE

import sys   def answer ( n , x , m , l , r ) : lptr = x rptr = x for i in range ( m ) : if l [ i ] < lptr and r [ i ] >= lptr : lptr = l [ i ] if r [ i ] > rptr and l [ i ] <= rptr : rptr = r [ i ] k = ( rptr - lptr ) + 1 return k   def main ( ) : t = int ( input ( ) ) while t : n , x , m = [ int ( i ) for i in sys . stdin . readline ( ) . split ( ) ] l = [ 0 ] * m r = [ 0 ] * m for j in range ( m ) : l [ j ] , r [ j ] = [ int ( i ) for i in sys . stdin . readline ( ) . split ( ) ] print ( answer ( n , x , m , l , r ) ) t -= 1 returnmain ( ) NEW_LINE


import java . util . * ; import java . io . * ;   public class CFA { BufferedReader br ; PrintWriter out ; StringTokenizer st ; boolean eof ; private static final long MOD = 1000L * 1000L * 1000L + 7 ; private static final int [ ] dx = { 0 , - 1 , 0 , 1 } ; private static final int [ ] dy = { 1 , 0 , - 1 , 0 } ; private static final String yes = " Yes " ; private static final String no = " No " ;   void solve ( ) {

import java . util . HashMap ; import java . util . HashSet ; import java . util . Scanner ;   public class ChladniFigure { static class Pair { int a ; int b ; int done = 0 ; public Pair ( int a0 , int b0 ) { a = Math . min ( a0 , b0 ) ; b = Math . max ( a0 , b0 ) ; } public String toString ( ) { return ( " ( " + a + " ▁ " + b + " ) " ) ; } } static int n , m ; static HashMap < Integer , HashSet < Integer > > map = new HashMap < > ( ) ; static HashSet < Pair > set = new HashSet < > ( ) ; static HashMap < Integer , HashMap < Integer , Pair > > maptoobj = new HashMap < > ( ) ; static void addpair ( int a , int b ) { if ( a > b ) { int temp = a ; a = b ; b = temp ; } if ( ! map . containsKey ( a ) ) { map . put ( a , new HashSet < Integer > ( ) ) ; maptoobj . put ( a , new HashMap < > ( ) ) ; } map . get ( a ) . add ( b ) ; Pair pair = new Pair ( a , b ) ; set . add ( pair ) ; maptoobj . get ( a ) . put ( b , pair ) ; } static boolean checkpair ( int a , int b ) { if ( a > b ) { int temp = a ; a = b ; b = temp ; } return ( map . containsKey ( a ) && map . get ( a ) . contains ( b ) ) ; }   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ; int startn = n ;

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

import java . util . * ; import java . io . * ; public class Main { public static void main ( String args [ ] ) { new Main ( ) . work ( ) ; } Scanner in = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; void work ( ) { int n = in . nextInt ( ) , m = in . nextInt ( ) ; ArrayList < Integer > [ ] graph = ( ArrayList < Integer > [ ] ) new ArrayList [ n ] ; for ( int i = 0 ; i < n ; i ++ ) graph [ i ] = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < m ; i ++ ) { int c1 = in . nextInt ( ) - 1 ; int c2 = in . nextInt ( ) - 1 ; if ( c1 < c2 ) { graph [ c1 ] . add ( c2 ) ; graph [ c2 ] . add ( c1 + n ) ; } else { graph [ c2 ] . add ( c1 ) ; graph [ c1 ] . add ( c2 + n ) ; } } for ( int i = 0 ; i < n ; i ++ ) Collections . sort ( graph [ i ] ) ; boolean f = false ; out : for ( int i = 1 ; i < n ; i ++ ) { if ( n % i != 0 ) continue ; for ( int j = 0 ; j < n ; j ++ ) { int k = ( j + i ) % n ; if ( graph [ j ] . size ( ) != graph [ k ] . size ( ) ) continue out ; for ( int l = 0 ; l < graph [ j ] . size ( ) ; l ++ ) { if ( ( graph [ j ] . get ( l ) + i ) % n != graph [ k ] . get ( l ) % n ) { continue out ; } } } f = true ; break ; } if ( f ) { out . print ( " Yes " ) ; } else { out . print ( " No " ) ; } out . flush ( ) ; } }

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

import math     class CodeforcesTask1147BSolution : def __init__ ( self ) : self . result = ' ' self . n_m = [ ] self . points = [ ]   def read_input ( self ) : self . n_m = [ int ( x ) for x in input ( ) . split ( " ▁ " ) ] for x in range ( self . n_m [ 1 ] ) : self . points . append ( [ int ( y ) for y in input ( ) . split ( " ▁ " ) ] )   def process_task ( self ) : can = False segm = { } for point in self . points : segm [ " { 0 } _ {1 } " . format ( * point ) ] = True segm [ " { 1 } _ {0 } " . format ( * point ) ] = True for k in range ( 1 , self . n_m [ 0 ] ) : if not self . n_m [ 0 ] % k : NEW_LINE

def check ( k , g ) : for i in g : a = ( i [ 0 ] + k ) % n b = ( i [ 1 ] + k ) % n if not ( min ( a , b ) , max ( a , b ) ) in g : return False return True   n , m = [ int ( i ) for i in input ( ) . split ( ) ]   g = set ( ) for i in range ( m ) : a , b = [ int ( i ) for i in input ( ) . split ( ) ] a -= 1 b -= 1 NEW_LINE


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

import java . util . * ; public class j { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String S = sc . nextLine ( ) ; StringBuilder sd = new StringBuilder ( " " ) ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { if ( S . charAt ( i ) >= ' a ' && S . charAt ( i ) <= ' z ' ) sd . append ( S . charAt ( i ) ) ; else if ( S . charAt ( i ) == ' ▁ ' ) { for ( ; S . charAt ( i ) == ' ▁ ' ; i ++ ) { } if ( S . charAt ( i ) >= ' a ' && S . charAt ( i ) <= ' z ' ) { sd . append ( ' ▁ ' ) ; sd . append ( S . charAt ( i ) ) ; } else { sd . append ( S . charAt ( i ) ) ; if ( S . charAt ( i + 1 ) != ' ▁ ' ) sd . append ( ' ▁ ' ) ; } } else if ( S . charAt ( i ) == ' . ' || S . charAt ( i ) == ' , ' || S . charAt ( i ) == ' ! ' || S . charAt ( i ) == ' ? ' ) { sd . append ( S . charAt ( i ) ) ; if ( S . charAt ( i + 1 ) != ' ▁ ' ) sd . append ( ' ▁ ' ) ; } } System . out . println ( sd ) ; }   }

import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; String text = sc . nextLine ( ) ; int n = text . length ( ) ; StringBuilder str = new StringBuilder ( text ) ; int i = 0 , j = 0 ; for ( i = 0 ; i < str . length ( ) ; i ++ ) { if ( str . charAt ( i ) == ' ▁ ' ) { j = i + 1 ; while ( j < str . length ( ) && str . charAt ( j ) == ' ▁ ' ) { str . deleteCharAt ( j ) ; } } } for ( i = 0 ; i < str . length ( ) ; i ++ ) { if ( str . charAt ( i ) == ' . ' || str . charAt ( i ) == ' , ' || str . charAt ( i ) == ' ! ' || str . charAt ( i ) == ' ? ' ) { if ( str . charAt ( i - 1 ) == ' ▁ ' ) { str . deleteCharAt ( i - 1 ) ; i -= 1 ; } if ( str . charAt ( i + 1 ) != ' ▁ ' ) { str . insert ( i + 1 , ' ▁ ' ) ; } } } if ( str . charAt ( str . length ( ) - 1 ) == ' ▁ ' ) str . deleteCharAt ( str . length ( ) - 1 ) ; pw . print ( str . toString ( ) ) ;  		      pw . close ( ) ; }

s = str ( input ( ) ) l = ' , . ! ? ' e = ' ' for i in range ( 0 , len ( s ) ) : if ( s [ i ] not in l and s [ i ] != ' ▁ ' ) : e = e + s [ i ] elif ( s [ i ] == ' ▁ ' ) : if ( e [ - 1 ] == ' ▁ ' ) : pass else : e = e + s [ i ] else : if ( e [ - 1 ] == ' ▁ ' ) : e = e [ 0 : len ( e ) - 1 ] e = e + s [ i ] + ' ▁ ' else : e = e + s [ i ] + ' ▁ ' print ( e ) NEW_LINE

a = input ( ) z = len ( a ) d = [ ] ; t = " " for i in a : if i . isalpha ( ) : t += i else : if t != " " : d . append ( t ) if i in ' . , ? ! ' : d . append ( i ) t = " " d . append ( t ) p = len ( d ) for i in range ( p - 1 ) : if d [ i + 1 ] in " . , ? ! " : print ( d [ i ] , end = " " ) else : print ( d [ i ] , end = " ▁ " ) print ( d [ - 1 ] ) NEW_LINE

punc = [ ' . ' , ' , ' , ' ! ' , ' ? ' ] ;   s = input ( ) x = s . split ( ) res = str ( ) ;   for i in x : res = res + i + ' ▁ '   for c in punc : y = res . split ( c ) NEW_LINE

import re s = input ( ) . strip ( ) s = re . sub ( ' \s + ' , ' ▁ ' , s ) s = re . sub ( ' \s ? ( [ . , ! ? ] ) \s ? ' , ' \\1 ▁ ' , s ) print ( s ) NEW_LINE

import res = re . sub ( " \ ▁ + " , " ▁ " , input ( ) ) s = re . sub ( ' ▁ * ( [ , . ! ? ] ) ▁ * ' , r ' \1 ▁ ' , s ) print ( s ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . HashMap ; import java . util . Scanner ; import java . util . StringTokenizer ;   public class Main {   public static void main ( String [ ] args ) {   Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; HashMap < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; int num = 0 ; while ( t -- > 0 ) { int a = sc . nextInt ( ) ; num = Math . max ( a , num ) ; if ( map . containsKey ( a ) ) { map . put ( a , map . get ( a ) + 1 ) ; } else { map . put ( a , 1 ) ; } } for ( int i = 1 ; i <= num ; i ++ ) { if ( num % i == 0 ) { map . put ( i , map . get ( i ) - 1 ) ; } } int ans = 0 ; for ( int i = num ; i >= 1 ; i -- ) { if ( map . containsKey ( i ) ) { if ( map . get ( i ) != 0 ) { ans = i ; break ; } } } System . out . println ( num + " ▁ " + ans ) ; } }

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

import java . util . Arrays ; import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int [ ] a = new int [ n ] ; int [ ] b = new int [ n ] ; int [ ] c = new int [ n ] ; int topb = - 1 , topc = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = in . nextInt ( ) ; }

n = int ( input ( ) ) s = list ( map ( int , input ( ) . split ( ) ) ) b = max ( s ) for i in range ( 1 , b + 1 ) : if ( b % i == 0 ) : s . pop ( s . index ( i ) ) a = max ( s ) print ( a , b ) NEW_LINE

n = int ( input ( ) ) divisors = [ int ( bruh ) for bruh in input ( ) . split ( ) ] divvies = sorted ( divisors ) bignum = divvies [ 0 ] * divvies [ - 1 ]   bignumdivvies = [ ]   for div in range ( 1 , bignum + 1 ) : if bignum % div == 0 : bignumdivvies . append ( div )   bignumdivvies = list ( set ( bignumdivvies ) )   smallnumdivvies = [ ]   for x in sorted ( divisors ) : for y in range ( divisors . count ( x ) - bignumdivvies . count ( x ) ) : smallnumdivvies . append ( x )   smallnum = smallnumdivvies [ 0 ] * smallnumdivvies [ - 1 ]   print ( bignum , smallnum ) NEW_LINE

import sys , mathsys . setrecursionlimit ( 10 ** 8 ) ''' def ▁ fun ( ) : ▁ ▁ ▁ ▁ for ▁ i ▁ in ▁ range ( 16 ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ for ▁ j ▁ in ▁ range ( 4 ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ i & (1 < < j ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ print ( j , end = ' ' ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ print ( ) import ▁ binarytreefrom ▁ collections ▁ import ▁ dequebst ▁ = ▁ binarytree . tree ( height = 4 , is _ perfect = True ) print ( bst ) def ▁ s ( bst ) : ▁ ▁ ▁ ▁ if ▁ bst : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ bst . left , bst . right ▁ = ▁ bst . right , bst . left ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ s ( bst . right ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ s ( bst . left ) s ( bst ) print ( bst ) ''' t = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) m = max ( a ) a [ a . index ( 1 ) ] = - 1 a [ a . index ( m ) ] = - 1 for i in range ( 2 , int ( m ** 0.5 ) + 1 ) : if m % i == 0 : a [ a . index ( i ) ] = - 1 if m // i != i : a [ a . index ( m // i ) ] = - 1 a . append ( 1 ) print ( m , max ( a ) ) NEW_LINE

import sys   def answer ( n , d ) : NEW_LINE

n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) x = max ( arr ) divs = [ ] for z in range ( 1 , x + 1 ) : if x % z == 0 : arr . pop ( arr . index ( z ) )   print ( x , max ( arr ) ) NEW_LINE


import java . io . * ; import java . util . * ; import java . lang . * ; public class Main { static InputReader sc ; static PrintWriter pw ; public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; sc = new InputReader ( inputStream ) ; pw = new PrintWriter ( outputStream ) ; solve ( ) ; pw . close ( ) ; }

import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . io . BufferedWriter ; import java . io . Writer ; import java . io . OutputStreamWriter ; import java . util . InputMismatchException ; import java . io . IOException ; import java . util . ArrayList ; 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 ) ; OutputWriter out = new OutputWriter ( outputStream ) ; BColorTheFence solver = new BColorTheFence ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class BColorTheFence { public void solve ( int testNumber , InputReader in , OutputWriter out ) {   int v = in . nextInt ( ) ; int [ ] costs = new int [ 10 ] ; int mini = Integer . MAX_VALUE ;   for ( int i = 1 ; i <= 9 ; i ++ ) { costs [ i ] = in . nextInt ( ) ; mini = Math . min ( mini , costs [ i ] ) ; }   int d = v / mini ; if ( d == 0 ) { out . print ( " - 1" ) ; return ; }   int idx = - 1 ; for ( int i = 1 ; i <= 9 ; i ++ ) { if ( costs [ i ] == mini ) idx = i ; }   ArrayList < Integer > ans = new ArrayList < > ( ) ; for ( int i = 0 ; i < d ; i ++ ) { ans . add ( idx ) ; }   int left = v - ( mini * d ) ;   for ( int i = 0 ; i < d ; i ++ ) { for ( int j = 9 ; j >= 1 ; j -- ) { if ( left + mini >= costs [ j ] ) { ans . set ( i , j ) ; left -= costs [ j ] ; left += mini ; break ; } } }   for ( int el : ans ) out . print ( el ) ;

from sys import stdin , stdoutfrom math import floor , gcd , fabs , factorial , fmod , sqrt , inf , logfrom collections import defaultdict as dd , dequefrom heapq import merge , heapify , heappop , heappush , nsmallestfrom bisect import bisect_left as bl , bisect_right as br , bisect mod = pow ( 10 , 9 ) + 7 mod2 = 998244353 def inp ( ) : return stdin . readline ( ) . strip ( ) def iinp ( ) : return int ( inp ( ) ) def out ( var , end = " \n " ) : stdout . write ( str ( var ) + " \n " ) def outa ( * var , end = " \n " ) : stdout . write ( ' ▁ ' . join ( map ( str , var ) ) + end ) def lmp ( ) : return list ( mp ( ) ) def mp ( ) : return map ( int , inp ( ) . split ( ) ) def smp ( ) : return map ( str , inp ( ) . split ( ) ) def l1d ( n , val = 0 ) : return [ val for i in range ( n ) ] def l2d ( n , m , val = 0 ) : return [ l1d ( m , val ) for j in range ( n ) ] def remadd ( x , y ) : return 1 if x % y else 0 def ceil ( a , b ) : return ( a + b - 1 ) // b def isprime ( x ) : if x <= 1 : return False if x in ( 2 , 3 ) : return True if x % 2 == 0 : return False for i in range ( 3 , int ( sqrt ( x ) ) + 1 , 2 ) : if x % i == 0 : return False return True n = iinp ( ) arr = lmp ( ) mn = min ( arr ) d = n // mnif d == 0 : print ( - 1 ) else : rem = n % mn for i in range ( d ) : rem += mn for j in range ( 8 , - 1 , - 1 ) : if arr [ j ] <= rem : break print ( j + 1 , end = ' ' ) rem -= arr [ j ] NEW_LINE

v = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) )   mincost = min ( a ) dig = v // mincost   if dig == 0 : print ( - 1 ) exit ( )   for i in range ( dig , 0 , - 1 ) : for j in range ( 9 , 0 , - 1 ) : if v - a [ j - 1 ] >= mincost * ( i - 1 ) : print ( j , end = " " ) v -= a [ j - 1 ] breakprint ( ) NEW_LINE

def colour_the_fence ( ) : n = int ( input ( ) ) litre_list = list ( map ( int , str ( input ( ) ) . split ( ) ) ) paint_dict = { }   for i in range ( 1 , 10 ) : if litre_list [ i - 1 ] > n : continue paint_dict [ litre_list [ i - 1 ] ] = i NEW_LINE

from sys import stdin , stdoutnmbr = lambda : int ( stdin . readline ( ) ) lst = lambda : list ( map ( int , input ( ) . split ( ) ) ) for i in range ( 1 ) : NEW_LINE