import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; public class Main { static int maxn = 110 ; static int cnt [ ] = new int [ maxn ] ; public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String s = in . next ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) cnt [ s . charAt ( i ) - ' a ' ] ++ ; int flag = 0 , flag2 = 0 ; for ( int i = 0 ; i < 26 ; i ++ ) { if ( cnt [ i ] > 1 ) flag ++ ; if ( cnt [ i ] >= 1 ) flag2 ++ ; } if ( flag2 > 4 ) System . out . println ( " No " ) ; else if ( flag >= 2 || flag2 > 3 || ( flag == 1 && flag2 >= 3 ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

from collections import Counter     def has_beautiful_splits ( s ) : counter = Counter ( s ) if len ( counter ) == 4 : return True elif len ( counter ) == 3 : return max ( counter . values ( ) ) > 1 elif len ( counter ) == 2 : return min ( counter . values ( ) ) > 1 return False     s = input ( ) print ( " Yes " if has_beautiful_splits ( s ) else " No " ) NEW_LINE

from collections import Counters = input ( ) A = [ char for char in s ]   A . sort ( ) c = Counter ( A ) if len ( c . keys ( ) ) > 4 : print ( " No " ) elif len ( c . keys ( ) ) == 4 : print ( " Yes " ) elif len ( c . keys ( ) ) == 3 : z = list ( c . values ( ) ) if z == [ 1 , 1 , 1 ] : print ( " No " ) else : print ( " Yes " ) elif len ( c . keys ( ) ) == 2 : z = list ( c . values ( ) ) if 1 in z : print ( " No " ) else : print ( " Yes " ) else : print ( " No " ) NEW_LINE

def adorable ( text ) : counter = { } for i in text : if i not in counter : counter [ i ] = 1 else : counter [ i ] += 1 n = len ( counter . keys ( ) ) if n == 1 : return " No " elif n == 2 : if all ( counter [ i ] >= 2 for i in counter ) : return " Yes " else : return " No " elif n == 3 : if any ( counter [ i ] >= 2 for i in counter ) : return " Yes " else : return " No " elif n == 4 : return " Yes " else : return " No "   print ( adorable ( input ( ) ) ) NEW_LINE

from sys import stdin , stdoutnmbr = lambda : int ( stdin . readline ( ) ) from collections import Counterlst = lambda : list ( map ( int , stdin . readline ( ) . split ( ) ) ) for _ in range ( 1 ) : s = input ( ) n = len ( s ) d = Counter ( s ) f = 1 ; cnt = 0 for k , v in d . items ( ) : if v == 1 : cnt += 1 if ( len ( d ) == 2 and cnt == 0 ) : print ( ' YES ' ) elif ( 3 == len ( d ) and cnt <= 2 ) : print ( ' YES ' ) elif ( len ( d ) == 4 ) : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


import java . io . IOException ; import java . util . Scanner ;   public class Main { static Scanner in = new Scanner ( System . in ) ; public static void main ( String [ ] args ) throws IOException { int a2 = query ( 1 , 2 ) ; int a3 = query ( 1 , 3 ) ; int a4 = query ( 1 , 4 ) ; int a5 = query ( 1 , 5 ) ; int a1 = gcd ( gcd ( a2 , a3 ) , gcd ( a4 , a5 ) ) ; if ( a1 == 15 * 2 || a1 == 23 * 2 ) { a1 /= 2 ; } a2 /= a1 ; a3 /= a1 ; a4 /= a1 ; a5 /= a1 ; int a6 = 4 + 8 + 15 + 16 + 23 + 42 - a1 - a2 - a3 - a4 - a5 ; System . out . println ( " ! ▁ " + a1 + " ▁ " + a2 + " ▁ " + a3 + " ▁ " + a4 + " ▁ " + a5 + " ▁ " + a6 ) ; } public static int query ( int i , int j ) { System . out . println ( " ? ▁ " + i + " ▁ " + j ) ; System . out . flush ( ) ; return in . nextInt ( ) ; } public static int gcd ( int a , int b ) { return b == 0 ? a : gcd ( b , a % b ) ; } }

from itertools import permutationsprint ( ' ? ▁ 1 ▁ 2' ) print ( ' ? ▁ 2 ▁ 3' ) print ( ' ? ▁ 3 ▁ 4' ) print ( ' ? ▁ 4 ▁ 5' ) ab = int ( input ( ) ) bc = int ( input ( ) ) cd = int ( input ( ) ) de = int ( input ( ) )   s = [ 4 , 8 , 15 , 16 , 23 , 42 ] for l in permutations ( s ) : if l [ 0 ] * l [ 1 ] == ab and l [ 1 ] * l [ 2 ] == bc and l [ 2 ] * l [ 3 ] == cd and l [ 3 ] * l [ 4 ] == de : print ( f ' ! ▁ { l [ 0 ] } ▁ { l [ 1 ] } ▁ { l [ 2 ] } ▁ { l [ 3 ] } ▁ { l [ 4 ] } ▁ { l [ 5 ] } ' ) NEW_LINE

''' bsdchodi ▁ ques better ▁ to ▁ take ▁ 1 ▁ element ▁ common ▁ in ▁ all ▁ and ▁ just ▁ find ▁ it   '''       l = [ 4 , 8 , 15 , 16 , 23 , 42 ] print ( ' ? ' , 1 , 5 ) a = int ( input ( ) ) print ( ' ? ' , 2 , 5 ) b = int ( input ( ) ) print ( ' ? ' , 3 , 5 ) c = int ( input ( ) ) print ( ' ? ' , 4 , 5 ) d = int ( input ( ) ) l = l [ : : - 1 ] v = 0 for i in range ( 0 , len ( l ) ) : if a // l [ i ] in l and b // l [ i ] in l and c // l [ i ] in l and d // l [ i ] in l : v = l [ i ] breakm = [ ] m . append ( a // v ) m . append ( b // v ) m . append ( c // v ) m . append ( d // v ) m . append ( v ) o = list ( set ( l ) - set ( m ) ) m = m + oprint ( ' ! ' , * m ) NEW_LINE

from math import gcdans = [ ] print ( ' ? ▁ 1 ▁ 2' , flush = True ) a = int ( input ( ) ) print ( ' ? ▁ 1 ▁ 3' , flush = True ) b = int ( input ( ) ) print ( ' ? ▁ 1 ▁ 4' , flush = True ) c = int ( input ( ) ) print ( ' ? ▁ 1 ▁ 5' , flush = True ) d = int ( input ( ) ) ans . append ( gcd ( gcd ( a , b ) , gcd ( c , d ) ) ) if ans [ 0 ] in [ 2 * 15 , 2 * 23 ] : ans [ 0 ] //= 2 ans . append ( a // ans [ 0 ] ) ans . append ( b // ans [ 0 ] ) ans . append ( c // ans [ 0 ] ) ans . append ( d // ans [ 0 ] ) ans . append ( [ x for x in [ 4 , 8 , 15 , 16 , 23 , 42 ] if x not in ans ] [ 0 ] ) print ( ' ! ' , * ans ) NEW_LINE

import sysimport mathimport itertools def ask ( l , r ) : print ( ' ? ' , l , r ) sys . stdout . flush ( ) n = int ( input ( ) ) return n def answer ( lst ) : print ( ' ! ' , * lst ) jury = [ 4 , 8 , 15 , 16 , 23 , 42 ] perm = list ( itertools . permutations ( jury ) ) ab = ask ( 1 , 2 ) bc = ask ( 2 , 3 ) cd = ask ( 3 , 4 ) de = ask ( 4 , 5 ) for a , b , c , d , e , f in perm : if a * b == ab and b * c == bc and c * d == cd and d * e == de : answer ( [ a , b , c , d , e , f ] ) NEW_LINE


import java . util . Arrays ; import java . util . Scanner ;   public class task1 { static Scanner scanner = new Scanner ( System . in ) ;   public static void main ( String [ ] args ) { int food [ ] = new int [ 3 ] ; int n = scanner . nextInt ( ) ; for ( int j = 0 ; j < n ; j ++ ) { for ( int i = 0 ; i < 3 ; i ++ ) { food [ i ] = scanner . nextInt ( ) ; } Arrays . sort ( food ) ; if ( food [ 0 ] == 0 ) { if ( food [ 1 ] == 0 && food [ 2 ] == 0 ) System . out . println ( 0 ) ; else if ( food [ 1 ] == 0 && food [ 2 ] >= 1 ) System . out . println ( 1 ) ; else if ( food [ 1 ] == 1 && food [ 2 ] >= 1 ) System . out . println ( 2 ) ; else if ( food [ 1 ] > 1 && food [ 2 ] > 1 ) System . out . println ( 3 ) ; } else if ( food [ 0 ] == 1 && food [ 1 ] == 1 && food [ 2 ] >= 1 ) System . out . println ( 3 ) ; else if ( ( food [ 0 ] == 1 && food [ 1 ] >= 2 && food [ 2 ] >= 2 ) || ( food [ 0 ] == 2 && food [ 1 ] == 2 && food [ 2 ] == 2 ) ) System . out . println ( 4 ) ; else if ( food [ 0 ] == 2 && food [ 1 ] >= 2 && food [ 2 ] > 2 ) System . out . println ( 5 ) ; else if ( food [ 0 ] == 3 && food [ 1 ] >= 3 && food [ 2 ] >= 3 ) System . out . println ( 6 ) ; else System . out . println ( 7 ) ;   } } }

import java . util . Scanner ;   public class FastFoodRestaurant { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int testCase = scanner . nextInt ( ) ; while ( ( testCase -- ) != 0 ) { int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; int c = scanner . nextInt ( ) ; if ( b > a ) { int tmp = a ; a = b ; b = tmp ; } if ( c > a ) { int tmp = a ; a = c ; c = tmp ; } if ( c > b ) { int tmp = c ; c = b ; b = tmp ; }   int cnt = 0 ; if ( a != 0 ) { -- a ; ++ cnt ; } if ( b != 0 ) { -- b ; ++ cnt ; } if ( c != 0 ) { -- c ; ++ cnt ; } if ( a != 0 && b != 0 ) { ++ cnt ; -- a ; -- b ; } if ( a != 0 && c != 0 ) { ++ cnt ; -- a ; -- c ; } if ( b != 0 && c != 0 ) { ++ cnt ; -- b ; -- c ; } if ( a != 0 && b != 0 && c != 0 ) { ++ cnt ; -- a ; -- b ; -- c ; }   System . out . println ( cnt ) ; }   }   }

import java . io . * ; import java . math . BigInteger ; import java . util . * ; public class Codeforces { public static void main ( String args [ ] ) throws FileNotFoundException , IOException { Scanner scan = new Scanner ( System . in ) ; int t = scan . nextInt ( ) ; while ( t -- > 0 ) { int arr [ ] = new int [ 3 ] ; arr [ 0 ] = scan . nextInt ( ) ; arr [ 1 ] = scan . nextInt ( ) ; arr [ 2 ] = scan . nextInt ( ) ; Arrays . sort ( arr ) ; int count = 0 ; if ( arr [ 0 ] > 0 || arr [ 1 ] > 0 || arr [ 2 ] > 0 ) { if ( arr [ 0 ] > 0 ) { arr [ 0 ] -- ; count ++ ; } if ( arr [ 1 ] > 0 ) { arr [ 1 ] -- ; count ++ ; } if ( arr [ 2 ] > 0 ) { arr [ 2 ] -- ; count ++ ; } } if ( arr [ 2 ] > 0 && arr [ 1 ] > 0 ) { arr [ 2 ] -- ; arr [ 1 ] -- ; count += 1 ; } if ( arr [ 2 ] > 0 && arr [ 0 ] > 0 ) { arr [ 2 ] -- ; arr [ 0 ] -- ; count += 1 ; } if ( arr [ 1 ] > 0 && arr [ 0 ] > 0 ) { arr [ 1 ] -- ; arr [ 0 ] -- ; count += 1 ; } if ( arr [ 2 ] > 0 && arr [ 1 ] > 0 && arr [ 0 ] > 0 ) { arr [ 2 ] -- ; arr [ 1 ] -- ; arr [ 0 ] -- ; count += 1 ; } System . out . println ( count ) ; } } }

import java . util . * ; public class fastfoodrestaurant { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; for ( int i = 1 ; i <= t ; i ++ ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int count = 0 ; int A [ ] = { 1 , 0 , 0 , 1 , 1 , 0 , 1 } ; int B [ ] = { 0 , 1 , 0 , 1 , 0 , 1 , 1 } ; int C [ ] = { 0 , 0 , 1 , 0 , 1 , 1 , 1 } ; if ( c > a ) { int k = c ; c = a ; a = k ; } for ( int j = 0 ; j <= 6 ; j ++ ) { if ( a - A [ j ] >= 0 && b - B [ j ] >= 0 && c - C [ j ] >= 0 ) { a = a - A [ j ] ; b = b - B [ j ] ; c = c - C [ j ] ; count ++ ; } } System . out . println ( count ) ; } } }

def solve ( a , b , c ) : slist = [ a , b , c ] slist . sort ( ) a , b , c = slist mlist = [ ( 0 , 0 , 1 ) , ( 0 , 1 , 0 ) , ( 1 , 0 , 0 ) , ( 0 , 1 , 1 ) , ( 1 , 0 , 1 ) , ( 1 , 1 , 0 ) , ( 1 , 1 , 1 ) ] cnt = 0   for da , db , dc in mlist : if a >= da and b >= db and c >= dc : a -= da b -= db c -= dc cnt += 1   return cnt   if __name__ == ' _ _ main _ _ ' : T = int ( input ( ) ) for t in range ( T ) : a , b , c = tuple ( map ( int , input ( ) . split ( ) ) ) print ( solve ( a , b , c ) ) NEW_LINE

import mathimport operator   def lcm ( a , b ) : return ( a / math . gcd ( a , b ) ) * b def nCr ( n , r ) : return ( ( math . factorial ( n ) ) / ( ( math . factorial ( r ) ) * ( math . factorial ( n - r ) ) ) )       def isKthBitSet ( n , k ) : if ( n & ( 1 << ( k - 1 ) ) ) : return True else : return Falsedef maximalRectangle ( matrix ) : if not matrix or not matrix [ 0 ] : return 0 n = len ( matrix [ 0 ] ) height = [ 0 ] * ( n + 1 ) ans = 0 for row in matrix : for i in range ( n ) : height [ i ] = height [ i ] + 1 if row [ i ] == '0' else 0 stack = [ - 1 ] for i in range ( n + 1 ) : while height [ i ] < height [ stack [ - 1 ] ] : h = height [ stack . pop ( ) ] w = i - 1 - stack [ - 1 ] ans = max ( ans , h * w ) stack . append ( i ) return ans     def matched ( str ) : count = 0 for i in str : if i == " ( " : count += 1 elif i == " ) " : count -= 1 if count < 0 : return False return count == 0   def isValid ( h , m , nh , nm ) : l = [ 0 , 1 , 5 , - 1 , - 1 , 2 , - 1 , - 1 , 8 , - 1 ] if ( l [ h // 10 ] == - 1 or l [ h % 10 ] == - 1 or l [ m // 10 ] == - 1 or l [ m % 10 ] == - 1 ) : return False resh = l [ m % 10 ] * 10 + l [ m // 10 ] resm = l [ h % 10 ] * 10 + l [ h // 10 ]   return ( resh < nh and resm < nm )       def solve ( ) :   a , b , c = map ( int , input ( ) . split ( ) ) NEW_LINE

test_number = int ( input ( ) )   for i in range ( test_number ) : dishes = sorted ( list ( map ( int , input ( ) . split ( ) ) ) , reverse = True )   visitor = 0   for i in range ( len ( dishes ) ) : if dishes [ i ] > 0 : dishes [ i ] -= 1 visitor += 1   for j in range ( 2 ) : for i in range ( 1 , 3 ) : if dishes [ j ] > 0 and dishes [ i ] > 0 and i > j : dishes [ j ] -= 1 dishes [ i ] -= 1 visitor += 1                 if dishes [ 0 ] > 0 and dishes [ 1 ] > 0 and dishes [ 2 ] > 0 : visitor += 1   print ( visitor ) NEW_LINE

T_ON = 1 DEBUG_ON = 0 MOD = 998244353     def solve ( ) : A = read_ints ( ) A . sort ( ) a , b , c = A total = 0 NEW_LINE

cases = int ( input ( ) ) while cases : cases -= 1 a , b , c = sorted ( map ( int , input ( ) . split ( ) ) , reverse = True ) ans = 0   if a : a -= 1 ans += 1 if b : b -= 1 ans += 1 if c : c -= 1 ans += 1 if a and b : a -= 1 b -= 1 ans += 1 if a and c : a -= 1 c -= 1 ans += 1 if c and b : c -= 1 b -= 1 ans += 1 if a and b and c : ans += 1   print ( ans ) NEW_LINE


import java . util . Scanner ; public class CF800 { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int x = input . nextInt ( ) ; int counter = 0 ; int counter2 = 1 ; int [ ] y = new int [ x ] ; for ( int i = 0 ; i < y . length ; i ++ ) { y [ i ] = input . nextInt ( ) ; counter ++ ; } for ( int c = 0 ; c < counter - 1 ; c ++ ) { if ( y [ c ] != y [ c + 1 ] ) { counter2 ++ ; } } System . out . println ( counter2 ) ; } }

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

import java . util . * ; public class magnets { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int c = 0 , d = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int m = sc . nextInt ( ) ; if ( m != c ) { c = m ; d ++ ; } } System . out . println ( d ) ; } }

import java . io . * ; import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String [ ] arr = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . next ( ) ; } int cnt = 1 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( ! ( arr [ i ] . equals ( arr [ i + 1 ] ) ) ) { cnt ++ ; } } System . out . println ( cnt ) ; } }

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

def function ( Str , X ) : import itertools Lst = [ ] for i , j in itertools . groupby ( Str ) : if i == X : Lst . append ( len ( list ( j ) ) ) return Lst N = int ( input ( ) ) Lst1 = [ ] for _ in range ( N ) : Str = input ( ) Lst1 . append ( Str ) NStr1 = " " . join ( Lst1 )   NStr = NStr1 . replace ( "10" , " P " ) NStr2 = NStr . replace ( "01" , " Q " )       Val = len ( function ( NStr2 , " P " ) )   Val1 = len ( function ( NStr2 , " Q " ) )   print ( Val + Val1 ) NEW_LINE

""" n = input ( ) . strip ( ) m = input ( ) . strip ( ) s = n [ : : -1 ] if ▁ s = = m : ▁ ▁ ▁ ▁ print ( " YES " ) else : ▁ ▁ ▁ ▁ print ( " NO " )  n = int ( input ( ) ) s = input ( ) . strip ( ) if ▁ s . count ( ' A ' ) > s . count ( ' D ' ) : ▁ ▁ ▁ ▁ print ( " Anton " ) elif ▁ s . count ( ' A ' ) < s . count ( ' D ' ) : ▁ ▁ ▁ ▁ print ( " Danik " ) else : ▁ ▁ ▁ ▁ print ( " Friendship " ) """ """ n = input ( ) . strip ( ) if ▁ ' H ' ▁ in ▁ n ▁ or ▁ ' Q ' ▁ in ▁ n ▁ or ▁ ' 9 ' ▁ in ▁ n : ▁ ▁ ▁ ▁ print ( " YES " ) else : ▁ ▁ ▁ ▁ print ( " NO " ) """ """ n , h = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) c = 0for ▁ i ▁ in ▁ a : ▁ ▁ ▁ ▁ if ▁ i > h : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ c = c + 2 ▁ ▁ ▁ ▁ else : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ c = c + 1print ( c ) """ """ c = 0for ▁ i ▁ in ▁ range ( int ( input ( ) ) ) : ▁ ▁ ▁ ▁ p , q = map ( int , input ( ) . split ( ) ) ▁ ▁ ▁ ▁ if ▁ ( q - p ) > = 2 : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ c = c + 1print ( c ) """ p = [ ] c = 1 for i in range ( int ( input ( ) ) ) : s = input ( ) p . append ( s ) if len ( p ) == 1 : print ( 1 ) else : for i in range ( len ( p ) - 1 ) : if p [ i ] != p [ i + 1 ] : c = c + 1 print ( c ) NEW_LINE

n = int ( input ( ) ) poles = [ ] for _ in range ( n ) : poles . append ( input ( ) ) num_groups = 1 for i in range ( n - 1 ) : if not int ( poles [ i ] [ 1 ] ) ^ int ( poles [ i + 1 ] [ 0 ] ) : num_groups += 1 print ( num_groups ) NEW_LINE

n = int ( input ( ) ) c = 1 for i in range ( n ) : if i == 0 : new = input ( ) continue old = new new = input ( ) if old [ 1 ] == new [ 0 ] : c += 1 print ( c ) NEW_LINE

n = int ( input ( ) ) current = input ( ) c = 1 for _ in range ( 1 , n ) : x = input ( ) if current != x : c += 1 current = xprint ( c ) NEW_LINE


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

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

n , m = map ( int , input ( ) . split ( ) ) arr = [ [ 0 , 0 , 0 , 0 ] for i in range ( n ) ]   i = 1 pos = 0 while 1 : if i > m or pos == n : break if i <= m : arr [ pos ] [ 0 ] = i i += 1 if i <= m : arr [ pos ] [ 3 ] = i i += 1 pos += 1   pos = 0 while 1 : if i > m or pos == n : break if i <= m : arr [ pos ] [ 1 ] = i i += 1 if i <= m : arr [ pos ] [ 2 ] = i i += 1 pos += 1       for i in arr : if i [ 1 ] : print ( i [ 1 ] , end = " ▁ " ) if i [ 0 ] : print ( i [ 0 ] , end = " ▁ " ) if i [ 2 ] : print ( i [ 2 ] , end = " ▁ " ) if i [ 3 ] : print ( i [ 3 ] , end = " ▁ " )   NEW_LINE

def STR ( ) : return list ( input ( ) ) def INT ( ) : return int ( input ( ) ) def MAP ( ) : return map ( int , input ( ) . split ( ) ) def MAP2 ( ) : return map ( float , input ( ) . split ( ) ) def LIST ( ) : return list ( map ( int , input ( ) . split ( ) ) ) def STRING ( ) : return input ( ) import stringimport sysfrom heapq import heappop , heappushfrom bisect import * from collections import deque , Counter , defaultdictfrom math import * from itertools import permutations , accumulatedx = [ - 1 , 1 , 0 , 0 ] dy = [ 0 , 0 , 1 , - 1 ] NEW_LINE

n , m = input ( ) . split ( ) n , m = int ( n ) , int ( m ) temp = 1 groos = n * 2 + 1 while groos <= m : print ( groos , end = " ▁ " ) print ( temp , end = " ▁ " ) groos , temp = groos + 1 , temp + 1 while temp <= min ( n * 2 , m ) : print ( temp , end = " ▁ " ) temp += 1 NEW_LINE

n , m = map ( int , input ( ) . split ( ) ) a , b , c , d = [ ] , [ ] , [ ] , [ ] for i in range ( n ) : if 2 * i + 1 <= m : a . append ( 2 * i + 1 ) NEW_LINE


import java . util . Arrays ; import java . util . Scanner ;   public class B1430 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int N = in . nextInt ( ) ; int K = in . nextInt ( ) ; Integer [ ] A = new Integer [ N ] ; for ( int n = 0 ; n < N ; n ++ ) { A [ n ] = in . nextInt ( ) ; } Arrays . sort ( A ) ; long answer = 0 ; for ( int n = 1 ; n <= K + 1 ; n ++ ) { answer += A [ N - n ] ; } System . out . println ( answer ) ; } }   }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . Collections ;   public class barrels { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int t = Integer . parseInt ( br . readLine ( ) ) ; for ( int i = 0 ; i < t ; i ++ ) { int [ ] rong0 = Arrays . stream ( br . readLine ( ) . split ( " \\ s " ) ) . mapToInt ( Integer :: parseInt ) . toArray ( ) ; int [ ] rong = Arrays . stream ( br . readLine ( ) . split ( " \\ s " ) ) . mapToInt ( Integer :: parseInt ) . toArray ( ) ; int n = rong0 [ 0 ] , k = rong0 [ 1 ] ; Integer [ ] newArray = new Integer [ rong . length ] ; int x = 0 ; for ( int value : rong ) { newArray [ x ++ ] = Integer . valueOf ( value ) ; } Arrays . sort ( newArray , Collections . reverseOrder ( ) ) ; long sum = 0 ; for ( int d = 0 ; d <= k ; d ++ ) { sum += newArray [ d ] ; } System . out . println ( sum ) ; } }   }

for i in range ( int ( input ( ) ) ) : n , k = map ( int , input ( ) . split ( ) ) NEW_LINE lis = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE temp = 0 NEW_LINE rr = sorted ( lis , reverse = True ) NEW_LINE for i in range ( k + 1 ) : temp += rr [ i ] NEW_LINE print ( temp ) NEW_LINE

for i in range ( int ( input ( ) ) ) : n , k = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE print ( sum ( sorted ( list ( map ( int , input ( ) . split ( ) ) ) ) [ : : - 1 ] [ : k + 1 ] ) ) NEW_LINE

t = int ( input ( ) ) NEW_LINE for j in range ( t ) : a , b = map ( int , input ( ) . split ( ' ▁ ' ) ) NEW_LINE k = list ( map ( int , input ( ' ' ) . split ( ' ▁ ' ) ) ) NEW_LINE if k . count ( 0 ) == a : NEW_LINE INDENT print ( 0 ) else : NEW_LINE k = sorted ( k ) NEW_LINE DEDENT z = max ( k ) NEW_LINE for i in range ( 1 , b + 1 ) : z += k [ a - 1 - i ] NEW_LINE print ( z ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n , k = map ( int , input ( ) . split ( ) ) NEW_LINE A = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE A . sort ( ) NEW_LINE print ( sum ( A [ - k - 1 : ] ) ) NEW_LINE


import java . util . * ; public class LittleElephantandMagicSquare { public static void main ( String arg [ ] ) { Scanner sc = new Scanner ( System . in ) ; int [ ] [ ] arr = new int [ 3 ] [ 3 ] ; long sum = 0 ;   for ( int i = 0 ; i < 3 ; i ++ ) { for ( int j = 0 ; j < 3 ; j ++ ) { arr [ i ] [ j ] = sc . nextInt ( ) ; sum += arr [ i ] [ j ] ; } }   sum /= 2 ;   arr [ 0 ] [ 0 ] = ( int ) sum - arr [ 0 ] [ 1 ] - arr [ 0 ] [ 2 ] ; arr [ 1 ] [ 1 ] = ( int ) sum - arr [ 1 ] [ 0 ] - arr [ 1 ] [ 2 ] ; arr [ 2 ] [ 2 ] = ( int ) sum - arr [ 2 ] [ 0 ] - arr [ 2 ] [ 1 ] ;   System . out . println ( ) ;   for ( int i = 0 ; i < 3 ; i ++ ) { for ( int j = 0 ; j < 3 ; j ++ ) { System . out . print ( arr [ i ] [ j ] + " ▁ " ) ; } System . out . println ( ) ; }      } }

import java . util . * ; public class Practice { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int i , j , sum = 0 ; int [ ] [ ] a = new int [ 3 ] [ 3 ] ; for ( i = 0 ; i < 3 ; ++ i ) for ( j = 0 ; j < 3 ; ++ j ) { a [ i ] [ j ] = scan . nextInt ( ) ; sum += a [ i ] [ j ] ; } a [ 0 ] [ 0 ] = sum / 2 - ( a [ 1 ] [ 0 ] + a [ 2 ] [ 0 ] ) ; a [ 1 ] [ 1 ] = sum / 2 - ( a [ 0 ] [ 1 ] + a [ 2 ] [ 1 ] ) ; a [ 2 ] [ 2 ] = sum / 2 - ( a [ 0 ] [ 2 ] + a [ 1 ] [ 2 ] ) ; for ( i = 0 ; i < 3 ; ++ i ) { System . out . println ( ) ; for ( j = 0 ; j < 3 ; ++ j ) System . out . print ( a [ i ] [ j ] + " ▁ " ) ; } } }

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

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

a , b , c = map ( int , input ( ) . split ( ) ) d , e , f = map ( int , input ( ) . split ( ) ) g , h , i = map ( int , input ( ) . split ( ) )   sum1 = a + b + csum2 = d + e + fsum3 = g + h + ia = ( sum1 + sum2 + sum3 ) // 2 - ( sum1 ) e = ( sum1 + sum2 + sum3 ) // 2 - ( sum2 ) i = ( sum1 + sum2 + sum3 ) // 2 - ( sum3 ) print ( a , b , c ) print ( d , e , f ) print ( g , h , i )           NEW_LINE

""" ▁ ▁ ▁ ▁ https : / / codeforces . com / problemset / problem / 259 / B """ import fileinput   def sommeColonne ( t , col ) : res = 0 for i in range ( 3 ) : res += t [ i ] [ col ] return res   def sommeLigne ( t , lig ) : res = 0 for i in range ( 3 ) : res += t [ lig ] [ i ] return res   def sommeDiag1 ( t ) : return t [ 0 ] [ 0 ] + t [ 1 ] [ 1 ] + t [ 2 ] [ 2 ]   def sommeDiag2 ( t ) : return t [ 0 ] [ 2 ] + t [ 1 ] [ 1 ] + t [ 2 ] [ 0 ]   def valide ( v ) : return v >= 1 and v <= 100000   def cherche ( t ) : """ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ Recherche ▁ par ▁ force ▁ brute . . . ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ Un ▁ candidat ▁ est ▁ un ▁ triplet ▁ de ▁ nombres ▁ ( la ▁ diagonale ) . ▁ ▁ ▁ ▁ """ NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class CF1372_D2_B { public static void main ( String [ ] args ) { FastScanner scanner = new FastScanner ( ) ; int t = scanner . nextInt ( ) ; StringBuilder out = new StringBuilder ( ) ; for ( int i = 0 ; i < t ; i ++ ) { solve ( scanner , out ) ; } System . out . print ( out ) ; }   private static void solve ( FastScanner scanner , StringBuilder out ) { int n = scanner . nextInt ( ) ;

import java . awt . Desktop ;   import java . io . BufferedReader ;    import java . io . IOException ; import java . io . InputStreamReader ; import java . net . URI ; import java . net . URISyntaxException ; import java . sql . Array ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Comparator ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Iterator ; import java . util . LinkedHashMap ; import java . util . LinkedHashSet ; import java . util . LinkedList ; import java . util . List ; import java . util . Map ; import java . util . PriorityQueue ; import java . util . Queue ; import java . util . Scanner ; import java . util . Set ; import java . util . Stack ; import java . util . StringTokenizer ; import java . util . TreeSet ; import java . util . Vector ;     public class codechef3 { static class comp implements Comparator < Integer > {   @ Override public int compare ( Integer o1 , Integer o2 ) { if ( Math . abs ( o1 ) > Math . abs ( o2 ) ) return - 1 ; else return 1 ; }   }   static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } }

import java . io . * ; import java . math . BigInteger ; import java . util . * ;    public class test1 {   static long getLCM ( int a , int b ) { int bigger = 0 , smaller = 0 ; if ( a > b ) { bigger = a ; smaller = b ; } else { bigger = b ; smaller = a ; }   if ( bigger % smaller == 0 ) return bigger ; long counter = 2 ; long num = bigger ; while ( num < Integer . MAX_VALUE ) { if ( ( num * counter ) % smaller == 0 ) { return num * counter ; } counter ++ ; } return ( long ) a * b ; }   public static void main ( String [ ] args ) throws IOException { long startTime = System . currentTimeMillis ( ) ; Reader sc = new Reader ( ) ; int t = sc . nextInt ( ) ; StringBuilder finalResult = new StringBuilder ( ) ;

import java . util . Scanner ; import java . util . ArrayList ; import java . util . Collections ; 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 ( ) ; ArrayList < Long > list = new ArrayList < > ( ) ; for ( long i = 1 ; i <= Math . sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { list . add ( i ) ; if ( n / i != i ) { list . add ( n / i ) ; } } } Collections . sort ( list ) ; long a = 0 , b = 0 , max = Long . MAX_VALUE ; for ( int i = 0 ; i < list . size ( ) - 1 ; i ++ ) {

def largest_factor ( n ) : if ( n % 3 == 0 ) : return n // 3 i = 5 while i ** 2 <= n : if ( n % i == 0 ) : return ( n // i ) if ( n % ( i + 2 ) ) == 0 : return n // ( i + 2 ) i += 6 return 1 def answer ( n ) : if n % 2 == 0 : return [ n // 2 , n // 2 ] NEW_LINE

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) p = 0 for i in range ( 2 , int ( n ** 0.5 ) + 1 ) : if n % i == 0 : p = i break if p == 0 : p = n print ( n // p , n - ( n // p ) )   NEW_LINE

from math import sqrtdef isPrime ( n ) : if ( n <= 1 ) : return False if ( n <= 3 ) : return True if ( n % 2 == 0 or n % 3 == 0 ) : return False i = 5 while ( i * i <= n ) : if ( n % i == 0 or n % ( i + 2 ) == 0 ) : return False i = i + 6 return True   def fun ( n ) : if n % 2 == 0 : return n // 2 , n // 2 elif isPrime ( n ) : return 1 , n - 1 else : for i in range ( 2 , n // 2 ) : if isPrime ( i ) and n % i == 0 : return n // i , n - ( n // i )   for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) print ( * fun ( n ) ) NEW_LINE

from sys import stdin , stdoutstdin . readlinedef mp ( ) : return list ( map ( int , stdin . readline ( ) . strip ( ) . split ( ) ) ) def it ( ) : return int ( stdin . readline ( ) . strip ( ) ) from collections import defaultdict as dd , Counter as C , dequefrom math import ceil , gcd   def factors ( n ) : s = set ( ) i = 2 while i * i <= n : if n % i == 0 : s . add ( i ) s . add ( n // i ) i += 1 return sorted ( list ( s ) )   for _ in range ( it ( ) ) : n = it ( ) x = factors ( n ) NEW_LINE

from math import * t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) )   i = 2 res = n - 1 while i <= sqrt ( n ) : if n % i == 0 : res = n // i break i += 1   print ( res , n - res ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ;   import java . util . * ; import javafx . util . Pair ;   public class Main { public static void main ( String args [ ] ) { FastScanner input = new FastScanner ( ) ; int n = input . nextInt ( ) ; int m = input . nextInt ( ) ; int k = input . nextInt ( ) ; int ans [ ] = new int [ m ] ; char a [ ] [ ] = new char [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = input . next ( ) . toCharArray ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { if ( a [ i ] [ j ] == ' U ' ) { if ( i % 2 == 0 ) ans [ j ] ++ ; } else if ( a [ i ] [ j ] == ' L ' ) { if ( j - i >= 0 ) { ans [ j - i ] ++ ; } } else if ( a [ i ] [ j ] == ' R ' ) { if ( j + i < m ) { ans [ j + i ] ++ ; } } } } for ( int an : ans ) { System . out . print ( an + " ▁ " ) ; } System . out . println ( " " ) ; }        static class FastScanner {   BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) {   return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) throws IOException { return br . readLine ( ) ; } }   }

def solve ( ) : answer = [ 0 ] * m for i in range ( 1 , n ) : for j in range ( m ) : if j - i >= 0 : if park [ i ] [ j - i ] == ' R ' : answer [ j ] += 1 if j + i < m : if park [ i ] [ j + i ] == ' L ' : answer [ j ] += 1 if 2 * i < n : if park [ 2 * i ] [ j ] == ' U ' : answer [ j ] += 1 return answer   n , m , k = tuple ( map ( int , input ( ) . split ( ) ) ) park = [ input ( ) for i in range ( n ) ] print ( ' ▁ ' . join ( map ( str , solve ( ) ) ) ) NEW_LINE

n , m , k = map ( int , input ( ) . split ( ) ) ans = [ 0 ] * m   for i in range ( n ) : field = input ( ) for j in range ( m ) : if ( field [ j ] == ' U ' ) and ( i % 2 == 0 ) : ans [ j ] += 1 elif ( field [ j ] == ' L ' ) and ( j >= i ) : ans [ j - i ] += 1 elif ( field [ j ] == ' R ' ) and ( j + i < m ) : ans [ j + i ] += 1   print ( ' ▁ ' . join ( map ( str , ans ) ) ) NEW_LINE

n , m , k = map ( int , input ( ) . split ( ) ) seen = [ 0 for _ in range ( m ) ] for i in range ( n ) : S = list ( input ( ) ) for j in range ( m ) : if S [ j ] == ' U ' and not i & 1 : seen [ j ] += 1 elif S [ j ] == ' L ' and j - i >= 0 : seen [ j - i ] += 1 elif S [ j ] == ' R ' and j + i < m : seen [ j + i ] += 1 print ( * seen , sep = " ▁ " ) NEW_LINE


import java . lang . * ; import java . util . * ; import java . io . * ;   public class pblm2 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; List < Integer > al = new ArrayList < Integer > ( ) ; int i = 1 , c = n - k , end = n ; if ( k < n ) { if ( k == 1 ) { while ( i <= n ) { al . add ( i ++ ) ; } } else { while ( c > 0 ) { al . add ( i ++ ) ; c -- ; } while ( i <= end ) { if ( end != i ) al . add ( end -- ) ; al . add ( i ++ ) ; } } } else if ( k == 1 && n == 1 ) al . add ( i ) ; for ( int p : al ) System . out . print ( p + " ▁ " ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class test { public static void main ( String ... args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int n = Integer . parseInt ( st . nextToken ( ) ) ; int k = Integer . parseInt ( st . nextToken ( ) ) ; int start = 1 ; int end = k + 1 ; int i = 0 ; while ( i < n ) { if ( i <= k && i % 2 == 0 ) { System . out . print ( start + " ▁ " ) ; start ++ ; i ++ ; } else if ( i <= k && i % 2 != 0 ) { System . out . print ( end + " ▁ " ) ; end -- ; i ++ ; } else { System . out . print ( ( i + 1 ) + " ▁ " ) ; i ++ ; } } } }

n , k = [ int ( i ) for i in input ( ) . split ( ) ] if k == 2 : print ( 1 , 3 , 2 , end = " ▁ " ) for i in range ( 4 , n + 1 ) : print ( i , end = " ▁ " ) elif k % 2 == 0 : low = 1 high = n for i in range ( k - 1 ) : if i % 2 == 1 : print ( low , end = " ▁ " ) low += 1 else : print ( high , end = " ▁ " ) high -= 1 for i in range ( low , high + 1 ) : print ( i , end = " ▁ " ) else : low = 1 high = n for i in range ( k - 1 ) : if i % 2 == 0 : print ( low , end = " ▁ " ) low += 1 else : print ( high , end = " ▁ " ) high -= 1 for i in range ( low , high + 1 ) : print ( i , end = " ▁ " ) print ( ) NEW_LINE

n , k = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) if n == 1 : print ( 1 ) elif n == 2 : print ( '1 ▁ 2' ) else : if k == 1 : for i in range ( 1 , n + 1 ) : print ( i , end = " ▁ " ) print ( ) elif k == n - 1 : i1 = 1 i2 = n for i in range ( 1 , n + 1 ) : if i % 2 != 0 : print ( i1 , end = " ▁ " ) i1 += 1 else : print ( i2 , end = " ▁ " ) i2 -= 1 else : for i in range ( 1 , n - k ) : print ( i , end = " ▁ " ) i1 = i + 1 i2 = n for j in range ( 1 , k + 2 ) : if j % 2 != 0 : print ( i1 , end = " ▁ " ) i1 += 1 else : print ( i2 , end = " ▁ " ) i2 -= 1 NEW_LINE

n , k = map ( int , input ( ) . split ( ) ) a = [ i + 1 for i in range ( n ) ] j = n ; ans = [ ] ; d = 1 ; t = 0 for i in range ( k ) : if i % 2 == 0 : ans . append ( j ) j -= 1 else : ans . append ( d ) d += 1 if k % 2 == 0 : for i in range ( d , j + 1 ) : ans . append ( i ) else : for i in range ( j , d - 1 , - 1 ) : ans . append ( i ) print ( * ans ) NEW_LINE


import java . util . * ; import java . io . * ; public class Main { static int [ ] A ; static int [ ] B ; static int [ ] C ; static int n ; static int ans ; public static void main ( String [ ] args ) throws IOException {

import java . util . * ; public class MyClass { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; ArrayList < Integer > even = new ArrayList < Integer > ( ) ; ArrayList < Integer > odd = new ArrayList < Integer > ( ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } Arrays . sort ( arr ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] % 2 == 0 ) even . add ( arr [ i ] ) ; else odd . add ( arr [ i ] ) ; } if ( even . size ( ) == odd . size ( ) ) System . out . println ( 0 ) ; else if ( even . size ( ) == odd . size ( ) + 1 || odd . size ( ) == even . size ( ) + 1 ) System . out . println ( 0 ) ; else { int s = 0 ; if ( odd . size ( ) > even . size ( ) ) { int k = odd . size ( ) - even . size ( ) ; for ( int i = k - 2 ; i >= 0 ; i -- ) s = s + odd . get ( i ) ; } else { int k = even . size ( ) - odd . size ( ) ; for ( int i = k - 2 ; i >= 0 ; i -- ) s = s + even . get ( i ) ; } System . out . println ( s ) ; } } }

import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long sum = 0 ; ArrayList < Integer > odd = new ArrayList < Integer > ( ) ; ArrayList < Integer > even = new ArrayList < Integer > ( ) ; while ( n -- > 0 ) { int t = sc . nextInt ( ) ; if ( t % 2 == 0 ) even . add ( t ) ; else odd . add ( t ) ; } Collections . sort ( odd ) ; Collections . sort ( even ) ; int t = Math . abs ( even . size ( ) - odd . size ( ) ) ; if ( t <= 1 ) sum = 0 ; else { t -- ; if ( even . size ( ) > odd . size ( ) ) { for ( int i = 0 ; i < t ; i ++ ) { sum += even . get ( i ) ; } } else { for ( int i = 0 ; i < t ; i ++ ) { sum += odd . get ( i ) ; } } } System . out . println ( sum ) ; } }

n = int ( input ( ) ) lst = sorted ( list ( map ( int , input ( ) . split ( ) ) ) , reverse = True ) pis = [ i for i in lst if i % 2 == 0 ] pos = [ i for i in lst if i not in pis ] a , b = len ( pis ) , len ( pos ) if abs ( a - b ) <= 1 : print ( 0 ) else : print ( sum ( pis [ b + 1 : ] ) if a > b else sum ( pos [ a + 1 : ] ) ) NEW_LINE

n = int ( input ( ) ) daf = list ( map ( int , input ( ) . split ( ) ) ) daf_even = [ x for x in daf if x % 2 == 0 ] daf_odd = [ x for x in daf if x % 2 ] daf_even . sort ( ) daf_odd . sort ( ) x = len ( daf_even ) y = len ( daf_odd ) if abs ( x - y ) <= 1 : print ( 0 ) else : if x > y + 1 : sel = x - ( y + 1 ) print ( sum ( daf_even [ : sel ] ) ) else : sel = y - ( x + 1 ) print ( sum ( daf_odd [ : sel ] ) ) NEW_LINE

T_ON = 0 DEBUG_ON = 0 MOD = 998244353     def solve ( ) : n = read_int ( ) A = read_ints ( ) A . sort ( ) odds = [ ] evens = [ ] for a in A : if is_odd ( a ) : odds . append ( a ) else : evens . append ( a ) count_odd = len ( odds ) count_even = len ( evens ) if abs ( count_odd - count_even ) <= 1 : print ( 0 ) return if count_odd > count_even : left = count_odd - count_even - 1 print ( sum ( odds [ : left ] ) ) else : left = count_even - count_odd - 1 print ( sum ( evens [ : left ] ) )     def main ( ) : T = read_int ( ) if T_ON else 1 for i in range ( T ) : solve ( )     def debug ( * xargs ) : if DEBUG_ON : print ( * xargs )     from collections import * import math     NEW_LINE


import java . util . * ; import java . util . Scanner ; import java . io . * ; import javax . lang . model . util . ElementScanner6 ; import static java . lang . System . out ;    public class B545 {   public static void main ( String args [ ] ) {   FastReader in = new FastReader ( ) ; PrintWriter pr = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; int tc = 1 ;

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class B {   public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; String s1 = fs . next ( ) ; String s2 = fs . next ( ) ; int dist = 0 ; for ( int i = 0 ; i < s1 . length ( ) ; i ++ ) { if ( s1 . charAt ( i ) != s2 . charAt ( i ) ) dist ++ ; } if ( dist % 2 != 0 ) { System . out . println ( " impossible " ) ; return ; } boolean f = true ; for ( int i = 0 ; i < s1 . length ( ) ; i ++ ) { if ( s1 . charAt ( i ) != s2 . charAt ( i ) ) { if ( f ) System . out . print ( s1 . charAt ( i ) ) ; else System . out . print ( s2 . charAt ( i ) ) ; f = ! f ; } else { System . out . print ( s1 . charAt ( i ) ) ; } } } static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } } }

import java . util . * ;    public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; String s = input . nextLine ( ) ; String t = input . nextLine ( ) ; int count = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) != t . charAt ( i ) ) count ++ ; } if ( count % 2 == 1 ) { System . out . println ( " impossible " ) ; } else { count = count / 2 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == t . charAt ( i ) ) System . out . print ( s . charAt ( i ) ) ; else { if ( count % 2 == 0 ) System . out . print ( s . charAt ( i ) ) ; else System . out . print ( t . charAt ( i ) ) ; count -- ; } } System . out . println ( " " ) ; } } }

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 ( ) : s , t = input ( ) , input ( ) n = len ( s ) diff = 0 answer = [ ]   for i in range ( n ) : if s [ i ] != t [ i ] : answer . append ( s [ i ] if diff % 2 == 0 else t [ i ] ) diff += 1 else : answer . append ( s [ i ] ) if diff % 2 == 0 : print ( " " . join ( answer ) ) else : print ( " impossible " )   main ( ) NEW_LINE

a = input ( ) b = input ( ) l = [ ] for i in range ( len ( a ) ) : if ( a [ i ] != b [ i ] ) : l . append ( i )   if len ( l ) % 2 : print ( " impossible " ) elif l : i = l [ len ( l ) // 2 ] print ( a [ : i ] + b [ i : ] ) else : print ( a ) NEW_LINE

s = input ( ) t = input ( ) c = 0 n = len ( s ) for j in range ( n ) : if s [ j ] != t [ j ] : c += 1 if c % 2 != 0 : print ( ' impossible ' ) else : c1 = 0 c2 = 0 p = " " for j in range ( n ) : if s [ j ] == t [ j ] : p += s [ j ] else : if c1 < c // 2 : c1 += 1 p += s [ j ] else : p += t [ j ] print ( p ) NEW_LINE

from sys import stdin , stdoutfrom os import pathrd = lambda : stdin . readline ( ) . strip ( ) wr = stdout . writeif ( path . exists ( ' input . txt ' ) ) : stdin = open ( " input . txt " , " r " ) import time NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . util . StringTokenizer ;   public class Gym {

import java . util . * ;     import java . io . * ; public class Main { static class Reader { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din ; private byte [ ] buffer ; private int bufferPointer , bytesRead ; public Reader ( ) { din = new DataInputStream ( System . in ) ; buffer = new byte [ BUFFER_SIZE ] ; bufferPointer = bytesRead = 0 ; } public Reader ( String file_name ) throws IOException { din = new DataInputStream ( new FileInputStream ( file_name ) ) ; buffer = new byte [ BUFFER_SIZE ] ; bufferPointer = bytesRead = 0 ; } public String readLine ( ) throws IOException { byte [ ] buf = new byte [ 64 ] ;

l = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE x = min ( l [ : 4 ] ) NEW_LINE if x > l [ 5 ] : NEW_LINE INDENT print ( l [ 5 ] - l [ 4 ] + 1 ) elif x >= l [ 4 ] : NEW_LINE print ( x - l [ 4 ] ) else : NEW_LINE print ( "0" ) NEW_LINE DEDENT

* P , a , b = map ( int , input ( ) . split ( ) ) NEW_LINE print ( max ( 0 , min ( b - a + 1 , min ( P ) - a ) ) ) NEW_LINE

l = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) NEW_LINE print ( min ( l [ 5 ] - l [ 4 ] + 1 , max ( 0 , min ( l [ : 4 ] ) - l [ 4 ] ) ) ) NEW_LINE

def check_permutations ( p1 , p2 , p3 , p4 , x ) : total = 0 NEW_LINE s1 = { p1 , p2 , p3 , p4 } NEW_LINE for i in s1 : a = i NEW_LINE s2 = { a } NEW_LINE s2 = s1 - s2 NEW_LINE for j in s2 : b = j NEW_LINE s3 = { j } NEW_LINE s3 = s2 - s3 NEW_LINE for k in s3 : c = k NEW_LINE s4 = { k } NEW_LINE s4 = s3 - s4 NEW_LINE for z in ( s4 ) : d = z NEW_LINE if ( ( ( ( x % a ) % b ) ) % c ) % d == x : total += 1 NEW_LINE return total NEW_LINE p1 , p2 , p3 , p4 , a , b = map ( int , input ( ) . split ( ) ) NEW_LINE ans = 0 NEW_LINE for i in range ( a , b + 1 ) : if NEW_LINE check_permutations ( p1 , p2 , p3 , p4 , i ) >= 7 : ans += 1 NEW_LINE print ( ans ) NEW_LINE

p1 , p2 , p3 , p4 , a , b = map ( int , input ( ) . split ( ) )   m = min ( p1 , p2 , p3 , p4 )   if m - a <= 0 : NEW_LINE INDENT print ( 0 ) elif m > b : NEW_LINE print ( b - a + 1 ) else : NEW_LINE print ( m - a ) NEW_LINE DEDENT


import java . util . * ;   public class dDiversity { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . next ( ) ; int k = scan . nextInt ( ) ; int counter = 0 ; if ( s . length ( ) < k ) { System . out . println ( " impossible " ) ; } else { int [ ] AtoZcount = new int [ 26 ] ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { AtoZcount [ s . charAt ( i ) - ' a ' ] ++ ; }

import javax . print . DocFlavor ; import java . io . * ; import java . net . Inet4Address ; import java . sql . ClientInfoStatus ; import java . util . * ;

import java . io . * ; import java . util . * ;   public class Main {   public static void main ( String [ ] args ) throws IOException { String s = sc . nextLine ( ) ; int k = sc . nextInt ( ) ; if ( k > s . length ( ) ) pw . println ( " impossible " ) ; else {

import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String s1 = s . nextLine ( ) ; int k = s . nextInt ( ) ; HashMap < Character , Integer > h = new HashMap < > ( ) ; for ( int i = 0 ; i < s1 . length ( ) ; i ++ ) { if ( h . containsKey ( s1 . charAt ( i ) ) ) h . put ( s1 . charAt ( i ) , h . get ( s1 . charAt ( i ) ) + 1 ) ; else h . put ( s1 . charAt ( i ) , 1 ) ; } if ( k > s1 . length ( ) ) System . out . println ( " impossible " ) ; else if ( h . size ( ) >= k ) System . out . println ( "0" ) ; else { int count = k - h . size ( ) ; System . out . println ( count ) ; } } }

s = input ( ) k = int ( input ( ) ) if len ( s ) >= k : print ( max ( 0 , k - len ( set ( s ) ) ) ) else : print ( ' impossible ' ) NEW_LINE

s = input ( ) k = int ( input ( ) ) arr = set ( list ( s ) )   x = len ( arr )     if ( x >= k ) : print ( 0 ) else : k -= x rem = len ( s ) - x   NEW_LINE

s = input ( ) k = int ( input ( ) )   ss = set ( s . strip ( ) )   ns = len ( ss )   if k > len ( s ) : print ( " impossible " ) else : print ( max ( 0 , k - ns ) )   NEW_LINE

s = list ( str ( input ( ) ) ) k = int ( input ( ) ) r = 0 possible = Trueif len ( s ) < k : possible = Falseelse : r = k - len ( set ( s ) ) r = 0 if r < 0 else rprint ( r if possible else " impossible " ) NEW_LINE

string = list ( input ( ) ) differnt_words = int ( input ( ) ) difset = set ( string )   if ( differnt_words > len ( string ) ) : print ( " impossible " ) else : val = differnt_words - len ( difset ) if ( val < 0 ) : print ( 0 ) else : print ( val ) NEW_LINE


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; int box = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int beg = 0 , ent = 0 ; for ( int i = 2 ; i <= n ; i ++ ) { beg = 0 ; ent = 0 ; for ( int j = 1 ; j < i ; j ++ ) beg += a [ j ] ; for ( int k = i ; k <= n ; k ++ ) ent += a [ k ] ; if ( beg >= x && beg <= y && ent >= x && ent <= y ) box = i ; } System . out . println ( box ) ; } }

import java . util . * ; import java . io . * ; import java . text . * ; import java . math . * ; import java . lang . Math . * ;   public class A { public static void main ( String [ ] args ) throws Exception { new A ( ) . run ( ) ; } public FastIO file = new FastIO ( ) ; public int ntc , ctc ; public final long MOD = 1000000007L ;

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

import java . util . Scanner ;   public class GroupDividing { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ;   int m = scan . nextInt ( ) ; int [ ] sum = new int [ m + 1 ] ; int k = - 1 ;   for ( int i = 0 ; i < m ; i ++ ) sum [ i + 1 ] = sum [ i ] + scan . nextInt ( ) ;   int x = scan . nextInt ( ) ; int y = scan . nextInt ( ) ;   for ( int i = 1 ; i < m + 1 ; i ++ ) { if ( sum [ i ] >= x && sum [ i ] <= y && sum [ m ] - sum [ i ] >= x && sum [ m ] - sum [ i ] <= y ) { k = i ; break ; } } System . out . println ( k + 1 ) ; } }

m = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) x , y = map ( int , input ( ) . split ( ) ) for i in range ( 1 , m ) : arr [ i ] += arr [ i - 1 ]   total = arr [ - 1 ]     for i in range ( m ) : if x <= arr [ i ] <= y and x <= total - arr [ i ] <= y : ans = i + 2 print ( ans ) exit ( ) print ( 0 ) NEW_LINE

n = int ( input ( ) ) arr = [ int ( z ) for z in input ( ) . split ( ) ] x , y = map ( int , input ( ) . split ( ) ) for i in range ( 1 , n ) : b = sum ( arr [ : i ] ) a = sum ( arr [ i : ] ) if b >= x and b <= y and a >= x and a <= y : print ( i + 1 ) exit ( ) print ( 0 ) NEW_LINE

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) b = list ( map ( int , input ( ) . split ( ) ) ) x = b [ 0 ] y = b [ 1 ] i = 1 s = sum ( a ) ans1 = 0 ans2 = sans = 0 while i <= n : ans1 += a [ i - 1 ] ans2 -= a [ i - 1 ] NEW_LINE

n = int ( input ( ) ) A = list ( map ( int , input ( ) . split ( ) ) ) x , y = map ( int , input ( ) . split ( ) )   for i in range ( 1 , n ) : A [ i ] = A [ i ] + A [ i - 1 ]   for i in range ( n ) : a = A [ i ] itr = A [ - 1 ] - a if a >= x and a <= y and itr >= x and itr <= y : print ( i + 2 ) breakelse : print ( 0 ) NEW_LINE

import sys , mathsys . setrecursionlimit ( 10 ** 8 ) ''' def ▁ fun ( ) : ▁ ▁ ▁ ▁ for ▁ i ▁ in ▁ range ( 16 ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ for ▁ j ▁ in ▁ range ( 4 ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ i & (1 < < j ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ print ( j , end = ' ' ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ print ( ) import ▁ binarytreefrom ▁ collections ▁ import ▁ dequebst ▁ = ▁ binarytree . tree ( height = 4 , is _ perfect = True ) print ( bst ) def ▁ s ( bst ) : ▁ ▁ ▁ ▁ if ▁ bst : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ bst . left , bst . right ▁ = ▁ bst . right , bst . left ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ s ( bst . right ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ s ( bst . left ) s ( bst ) print ( bst ) '''   n = int ( input ( ) ) s = list ( map ( int , input ( ) . split ( ) ) ) x , y = map ( int , input ( ) . split ( ) ) ss = 0 pika = 1 for i in range ( n ) : ss += s [ i ] if x <= ss <= y and x <= sum ( s [ i + 1 : ] ) <= y : print ( i + 2 ) pika = 0 breakif pika == 1 : print ( 0 ) NEW_LINE


import java . util . Arrays ; import java . util . Collections ; import java . util . Comparator ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ; import java . util . TreeMap ;   public class orderBook {   public static void main ( String [ ] args ) {

import java . util . Scanner ;   public class B572 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; int S = in . nextInt ( ) ; int [ ] buy = new int [ 100001 ] ; int [ ] sell = new int [ 100001 ] ; for ( int n = 0 ; n < N ; n ++ ) { String type = in . next ( ) ; int p = in . nextInt ( ) ; int q = in . nextInt ( ) ; int [ ] A = ( type . charAt ( 0 ) == ' B ' ) ? buy : sell ; A [ p ] += q ; } int sellS = S ; int p = 0 ; while ( sellS > 0 && p < sell . length ) { if ( sell [ p ] > 0 ) { sellS -- ; } p ++ ; } p -- ; while ( p >= 0 ) { if ( sell [ p ] > 0 ) { System . out . println ( " S ▁ " + p + " ▁ " + sell [ p ] ) ; } p -- ; } int buyS = S ; for ( p = buy . length - 1 ; p >= 0 ; p -- ) { if ( buy [ p ] > 0 && buyS > 0 ) { buyS -- ; System . out . println ( " B ▁ " + p + " ▁ " + buy [ p ] ) ; } } }   }

import sys , os . pathfrom collections import * from copy import * import mathmod = 10 ** 9 + 7 if ( os . path . exists ( ' input . txt ' ) ) : sys . stdin = open ( " input . txt " , " r " ) sys . stdout = open ( " output . txt " , " w " )     n , s = map ( int , input ( ) . split ( ) ) mat = [ ] buy = { } sell = { } for i in range ( n ) : dpq = list ( map ( str , input ( ) . split ( ) ) ) d = dpq [ 0 ] p = int ( dpq [ 1 ] ) q = int ( dpq [ 2 ] ) if ( d == " S " ) : sell [ p ] = sell . get ( p , 0 ) + q else : buy [ p ] = buy . get ( p , 0 ) + qb = list ( buy . items ( ) ) b . sort ( ) sel = list ( sell . items ( ) ) sel . sort ( ) b = b [ - s : ] sel = sel [ : s ] b . reverse ( ) sel . reverse ( ) for i in sel : print ( ' S ' , * i ) for i in b : print ( ' B ' , * i )           NEW_LINE

n , s = map ( int , input ( ) . split ( ) )   buys , sells = { } , { }   for i in range ( n ) : line = input ( ) . split ( ) d = line [ 0 ] p = int ( line [ 1 ] ) v = int ( line [ 2 ] )   if d == ' B ' : if p in buys : buys [ p ] += v else : buys [ p ] = v else : if p in sells : sells [ p ] += v else : sells [ p ] = v   sells = sorted ( sells . items ( ) ) [ : s ] buys = sorted ( buys . items ( ) , reverse = True ) [ : s ]   for sell in sells [ : : - 1 ] : print ( ' S ' , sell [ 0 ] , sell [ 1 ] )   for buy in buys : print ( ' B ' , buy [ 0 ] , buy [ 1 ] ) NEW_LINE

n , s = input ( ) . split ( ) n , s = int ( n ) , int ( s ) dic = { } while n > 0 : listOfInput = input ( ) . split ( ) key = ' ▁ ' . join ( listOfInput [ : - 1 ] ) value = listOfInput [ - 1 ] if key in dic : dic [ key ] += int ( value ) else : dic [ key ] = int ( value ) n -= 1 listOfSells = sorted ( [ int ( key . split ( ) [ 1 ] ) for key in dic if key . split ( ) [ 0 ] == ' S ' ] ) [ : s ] listOfBuys = sorted ( [ int ( key . split ( ) [ 1 ] ) for key in dic if key . split ( ) [ 0 ] == ' B ' ] ) for i in range ( s ) : if listOfSells : value = listOfSells . pop ( ) key = ' S ▁ ' + str ( value ) print ( ' S ▁ ' + str ( value ) + ' ▁ ' + str ( dic [ key ] ) ) else : passfor i in range ( s ) : if listOfBuys : value = listOfBuys . pop ( ) key = ' B ▁ ' + str ( value ) print ( ' B ▁ ' + str ( value ) + ' ▁ ' + str ( dic [ key ] ) ) else : pass NEW_LINE

a , b = map ( int , input ( ) . split ( ) ) bs , s = { } , { } for _ in " ▁ " * a : x , y , z = input ( ) . split ( ) y , z = int ( y ) , int ( z ) if x == ' B ' : if y in bs : bs [ y ] += z else : bs [ y ] = z else : if y in s : s [ y ] += z else : s [ y ] = z NEW_LINE


import java . lang . * ; import java . util . * ; import java . util . stream . Collectors ; import java . io . * ; public class Cat_Furrier { public static boolean samechars ( String [ ] st ) { int [ ] ar = new int [ 26 ] ; for ( int i = 0 ; i < st [ 0 ] . length ( ) ; i ++ ) ar [ st [ 0 ] . charAt ( i ) - ' a ' ] ++ ; for ( int j = 1 ; j < st . length ; j ++ ) { int [ ] tar = new int [ 26 ] ; for ( int i = 0 ; i < st [ j ] . length ( ) ; i ++ ) tar [ st [ j ] . charAt ( i ) - ' a ' ] ++ ; if ( ! Arrays . equals ( ar , tar ) ) return false ; } return true ; } public static void main ( String [ ] args ) {

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ; import static java . util . Arrays . sort ; import javafx . util . Pair ;   public class Main {   public static void main ( String [ ] args ) {   FastScanner input = new FastScanner ( ) ; int n = input . nextInt ( ) ; StringBuilder s [ ] = new StringBuilder [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { s [ i ] = new StringBuilder ( input . next ( ) ) ; }

import java . util . * ; import java . io . * ; import java . math . * ;   public class First {   public static int func ( int m , int n , String [ ] s ) { boolean flag = true ; int min = Integer . MAX_VALUE ; for ( int i = 0 ; i < m ; i ++ ) { String target = s [ i ] + s [ i ] ; int sum = 0 ; for ( int j = 0 ; j < m ; j ++ ) { if ( i == j ) { continue ; } int index = target . lastIndexOf ( s [ j ] ) ; if ( index == - 1 ) { flag = false ; break ; } else { if ( index > 0 ) { sum += ( n - index ) ; } } } if ( ! flag ) { break ; } if ( min > sum ) { min = sum ; } } if ( ! flag ) { return - 1 ; } return min ; } public static void process ( ) throws IOException { int m = ni ( ) ; String [ ] s = new String [ m ] ; for ( int i = 0 ; i < m ; i ++ ) { s [ i ] = nln ( ) ; } int n = s [ 0 ] . length ( ) ; int ans = ( m == 1 ) ? 0 : func ( m , n , s ) ; pn ( ans ) ; }    static AnotherReader sc ; static PrintWriter out ; public static void main ( String [ ] args ) throws IOException { out = new PrintWriter ( System . out ) ; sc = new AnotherReader ( ) ; boolean oj = true ;

import java . io . * ; import java . util . * ; public class Asd { static PrintWriter w = new PrintWriter ( System . out ) ; static FastScanner s = new FastScanner ( ) ;   public static void main ( String [ ] args ) {

n = int ( input ( ) ) arr = [ ] mi = 100000 def get_next ( word ) : return word [ 1 : len ( word ) ] + word [ 0 ] def other ( cur_word ) : total = 0 for i in range ( 1 , n ) : flag = 0 mw = arr [ i ] for j in range ( len ( mw ) ) : if ( mw == cur_word ) : flag = 1 break total += 1 mw = get_next ( mw ) if ( flag == 0 ) : return - 1 return total for i in range ( n ) : arr . append ( input ( ) ) cur_word = arr [ 0 ] for i in range ( len ( arr [ 0 ] ) ) : res = i + other ( cur_word ) mi = min ( res , mi ) cur_word = get_next ( cur_word ) print ( mi ) NEW_LINE

from collections import Counterfrom sys import stdin , stdout   STRS = [ ]   def main ( ) : n = int ( stdin . readline ( ) . rstrip ( ) )   for _ in range ( n ) : STRS . append ( stdin . readline ( ) . rstrip ( ) )   k = len ( STRS [ 0 ] ) best = float ( ' inf ' ) c = Counter ( STRS [ 0 ] ) for s in STRS : if c != Counter ( s ) : best = - 1 break   if best > 0 : table = [ [ float ( ' inf ' ) ] * k for _ in range ( n ) ] table [ 0 ] = list ( range ( k ) )   for i in range ( 1 , n ) : NEW_LINE

n = int ( input ( ) ) s = [ input ( ) for i in range ( n ) ] m = len ( s [ 0 ] ) ans = 10 ** 18 l = [ [ ] for i in range ( n ) ] for i in range ( n ) : for j in range ( m + 1 ) : l [ i ] . append ( s [ i ] ) s [ i ] = s [ i ] [ 1 : ] + s [ i ] [ 0 ] for i in range ( m ) : c = i flag = True for j in range ( 1 , n ) : if not l [ 0 ] [ i ] in l [ j ] : flag = False break idx = l [ j ] . index ( l [ 0 ] [ i ] ) c += idx if flag : ans = min ( ans , c ) if ans == 10 ** 18 : print ( - 1 ) else : print ( ans ) NEW_LINE

def check ( string1 , string2 ) : size1 = len ( string1 ) size2 = len ( string2 ) temp = ' ' if size1 != size2 : return 0 temp = string1 + string1 if ( temp . count ( string2 ) > 0 ) : return 1 else : return 0 n = int ( input ( ) ) s = [ ] for i in range ( n ) : s . append ( input ( ) ) for i in range ( 1 , n ) : if check ( s [ 0 ] , s [ i ] ) == 0 : print ( - 1 ) exit ( ) def r ( s1 , s2 ) : for i in range ( len ( s2 ) ) : if s2 [ i : ] + s2 [ : i ] == s1 : return ip = float ( " inf " ) for i in range ( n ) : ans = 0 for j in range ( n ) : if i == j : continue else : ans += r ( s [ i ] , s [ j ] ) p = min ( p , ans ) print ( p ) NEW_LINE


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

import java . util . Scanner ;   public class MemoryAndCrow { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] b = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { b [ i ] = sc . nextInt ( ) ; } for ( int j = 0 ; j < n - 1 ; j ++ ) { System . out . print ( b [ j ] + b [ j + 1 ] + " ▁ " ) ; } System . out . print ( b [ n - 1 ] ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; import java . util . stream . IntStream ; import javafx . util . Pair ;   public class Main {   static void sort ( long a [ ] ) { Random ran = new Random ( ) ; for ( int i = 0 ; i < a . length ; i ++ ) { int r = ran . nextInt ( a . length ) ; long temp = a [ r ] ; a [ r ] = a [ i ] ; a [ i ] = temp ; }   Arrays . sort ( a ) ; }   public static void main ( String [ ] args ) throws IOException { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int a [ ] = new int [ n ] ; int ans [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = input . nextInt ( ) ; } ans [ n - 1 ] = a [ n - 1 ] ; for ( int i = 0 ; i < n - 1 ; i ++ ) { ans [ i ] = a [ i ] + a [ i + 1 ] ; } for ( int an : ans ) { System . out . print ( an + " ▁ " ) ; } System . out . println ( ) ; }   }

import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; int [ ] arr = new int [ t ] ; int [ ] brr = new int [ t ] ; for ( int i = 0 ; i < t ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } for ( int j = 0 ; j < t - 1 ; j ++ ) { brr [ j ] = arr [ j ] + arr [ j + 1 ] ; } brr [ t - 1 ] = arr [ t - 1 ] ; for ( int x : brr ) { System . out . print ( x + " ▁ " ) ; } } }

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

n = int ( input ( ) ) a = [ int ( x ) for x in input ( ) . split ( ) ] l = [ ] for i in range ( 1 , n ) : l . append ( a [ i ] + a [ i - 1 ] ) l . append ( a [ n - 1 ] ) print ( * l ) NEW_LINE

n = int ( input ( ) ) List = list ( map ( int , input ( ) . split ( ) ) )   A = 0 list_new = [ ] for i in range ( 0 , n ) : if i == len ( List ) - 1 : list_new . append ( List [ i ] ) break A = List [ i + 1 ] + List [ i ] list_new . append ( A ) A = 0   for i in range ( len ( list_new ) ) : print ( list_new [ i ] , end = " ▁ " ) NEW_LINE

def solve ( arr ) : res = [ arr [ - 1 ] ] for i in range ( len ( arr ) - 2 , - 1 , - 1 ) : res . insert ( 0 , arr [ i ] + arr [ i + 1 ] ) return res                       def main ( ) : n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) print ( * solve ( arr ) ) main ( ) NEW_LINE

n = int ( input ( ) ) li = list ( map ( int , input ( ) . split ( ) ) ) for i in range ( n - 1 ) : print ( li [ i ] + li [ i + 1 ] , end = ' ▁ ' ) print ( li [ n - 1 ] )   NEW_LINE

n = int ( input ( ) ) lst = [ int ( i ) for i in input ( ) . split ( ) ]   for i in range ( n - 1 ) : print ( lst [ i ] + lst [ i + 1 ] , end = ' ▁ ' ) print ( lst [ n - 1 ] ) NEW_LINE


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

import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { if ( i == 1 ) { System . out . println ( "2" ) ; } else { System . out . println ( ( long ) i * ( i + 1 ) * ( i + 1 ) - ( i - 1 ) ) ; } } } }

import java . util . * ; import java . io . * ; import java . math . BigInteger ; public class mat { static class InputReader { private InputStream stream ; private byte [ ] inbuf = new byte [ 1024 ] ; private int start = 0 ; private int end = 0 ;   public InputReader ( InputStream stream ) { this . stream = stream ; }   private int readByte ( ) { if ( start == - 1 ) throw new UnknownError ( ) ; if ( end >= start ) { end = 0 ; try { start = stream . read ( inbuf ) ; } catch ( IOException e ) { throw new UnknownError ( ) ; } if ( start <= 0 ) return - 1 ; } return inbuf [ end ++ ] ; }   private boolean isSpaceChar ( int c ) { return ! ( c >= 33 && c <= 126 ) ; }   private int skip ( ) { int b ; while ( ( b = readByte ( ) ) != - 1 && isSpaceChar ( b ) ) ; return b ; }   public String next ( ) { int b = skip ( ) ; StringBuilder sb = new StringBuilder ( ) ; while ( ! ( isSpaceChar ( b ) ) ) {

from math import sqrt , floor , ceil   NEW_LINE

from sys import stdoutn = int ( input ( ) ) stdout . write ( "2 \n " ) for lv in range ( 2 , n + 1 ) : stdout . write ( str ( lv * ( lv + 1 ) * ( lv + 1 ) - ( lv - 1 ) ) + ' \n ' ) NEW_LINE

n = int ( input ( ) ) l = [ 2 ] cs = 2 for i in range ( 2 , n + 1 ) : xs = i * ( i + 1 ) ys = xs * xs ax = ys - cs ax = ax // i cs = xs l . append ( ax )   for i in range ( len ( l ) ) : print ( l [ i ] ) NEW_LINE

import mathn = int ( input ( ) ) al = 2 for i in range ( 1 , n + 1 ) : ai = ( i * i + i ) ** 2 ; res = ( ai - al ) // i ; al = ( i * i + i ) print ( int ( res ) ) NEW_LINE


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

import java . util . Scanner ; import java . util . Set ; import java . util . TreeSet ;   public class Main { public static void main ( String [ ] args ) throws Exception { Scanner in = new Scanner ( System . in ) ; int t = in . nextInt ( ) ; int n ; while ( t != 0 ) { n = in . nextInt ( ) ; Set < Integer > s = new TreeSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int a = in . nextInt ( ) ; if ( s . contains ( a ) ) s . add ( a + 1 ) ; else s . add ( a ) ; } System . out . println ( s . size ( ) ) ; t -- ; } } }

import java . util . Scanner ;   public class B1466 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int N = in . nextInt ( ) ; int answer = 0 ; int last = 0 ; for ( int n = 0 ; n < N ; n ++ ) { int x = in . nextInt ( ) ; if ( last < x ) { last = x ; answer ++ ; } else if ( last == x ) { last = x + 1 ; answer ++ ; } } System . out . println ( answer ) ; } }   }

import java . util . * ; public class enhancements { public static void main ( String [ ] args ) { int t , n ;   Scanner sc = new Scanner ( System . in ) ;   t = sc . nextInt ( ) ;   while ( t -- > 0 ) { n = sc . nextInt ( ) ; Set < Integer > s = new TreeSet < > ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { int a = sc . nextInt ( ) ; if ( s . contains ( a ) ) s . add ( a + 1 ) ; else s . add ( a ) ; }   System . out . println ( s . size ( ) ) ; }   }   }

t = int ( input ( ) ) NEW_LINE for i in range ( t ) : n = int ( input ( ) ) NEW_LINE x = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE l = set ( ) NEW_LINE for j in x : if NEW_LINE j not in l : l . add ( j ) else : l . add ( j + 1 ) NEW_LINE l1 = set ( ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE a = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE a . sort ( reverse = True ) NEW_LINE d = { } NEW_LINE for el in a : d [ el ] = True   for i in range ( n ) : if NEW_LINE not d . get ( a [ i ] + 1 , False ) : d [ a [ i ] + 1 ] = True NEW_LINE d . pop ( a [ i ] ) else : d [ a [ i ] ] = True   print ( len ( d ) ) NEW_LINE

for t in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE a = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE count = [ 0 ] * ( 2 * n + 2 ) NEW_LINE for i in a : count [ i ] += 1 NEW_LINE for i in range ( len ( a ) - 1 , - 1 , - 1 ) : if NEW_LINE count [ a [ i ] + 1 ] == 0 : count [ a [ i ] + 1 ] += 1 NEW_LINE count [ a [ i ] ] -= 1 NEW_LINE a [ i ] += 1 NEW_LINE print ( len ( set ( a ) ) ) NEW_LINE

from collections import defaultdictfor NEW_LINE _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE a = sorted ( list ( map ( int , input ( ) . split ( ) ) ) , reverse = 1 ) NEW_LINE d = defaultdict ( int ) NEW_LINE for i in a : d [ i ] += 1 NEW_LINE for i in a : if NEW_LINE not d [ i + 1 ] : d [ i ] -= 1 NEW_LINE if not d [ i ] : del d [ i ] NEW_LINE d [ i + 1 ] = 1 NEW_LINE print ( len ( d ) ) NEW_LINE


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = scanner . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = scanner . nextInt ( ) ; int k = scanner . nextInt ( ) ; int [ ] visit = new int [ 200 ] ; int count = 0 ;

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

import java . io . * ; import java . util . * ;   public class Main { static PrintWriter pr = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; public static void main ( String [ ] args ) throws IOException { int t = input . nextInt ( ) ; int [ ] a = new int [ 105 ] ; Set < Integer > st = new HashSet < Integer > ( ) ; while ( t -- != 0 ) { st . clear ( ) ; int n = input . nextInt ( ) ; int k = input . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int x = input . nextInt ( ) ; st . add ( x ) ; } int cnt = st . size ( ) ; if ( k == 1 && cnt > 1 ) { pr . println ( - 1 ) ; continue ; } if ( cnt <= k ) { pr . println ( 1 ) ; continue ; } pr . println ( 1 + ( cnt - 2 ) / ( k - 1 ) ) ; } pr . flush ( ) ; } static class input { static BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; static StreamTokenizer in = new StreamTokenizer ( br ) ; static String nextLine ( ) throws IOException { return br . readLine ( ) ; } static int nextInt ( ) throws IOException { in . nextToken ( ) ; return ( int ) in . nval ; } static long nextLong ( ) throws IOException { in . nextToken ( ) ; return ( long ) in . nval ; } static double nextDouble ( ) throws IOException { in . nextToken ( ) ; return in . nval ; } } }

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

t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n , k = map ( int , input ( ) . split ( ) ) NEW_LINE l = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE p = 0 NEW_LINE pre = - 1 NEW_LINE for i in range ( n ) : if NEW_LINE pre != l [ i ] : pre = l [ i ] NEW_LINE p += 1 NEW_LINE if k == 1 and p > 1 : NEW_LINE INDENT print ( - 1 ) else : NEW_LINE cnt = 1 NEW_LINE DEDENT p -= k NEW_LINE while p > 0 : p -= ( k - 1 ) NEW_LINE cnt += 1 NEW_LINE print ( cnt ) NEW_LINE

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


import java . util . * ; import java . io . * ; public class A { public static void main ( String ar [ ] ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int t = Integer . parseInt ( br . readLine ( ) ) ; StringBuffer sb = new StringBuffer ( ) ; for ( int r = 0 ; r < t ; r ++ ) { int n = Integer . parseInt ( br . readLine ( ) ) ; String s1 [ ] = br . readLine ( ) . split ( " ▁ " ) ; int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = Integer . parseInt ( s1 [ i ] ) ; Arrays . sort ( a ) ; boolean b [ ] = new boolean [ 1000001 ] ; Arrays . fill ( b , true ) ; int k = 1 ; sb . append ( " YES " ) . append ( " \n " ) ; int count = 0 ; while ( count < n ) { while ( ! b [ k ] ) k ++ ; count ++ ; sb . append ( k ) . append ( " ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { int u = k + a [ j ] - a [ i ] ; if ( u <= 1000000 && u >= 1 ) b [ u ] = false ; } } k ++ ; } sb . append ( " \n " ) ; } System . out . println ( sb ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . io . PrintWriter ; import java . io . StreamTokenizer ; import java . util . Arrays ;   public class Main {   public static void main ( String [ ] args ) throws IOException { StreamTokenizer in = new StreamTokenizer ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; PrintWriter out = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ; in . nextToken ( ) ; int t = ( int ) in . nval ; for ( int i = 0 ; i < t ; i ++ ) { in . nextToken ( ) ; int n = ( int ) in . nval ; int a [ ] = new int [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { in . nextToken ( ) ; int num = ( int ) in . nval ; a [ j ] = num ; } if ( n == 1 ) { out . println ( " YES " ) ; out . println ( 1 ) ; continue ; } int chaA [ ] = new int [ 1000010 ] ; Arrays . sort ( a ) ; for ( int j = 0 ; j < n - 1 ; j ++ ) { for ( int k = j + 1 ; k < n ; k ++ ) { chaA [ a [ k ] - a [ j ] ] = 1 ;

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( ) b = [ ] b . append ( 1 ) t = 10 ** 6 used = [ 0 ] * ( t + 1 ) used [ 1 ] = 1 can_be = 2 diffs = [ ] for i in range ( n ) : for j in range ( i + 1 , n ) : diffs . append ( a [ j ] - a [ i ] ) for i in range ( 1 , n ) : for j in diffs : used [ min ( b [ i - 1 ] + j , t ) ] = 1 while ( used [ can_be ] ) : can_be += 1 b . append ( can_be ) used [ can_be ] = 1 if len ( b ) == n : print ( ' YES ' ) for i in b : print ( i , end = ' ▁ ' ) print ( ' ' ) else : print ( ' NO ' )     NEW_LINE

''' from ▁ random ▁ import ▁ randint visited ▁ = ▁ [ -1 ] ▁ * ▁ ( 2 ▁ * ▁ 10 ▁ * * ▁ 6 ▁ + ▁ 1 ) t ▁ = ▁ int ( input ( ) ) for ▁ i ▁ in ▁ range ( t ) : ▁ ▁ ▁ ▁ n , ▁ A ▁ = ▁ int ( input ( ) ) , ▁ list ( map ( int , ▁ input ( ) . split ( ) ) ) ▁ ▁ ▁ ▁ A . sort ( ) ▁ ▁ ▁ ▁ res ▁ = ▁ [ 1 ] ▁ * ▁ n ▁ ▁ ▁ ▁ v ▁ = ▁ 1 ▁ ▁ ▁ ▁ cnt ▁ = ▁ 0 ▁ ▁ ▁ ▁ while ▁ cnt ▁ < ▁ n : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ # v ▁ = ▁ randint ( 1 , ▁ 10 * * 6 ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ all ( visited [ a ▁ + ▁ v ] ▁ ! = ▁ i ▁ for ▁ a ▁ in ▁ A ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ for ▁ a ▁ in ▁ A : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ visited [ a ▁ + ▁ v ] ▁ = ▁ i ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ res [ cnt ] ▁ = ▁ v ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ cnt ▁ + = ▁ 1 ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ v ▁ + = ▁ 1 ▁ ▁ ▁ ▁ print ( " YES \n " ▁ + ▁ ' ▁ ' . join ( map ( str , res ) ) ) '''   t = int ( input ( ) )   def check ( arr , v , dic ) : for i in arr : if dic [ i + v ] == 1 : return True return False     def check2 ( arr , v , dic ) : ok = False for i in arr : if dic [ i + v ] == 1 : ok = True break return ok     dic = [ 0 ] * 2000005   for _ in range ( t ) : n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) arr . sort ( ) brr = [ 1 ] * n cnt = 0 i = 1 flag = True tmp = { } while cnt < n : ''' ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ while ▁ check ( arr , i , dic ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ i ▁ + = ▁ 1 ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ brr [ cnt ] ▁ = ▁ i  ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ for ▁ v ▁ in ▁ arr : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ # if ▁ i + v > 2e6 : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ # ▁ ▁ ▁ ▁ break ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ dic [ i + v ] ▁ = ▁ 1 ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ tmp [ i + v ] ▁ = ▁ 1 ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ cnt ▁ + = ▁ 1 ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ''' NEW_LINE

''' from ▁ random ▁ import ▁ randint visited ▁ = ▁ [ -1 ] ▁ * ▁ ( 2 ▁ * ▁ 10 ▁ * * ▁ 6 ▁ + ▁ 1 ) t ▁ = ▁ int ( input ( ) ) for ▁ i ▁ in ▁ range ( t ) : ▁ ▁ ▁ ▁ n , ▁ A ▁ = ▁ int ( input ( ) ) , ▁ list ( map ( int , ▁ input ( ) . split ( ) ) ) ▁ ▁ ▁ ▁ A . sort ( ) ▁ ▁ ▁ ▁ res ▁ = ▁ [ 1 ] ▁ * ▁ n ▁ ▁ ▁ ▁ v ▁ = ▁ 1 ▁ ▁ ▁ ▁ cnt ▁ = ▁ 0 ▁ ▁ ▁ ▁ while ▁ cnt ▁ < ▁ n : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ # v ▁ = ▁ randint ( 1 , ▁ 10 * * 6 ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ all ( visited [ a ▁ + ▁ v ] ▁ ! = ▁ i ▁ for ▁ a ▁ in ▁ A ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ for ▁ a ▁ in ▁ A : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ visited [ a ▁ + ▁ v ] ▁ = ▁ i ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ res [ cnt ] ▁ = ▁ v ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ cnt ▁ + = ▁ 1 ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ v ▁ + = ▁ 1 ▁ ▁ ▁ ▁ print ( " YES \n " ▁ + ▁ ' ▁ ' . join ( map ( str , res ) ) ) '''   t = int ( input ( ) )   def check ( arr , v , dic ) : for i in arr : if dic [ i + v ] == 1 : return True return False     def check2 ( arr , v , dic ) : ok = False for i in arr : if dic [ i + v ] == 1 : ok = True break return ok     def check3 ( arr , v , dic ) : return any ( dic [ a + v ] == 1 for a in arr )     dic = [ 0 ] * 2000005   for _ in range ( t ) : n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) arr . sort ( ) brr = [ 1 ] * n cnt = 0 i = 1 flag = True tmp = { } while cnt < n : ''' ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ while ▁ check ( arr , i , dic ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ i ▁ + = ▁ 1 ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ brr [ cnt ] ▁ = ▁ i  ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ for ▁ v ▁ in ▁ arr : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ # if ▁ i + v > 2e6 : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ # ▁ ▁ ▁ ▁ break ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ dic [ i + v ] ▁ = ▁ 1 ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ tmp [ i + v ] ▁ = ▁ 1 ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ cnt ▁ + = ▁ 1 ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ''' NEW_LINE

visited = [ - 1 ] * ( 2 * 10 ** 6 + 1 ) t = int ( input ( ) ) for i in range ( t ) : n , A = int ( input ( ) ) , list ( map ( int , input ( ) . split ( ) ) ) A . sort ( ) res = [ ] v = 1 while len ( res ) < n : flag = True for a in A : if visited [ a + v ] == i : flag = False break if not flag : v += 1 continue for a in A : visited [ a + v ] = i res . append ( v ) v += 1 print ( " YES \n " + ' ▁ ' . join ( map ( str , res ) ) ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( ) b = [ ] b . append ( 1 ) used = [ 0 ] * ( 10 ** 6 + 1 ) used [ 1 ] = 1 can_be = 2 diffs = [ ] for i in range ( n ) : for j in range ( i + 1 , n ) : diffs . append ( a [ j ] - a [ i ] ) for i in range ( 1 , n ) : for j in diffs : used [ min ( b [ i - 1 ] + j , 10 ** 6 ) ] = 1 while ( used [ can_be ] ) : can_be += 1 b . append ( can_be ) used [ can_be ] = 1 if len ( b ) == n : print ( ' YES ' ) for i in b : print ( i , end = ' ▁ ' ) print ( ' ' ) else : print ( ' NO ' )     NEW_LINE


import java . util . * ; import java . math . * ; public class SavingTheCity { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int runs = sc . nextInt ( ) ; while ( runs -- > 0 ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; char [ ] arr = sc . next ( ) . toCharArray ( ) ; int ones = 0 ; int zeros = 0 ; int out = 0 ; for ( int i = 0 ; i < arr . length ; i ++ ) { if ( arr [ i ] == '0' ) zeros ++ ; else { ones ++ ; if ( ones == 1 ) out += a ; else out += Math . min ( a , zeros * b ) ; zeros = 0 ; } } System . out . println ( out ) ; } } }

import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import java . util . Scanner ;   public class B1443 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int A = in . nextInt ( ) ; int B = in . nextInt ( ) ; String S = in . next ( ) ; int pos1 = S . indexOf ( '1' ) ; int answer = 0 ; if ( pos1 != - 1 ) { List < Integer > gaps = new ArrayList < > ( ) ; while ( true ) { int pos0 = S . indexOf ( '0' , pos1 ) ; if ( pos0 == - 1 ) break ; pos1 = S . indexOf ( '1' , pos0 ) ; if ( pos1 == - 1 ) break ; gaps . add ( pos1 - pos0 ) ; } Collections . sort ( gaps ) ; answer += A ; for ( int gap : gaps ) { answer += Math . min ( gap * B , A ) ; } } System . out . println ( answer ) ; } }   }

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 , dequeimport NEW_LINE math   for _ in range ( it ( ) ) : a , b = mp ( ) NEW_LINE l = input ( ) NEW_LINE s = l . strip ( '0' ) NEW_LINE ind = 0 NEW_LINE ans , flag = a , 0 NEW_LINE for i in range ( 1 , len ( s ) ) : if NEW_LINE s [ i ] == '1' and flag == 0 : k = i - ind NEW_LINE ans += min ( ( k - 1 ) * b , a ) NEW_LINE ind = i NEW_LINE flag = 1 elif s [ i ] == '1' : k = i - ind NEW_LINE ans += min ( ( k - 1 ) * b , a ) NEW_LINE ind = i NEW_LINE if not flag : if NEW_LINE s : NEW_LINE if s [ 0 ] == '1' : NEW_LINE INDENT print ( a ) else : NEW_LINE print ( 0 ) else : print ( 0 ) else : print ( ans )     NEW_LINE DEDENT

import sysfor NEW_LINE x in range ( int ( input ( ) ) ) : a , b = map ( int , input ( ) . split ( ) ) NEW_LINE s = input ( ) NEW_LINE s = s . strip ( '0' ) NEW_LINE if '1' not in s or s == [ ] : print ( 0 ) NEW_LINE continue NEW_LINE ans = a NEW_LINE zero = 0 NEW_LINE for i in s : if NEW_LINE i == '0' : zero += 1 NEW_LINE if i == '1' : if NEW_LINE zero > 0 : ans += min ( a , zero * b ) NEW_LINE zero = 0 NEW_LINE print ( ans ) NEW_LINE

t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : a , b = map ( int , input ( ) . split ( ) ) NEW_LINE s = input ( ) NEW_LINE id = 0 NEW_LINE id1 = 0 NEW_LINE ans = 0 NEW_LINE m = float ( ' inf ' ) NEW_LINE for i in range ( len ( s ) ) : if NEW_LINE s [ i ] == '0' : m += 1 else : ans += min ( a , b * m ) NEW_LINE m = 0 NEW_LINE print ( ans ) NEW_LINE

t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : a , b = map ( int , input ( ) . split ( ) ) NEW_LINE s = input ( ) NEW_LINE cnt = 10 ** 6 NEW_LINE ans = 0 NEW_LINE for i in range ( len ( s ) ) : if NEW_LINE s [ i ] == "0" : cnt += 1 else : ans += min ( a , cnt * b ) NEW_LINE cnt = 0 NEW_LINE print ( ans ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;    public class Main {   public static void main ( String [ ] args ) throws IOException {   Scanner sc = new Scanner ( System . in ) ; int testCases = sc . nextInt ( ) ; while ( testCases -- > 0 ) { StringBuilder inp = new StringBuilder ( sc . next ( ) ) ; int n = inp . length ( ) ; boolean aliceTurn = true ; for ( int i = 0 ; i < n ; i ++ ) { if ( aliceTurn ) { if ( inp . charAt ( i ) == ' a ' ) { inp . setCharAt ( i , ' b ' ) ; } else { inp . setCharAt ( i , ' a ' ) ; } aliceTurn = false ; } else { if ( inp . charAt ( i ) == ' z ' ) { inp . setCharAt ( i , ' y ' ) ; } else { inp . setCharAt ( i , ' z ' ) ; } aliceTurn = true ; } } System . out . println ( inp . toString ( ) ) ; } }   static class Scanner { StringTokenizer st ; BufferedReader br ;   public Scanner ( InputStream s ) { br = new BufferedReader ( new InputStreamReader ( s ) ) ; }   public String next ( ) throws IOException { while ( st == null || ! st . hasMoreTokens ( ) ) st = new StringTokenizer ( br . readLine ( ) ) ; return st . nextToken ( ) ; }   public int nextInt ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; }   public long nextLong ( ) throws IOException { return Long . parseLong ( next ( ) ) ; }   public double nextDouble ( ) throws IOException { return Double . parseDouble ( next ( ) ) ; }   public char nextChar ( ) throws IOException { return next ( ) . charAt ( 0 ) ; }   public String nextLine ( ) throws IOException { return br . readLine ( ) ; }   public boolean ready ( ) throws IOException { return br . ready ( ) ; }   } }

import java . util . * ; import java . lang . * ; import java . io . * ;   public class Codechef { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; sc . nextLine ( ) ; while ( t -- > 0 ) { String s = sc . nextLine ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == ' a ' && i % 2 == 0 ) System . out . print ( " b " ) ; else if ( i % 2 == 0 ) System . out . print ( " a " ) ; else { if ( s . charAt ( i ) == ' z ' ) System . out . print ( " y " ) ; else System . out . print ( " z " ) ; } } System . out . println ( ) ; } } }

import java . util . * ; import java . lang . * ; import java . io . * ; import java . math . BigInteger ;   public class Test { public static void main ( String [ ] args ) { new A ( ) . run ( ) ; } static class A { public void run ( ) { Scanner in = new Scanner ( System . in ) ; int t = in . nextInt ( ) ; while ( t -- > 0 ) { char [ ] s = in . next ( ) . toCharArray ( ) ; int c = 0 ; for ( int i = 0 ; i < s . length ; i ++ ) { if ( c == 0 ) { if ( s [ i ] == ' a ' ) s [ i ] = ' b ' ; else s [ i ] = ' a ' ; } else { if ( s [ i ] == ' z ' ) s [ i ] = ' y ' ; else s [ i ] = ' z ' ; } c ^= 1 ; } System . out . println ( s ) ; } } } }

import java . util . * ; import java . lang . * ; import java . io . * ;   public class Codechef { public static void main ( String [ ] args ) throws java . lang . Exception { FastReader in = new FastReader ( System . in ) ; StringBuilder sb = new StringBuilder ( ) ; int t = 1 ; t = in . nextInt ( ) ; while ( t > 0 ) { -- t ; String s = in . next ( ) ; StringBuilder ans = new StringBuilder ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( i % 2 == 0 ) { if ( s . charAt ( i ) == ' a ' ) sb . append ( " b " ) ; else sb . append ( " a " ) ; } else { if ( s . charAt ( i ) == ' z ' ) sb . append ( " y " ) ; else sb . append ( " z " ) ; } } sb . append ( " \n " ) ; } System . out . print ( sb ) ; } static int upper_bound ( int arr [ ] , int x ) { int a = Arrays . binarySearch ( arr , x ) ; if ( a < 0 ) { a *= ( - 1 ) ; return a - 1 ; } else { while ( a < arr . length && arr [ a ] == x ) ++ a ; return a ; } } static long gcd ( long a , long b ) { if ( a == 0 ) return b ; else return gcd ( b % a , a ) ; }

t = int ( input ( ) ) NEW_LINE while t :     NEW_LINE s = input ( ) NEW_LINE strinig_list = [ ] NEW_LINE for i in range ( len ( s ) ) : if NEW_LINE i % 2 == 0 : NEW_LINE if s [ i ] != " a " : NEW_LINE INDENT strinig_list . append ( " a " ) else : NEW_LINE strinig_list . append ( " b " ) else : if s [ i ] != " z " : NEW_LINE strinig_list . append ( " z " ) else : NEW_LINE strinig_list . append ( " y " ) NEW_LINE DEDENT for i in strinig_list : print ( i , end = " " ) NEW_LINE print ( " " ) NEW_LINE t -= 1   NEW_LINE

t = int ( input ( ) ) NEW_LINE for i in range ( t ) : s = list ( map ( str , input ( ) ) ) NEW_LINE for j in range ( len ( s ) ) : if NEW_LINE j % 2 == 0 : NEW_LINE if s [ j ] == " a " : NEW_LINE INDENT s [ j ] = " b " else : NEW_LINE s [ j ] = " a " else : if s [ j ] == " z " : NEW_LINE s [ j ] = " y " else : NEW_LINE s [ j ] = " z " NEW_LINE DEDENT print ( ' ' . join ( map ( str , s ) ) )           NEW_LINE

def solve ( ) : string = input ( ) NEW_LINE newStr = " "   for count , i in enumerate ( string ) : if NEW_LINE count % 2 != 0 : NEW_LINE if i == " z " : NEW_LINE INDENT newStr += " y " else : NEW_LINE newStr += " z " else : if i == " a " : NEW_LINE newStr += " b " else : NEW_LINE newStr += " a " NEW_LINE DEDENT print ( newStr )     for i in range ( int ( input ( ) ) ) : solve ( )     NEW_LINE

for t in range ( int ( input ( ) ) ) : s = input ( ) NEW_LINE r = ' ' NEW_LINE for i in range ( len ( s ) ) : if NEW_LINE i % 2 == 0 : NEW_LINE if s [ i ] != ' a ' : NEW_LINE INDENT r += ' a ' else : NEW_LINE r += ' b ' else : if s [ i ] != ' z ' : NEW_LINE r += ' z ' else : NEW_LINE r += ' y ' NEW_LINE DEDENT print ( r ) NEW_LINE


import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; String str = s . next ( ) ; long prefix [ ] = new long [ str . length ( ) ] ; long suffix [ ] = new long [ str . length ( ) ] ; for ( int i = 1 ; i < str . length ( ) ; i ++ ) { prefix [ i ] = prefix [ i - 1 ] ; if ( str . charAt ( i ) == ' v ' && str . charAt ( i - 1 ) == ' v ' ) { prefix [ i ] ++ ; } } for ( int i = str . length ( ) - 2 ; i >= 0 ; i -- ) { suffix [ i ] = suffix [ i + 1 ] ; if ( str . charAt ( i ) == ' v ' && str . charAt ( i + 1 ) == ' v ' ) { suffix [ i ] ++ ; }   } long ans = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( str . charAt ( i ) == ' o ' ) { ans += prefix [ i ] * suffix [ i ] ; } } System . out . println ( ans ) ; } }

import java . util . * ; import java . io . * ; import java . math . * ;   public class First { public static void process ( ) throws IOException { String s = nln ( ) . trim ( ) ; char ch [ ] = s . toCharArray ( ) ; int n = ch . length ; int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { if ( i == 0 ) { a [ i ] = 0 ; } else { if ( ch [ i ] == ' v ' && ch [ i ] == ch [ i - 1 ] ) { a [ i ] = a [ i - 1 ] + 1 ; } else { a [ i ] = a [ i - 1 ] ; } } } int x = a [ n - 1 ] ; long ans = 0l ; for ( int i = 0 ; i < n ; i ++ ) { if ( ch [ i ] == ' o ' ) { ans += ( ( ( long ) a [ i ] ) * ( x - a [ i ] ) ) ; } } pn ( ans ) ; }    static AnotherReader sc ; static PrintWriter out ; public static void main ( String [ ] args ) throws IOException { out = new PrintWriter ( System . out ) ; sc = new AnotherReader ( ) ; boolean oj = true ;

import java . io . * ; import java . util . * ; import java . lang . * ;   public class c1 { public static FScanner scan ; public static PrintWriter out ; public static void main ( String [ ] args ) { scan = new FScanner ( ) ; out = new PrintWriter ( new BufferedOutputStream ( System . out ) ) ;   int T = 1 ;

st = input ( ) li = [ ] s = 0   for i in range ( len ( st ) ) : if ( st [ i ] == " v " ) : s += 1 else : if ( s > 1 ) : li . append ( s - 1 ) li . append ( 0 ) s = 0 if ( s > 0 ) : li . append ( s - 1 ) NEW_LINE


import java . util . * ;   public class Test {   public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int a = in . nextInt ( ) ; int b = in . nextInt ( ) ; int c = in . nextInt ( ) ;   int count = 0 ; for ( int i = 0 ; i <= a ; i += 2 ) { int rem = n ; rem = rem - i / 2 ; for ( int j = 0 ; j <= b && j <= rem ; j ++ ) { int rem1 = rem - j ; if ( rem1 % 2 == 0 && rem1 / 2 <= c ) count ++ ; } } System . out . println ( count ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ; import java . io . PrintWriter ;   public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int n = Integer . parseInt ( st . nextToken ( ) ) ; int a = Integer . parseInt ( st . nextToken ( ) ) ; int b = Integer . parseInt ( st . nextToken ( ) ) ; int c = Integer . parseInt ( st . nextToken ( ) ) ; br . close ( ) ; PrintWriter pw = new PrintWriter ( System . out ) ; int count = 0 ; for ( int j = 0 ; j <= b ; j ++ ) { for ( int k = 0 ; k <= c ; k ++ ) { if ( n - j - 2 * k > 0 && n - j - 2 * k > 0.5 * a ) continue ; if ( n - j - 2 * k >= 0 ) count ++ ; } } pw . println ( count ) ; pw . flush ( ) ; pw . close ( ) ; } }

n , a , b , c = list ( map ( int , input ( ) . split ( ) ) ) res = 0 for x in range ( c + 1 ) : for y in range ( b + 1 ) : diff = n - 2 * x - y if diff >= 0 and diff * 2 <= a : res += 1 print ( res ) NEW_LINE

def nik ( rudy , x , y , z , cot ) : for i in range ( z + 1 ) : for j in range ( y + 1 ) : t = rudy - i * 2 - j if t >= 0 and x * 0.5 >= t : cot += 1 return cotrudy , x , y , z = list ( map ( int , input ( ) . split ( ) ) ) cot = 0 print ( nik ( rudy , x , y , z , cot ) )   NEW_LINE

def nik ( rudy , pig , y , z ) : temp = 0 for i in range ( z + 1 ) : for j in range ( y + 1 ) : t = rudy - i * 2 - j if t >= 0 and pig * 0.5 >= t : temp += 1 print ( temp ) rudy , pig , y , z = list ( map ( int , input ( ) . split ( ) ) ) nik ( rudy , pig , y , z ) NEW_LINE

n , c , b , a = map ( int , input ( ) . split ( ) )   c = c // 2   k = 0 for i in range ( a + 1 ) :   if 2 * i > n : break   for j in range ( b + 1 ) :   if 2 * i + j > n :   break   if 2 * i + j + c >= n :   k += 1   print ( k ) NEW_LINE


import com . sun . org . apache . bcel . internal . generic . AALOAD ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . * ; import java . util . stream . IntStream ; import javafx . util . Pair ;   public class Main {   static void sort ( int a [ ] ) { Random ran = new Random ( ) ; for ( int i = 0 ; i < a . length ; i ++ ) { int r = ran . nextInt ( a . length ) ; int temp = a [ r ] ; a [ r ] = a [ i ] ; a [ i ] = temp ; }   Arrays . sort ( a ) ; }   public static void main ( String [ ] args ) throws IOException {   Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int x1 , y1 , x2 , y2 ; x1 = y1 = Integer . MAX_VALUE ; x2 = y2 = Integer . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { int a = input . nextInt ( ) ; int b = input . nextInt ( ) ; x1 = Math . min ( x1 , a ) ; y1 = Math . min ( y1 , b ) ; x2 = Math . max ( x2 , a ) ; y2 = Math . max ( y2 , b ) ; } if ( x1 == x2 || y1 == y2 ) { System . out . println ( " - 1" ) ; } else { System . out . println ( Math . abs ( x2 - x1 ) * Math . abs ( y2 - y1 ) ) ; } }   }

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

import java . util . Scanner ;   public class SymmetryPool { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ;   int n = scanner . nextInt ( ) ;   int [ ] [ ] coo = new int [ n ] [ 2 ] ; for ( int i = 0 ; i < n ; i ++ ) { coo [ i ] [ 0 ] = scanner . nextInt ( ) ; coo [ i ] [ 1 ] = scanner . nextInt ( ) ; }   if ( n == 1 ) { System . out . println ( - 1 ) ; } else if ( n == 2 ) { int side1 = Math . abs ( coo [ 0 ] [ 1 ] - coo [ 1 ] [ 1 ] ) ; int side2 = Math . abs ( coo [ 0 ] [ 0 ] - coo [ 1 ] [ 0 ] ) ; if ( side1 == 0 || side2 == 0 ) { System . out . println ( - 1 ) ; } else { System . out . println ( side1 * side2 ) ; } } else { int side1 = 0 ; int side2 = 0 ; for ( int i = 0 ; i < 2 ; i ++ ) { if ( coo [ i ] [ 1 ] - coo [ i + 1 ] [ 1 ] != 0 ) side2 = Math . abs ( coo [ i ] [ 1 ] - coo [ i + 1 ] [ 1 ] ) ; if ( coo [ i ] [ 0 ] - coo [ i + 1 ] [ 0 ] != 0 ) side1 = Math . abs ( coo [ i ] [ 0 ] - coo [ i + 1 ] [ 0 ] ) ; }   System . out . println ( side1 * side2 ) ; } } }

n = int ( input ( ) ) if n == 1 : x1 , y1 = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) print ( - 1 ) elif n == 2 : x1 , y1 = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) x2 , y2 = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) if x1 == x2 or y1 == y2 : print ( - 1 ) else : print ( abs ( x1 - x2 ) * abs ( y1 - y2 ) ) elif n == 3 : x1 , y1 = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) x2 , y2 = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) x3 , y3 = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) if x1 != x2 and y1 != y2 : print ( abs ( x1 - x2 ) * abs ( y1 - y2 ) ) elif x1 != x3 and y1 != y3 : print ( abs ( x1 - x3 ) * abs ( y1 - y3 ) ) else : print ( abs ( x2 - x3 ) * abs ( y2 - y3 ) ) else : x1 , y1 = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) x2 , y2 = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) x3 , y3 = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) x4 , y4 = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) if x1 != x2 and y1 != y2 : print ( abs ( x1 - x2 ) * abs ( y1 - y2 ) ) elif x1 != x3 and y1 != y3 : print ( abs ( x1 - x3 ) * abs ( y1 - y3 ) ) else : print ( abs ( x1 - x4 ) * abs ( y1 - y4 ) ) NEW_LINE

n = int ( input ( ) ) st = [ ] if n == 1 : print ( " - 1" ) elif n == 2 : for i in range ( 2 ) : st . append ( tuple ( map ( int , input ( ) . split ( ) ) ) ) if st [ 0 ] [ 0 ] == st [ 1 ] [ 0 ] or st [ 1 ] [ 1 ] == st [ 0 ] [ 1 ] : print ( " - 1" ) else : print ( abs ( st [ 0 ] [ 0 ] - st [ 1 ] [ 0 ] ) * abs ( st [ 1 ] [ 1 ] - st [ 0 ] [ 1 ] ) ) else : b = False for i in range ( n ) : st . append ( tuple ( map ( int , input ( ) . split ( ) ) ) ) for i in range ( n - 1 ) : for ii in range ( i + 1 , n ) : if st [ i ] [ 0 ] != st [ ii ] [ 0 ] and st [ ii ] [ 1 ] != st [ i ] [ 1 ] : print ( abs ( st [ i ] [ 0 ] - st [ ii ] [ 0 ] ) * abs ( st [ i ] [ 1 ] - st [ ii ] [ 1 ] ) ) b = True ; break if b : break     NEW_LINE

def solve ( ) : n = int ( input ( ) ) pairs = [ ] for _ in range ( n ) : pairs . append ( tuple ( map ( int , input ( ) . split ( ) ) ) )   pairs . sort ( )   left = min ( pairs , key = lambda x : x [ 0 ] ) [ 0 ] right = max ( pairs , key = lambda x : x [ 0 ] ) [ 0 ]   top = max ( pairs , key = lambda x : x [ 1 ] ) [ 1 ] bot = min ( pairs , key = lambda x : x [ 1 ] ) [ 1 ]   area = ( right - left ) * ( top - bot ) if area == 0 : print ( - 1 ) else : print ( area ) solve ( )   NEW_LINE