import java . io . File ; import java . util . Arrays ; import java . util . Scanner ; import java . util . StringTokenizer ;   public class p021 { public static void main ( String args [ ] ) throws Exception {


n , w = map ( int , input ( ) . split ( ) ) a = [ int ( x ) for x in input ( ) . split ( ) ] a . sort ( )   print ( min ( a [ 0 ] , a [ n ] / 2 , w / 3 / n ) * 3 * n ) 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 , Counterfrom math import * from itertools import permutations , accumulatedx = [ - 1 , 1 , 0 , 0 ] dy = [ 0 , 0 , 1 , - 1 ] NEW_LINE


n , w = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( ) g = a [ 0 ] b = a [ n ] if g >= w : print ( w ) else : if g * 2 > b : g = b / 2 t = g * n + g * 2 * n if t <= w : print ( t ) else : print ( w ) NEW_LINE


n , w = map ( int , input ( ) . split ( ) ) a = [ float ( x ) for x in input ( ) . split ( ) ] a . sort ( ) tt = min ( a [ 0 ] , ( a [ n ] / 2 ) ) ttt = 3 * n * ttt = wt = min ( w , 3 * n * tt ) print ( t ) NEW_LINE


import java . util . * ; import java . lang . * ; import java . io . * ; import java . math . * ;   public class Codechef { static int n ; static double w ; static Double arr [ ] ; static BufferedReader bf ; static StringBuffer str = new StringBuffer ( " " ) ;   static boolean f ( double mid ) { double girl = mid / ( n * 3 ) ; double boy = 2 * mid / ( n * 3 ) ; return arr [ 0 ] >= girl && arr [ n ] >= boy ; } static void solve ( ) throws Exception { String s [ ] = bf . readLine ( ) . trim ( ) . split ( " \\ s + " ) ; n = Integer . parseInt ( s [ 0 ] ) ; w = Double . parseDouble ( s [ 1 ] ) ; arr = new Double [ 2 * n ] ; s = bf . readLine ( ) . trim ( ) . split ( " \\ s + " ) ; for ( int i = 0 ; i < ( 2 * n ) ; i ++ ) arr [ i ] = Double . parseDouble ( s [ i ] ) ; Arrays . sort ( arr ) ; double ans = arr [ 0 ] ; double l = 0 , r = w ; for ( int i = 0 ; i < 100 ; i ++ ) { double mid = l + ( r - l ) / 2 ; if ( f ( mid ) ) { ans = mid ; l = mid ; } else r = mid ; } str . append ( ans + " \n " ) ; }   public static void main ( String [ ] args ) throws java . lang . Exception { bf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; solve ( ) ; System . out . print ( str ) ; } }

n , w = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( ) g = a [ 0 ] b = a [ n ] if ( g * 2 ) <= b : b = ( g * 2 ) elif ( g * 2 ) > b : g = b / 2 ans = ( g * n ) + ( b * n ) if ans > w : ans = wprint ( ans ) NEW_LINE


import java . util . Arrays ; import java . util . Scanner ;   public class PashaAndTea { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long w = sc . nextInt ( ) ; int [ ] a = new int [ n * 2 ] ; for ( int i = 0 ; i < n * 2 ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } Arrays . sort ( a ) ; double unit = Math . min ( a [ 0 ] , ( double ) a [ n ] / 2 ) ; double max = Math . min ( w , unit * n * 3 ) ; System . out . println ( max ) ; } }


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


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

import sysimport itertoolsimport collections     def rs ( x = ' ' ) : return sys . stdin . readline ( ) . strip ( ) if len ( x ) == 0 else input ( x ) . strip ( ) def ri ( x = ' ' ) : return int ( rs ( x ) ) def rm ( x = ' ' ) : return map ( str , rs ( x ) . split ( ) ) def rl ( x = ' ' ) : return rs ( x ) . split ( ) def rmi ( x = ' ' ) : return map ( int , rs ( x ) . split ( ) ) def rli ( x = ' ' ) : return [ int ( x ) for x in rs ( x ) . split ( ) ] def println ( val ) : sys . stdout . write ( str ( val ) + ' \n ' )     def solve ( testCase ) : n , a = ri ( ) , rli ( ) fives = a . count ( 5 ) zeros = n - fives NEW_LINE


def solution ( ) : n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) c5 = 0 c0 = 0 for i in arr : if i == 5 : c5 += 1 else : c0 += 1 c5 = ( c5 // 9 ) * 9   if c0 == 0 : print ( - 1 ) return elif c5 == 0 : print ( 0 ) return else : st = '5' * c5 st += '0' * c0 print ( int ( st ) ) 	 	               	   if __name__ == ' _ _ main _ _ ' : solution ( ) NEW_LINE


n = int ( input ( ) ) bt = list ( map ( int , input ( ) . split ( ) ) ) if 0 in bt : c5 = 0 c0 = 0 for a in bt : if a == 5 : c5 += 1 else : c0 += 1 if c5 < 9 : print ( 0 ) else : print ( ( int ( c5 / 9 ) ) * 9 * "5" + c0 * "0" ) else : print ( - 1 ) NEW_LINE


import mathn = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) c5 = l . count ( 5 ) cc = math . floor ( c5 / 9 ) c0 = l . count ( 0 ) if c0 == 0 : print ( - 1 ) else : if cc == 0 : print ( 0 ) else : a = '5' * ( 9 * cc ) + '0' * c0 print ( a ) NEW_LINE


import java . util . ArrayList ; import java . util . Scanner ;   public class JeffandDigits { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; System . out . println ( getIndex ( scanner , n ) ) ; }   private static String getIndex ( Scanner scanner , int n ) { ArrayList < Integer > arrayList = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { arrayList . add ( scanner . nextInt ( ) ) ; } if ( ! arrayList . contains ( 0 ) ) return " - 1" ; int count = 0 ; int count0 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arrayList . get ( i ) == 5 ) count ++ ; if ( arrayList . get ( i ) == 0 ) count0 ++ ; }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int ar [ ] = new int [ N ] ; boolean isDivisibleByTen = false ; int sum = 0 ; int zeroCount = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int val = sc . nextInt ( ) ; sum += val ; if ( val == 0 ) { isDivisibleByTen = true ; zeroCount ++ ; } } if ( ! isDivisibleByTen ) System . out . println ( - 1 ) ; else { int val = sum / 45 ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < 9 * val ; i ++ ) { sb . append ( 5 ) ; } for ( int i = 0 ; i < zeroCount ; i ++ ) { if ( sb . toString ( ) . length ( ) == 0 ) { sb . append ( 0 ) ; break ; } else sb . append ( 0 ) ; } System . out . println ( sb . toString ( ) ) ; } } }


import java . util . Scanner ;   public class A352 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int five = 0 ; int zero = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x = scanner . nextInt ( ) ; if ( x == 5 ) { five ++ ; } else { zero ++ ; } } if ( five < 9 && zero >= 1 ) { System . out . println ( "0" ) ; } else if ( five == n ) { System . out . println ( " - 1" ) ; } else { int temp = five % 9 ; five -= temp ; for ( int i = 0 ; i < five ; i ++ ) { System . out . print ( "5" ) ; } for ( int i = 0 ; i < zero ; i ++ ) { System . out . print ( "0" ) ; } } } }


import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int f = 0 , z = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( scan . nextInt ( ) == 5 ) { f ++ ; } else { z ++ ; } } if ( z == 0 ) { System . out . println ( " - 1" ) ; } else if ( f < 9 ) { System . out . println ( "0" ) ; } else { f = f - f % 9 ; for ( int i = 0 ; i < f ; i ++ ) { System . out . print ( "5" ) ; } for ( int j = 0 ; j < z ; j ++ ) { System . out . print ( "0" ) ; } }      }   }


import java . math . BigInteger ; import java . sql . Array ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collection ; import java . util . Collections ; import java . util . Comparator ; import java . util . HashMap ; import java . util . InputMismatchException ; import java . util . Iterator ; import java . util . LinkedHashSet ; import java . util . LinkedList ; import java . util . List ; import java . util . Map ; import java . util . Map . Entry ; import java . util . PriorityQueue ; import java . util . Queue ; import java . util . Scanner ; import java . util . Set ; import java . util . Stack ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . TreeMap ; import java . util . TreeSet ; public class Main { static InputReader rd = new InputReader ( System . in ) ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long m = sc . nextLong ( ) ; long l = sc . nextLong ( ) ; int t = 0 ;

n , m , l = list ( map ( int , input ( ) . split ( ) ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) arr = [ 0 ] + arr + [ 0 ]   count = 0 for i in range ( 1 , n + 1 ) : if arr [ i ] > l and arr [ i - 1 ] <= l : count += 1 for _ in range ( m ) : s = input ( ) . split ( ) if s [ 0 ] == "0" : print ( count ) else : p , q = int ( s [ 1 ] ) , int ( s [ 2 ] ) arr [ p ] += q if arr [ p ] <= l or arr [ p ] - q > l : continue if arr [ p - 1 ] <= l and arr [ p + 1 ] <= l : count += 1 elif arr [ p - 1 ] > l and arr [ p + 1 ] > l : count -= 1 NEW_LINE


import sys   def Find ( parent , x ) : if parent [ x ] != x : parent [ x ] = Find ( parent , parent [ x ] ) return parent [ x ] def Union ( parent , rank , x , y ) : x_root = Find ( parent , x ) y_root = Find ( parent , y ) if x_root == y_root : return if rank [ x_root ] < rank [ y_root ] : parent [ x_root ] = y_root elif rank [ x_root ] > rank [ y_root ] : parent [ y_root ] = x_root else : parent [ x_root ] = y_root rank [ y_root ] += 1 hair_n , request_n , fav = map ( int , sys . stdin . readline ( ) . split ( ) ) hair = [ - 1 ] + list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) parent_list = [ i for i in range ( hair_n + 1 ) ] rank_list = [ 0 for i in range ( hair_n + 1 ) ] ans = 0 for i in range ( 1 , hair_n ) : if hair [ i ] > fav and hair [ i + 1 ] > fav : Union ( parent_list , rank_list , i , i + 1 ) for i in range ( 1 , hair_n + 1 ) : if i == parent_list [ i ] and hair [ i ] > fav : ans += 1 for r in range ( request_n ) : query = list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) if query [ 0 ] == 1 : growing_hair = query [ 1 ] change = query [ 2 ] prev_hair = hair [ growing_hair ] hair [ growing_hair ] += change if hair [ growing_hair ] > fav and prev_hair <= fav : ans += 1 if hair [ growing_hair - 1 ] > fav : ans -= 1 if growing_hair < hair_n : if hair [ growing_hair + 1 ] > fav : ans -= 1 else : print ( ans ) NEW_LINE


import sys     def Find ( parent , x ) : if parent [ x ] != x : parent [ x ] = Find ( parent , parent [ x ] ) return parent [ x ] def Union ( parent , rank , x , y ) : x_root = Find ( parent , x ) y_root = Find ( parent , y ) if x_root == y_root : return if rank [ x_root ] < rank [ y_root ] : parent [ x_root ] = y_root elif rank [ x_root ] > rank [ y_root ] : parent [ y_root ] = x_root else : parent [ x_root ] = y_root rank [ y_root ] += 1           hair_n , request_n , fav = map ( int , sys . stdin . readline ( ) . split ( ) ) hair = [ - 1 ] + list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) parent_list = [ i for i in range ( hair_n + 1 ) ] rank_list = [ 0 for i in range ( hair_n + 1 ) ] ans = 0   for i in range ( 1 , hair_n ) : if hair [ i ] > fav and hair [ i + 1 ] > fav : Union ( parent_list , rank_list , i , i + 1 ) for i in range ( 1 , hair_n + 1 ) : if i == parent_list [ i ] and hair [ i ] > fav : ans += 1 for r in range ( request_n ) : query = list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) if query [ 0 ] == 1 : growing_hair = query [ 1 ] change = query [ 2 ] prev_hair = hair [ growing_hair ] hair [ growing_hair ] += change if hair [ growing_hair ] > fav and prev_hair <= fav : ans += 1 if hair [ growing_hair - 1 ] > fav : ans -= 1 if growing_hair < hair_n : if hair [ growing_hair + 1 ] > fav : ans -= 1 else : print ( ans ) NEW_LINE


import sys   hair_n , request_n , fav = map ( int , input ( ) . split ( ) ) hair = [ - 1 ] + list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) + [ - 1 ] ans = 0   new = Falsefor i in range ( 1 , hair_n + 1 ) : if hair [ i ] > fav and new == False : ans += 1 new = True elif hair [ i ] <= fav : new = False for r in range ( request_n ) : query = list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) if query [ 0 ] == 1 : growing_hair = query [ 1 ] change = query [ 2 ] prev_hair = hair [ growing_hair ] hair [ growing_hair ] += change if hair [ growing_hair ] > fav and prev_hair <= fav : ans += 1 if hair [ growing_hair - 1 ] > fav : ans -= 1 if growing_hair < hair_n : if hair [ growing_hair + 1 ] > fav : ans -= 1 else : print ( ans ) NEW_LINE


n , m , l = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) subs = [ 0 ] * ( n + 2 ) cnt = 0 flag = Falsefor i in range ( n ) : if a [ i ] > l : if flag == False : cnt += 1 flag = True subs [ i + 1 ] = 1 else : flag = Falsefor i in range ( m ) : q = tuple ( map ( int , input ( ) . split ( ) ) ) op = q [ 0 ] if op == 1 : op , p , d = q before = a [ p - 1 ] a [ p - 1 ] += d if before <= l < a [ p - 1 ] : subs [ p ] = 1 if subs [ p - 1 ] and subs [ p + 1 ] : cnt -= 1 elif not ( subs [ p - 1 ] or subs [ p + 1 ] ) : cnt += 1 else : print ( cnt ) NEW_LINE


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

n , k = map ( int , input ( ) . split ( ) ) r = 2 * n - 2 * kfor i in range ( 2 * n , r , - 2 ) : print ( i - 1 , i , end = ' ▁ ' ) for i in range ( r , 1 , - 2 ) : print ( i , i - 1 , end = ' ▁ ' ) NEW_LINE


import math   ans = [ ] n , m = map ( int , input ( ) . split ( ) ) for i in range ( 1 , n + 1 ) : ans . append ( [ 2 * i - 1 , 2 * i ] )   current = 0 i = 0 while current != 2 * m and i < n : if current < m and i < n : ans [ i ] [ 0 ] , ans [ i ] [ 1 ] = ans [ i ] [ 1 ] , ans [ i ] [ 0 ] current += 1 i += 1 for i in ans : print ( * i , end = " ▁ " ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) if ( k == 0 ) : for i in range ( 1 , 2 * n + 1 ) : print ( i , end = " ▁ " ) else : l = [ i for i in range ( 1 , 2 * n + 1 ) ] for i in range ( 1 , k + 1 ) : j = 2 * i - 1 m = 2 * i while ( j <= m ) : temp = l [ j - 1 ] l [ j - 1 ] = l [ m - 1 ] l [ m - 1 ] = temp j = j + 1 m = m - 1 for i in range ( 2 * n ) : print ( l [ i ] , end = " ▁ " ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) a = [ i + 1 for i in range ( n * 2 ) ] for i in range ( 1 , k + 1 ) : a [ 2 * ( i - 1 ) ] , a [ ( 2 * i ) ] = a [ 2 * i ] , a [ 2 * ( i - 1 ) ] print ( * a ) NEW_LINE


import java . io . * ; import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; PrintWriter out = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; int n = in . nextInt ( ) , k = in . nextInt ( ) ; out . print ( ( k + 1 ) + " ▁ " ) ; for ( int i = 1 ; i <= 2 * n ; i ++ ) if ( i != k + 1 ) out . print ( i + " ▁ " ) ;   out . flush ( ) ; out . close ( ) ; in . close ( ) ; } }


import java . io . * ; import java . util . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;    public class Main1 {   static class pair implements Comparable < pair > { int a ; int b ; public pair ( int a , int b ) { this . a = a ; this . b = b ; } @ Override public int compareTo ( pair o ) {


import java . io . BufferedReader ; import java . io . File ; import java . io . FileWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ;   import javafx . util . Pair ;   public class Main {   public static void main ( String args [ ] ) { FastScanner input = new FastScanner ( ) ; int n = input . nextInt ( ) ; int k = input . nextInt ( ) * 2 ; int a [ ] = new int [ n * 2 ] ; int j = 1 ; for ( int i = 0 ; i < 2 * n ; i += 2 , j ++ ) { a [ i ] = ( j ) * 2 ; a [ i + 1 ] = ( j ) * 2 - 1 ; }


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

seive = [ ] def precalc ( n ) : i = 2 while ( i * i <= n ) : if ( seive [ i ] ) : j = i * i while ( j <= n ) : seive [ j ] = False j += i i += 1 def main ( ) : global seive n , k = map ( int , input ( ) . split ( ) ) seive , nums , cnt = [ True ] * ( n + 1 ) , [ ] , 0 precalc ( n ) for i in range ( 2 , n + 1 ) : if ( seive [ i ] ) : nums . append ( i ) limit = len ( nums ) if ( k == 0 ) : print ( ' YES ' ) return if ( n == 1 or n == 2 or n == 3 ) : print ( ' NO ' ) return for num in range ( 4 , n + 1 ) : if ( seive [ num ] ) : num -= 1 for number in range ( 0 , limit ) : if ( number + 1 < limit and nums [ number ] + nums [ number + 1 ] == num ) : cnt += 1 NEW_LINE


def is_prime ( num ) : if num == 1 or num % 2 == 0 : return False if num == 2 : return True for i in range ( 3 , 1 + int ( num ** 0.5 ) ) : if num % i == 0 : return False return True     n , m = map ( int , input ( ) . split ( ) ) lst = [ ] count = 0   for i in range ( 2 , n + 1 ) : if is_prime ( i ) : lst . append ( i )   for i in range ( 2 , len ( lst ) ) : if count == m : break for j in range ( i ) : if lst [ j ] + lst [ j + 1 ] + 1 == lst [ i ] : count += 1 break   print ( ' YES ' if count == m else ' NO ' ) NEW_LINE


def solve ( n , k ) : primes = set ( [ * range ( 2 , n + 1 ) ] )   for i in range ( 2 , int ( n ** ( 1 / 2 ) ) + 1 ) : if i in primes : j = 2 while i * j < n : if i * j in primes : primes . remove ( i * j ) j += 1 primesL = list ( primes )   total = 0 for i in range ( len ( primesL ) - 2 ) : if ( primesL [ i ] + primesL [ i + 1 ] + 1 ) in primes : total += 1   if total >= k : print ( " YES " ) else : print ( " NO " )   n , k = map ( int , input ( ) . split ( " ▁ " ) ) solve ( n , k ) NEW_LINE


import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int n = scn . nextInt ( ) ; int k = scn . nextInt ( ) ; int len = 0 ; int len1 = 0 ; for ( int i = 2 ; i < n ; i ++ ) { int count = 0 ; for ( int j = 2 ; j < i ; j ++ ) { if ( ( i % j ) == 0 ) { count ++ ; } } if ( count == 0 ) { len ++ ; } } int [ ] arr = new int [ len ] ; for ( int i = 2 ; i < n ; i ++ ) { int count = 0 ; for ( int j = 2 ; j < i ; j ++ ) { if ( ( i % j ) == 0 ) { count ++ ; } } if ( count == 0 ) { arr [ len1 ] = i ; len1 ++ ; } } int num = 0 ; for ( int i = 0 ; i < arr . length - 1 ; i ++ ) { int ans = arr [ i ] + arr [ i + 1 ] + 1 ;


import java . util . * ; public class secauc { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int arr [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = sc . nextInt ( ) ; int max = - 1 ; int index = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] > max ) { max = arr [ i ] ; index = i ; } } Arrays . sort ( arr ) ; System . out . println ( ( index + 1 ) + " ▁ " + arr [ n - 2 ] ) ; } }

n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) max = 0 for i in range ( 1 , n ) : if arr [ max ] < arr [ i ] : max = iarr . sort ( ) print ( max + 1 , arr [ - 2 ] ) NEW_LINE


n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) i = l . index ( max ( l ) ) + 1 l . remove ( max ( l ) ) print ( i , max ( l ) ) NEW_LINE


n = int ( input ( ) ) p = list ( map ( int , input ( ) . split ( ) ) ) b = sorted ( p ) a = max ( p ) c = p . index ( a ) + 1 d = b [ - 2 ] print ( c , d ) NEW_LINE


n = int ( input ( ) ) x = list ( map ( int , input ( ) . split ( ) ) ) c = x . copy ( ) c . sort ( ) print ( x . index ( max ( x ) ) + 1 , c [ - 2 ] ) NEW_LINE


import java . util . * ;   public class Solution { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; Map < Integer , Integer > prices = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { prices . put ( scan . nextInt ( ) , i + 1 ) ; } List < Integer > pList = new ArrayList < > ( prices . keySet ( ) ) ; Collections . sort ( pList ) ; int participantN = prices . get ( pList . get ( n - 1 ) ) ; int sum = pList . get ( n - 2 ) ; System . out . println ( participantN + " ▁ " + sum ) ; } }


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


import java . util . * ; import java . io . * ;   public class solution { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int index = 0 ; int max = 0 ; int a [ ] = new int [ n ] ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; if ( a [ i ] > max ) { max = a [ i ] ; index = i + 1 ; } } Arrays . sort ( a ) ; System . out . println ( index + " ▁ " + a [ n - 2 ] ) ; } }


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


import java . util . Scanner ;   public class CityDay { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , x = in . nextInt ( ) , y = in . nextInt ( ) , i , a [ ] = new int [ n ] ; for ( i = 0 ; i < n ; i ++ ) a [ i ] = in . nextInt ( ) ; in . close ( ) ; for ( i = 0 ; i < n ; i ++ ) { int b = 1 , c = 1 , z = 0 ; while ( i - b >= 0 && b <= x ) { if ( a [ i - b ] <= a [ i ] ) z = 1 ; b ++ ; } while ( c < n - i && c <= y ) { if ( a [ i + c ] <= a [ i ] ) z = 1 ; c ++ ; } if ( z == 0 ) { System . out . println ( i + 1 ) ; break ; } } } }

from sys import stdinn , x , y = map ( int , stdin . readline ( ) . split ( ) ) a = list ( map ( int , stdin . readline ( ) . split ( ) ) ) for i in range ( n ) : if min ( a [ max ( i - x , 0 ) : min ( i + y + 1 , n ) ] ) == a [ i ] : print ( i + 1 ) break NEW_LINE


n , x , y = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) i = 0 if n == 1 : print ( 1 ) else : for i in range ( n ) : cnt = 0 j = i - 1 ok = True while j > 0 : if cnt == x : ok = True break if a [ i ] >= a [ j ] : ok = False break else : cnt += 1 j -= 1 if ok : z = 0 j = i + 1 while j <= n - 1 : if z == y : ok = True break if a [ i ] >= a [ j ] : ok = False break else : z += 1 j += 1 if ok : break print ( i + 1 ) NEW_LINE


n , a , b = list ( map ( int , input ( ) . split ( ) ) ) days = list ( map ( int , input ( ) . split ( ) ) )   for i in range ( n ) : start = max ( 0 , i - a ) end = min ( i + b + 1 , n ) if days [ i ] == min ( days [ start : end ] ) : print ( i + 1 ) break NEW_LINE


import java . io . * ; import java . math . * ; import java . security . * ; import java . text . * ; import java . time . LocalTime ; import java . util . * ; import java . util . concurrent . * ; import java . util . regex . * ;    public class D {    public static void main ( String [ ] args ) { FastScanner scan = new FastScanner ( ) ;


import java . io . * ; import java . util . * ;   public class NewClassTest42 { static final int LINE_LENGTH = 64 ;


import java . util . * ; public class CityDay {   public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; long a [ ] = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextLong ( ) ; int res = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { int c = 0 , d = 0 , flag = 0 ; for ( int j = i - 1 ; j >= 0 ; j -- ) { if ( c == x ) break ; if ( a [ j ] < a [ i ] ) { flag = 1 ; break ; } c ++ ; } for ( int j = i + 1 ; j < n ; j ++ ) { if ( flag == 1 ) break ; if ( d == y ) break ; if ( a [ j ] < a [ i ] ) { flag = 1 ; break ; } d ++ ; } if ( flag == 0 ) { res = i + 1 ; break ; } } System . out . println ( res ) ; sc . close ( ) ; } }


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 = 100000007 ;   private static final int MAXN = 300005 ; 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 sys , math , itertoolsfrom collections import Counter , deque , defaultdictfrom bisect import bisect_left , bisect_right from heapq import heappop , heappush , heapifymod = 10 ** 9 + 7 INF = float ( ' inf ' ) def inp ( ) : return int ( sys . stdin . readline ( ) ) def inpl ( ) : return list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) def inpl_1 ( ) : return list ( map ( lambda x : int ( x ) - 1 , sys . stdin . readline ( ) . split ( ) ) ) def inps ( ) : return sys . stdin . readline ( ) def inpsl ( x ) : tmp = sys . stdin . readline ( ) ; return list ( tmp [ : x ] ) def err ( x ) : print ( x ) ; exit ( )   x , y , l , r = inpl ( ) se = set ( ) for a in range ( 100 ) : if x ** a > r : break for b in range ( 100 ) : now = x ** a + y ** b if now > r : break if now >= l : se . add ( now ) res = 0 NEW_LINE


x , y , l , r = map ( int , input ( ) . split ( ' ▁ ' ) )   arr_x = [ 1 ] while True : if arr_x [ - 1 ] * x <= r : arr_x . append ( arr_x [ - 1 ] * x ) else : break   arr_y = [ 1 ] while True : if arr_y [ - 1 ] * y <= r : arr_y . append ( arr_y [ - 1 ] * y ) else : break   L = [ i + j for i in arr_x for j in arr_y if i + j >= l and i + j <= r ] L = sorted ( list ( set ( L ) ) )   ans = 0 curr = l - 1 for i in L : ans = max ( ans , i - curr - 1 ) curr = i   ans = max ( ans , r + 1 - curr - 1 )   print ( ans ) NEW_LINE


def solve ( ) : x , y , l , r = [ int ( s ) for s in input ( ) . split ( ' ▁ ' ) ]   def pows ( x ) : z = 1 p = set ( ) while z <= 10 ** 18 : p . add ( z ) z *= x return p   x_pows = pows ( x ) y_pows = pows ( y )   fails = [ l - 1 ]   for a in x_pows : for b in y_pows : if l <= a + b <= r : fails . append ( a + b ) fails . sort ( ) fails . append ( r + 1 ) m = 0   for i in range ( 1 , len ( fails ) ) : m = max ( fails [ i ] - fails [ i - 1 ] - 1 , m )   return m     print ( solve ( ) ) 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


import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; long y = sc . nextLong ( ) ; long f = sc . nextLong ( ) ; long l = sc . nextLong ( ) ; long max = 0 ; int j = 0 ; int p = 0 ; ArrayList < Long > res = new ArrayList < > ( ) ; for ( j = 0 ; j < 60 ; j ++ ) { for ( p = 0 ; p < 60 ; p ++ ) { if ( ( Math . pow ( x , j ) + Math . pow ( y , p ) ) <= 1000000000000000000l ) { if ( ( pow ( x , j ) + pow ( y , p ) ) >= f && ( pow ( x , j ) + pow ( y , p ) ) <= l ) { res . add ( ( pow ( x , j ) + pow ( y , p ) ) ) ; } } } } int i = 0 ; Collections . sort ( res ) ; long [ ] arr = new long [ res . size ( ) + 1 ] ; if ( res . size ( ) > 0 ) { arr [ 0 ] = res . get ( 0 ) - f ; for ( i = 1 ; i < arr . length - 1 ; i ++ ) {


import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int sampleLength = sc . nextInt ( ) ; int repeats = sc . nextInt ( ) ; String sample = sc . next ( ) ; String result = getString ( sample , sampleLength , repeats ) ; System . out . println ( result ) ;   }   public static String getString ( String sample , int length , int repeats ) { StringBuilder sb = new StringBuilder ( sample ) ;   int mainPos = 0 ; int samplePos = 0 ;   for ( int i = 0 ; i < repeats ; i ++ ) { for ( int j = 0 ; j < length ; j ++ ) { if ( ( mainPos + samplePos ) >= sb . length ( ) ) { sb . append ( sample . charAt ( samplePos ) ) ; } if ( sb . charAt ( mainPos + samplePos ) != sample . charAt ( samplePos ) ) { i -- ; break ; } samplePos ++ ; } mainPos ++ ; samplePos = 0 ; }   return sb . toString ( ) ; }   }

def foo ( s ) : if len ( s ) == 1 : return s for i in range ( 1 , len ( s ) ) : if s . startswith ( s [ i : ] ) : return s [ len ( s ) - i : ] return s n , k = [ int ( x ) for x in input ( ) . split ( ) ] t = input ( ) print ( t + ( foo ( t ) * ( k - 1 ) ) ) NEW_LINE


n , k = list ( map ( int , input ( ) . split ( ) ) ) s = input ( ) for x in range ( 1 , n ) : if s [ : - x ] == s [ x : ] : print ( s + s [ - x : ] * ( k - 1 ) ) breakelse : print ( s * k ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) s = input ( ) p = len ( s ) - 1 while s [ : p ] != s [ - p : ] : p = p - 1 print ( s + s [ p : ] * ( k - 1 ) ) NEW_LINE


v = input ( ) . split ( ) n = int ( v [ 0 ] ) k = int ( v [ 1 ] )   s = input ( ) ap = 0   i = 1 while i < n : if s [ : i ] == s [ - i : ] : ap = i   i += 1   print ( s + s [ ap : ] * ( k - 1 ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) s = input ( ) f = 0 for i in range ( 1 , n ) : if s [ : n - i ] == s [ i : ] : f = 1 breakif f == 0 : print ( s * k ) else : j = n - i final = s [ j : ] print ( s + final * ( k - 1 ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . util . StringTokenizer ;   public class temp4 { static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } static class Print { private final BufferedWriter bw ; public Print ( ) { bw = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ; } public void print ( String str ) throws IOException { bw . append ( str ) ; } public void println ( String str ) throws IOException { print ( str ) ; bw . append ( " \n " ) ; } public void close ( ) throws IOException { bw . close ( ) ; } } public static void main ( String [ ] args ) throws IOException { FastReader scn = new FastReader ( ) ; Print pr = new Print ( ) ; int n = scn . nextInt ( ) , k = scn . nextInt ( ) ; String s = scn . next ( ) ; int [ ] lps = new int [ n ] ; computeLPSArray ( s , n , lps ) ; int t = n - lps [ n - 1 ] ; String temp = s . substring ( lps [ n - 1 ] ) ; for ( int i = 1 ; i < k ; i ++ ) { s += temp ; } System . out . println ( s ) ; } public static void computeLPSArray ( String pat , int M , int lps [ ] ) {


import java . util . * ; import java . io . * ; public class Main { public static int mod = 1000000007 ; public static void solve ( InputReader in ) { int n = in . readInt ( ) ; int k = in . readInt ( ) ; char s [ ] = in . readString ( ) . toCharArray ( ) ; int lps [ ] = new int [ n ] ; for ( int i = 1 ; i < n ; i ++ ) { int j = lps [ i - 1 ] ; while ( j > 0 && s [ i ] != s [ j ] ) { j = lps [ j - 1 ] ; } if ( s [ i ] == s [ j ] ) { lps [ i ] = ++ j ; } } int sub = n - lps [ n - 1 ] ; for ( int i = 0 ; i < k - 1 ; i ++ ) { for ( int j = 0 ; j < sub ; j ++ ) { System . out . print ( s [ j ] ) ; } } System . out . print ( new String ( s ) ) ; } public static void main ( String [ ] args ) {


import java . lang . * ; import java . util . * ; import java . io . * ; public class Problem {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] ar = new int [ n ] ; int [ ] wake = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) ar [ i ] = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) wake [ i ] = sc . nextInt ( ) ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { ans += ( wake [ i ] == 1 ) ? ar [ i ] : 0 ; } int cur = 0 , max = 0 ; int i = 0 , j = 0 ; while ( j <= n ) { if ( j < k ) { cur += ( wake [ j ] == 0 ) ? ar [ j ] : 0 ; } else if ( j >= k && j < n ) { cur += ( ( wake [ j ] == 0 ) ? ar [ j ] : 0 ) - ( ( wake [ i ] == 0 ) ? ar [ i ] : 0 ) ; i ++ ; } max = Math . max ( max , cur ) ; j ++ ; } System . out . println ( ans + max ) ; }   }

n , k = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) t = list ( map ( int , input ( ) . split ( ) ) ) p = 0 for i in range ( n ) : if t [ i ] == 1 : p += a [ i ] a [ i ] = 0 ans = s = sum ( a [ : k ] ) for i in range ( 0 , n - k ) : s = s + a [ i + k ] - a [ i ] ans = max ( ans , s ) print ( ans + p ) NEW_LINE


n , k = map ( int , input ( ) . split ( " ▁ " ) ) v = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) condition = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) sum = 0 for i in range ( n ) : if condition [ i ] == 1 : sum += v [ i ] v [ i ] = 0 sum2 = 0 for i in range ( k ) : if condition [ i ] == 0 : sum2 += v [ i ] temp = sum2for i in range ( 0 , n - k ) : temp = temp - v [ i ] + v [ i + k ] if temp > sum2 : sum2 = tempprint ( sum2 + sum ) NEW_LINE


n , k = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) lst = list ( map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) ) t = list ( map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) ) s = 0 l = [ ] for i in range ( n ) : if t [ i ] == 1 : s += lst [ i ] if t [ i ] == 0 : l . append ( lst [ i ] ) else : l . append ( 0 ) s1 = sum ( l [ : k ] ) m = s1for i in range ( n - k ) : s1 -= l [ i ] s1 += l [ k + i ] if s1 > m : m = s1print ( m + s ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) m = list ( map ( int , input ( ) . split ( ) ) ) d , e , s , f = 0 , 0 , 0 , 0 for i in range ( n ) : if m [ i ] : s = s + l [ i ] l [ i ] = 0 if i > k - 1 : e = max ( e , d ) d = d - l [ f ] f = f + 1   d = d + l [ i ]   print ( s + max ( d , e ) ) NEW_LINE


import java . util . * ; public class square { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , k = sc . nextInt ( ) ; int [ ] a = new int [ n ] , wake = new int [ n ] ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { wake [ i ] = sc . nextInt ( ) ; if ( wake [ i ] == 1 ) sum += a [ i ] ; } int zeros = 0 , max = 0 ; for ( int i = 0 ; i < k ; i ++ ) if ( wake [ i ] == 0 ) { zeros ++ ; max += a [ i ] ; } int temp = max ; for ( int i = 1 ; i <= n - k ; i ++ ) { if ( wake [ i - 1 ] == 0 ) temp -= a [ i - 1 ] ; if ( wake [ i + k - 1 ] == 0 ) temp += a [ i + k - 1 ] ; max = Math . max ( max , temp ) ; } System . out . println ( sum + max ) ; } }


import java . io . * ; import java . util . * ;   public class FlippingGame {   public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String nk [ ] = br . readLine ( ) . trim ( ) . split ( " ▁ " ) ; int n = Integer . parseInt ( nk [ 0 ] ) ; int k = Integer . parseInt ( nk [ 1 ] ) ; int a [ ] = new int [ n ] ; int awake [ ] = new int [ n ] ; int p [ ] = new int [ n ] ; int p2 [ ] = new int [ n ] ;   String ss [ ] = br . readLine ( ) . trim ( ) . split ( " ▁ " ) ; String x [ ] = br . readLine ( ) . trim ( ) . split ( " ▁ " ) ;   int j = 0 , max = 0 ;   while ( j < n ) { a [ j ] = Integer . parseInt ( ss [ j ] ) ; awake [ j ] = Integer . parseInt ( x [ j ] ) ; if ( j == 0 ) { if ( awake [ j ] == 1 ) p [ j ] = a [ j ] ; p2 [ j ] = a [ j ] ; } else if ( awake [ j ] == 0 ) { p [ j ] = p [ j - 1 ] ; p2 [ j ] = p2 [ j - 1 ] + a [ j ] ; } else { p [ j ] = p [ j - 1 ] + a [ j ] ; p2 [ j ] = p2 [ j - 1 ] + a [ j ] ; } j ++ ; }   for ( int i = 0 ; i < n - k + 1 ; i ++ ) { if ( i == 0 ) { max = Math . max ( max , p2 [ i + k - 1 ] + ( p [ n - 1 ] - p [ i + k - 1 ] ) ) ; } else {


import java . util . * ; import java . io . * ; import java . math . * ;   public class First { public static void process ( ) throws IOException { int n = ni ( ) ; int k = ni ( ) ; int a [ ] = new int [ n + 1 ] ; int beh [ ] = new int [ n + 1 ] ; int p [ ] = new int [ n + 1 ] ;   int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i + 1 ] = ni ( ) ; } for ( int i = 1 ; i <= n ; i ++ ) { beh [ i ] = ni ( ) ; } if ( k >= n ) { for ( int i = 0 ; i < n ; i ++ ) { sum += a [ i + 1 ] ; } pn ( sum ) ; } else { for ( int i = 1 ; i <= n ; i ++ ) { if ( beh [ i ] == 1 ) { sum += a [ i ] ; p [ i ] = p [ i - 1 ] ; } else { p [ i ] = p [ i - 1 ] + a [ i ] ; } } int max = Integer . MIN_VALUE ; for ( int i = 1 ; i <= ( n - k + 1 ) ; i ++ ) { int x = p [ i + ( k - 1 ) ] - p [ i - 1 ] ; max = Math . max ( max , x ) ; } sum += max ; pn ( sum ) ; }             }    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 . util . Scanner ;   public class SolutionA { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; if ( n == 0 ) { System . out . println ( 0 ) ; } else if ( n % 2 == 0 ) { System . out . println ( n + 1 ) ; } else { System . out . println ( ( n + 1 ) / 2 ) ; }   } }

n = int ( input ( ) ) if n == 0 : print ( 0 ) elif n % 2 == 1 : print ( ( n + 1 ) // 2 ) else : print ( n + 1 ) NEW_LINE


n = int ( input ( ) ) n += 1 if ( n == 1 ) : print ( 0 ) elif n % 2 == 0 : print ( n // 2 ) else : print ( n ) NEW_LINE


n = int ( input ( ) ) + 1 if n < 2 : print ( 0 ) elif n % 2 == 0 : print ( n // 2 ) else : print ( n ) NEW_LINE


n = int ( input ( ) ) + 1 if n == 1 : print ( 0 ) elif n % 2 : print ( n ) else : print ( n // 2 ) NEW_LINE


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


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


import java . util . * ; import java . io . * ; public final class Codeforces { public static BufferedReader buffer = new BufferedReader ( new InputStreamReader ( System . in ) ) ; public static BufferedWriter logger = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ; public static void main ( String [ ] args ) { try { long n = Long . parseLong ( buffer . readLine ( ) ) ; n = n + 1 ; if ( n % 2 == 0 ) { logger . write ( n / 2 + " " ) ; } else { if ( n == 1 ) { n = 0 ; } logger . write ( n + " " ) ; } logger . flush ( ) ; } catch ( IOException exc ) { } } }


import java . io . * ; import java . util . * ;   import javax . lang . model . util . ElementScanner6 ;   public class codeforces { public static void main ( String [ ] args ) throws IOException { BufferedReader bf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; long n = Long . parseLong ( bf . readLine ( ) . trim ( ) ) ; if ( n == 0 ) System . out . println ( 0 ) ; else { if ( ( n + 1 ) % 2 == 0 ) System . out . println ( ( n + 1 ) / 2 ) ; else System . out . println ( n + 1 ) ; } } }


s = input ( )   print ( ( len ( s ) + ( s . count ( '1' ) > 1 ) ) // 2 ) NEW_LINE


s = input ( ) res = len ( s ) // 2 if len ( s ) % 2 == 1 : for c in s [ 1 : ] : if c == '1' : res += 1 breakprint ( res ) NEW_LINE


import mathn = input ( ) if n == '0' : print ( 0 ) else : k = int ( n , 2 ) NEW_LINE


import math   s = input ( ) if len ( s ) == 1 : print ( 0 ) elif len ( s ) == 2 : print ( 1 ) else : ans = math . ceil ( len ( s ) / 2 ) if s [ 1 : ] . count ( '1' ) == 0 and len ( s ) % 2 == 1 : ans -= 1 print ( ans ) NEW_LINE


n = input ( )   l = len ( n )       if l % 2 == 0 : print ( int ( l / 2 ) ) else : c = n . count ( '1' ) if c > 1 : print ( int ( l / 2 ) + 1 ) else : print ( int ( l / 2 ) ) NEW_LINE


import java . nio . file . FileAlreadyExistsException ; import java . sql . SQLOutput ; import java . util . * ;   public class Example { static int [ ] dp ;   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;


import java . util . * ;   public class CF102 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int length = s . length ( ) ; int index = s . lastIndexOf ( '1' ) ; if ( length == 1 ) { System . out . println ( 0 ) ; return ; } if ( index != ( 0 ) ) { long ans = ( length - 1 ) / 2 + 1 ;


import java . util . Scanner ;   public class BowWowAndTheTimetable { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; solve ( scanner . nextLine ( ) ) ; }   public static void solve ( String numbers ) { if ( numbers . lastIndexOf ( "1" ) == 0 || numbers . equals ( "0" ) ) System . out . println ( numbers . length ( ) / 2 ) ; else System . out . println ( ( numbers . length ( ) + 1 ) / 2 ) ; } }


import java . util . * ; public class TheNewYearMeetingFriends { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int arr [ ] = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) arr [ i ] = in . nextInt ( ) ; Arrays . sort ( arr ) ; int result = ( arr [ 1 ] - arr [ 0 ] ) + ( arr [ 2 ] - arr [ 1 ] ) ; System . out . println ( result ) ; } }

a = ( int ( i ) for i in input ( ) . split ( ) ) a = sorted ( a ) print ( ( a [ 1 ] - a [ 0 ] ) + ( a [ 2 ] - a [ 1 ] ) ) NEW_LINE


friend_coordinate = list ( map ( int , input ( ) . split ( ) ) ) min_value = min ( friend_coordinate ) max_value = max ( friend_coordinate )   mid = ( min_value + max_value ) // 2 print ( ( max_value - mid ) + ( mid - min_value ) ) NEW_LINE


a = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) a . sort ( ) print ( abs ( a [ 1 ] - a [ 0 ] ) + abs ( a [ 1 ] - a [ 2 ] ) ) NEW_LINE


l = list ( map ( int , input ( ) . split ( ) ) ) l . sort ( ) mi , mm , md = l [ 0 ] , l [ 1 ] , l [ 2 ] print ( abs ( mi - mm ) + abs ( md - mm ) ) NEW_LINE


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ;   int x1 = in . nextInt ( ) ; int x2 = in . nextInt ( ) ; int x3 = in . nextInt ( ) ; int max = Math . max ( x1 , Math . max ( x2 , x3 ) ) ; int min = Math . min ( x1 , Math . min ( x2 , x3 ) ) ;   System . out . println ( max - min ) ;    }   }


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ;   int x1 = in . nextInt ( ) ; int max = x1 ; int min = x1 ; int x2 = in . nextInt ( ) ; max = Math . max ( max , x2 ) ; min = Math . min ( min , x2 ) ; int x3 = in . nextInt ( ) ; max = Math . max ( max , x3 ) ; min = Math . min ( min , x3 ) ; System . out . println ( max - min ) ;       }   }


import java . util . Scanner ;   public class A723 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int x1 = scanner . nextInt ( ) , x2 = scanner . nextInt ( ) , x3 = scanner . nextInt ( ) , max , min ;   max = Math . max ( x1 , Math . max ( x2 , x3 ) ) ; min = Math . min ( x1 , Math . min ( x2 , x3 ) ) ; System . out . println ( max - min ) ; } }


import java . util . Arrays ; import java . util . Scanner ;   public class MeetingFriends { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n1 = scanner . nextInt ( ) ; int n2 = scanner . nextInt ( ) ; int n3 = scanner . nextInt ( ) ;   int min = Math . min ( Math . min ( n1 , n2 ) , n3 ) ; int max = Math . max ( Math . max ( n1 , n2 ) , n3 ) ;   int [ ] arr = { n1 , n2 , n3 } ; int mid = Arrays . stream ( arr ) . filter ( e -> e != min && e != max ) . toArray ( ) [ 0 ] ;   System . out . println ( ( max - mid ) + ( mid - min ) ) ;   } }


import java . io . * ; import java . util . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;    public class Main1 {   static class pair implements Comparable < pair > { int a ; int b ; public pair ( int a , int b ) { this . a = a ; this . b = b ; } @ Override public int compareTo ( pair o ) {

l = list ( map ( int , input ( ) . split ( ) ) ) n = l [ 0 ] a = l [ 1 ] b = l [ 2 ] c = l [ 3 ] d = l [ 4 ] k = 0 for i in range ( n ) : x = i + 1 c2 = x + b - c c3 = x + a - d c4 = x + a + b - c - d if ( c2 > 0 and c3 > 0 and c4 > 0 ) : if ( c2 < n + 1 and c3 < n + 1 and c4 < n + 1 ) : k += 1 print ( n * k ) NEW_LINE


import sysimport mathfrom collections import defaultdictimport itertools   MAXNUM = math . infMINNUM = - 1 * math . inf     def getInt ( ) : return int ( sys . stdin . readline ( ) . rstrip ( ) )     def getInts ( ) : return map ( int , sys . stdin . readline ( ) . rstrip ( ) . split ( " ▁ " ) )     def getString ( ) : return sys . stdin . readline ( ) . rstrip ( )     def printOutput ( ans ) : sys . stdout . write ( str ( ans ) + " \n " )     def solve ( n , a , b , c , d ) :   maxCorner = max ( a + b , a + c , c + d , b + d ) minCorner = min ( a + b , a + c , c + d , b + d ) diff = maxCorner - minCorner   if n * ( n - diff ) >= 0 : return n * ( n - diff ) return 0         def readinput ( ) : n , a , b , c , d = getInts ( ) printOutput ( solve ( n , a , b , c , d ) )   readinput ( ) NEW_LINE


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


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


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ; import static java . util . Arrays . sort ; import javafx . util . Pair ;   public class Main {   public static void main ( String [ ] args ) {   FastScanner input = new FastScanner ( ) ;   long n = input . nextInt ( ) ; long a , b , c , d ; a = input . nextInt ( ) ; b = input . nextInt ( ) ; c = input . nextInt ( ) ; d = input . nextInt ( ) ; long count = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { long z1 = b - c + i ; long x2 = i + a - d ; long z2 = i + a + b - c - d ; if ( ( z1 > 0 && z1 <= n ) && ( x2 > 0 && x2 <= n ) && ( z2 > 0 && z2 <= n ) ) { count ++ ; } } System . out . println ( count * n ) ; }   static class FastScanner {   BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) {   return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) throws IOException { return br . readLine ( ) ; } }   }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long c = sc . nextLong ( ) ; long d = sc . nextLong ( ) ; long x , y , z , w ; long result = 0 ; for ( x = 1 ; x <= n ; x ++ ) { y = b - c + x ; z = a - d + x ; w = a + b - c - d + x ; if ( ( y >= 1 ) && ( y <= n ) && ( z >= 1 ) && ( z <= n ) && ( w >= 1 ) && ( w <= n ) ) { result ++ ; } } result = result * n ;


import java . util . Scanner ;   public class PaintingCounter { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ;   int n = scanner . nextInt ( ) ; int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; int c = scanner . nextInt ( ) ; int d = scanner . nextInt ( ) ;   int A = b - c ; int B = a - d ; int C = a + b - c - d ;   long sub = Math . max ( Math . max ( A , B ) , C ) ; long diff = Math . min ( Math . min ( A , B ) , C ) ;   if ( diff < 0 ) { if ( sub < 0 ) sub = 0 ; sub -= diff ; }   long count = n - sub ;   if ( count < 0 ) count = 0 ; else count *= n ;   System . out . println ( count ) ; } }


import java . util . * ; public class b { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; long n = in . nextInt ( ) , a = in . nextInt ( ) , b = in . nextInt ( ) , c = in . nextInt ( ) , d = in . nextInt ( ) ; if ( Math . abs ( a - d ) + Math . abs ( b - c ) <= n ) System . out . printf ( " % d \n " , n * ( n - Math . abs ( a - d ) - Math . abs ( b - c ) ) ) ; else System . out . printf ( "0 \n " ) ; in . close ( ) ; } }


import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . * ; import java . io . * ; import java . math . * ; public class Main { InputStream is ; PrintWriter out ; String INPUT = " " ;

def findMoves ( x , y , p , q ) : res = 21 for i in range ( 11 ) : for j in range ( 11 ) : if i > 0 or j > 0 : if ( x + ( i * p ) + ( j * q ) ) % 10 == y : res = min ( i + j - 1 , res ) if res == 21 : return - 1 return resdef calc ( p , q ) : ans = 0 for i in range ( 10 ) : for j in range ( 10 ) : if count [ i ] [ j ] > 0 : moves = findMoves ( i , j , p , q ) if moves == - 1 : return - 1 else : ans += ( moves * count [ i ] [ j ] ) return anss = str ( input ( ) ) n = len ( s ) count = [ [ 0 ] * 10 for i in range ( 10 ) ] for i in range ( n - 1 ) : j = int ( s [ i ] ) k = int ( s [ i + 1 ] ) count [ j ] [ k ] += 1 answer = [ [ 0 ] * 10 for i in range ( 10 ) ] for i in range ( 10 ) : for j in range ( 10 ) : answer [ i ] [ j ] = calc ( i , j ) print ( " ▁ " . join ( str ( x ) for x in answer [ i ] ) ) NEW_LINE


from collections import * s = input ( ) c = Counter ( ( ord ( y ) - ord ( x ) ) % 10 for x , y in zip ( s , s [ 1 : ] ) ) for i in range ( 100 ) : a = [ - 1 ] * 10 for j in range ( 1 , 11 ) : for k in range ( j + 1 ) : x = ( ( j - k ) * ( i // 10 ) + k * ( i % 10 ) ) % 10 if a [ x ] == - 1 : a [ x ] = j - 1 z = 0 for x in c : if a [ x ] == - 1 : z = - 1 break else : z += a [ x ] * c [ x ] print ( z ) NEW_LINE


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

n = input ( ) lst = list ( map ( float , input ( ) . split ( ) ) ) ds = [ ] ds . append ( 0 ) for i , elem in enumerate ( lst [ 1 : ] ) : ds . append ( ds [ i ] * elem + lst [ i ] * elem ) ans = 2 * sum ( ds ) + sum ( lst ) print ( ans ) NEW_LINE


import java . util . * ; import java . io . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastScanner in = new FastScanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; new Main ( ) . run ( in , out ) ; out . close ( ) ; }   public static long mod = 17352642619633L ;   void run ( FastScanner in , PrintWriter out ) {   int [ ] cnt = new int [ 100 ] ; int n = 2 * in . nextInt ( ) ;   int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = in . nextInt ( ) ; cnt [ a [ i ] ] ++ ; }

from sys import stdin   n = int ( stdin . readline ( ) ) a = [ int ( x ) for x in stdin . readline ( ) . split ( ) ] a = sorted ( [ ( a [ x ] , x ) for x in range ( n * 2 ) ] )   group = { }   for x , ind in a : if x in group : group [ x ] . append ( ind ) else : group [ x ] = [ ind ]   g2 = [ ]   for x in group : g2 . append ( [ len ( group [ x ] ) , group [ x ] ] )   g2 . sort ( )   left = 0 right = 0   board = [ 0 for x in range ( n * 2 ) ]   ind = 0 for x , l in g2 : if x == 1 : ind += 1 if left <= right : left += 1 board [ l [ 0 ] ] = '1' else : right += 1 board [ l [ 0 ] ] = '2' else : break   if right > left : turn = Trueelse : turn = False   for x , l in g2 [ ind : ] : left += 1 right += 1   if x % 2 == 1 : last = l . pop ( ) if turn : board [ last ] = '1' else : board [ last ] = '2' turn = not turn for n in l [ : : 2 ] : board [ n ] = '1' for n in l [ 1 : : 2 ] : board [ n ] = '2' print ( left * right ) print ( ' ▁ ' . join ( board ) ) NEW_LINE


n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) adj = [ [ ] for i in range ( 100 ) ] for i in range ( 2 * n ) : adj [ arr [ i ] ] . append ( i ) res = [ 0 ] * ( 2 * n ) mul , curr = [ ] , 1 x = [ 0 , 0 ] for i in range ( 10 , 100 ) : if len ( adj [ i ] ) == 1 : res [ adj [ i ] [ 0 ] ] = curr x [ curr - 1 ] += 1 curr = 3 - curr if len ( adj [ i ] ) > 1 : res [ adj [ i ] [ 0 ] ] = 1 res [ adj [ i ] [ 1 ] ] = 2 x [ 0 ] += 1 x [ 1 ] += 1 for j in range ( 2 , len ( adj [ i ] ) ) : mul . append ( adj [ i ] [ j ] ) for i in range ( len ( mul ) ) : res [ mul [ i ] ] = curr curr = 3 - currprint ( x [ 0 ] * x [ 1 ] ) print ( * res ) NEW_LINE


from collections import * n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) c = Counter ( a ) for i in range ( 2 * n ) : a [ i ] = [ a [ i ] , i ] a . sort ( ) ans = [ 0 for i in range ( 2 * n ) ] da , db = { } , { } f = 0 for i in range ( 2 * n ) : if ( c [ a [ i ] [ 0 ] ] == 1 ) : continue ans [ a [ i ] [ 1 ] ] = f + 1 if ( f & 1 ) : da [ a [ i ] [ 0 ] ] = 1 else : db [ a [ i ] [ 0 ] ] = 1 f ^= 1 for i in range ( 2 * n ) : if ( ans [ a [ i ] [ 1 ] ] != 0 ) : continue ans [ a [ i ] [ 1 ] ] = f + 1 if ( f & 1 ) : da [ a [ i ] [ 0 ] ] = 1 else : db [ a [ i ] [ 0 ] ] = 1 f ^= 1 print ( len ( da ) * len ( db ) ) print ( * ans ) NEW_LINE


n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) g = [ [ ] for i in range ( 100 ) ] for i in range ( 2 * n ) : g [ arr [ i ] ] . append ( i ) x = 0 y = 0 curr = 1 r = [ ] for i in range ( 10 , 100 ) : if len ( g [ i ] ) == 1 : arr [ g [ i ] [ 0 ] ] = curr if curr == 1 : x += 1 else : y += 1 curr = 3 - curr if len ( g [ i ] ) > 1 : arr [ g [ i ] [ 0 ] ] = 1 arr [ g [ i ] [ 1 ] ] = 2 x += 1 y += 1 for j in range ( 2 , len ( g [ i ] ) ) : r . append ( g [ i ] [ j ] ) for i in range ( len ( r ) ) : arr [ r [ i ] ] = 2 - ( i % 2 ) print ( x * y ) print ( * arr ) NEW_LINE


n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) g = [ [ ] for i in range ( 100 ) ] for i in range ( 2 * n ) : g [ arr [ i ] ] . append ( i ) x = 0 y = 0 curr = 1 flip = 2 for i in range ( 10 , 100 ) : if len ( g [ i ] ) == 1 : arr [ g [ i ] [ 0 ] ] = curr if curr == 1 : x += 1 else : y += 1 curr = 3 - curr if len ( g [ i ] ) > 1 : arr [ g [ i ] [ 0 ] ] = 1 arr [ g [ i ] [ 1 ] ] = 2 x += 1 y += 1 for j in range ( 2 , len ( g [ i ] ) ) : arr [ g [ i ] [ j ] ] = flip flip = 3 - flipprint ( x * y ) print ( * arr ) NEW_LINE


import java . io . * ; import java . util . * ;   public class CF353B { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int [ ] kk = new int [ 100 ] ; int [ ] pp = new int [ 100 ] ; int [ ] qq = new int [ 100 ] ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int [ ] aa = new int [ n + n ] ; for ( int i = 0 ; i < n + n ; i ++ ) { int a = Integer . parseInt ( st . nextToken ( ) ) ; kk [ a ] ++ ; aa [ i ] = a ; } int p = 0 , q = 0 ; for ( int a = 10 ; a <= 99 ; a ++ ) if ( kk [ a ] >= 2 ) { p ++ ; q ++ ; pp [ a ] ++ ; qq [ a ] ++ ; kk [ a ] -= 2 ; } else if ( kk [ a ] >= 1 && p <= q ) { p ++ ; pp [ a ] ++ ; kk [ a ] -- ; } else if ( kk [ a ] >= 1 && p > q ) { q ++ ; qq [ a ] ++ ; kk [ a ] -- ; } int m = p * q ; for ( int a = 10 ; a <= 99 ; a ++ ) while ( kk [ a ] > 0 ) if ( p <= q ) { p ++ ; pp [ a ] ++ ; kk [ a ] -- ; } else { q ++ ; qq [ a ] ++ ; kk [ a ] -- ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < n + n ; i ++ ) { int a = aa [ i ] , g ; if ( pp [ a ] > 0 ) { g = 1 ; pp [ a ] -- ; } else { g = 2 ; qq [ a ] -- ; } sb . append ( g + " ▁ " ) ; } System . out . println ( m ) ; System . out . println ( sb ) ; } }


import java . util . * ;   public class Round205B {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Map < Integer , List < Integer > > map = new HashMap < > ( ) ; for ( int i = 0 ; i < 2 * n ; i ++ ) { map . computeIfAbsent ( sc . nextInt ( ) , k -> new ArrayList < > ( ) ) . add ( i ) ; } int [ ] b = new int [ 2 * n ] ; int max = 2 * n ; int group = 1 ; for ( List < Integer > list : map . values ( ) ) { if ( list . size ( ) == 1 ) { b [ list . get ( 0 ) ] = group ; group = 3 - group ; } } for ( List < Integer > list : map . values ( ) ) { if ( list . size ( ) > 1 ) { for ( int i = 0 ; i < list . size ( ) ; i ++ ) { b [ list . get ( i ) ] = group ; group = 3 - group ; } max -= list . size ( ) - 2 ; } } if ( max % 2 == 0 ) { max = max * max / 4 ; } else { max = ( max / 2 ) * ( max / 2 + 1 ) ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i : b ) { sb . append ( i ) . append ( " ▁ " ) ; } System . out . println ( max + " \n " + sb ) ; }   }


import java . util . * ; import java . io . BufferedReader ; import java . io . FileNotFoundException ; import java . io . FileReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ;   public class divs { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { String s = sc . next ( ) ; char [ ] a = s . toCharArray ( ) ; Arrays . sort ( a ) ;

n = int ( input ( ) ) for i in range ( n ) : a = sorted ( list ( input ( ) ) ) flag = True for j in range ( len ( a ) - 1 ) : if ord ( a [ j ] ) + 1 != ord ( a [ j + 1 ] ) : flag = False if ( flag ) : print ( " Yes " ) else : print ( " No " ) NEW_LINE


import java . util . Scanner ; import java . util . Arrays ;   public class Main { public static void main ( String [ ] args ) { Scanner puttingvaluesinside = new Scanner ( System . in ) ; int t = puttingvaluesinside . nextInt ( ) ; puttingvaluesinside . nextLine ( ) ; while ( t -- > 0 ) { char c [ ] = puttingvaluesinside . nextLine ( ) . toCharArray ( ) ; boolean flag = true ;


import java . util . * ; import java . io . * ; public class A { public static FastReader sc = new FastReader ( ) ; public static PrintWriter out = new PrintWriter ( System . out ) ; public static void taskSolver ( ) { char ch [ ] = sc . next ( ) . toCharArray ( ) ; int arr [ ] = new int [ ch . length ] ; for ( int i = 0 ; i < ch . length ; i ++ ) { arr [ i ] = ch [ i ] - ' a ' ; } Arrays . sort ( arr ) ; int flag = 1 ; for ( int i = 1 ; i < arr . length ; i ++ ) { if ( arr [ i ] != arr [ i - 1 ] + 1 ) { flag = 0 ; break ; } } if ( flag == 0 ) out . println ( " No " ) ; else out . println ( " Yes " ) ; } public static void main ( String args [ ] ) throws java . lang . Exception { int t = sc . nextInt ( ) ; while ( t -- > 0 ) taskSolver ( ) ; out . close ( ) ; } static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . StringTokenizer ; import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . InputStream ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class TaskA { public void solve ( int testNumber , InputReader in , PrintWriter out ) { int t = in . nextInt ( ) ; for ( int cas = 1 ; cas <= t ; cas ++ ) { String s = in . next ( ) ;


import java . util . * ; public class question { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; for ( int l = 0 ; l < t ; l ++ ) { String s = sc . next ( ) ; char arr [ ] = s . toCharArray ( ) ; Arrays . sort ( arr ) ; int count = 0 ; for ( int i = 0 ; i < arr . length ; i ++ ) { if ( i < arr . length - 1 ) { char ch = arr [ i ] ; int x = ch ; if ( arr [ i + 1 ] == ( char ) ( x + 1 ) ) count ++ ; } } if ( count == arr . length - 1 ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; }   } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . StringTokenizer ;   public class Zad862B { static int [ ] mark ; static Edge [ ] g ; static ArrayList < Integer > al = new ArrayList < > ( ) ; static ArrayList < Integer > roots = new ArrayList < > ( ) ; public static void main ( String [ ] args ) {

import sys             def solve ( ) : n = int ( sys . stdin . readline ( ) ) g = [ set ( ) for _ in range ( n + 1 ) ] count = 0 for _ in range ( n - 1 ) : a , b = map ( int , sys . stdin . readline ( ) . split ( ' ▁ ' ) ) g [ a ] . add ( b ) g [ b ] . add ( a ) red , blue = set ( ) , set ( ) nodes = [ 1 ] NEW_LINE


def solve ( vertices , edge ) : table = { i : [ ] for i in range ( 1 , vertices + 1 ) } visited = [ False ] * ( vertices + 1 ) setA = 0 setB = 0 putSetA = True for i , j in edge : table [ i ] . append ( j ) table [ j ] . append ( i ) queue = [ edge [ 0 ] [ 0 ] ] while len ( queue ) > 0 : index = 0 length = len ( queue ) while index < length : if visited [ queue [ index ] ] : index += 1 continue if putSetA : setA += 1 else : setB += 1 queue . extend ( table [ queue [ index ] ] ) visited [ queue [ index ] ] = True index += 1 queue = queue [ index : ] if putSetA : putSetA = False else : putSetA = True return ( setA * setB ) - ( vertices - 1 )           v = int ( input ( ) ) ed = [ ] for _ in range ( v - 1 ) : ed . append ( list ( map ( int , input ( ) . split ( ) ) ) )   print ( solve ( v , ed ) ) NEW_LINE


from collections import defaultdictfrom collections import dequen = int ( input ( ) ) d = defaultdict ( list ) for i in range ( n - 1 ) : u , v = map ( int , input ( ) . split ( ) ) d [ u ] . append ( v ) d [ v ] . append ( u ) visited = [ 0 ] * ( n + 1 ) c = { } nr , nb = 0 , 0 q = deque ( ) q . append ( 1 ) visited [ 1 ] = 1 c [ 1 ] = ' R ' nr = nr + 1 while q : i = q . popleft ( ) co = ' R ' if c [ i ] == ' B ' else ' B ' for j in d [ i ] : if visited [ j ] == 0 : visited [ j ] = 1 c [ j ] = co if co == ' R ' : nr = nr + 1 else : nb = nb + 1 q . append ( j ) ans = 0 for i in d : if c [ i ] == ' R ' : ans = ans + nb - len ( d [ i ] ) else : ans = ans + nr - len ( d [ i ] ) print ( ans // 2 ) NEW_LINE


import java . io . * ; import java . util . * ;   public class BipartiteMahmoud {   static ArrayList < Node > map ; static boolean [ ] vis ; static int n ; static long l , r ;   public static void main ( String [ ] args ) throws IOException { FastReader fr = new FastReader ( ) ; PrintWriter pr = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ;   n = fr . nextInt ( ) ;   map = new ArrayList < > ( ) ; vis = new boolean [ n ] ;   for ( int i = 0 ; i < n ; i ++ ) { map . add ( new Node ( i ) ) ; }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ;   public class Bipratite_862B { static final int RED = 0 ; static final int BLUE = 1 ;   public static void main ( String [ ] args ) throws IOException { BufferedReader sc = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( sc . readLine ( ) ) ; List < Integer > [ ] graph = new ArrayList [ n + 1 ] ;   for ( int i = 0 ; i < n + 1 ; i ++ ) { graph [ i ] = new ArrayList < > ( ) ; } for ( int i = 0 ; i < n - 1 ; i ++ ) { String [ ] s = sc . readLine ( ) . split ( " \\ s " ) ; int a = Integer . parseInt ( s [ 0 ] ) ; int b = Integer . parseInt ( s [ 1 ] ) ; graph [ a ] . add ( b ) ; graph [ b ] . add ( a ) ; } BigInteger [ ] colorCount = new BigInteger [ 2 ] ; colorCount [ RED ] = BigInteger . ZERO ; colorCount [ BLUE ] = BigInteger . ZERO ; colorGraph ( graph , new boolean [ n + 1 ] , 1 , RED , colorCount ) ; System . out . println ( colorCount [ BLUE ] . multiply ( colorCount [ RED ] ) . subtract ( ( BigInteger . valueOf ( n - 1 ) ) ) ) ; }   static void colorGraph ( List < Integer > [ ] graph , boolean [ ] vis , int vertex , int currColor , BigInteger [ ] colorCount ) { if ( vis [ vertex ] ) return ; List < Integer > edges = graph [ vertex ] ; if ( edges == null ) return ; int next = ( currColor == RED ) ? BLUE : RED ; vis [ vertex ] = true ; colorCount [ currColor ] = colorCount [ currColor ] . add ( BigInteger . ONE ) ; for ( Integer i : edges ) { colorGraph ( graph , vis , i , next , colorCount ) ; } } }


import java . util . * ; public class tcf { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; ArrayList < ArrayList < Integer > > graph = new ArrayList < > ( ) ; for ( int i = 0 ; i <= n ; i ++ ) { graph . add ( new ArrayList < Integer > ( ) ) ; } for ( int i = 0 ; i < n - 1 ; i ++ ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; graph . get ( a ) . add ( b ) ; graph . get ( b ) . add ( a ) ; } Queue < Integer > q = new LinkedList < Integer > ( ) ; q . add ( 1 ) ; int level = 0 ; boolean [ ] vis = new boolean [ n + 1 ] ; vis [ 1 ] = true ; long even = 0 ; long odd = 0 ; HashMap < Integer , Integer > map = new HashMap < > ( ) ; while ( ! q . isEmpty ( ) ) { int size = q . size ( ) ;


import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ;   public class Main { public static int count1 ; public static int count2 ;   public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ;   int n = sc . nextInt ( ) ; int [ ] u = new int [ n - 1 ] ; int [ ] v = new int [ n - 1 ] ; for ( int i = 0 ; i < n - 1 ; i ++ ) { u [ i ] = sc . nextInt ( ) ; v [ i ] = sc . nextInt ( ) ; } System . out . println ( solve ( u , v ) ) ;   sc . close ( ) ; }   public static long solve ( int [ ] u , int [ ] v ) { int n = u . length + 1 ;   List < Integer > [ ] adjLists = new List [ n ] ; for ( int i = 0 ; i < adjLists . length ; i ++ ) { adjLists [ i ] = new ArrayList < > ( ) ; } for ( int i = 0 ; i < u . length ; i ++ ) { adjLists [ u [ i ] - 1 ] . add ( v [ i ] - 1 ) ; adjLists [ v [ i ] - 1 ] . add ( u [ i ] - 1 ) ; }   count1 = 0 ; count2 = 0 ; search ( adjLists , new boolean [ n ] , 0 , true ) ;   return ( long ) count1 * count2 - ( n - 1 ) ; }   public static void search ( List < Integer > [ ] adjLists , boolean [ ] visited , int node , boolean condTree ) { visited [ node ] = true ;   if ( condTree ) { count1 ++ ; } else { count2 ++ ; }   for ( int adj : adjLists [ node ] ) { if ( ! visited [ adj ] ) { search ( adjLists , visited , adj , ! condTree ) ; } } } }


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

n = int ( input ( ) ) v_arr = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) u_arr = v_arr . copy ( ) u_arr . sort ( ) m = int ( input ( ) )   def sum_calc ( arr ) : sum_ = 0 sum_arr = [ 0 ] for item in arr : sum_ += item sum_arr . append ( sum_ ) return sum_arr   sum_v = sum_calc ( v_arr ) sum_u = sum_calc ( u_arr ) for i in range ( m ) : inp = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) _type = inp [ 0 ] l = inp [ 1 ] r = inp [ 2 ] if _type == 1 : print ( sum_v [ r ] - sum_v [ l - 1 ] ) else : print ( sum_u [ r ] - sum_u [ l - 1 ] ) NEW_LINE


n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) v = [ ] s = 0 for i in l : s += i v . append ( s ) u = [ ] s = 0 l . sort ( ) for i in l : s += i u . append ( s )   m = int ( input ( ) ) for i in range ( m ) : t , L , r = map ( int , input ( ) . split ( ) )   if t == 1 : if L == 1 : print ( v [ r - 1 ] ) else : print ( v [ r - 1 ] - v [ L - 2 ] ) else : if L == 1 : print ( u [ r - 1 ] ) else : print ( u [ r - 1 ] - u [ L - 2 ] )   NEW_LINE


n = int ( input ( ) ) v = list ( map ( int , input ( ) . split ( ) ) ) v . insert ( 0 , 0 ) n += 1 a = v . copy ( ) a . sort ( ) for i in range ( n ) : a [ i ] += 0 if i == 0 else a [ i - 1 ] v [ i ] += 0 if i == 0 else v [ i - 1 ]   m = int ( input ( ) ) for _ in range ( m ) : t , l , r = map ( int , input ( ) . split ( ) ) if t == 1 : print ( v [ r ] - v [ l - 1 ] ) else : print ( a [ r ] - a [ l - 1 ] ) NEW_LINE


def accumulate_sum ( costs ) : result = [ ] result . append ( 0 ) result . append ( costs [ 0 ] ) for i in range ( 1 , len ( costs ) ) : result . append ( result [ i ] + costs [ i ] ) return result     n = int ( input ( ) ) costs = list ( map ( int , input ( ) . split ( ) ) ) m = int ( input ( ) ) sorted_costs = sorted ( costs ) vs = accumulate_sum ( costs ) us = accumulate_sum ( sorted_costs ) for i in range ( m ) : q , l , r = map ( int , input ( ) . split ( ) ) if q == 1 : cs = vs else : cs = us if l == r : print ( cs [ r ] - cs [ l - 1 ] ) else : print ( cs [ r ] - cs [ l - 1 ] ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . PriorityQueue ; import java . util . StringTokenizer ;   public class B433_Kuriyama_Mirais_Stones {   public static void main ( String [ ] args ) throws NumberFormatException , IOException {


import java . util . * ; import java . io . * ; import java . io . FileInputStream ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ; import java . math . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Solution { public static void main ( String args [ ] ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long [ ] sorted = new long [ n + 1 ] ; long [ ] dp = new long [ n + 1 ] ; long c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int a = sc . nextInt ( ) ; sorted [ i ] = a ; c += a ; dp [ 1 + i ] = c ; } Arrays . sort ( sorted ) ; for ( int i = 0 ; i < n ; i ++ ) sorted [ i + 1 ] += sorted [ i ] ; int q = sc . nextInt ( ) ; while ( q -- > 0 ) { int t = sc . nextInt ( ) , l = sc . nextInt ( ) , r = sc . nextInt ( ) ; System . out . println ( t == 1 ? dp [ r ] - dp [ l - 1 ] : sorted [ r ] - sorted [ l - 1 ] ) ; } } }


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


import java . util . * ; public class P2 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; boolean bad = false ; int k = 0 ; int p = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == ' . ' ) { if ( s . charAt ( i - 1 ) == '9' ) { System . out . println ( " GOTO ▁ Vasilisa . " ) ; } else if ( s . charAt ( i + 1 ) >= '5' ) { bad = true ; p = Character . getNumericValue ( ( s . charAt ( i - 1 ) ) ) ; p ++ ; System . out . print ( s . substring ( 0 , i - 1 ) ) ; System . out . print ( p ) ; } else { k = i ; System . out . println ( s . substring ( 0 , k ) ) ; } } } } }

n = input ( ) NEW_LINE r = n . index ( ' . ' ) NEW_LINE if n [ r - 1 ] == '9' : NEW_LINE INDENT print ( ' GOTO ▁ Vasilisa . ' ) NEW_LINE DEDENT else : NEW_LINE INDENT if n [ r + 1 ] >= '5' : NEW_LINE INDENT print ( int ( n [ : r ] ) + 1 ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( n [ : r ] ) NEW_LINE DEDENT DEDENT


a , b = input ( ) . split ( " . " ) NEW_LINE if a [ - 1 ] == "9" : NEW_LINE INDENT print ( " GOTO ▁ Vasilisa . " ) NEW_LINE DEDENT else : NEW_LINE INDENT if int ( b [ 0 ] ) < 5 : NEW_LINE INDENT print ( int ( a ) ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( int ( a ) + 1 ) NEW_LINE DEDENT DEDENT


numero = input ( ) NEW_LINE indice_punto = - 1 NEW_LINE i = 0 NEW_LINE while indice_punto == - 1 and i < len ( numero ) : NEW_LINE INDENT if numero [ i ] == ' . ' : NEW_LINE INDENT indice_punto = i NEW_LINE DEDENT i = i + 1 NEW_LINE DEDENT unidades = int ( numero [ indice_punto - 1 ] ) NEW_LINE decimas = int ( numero [ indice_punto + 1 ] ) NEW_LINE if unidades < 9 and decimas < 5 : NEW_LINE INDENT print ( numero [ : indice_punto ] ) NEW_LINE DEDENT elif unidades < 9 and decimas >= 5 : NEW_LINE INDENT print ( numero [ : indice_punto - 1 ] + str ( int ( numero [ indice_punto - 1 ] ) + 1 ) ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ' GOTO ▁ Vasilisa . ' ) NEW_LINE DEDENT


n = input ( ) NEW_LINE ans = " " NEW_LINE capture_next = False NEW_LINE for char in n : NEW_LINE INDENT if char == " . " : NEW_LINE INDENT capture_next = True NEW_LINE DEDENT elif capture_next : NEW_LINE INDENT last_digit = char NEW_LINE break NEW_LINE DEDENT else : NEW_LINE INDENT ans += char NEW_LINE DEDENT DEDENT if ans [ - 1 ] == "9" : NEW_LINE INDENT print ( " GOTO ▁ Vasilisa . " ) NEW_LINE DEDENT else : NEW_LINE INDENT if int ( last_digit ) < 5 : NEW_LINE INDENT print ( ans ) NEW_LINE DEDENT else : NEW_LINE INDENT s = ans [ : - 1 ] + str ( int ( ans [ - 1 ] ) + 1 ) NEW_LINE print ( s ) NEW_LINE DEDENT DEDENT


n = input ( ) NEW_LINE idx = n . index ( ' . ' ) NEW_LINE if n [ idx - 1 ] == '9' : NEW_LINE INDENT print ( " GOTO ▁ Vasilisa . " ) NEW_LINE DEDENT else : NEW_LINE INDENT if n [ idx + 1 ] < '5' : NEW_LINE INDENT print ( n [ : idx ] ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( int ( n [ : idx ] ) + 1 ) NEW_LINE DEDENT DEDENT


import java . util . * ; public class question { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int j = 0 ; while ( s . charAt ( j ) != ' . ' ) { j ++ ; } if ( s . charAt ( j - 1 ) == '9' ) System . out . println ( " GOTO ▁ Vasilisa . " ) ; else if ( s . charAt ( j + 1 ) < '5' ) { System . out . println ( s . substring ( 0 , j ) ) ; } else if ( s . charAt ( j + 1 ) >= '5' && s . charAt ( j - 1 ) == '9' ) { System . out . println ( " GOTO ▁ Vasilisa . " ) ; } else if ( s . charAt ( j + 1 ) >= '5' ) { System . out . print ( s . substring ( 0 , j - 1 ) ) ; int val = Character . getNumericValue ( s . charAt ( j - 1 ) ) ; System . out . print ( val + 1 ) ; } } }


import java . math . BigInteger ; import java . util . Scanner ; public class prob2 { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; String ch = input . nextLine ( ) ; if ( ch . contains ( " . " ) ) { String ch1 = " " ; int l = ch . indexOf ( " . " ) ; char sign = ch . charAt ( l + 1 ) ; char sign1 = ch . charAt ( l - 1 ) ; for ( int i = 0 ; i < l ; ++ i ) { ch1 += ch . charAt ( i ) + " " ; } if ( sign == '5' || sign == '6' || sign == '7' || sign == '8' || sign == '9' || sign1 == '9' ) { if ( sign1 == '9' ) { System . out . println ( " GOTO ▁ Vasilisa . " ) ; } else { BigInteger num = new BigInteger ( ch1 ) ; num = num . add ( BigInteger . ONE ) ; System . out . println ( num ) ; } } else { System . out . println ( ch1 ) ; } } else { System . out . println ( ch ) ; } } }


import java . util . * ; import java . io . * ;   public class A { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; ArrayList < Integer > map = new ArrayList < Integer > ( ) ; HashMap < Integer , Integer > hm = new HashMap < Integer , Integer > ( ) ;   for ( int i = 0 ; i < n ; i ++ ) { int j = sc . nextInt ( ) ; if ( ! hm . containsKey ( j ) ) { map . add ( j ) ; hm . put ( j , j ) ; } }   Collections . sort ( map ) ; boolean found = false ;   outer : for ( int i = 0 ; i < map . size ( ) ; i ++ ) { int first = map . get ( i ) * 2 ; for ( int j = i + 1 ; j < map . size ( ) ; j ++ ) { int second = map . get ( j ) ; if ( first > second ) { System . out . println ( " YES " ) ; found = true ; break outer ; } } }   if ( ! found ) System . out . println ( " NO " ) ; } }

def datatypes ( x , answer ) : for i in range ( 1 , n ) : if x [ i ] < 2 * x [ i - 1 ] and x [ i ] != x [ i - 1 ] : answer = " YES " break print ( answer ) n = int ( input ( ) ) x = list ( map ( int , input ( ) . split ( ) ) ) x . sort ( ) answer = " NO " datatypes ( x , answer )       NEW_LINE


n = int ( input ( ) ) a = sorted ( list ( map ( int , input ( ) . split ( ) ) ) ) for i in range ( n - 1 ) : if a [ i ] < a [ i + 1 ] and a [ i ] * 2 > a [ i + 1 ] : print ( " YES " ) exit ( ) print ( " NO " ) NEW_LINE


def nik ( rud , ans ) : for i in range ( 1 , n ) : if rud [ i ] < 2 * rud [ i - 1 ] and rud [ i ] != rud [ i - 1 ] : ans = " YES " break print ( ans ) n = int ( input ( ) ) rud = list ( map ( int , input ( ) . split ( ) ) ) rud . sort ( ) ans = " NO " nik ( rud , ans ) NEW_LINE


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = sc . nextInt ( ) ; Arrays . sort ( arr ) ; boolean flag = false ; for ( int i = 0 ; i < n - 1 ; i ++ ) if ( arr [ i ] * 2 > arr [ i + 1 ] && arr [ i ] != arr [ i + 1 ] ) flag = true ; System . out . println ( flag ? " YES " : " NO " ) ; } }


import java . util . Scanner ; import java . util . * ;   public class fridgeLockers { static Scanner input = new Scanner ( System . in ) ; static int t ; static int n , m ;   public static void main ( String [ ] args ) { t = input . nextInt ( ) ;

t = int ( input ( ) ) import heapq   for _ in range ( t ) : n , m = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) if m < n or n <= 2 : print ( - 1 ) continue s = sum ( a ) smallest = heapq . nsmallest ( 2 , range ( len ( a ) ) , a . __getitem__ ) smallest_values = [ a [ i ] for i in smallest ] print ( 2 * s + sum ( smallest_values ) * ( m - n ) ) for i in range ( 1 , n ) : print ( i , i + 1 ) print ( n , 1 ) for i in range ( m - n ) : print ( * smallest ) NEW_LINE


def main ( ) : t = int ( input ( ) ) allans = [ ] for _ in range ( t ) : n , m = readIntArr ( ) a = readIntArr ( ) if n > 2 and m >= n : weights = [ ] for i , w in enumerate ( a ) : weights . append ( [ w , i ] ) weights . sort ( key = lambda x : x [ 0 ] ) lo1 = weights [ 0 ] [ 1 ] + 1 NEW_LINE


for _ in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) if m < n or n == 2 : print ( - 1 ) else : print ( 2 * sum ( a ) ) for i in range ( n ) : print ( i + 1 , max ( 1 , ( i + 2 ) % ( n + 1 ) ) ) NEW_LINE


import sysdef input ( ) : return sys . stdin . readline ( ) . strip ( ) def iinput ( ) : return int ( input ( ) ) def minput ( ) : return map ( int , input ( ) . split ( ) ) def listinput ( ) : return list ( map ( int , input ( ) . split ( ) ) ) for _ in range ( iinput ( ) ) : n , m = minput ( ) if n > m or n < 3 : _ = listinput ( ) print ( - 1 ) else : print ( 2 * sum ( listinput ( ) ) ) for i in range ( n ) : print ( i + 1 , ( i + 1 ) % n + 1 ) ''' p = input ( ) q = input ( ) r = input ( ) answer = [ ] for ▁ _ ▁ in ▁ range ( 2 ) : ▁ ▁ ▁ ▁ if ▁ p . find ( q ) ! = - 1 ▁ and ▁ p . find ( q ) + len ( q ) < = p . rfind ( r ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ answer . append ( 1 ) ▁ ▁ ▁ ▁ else : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ answer . append ( 0 ) ▁ ▁ ▁ ▁ p = p [ : : -1 ] if ▁ answer [ 0 ] = = 1 ▁ and ▁ answer [ 1 ] = = 1 : ▁ ▁ ▁ ▁ print ( " both " ) elif ▁ answer [ 1 ] = = 1 : ▁ ▁ ▁ ▁ print ( " backward " ) elif ▁ answer [ 0 ] = = 1 : ▁ ▁ ▁ ▁ print ( " forward " ) else : ▁ ▁ ▁ ▁ print ( " fantasy " ) ''' NEW_LINE


if __name__ == ' _ _ main _ _ ' : for _ in range ( int ( input ( ) ) ) : n , m = [ int ( s ) for s in input ( ) . split ( ) ] aa = [ int ( s ) for s in input ( ) . split ( ) ]   if n < 3 or m < n : print ( - 1 )   else : print ( f ' {2 ▁ * ▁ sum ( aa ) } ' ) for i in range ( n ) : print ( f ' { i + 1 } ▁ { ( i + 1 ) % n ▁ + ▁ 1 } ' )     NEW_LINE


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


import java . util . * ; import java . lang . * ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; String ar [ ] = new String [ t ] ; ArrayList < String > l = new ArrayList < > ( ) ; for ( int p = 0 ; p < t ; p ++ ) { ar [ p ] = sc . next ( ) ; if ( l . contains ( ar [ p ] ) == false ) { l . add ( ar [ p ] ) ; System . out . println ( " NO " ) ; } else { l . add ( ar [ p ] ) ; System . out . println ( " YES " ) ; } } } }

def main_function ( ) : n = int ( input ( ) ) names = [ ] output_list = [ ] dict = { } for i in range ( n ) : names . append ( input ( ) ) for name in names : if not name in dict : output_list . append ( " NO " ) dict [ name ] = 1 else : output_list . append ( " YES " ) return " \n " . join ( output_list )     print ( main_function ( ) ) NEW_LINE


import sys   def main ( ) : _ , * l = sys . stdin . read ( ) . strip ( ) . split ( ) out , s = [ ] , set ( ) for i in l : if i in s : out . append ( ' YES ' ) else : s . add ( i ) ; out . append ( ' NO ' ) return out   print ( * main ( ) , sep = ' \n ' ) NEW_LINE


n = int ( input ( ) ) l = [ ] for i in range ( 0 , n ) : y = input ( ) if ( y in l ) : print ( " YES " ) else : print ( " NO " ) l . append ( y )   NEW_LINE


n = int ( input ( ) ) names = { } for i in range ( n ) : name = input ( ) if name in names : print ( ' YES ' ) else : print ( ' NO ' ) names [ name ] = 1 NEW_LINE


i = int ( input ( ) ) l = [ ] res = [ ] while i > 0 : a = input ( ) i -= 1 if a in l : res . append ( ' YES ' ) else : l . append ( a ) res . append ( ' NO ' )   for e in res : print ( e ) NEW_LINE


import java . io . * ; import java . util . * ;   public class Diary {


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . HashSet ; import java . util . LinkedList ; import java . util . Queue ; import java . util . Stack ; import java . util . StringTokenizer ;     public class Main {   static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } public static boolean check ( String st ) { Stack < Character > stck = new Stack < Character > ( ) ; for ( char c : st . toCharArray ( ) ) { if ( c == ' ( ' ) { stck . push ( ' ) ' ) ; } else if ( c == ' [ ' ) { stck . push ( ' ] ' ) ; } else if ( stck . isEmpty ( ) || c != stck . pop ( ) ) { return false ; } } return stck . isEmpty ( ) ; }   public static void main ( String [ ] args ) { PrintWriter pw = new PrintWriter ( System . out ) ; FastReader sc = new FastReader ( ) ; int t = sc . nextInt ( ) ; HashSet < String > hs = new HashSet < String > ( ) ; while ( t -- > 0 ) { String str = sc . nextLine ( ) ; if ( hs . contains ( str ) ) { System . out . println ( " YES " ) ; } else { hs . add ( str ) ; System . out . println ( " NO " ) ; } } } }


import java . io . * ; import java . util . * ; import java . math . * ; import java . awt . Point ; public class CFTemplate { static final long MOD = 1000000007L ;


import java . io . * ; import java . math . BigDecimal ; import java . math . BigInteger ; import java . math . RoundingMode ; import java . util . * ; import java . util . concurrent . LinkedBlockingDeque ;   import java . util . ArrayList ; import java . util . HashMap ; import java . util . LinkedList ;

t = int ( input ( ) ) for i in range ( t ) : NEW_LINE


from sys import stdininput = lambda : stdin . readline ( ) from math import ceil , sqrt , gcdfor _ in range ( int ( input ( ) ) ) : n , m , k = map ( int , input ( ) . split ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) flag = ' YES ' for i in range ( n - 1 ) : if l [ i + 1 ] > l [ i ] : if l [ i + 1 ] - l [ i ] > k : if m < l [ i + 1 ] - l [ i ] - k : flag = ' NO ' break else : m -= ( l [ i + 1 ] - l [ i ] - k ) NEW_LINE


t = int ( input ( ) )   for i in range ( t ) : n , m , k = [ int ( i ) for i in input ( ) . split ( ) ] h = [ int ( i ) for i in input ( ) . split ( ) ] flag = 1   for i in range ( n - 1 ) : m += h [ i ] - max ( 0 , h [ i + 1 ] - k ) if m < 0 : flag = 0 break if flag : print ( " YES " ) else : print ( " NO " ) NEW_LINE


test = int ( input ( ) ) for t in range ( 0 , test ) : n , m , k = map ( int , input ( ) . split ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) p = int ( 0 ) for i in range ( n - 1 ) : m = m + arr [ i ] - max ( p , arr [ i + 1 ] - k ) if m < 0 : p = 1 break   if p == 0 : print ( " YES " ) else : print ( " NO " )           NEW_LINE


t = int ( input ( ) ) for zzz in range ( t ) : n , m , k = map ( int , input ( ) . split ( ) ) hs = list ( map ( int , input ( ) . split ( ) ) ) for i in range ( n - 1 ) : m += max ( min ( hs [ i ] + k - hs [ i + 1 ] , hs [ i ] ) , 0 ) hs [ i ] -= max ( hs [ i ] + k - hs [ i + 1 ] , 0 ) if ( hs [ i ] + k < hs [ i + 1 ] ) : if ( m >= hs [ i + 1 ] - hs [ i ] - k ) : m -= hs [ i + 1 ] - hs [ i ] - k else : print ( ' NO ' ) break else : print ( ' YES ' ) NEW_LINE


import java . lang . * ; import java . util . * ; import java . util . stream . Collectors ; import java . io . * ;   public class absolute { public static void main ( String [ ] args ) {


import java . util . Arrays ; import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] f = new int [ n ] ; for ( int i = 0 ; i < f . length ; i ++ ) { f [ i ] = sc . nextInt ( ) ; } System . out . println ( solve ( f , k ) ) ;   sc . close ( ) ; }   static int solve ( int [ ] f , int k ) { int [ ] sorted = Arrays . stream ( f ) . boxed ( ) . sorted ( ) . mapToInt ( x -> x ) . toArray ( ) ;   int result = 0 ; for ( int i = f . length - 1 ; i >= 0 ; i -= k ) { result += ( sorted [ i ] - 1 ) * 2 ; } return result ; } }

a , b = map ( int , input ( ) . split ( ) ) z = list ( map ( int , input ( ) . split ( ) ) ) ; s = 0 for i in set ( z ) : r = z . count ( i ) ; s += 2 * ( i - 1 ) * ( r // b ) for j in range ( b * ( r // b ) ) : z . remove ( i ) z . sort ( reverse = True ) print ( s + sum ( 2 * ( i - 1 ) for i in z [ : : b ] ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) NEW_LINE


import mathn , k = map ( int , input ( ) . split ( ) ) p = list ( map ( int , input ( ) . split ( ) ) ) p . sort ( ) p . reverse ( ) ans = 0 for i in range ( math . ceil ( n / k ) ) : ans += 2 * ( p [ k * i ] - 1 ) print ( ans ) NEW_LINE


from sys import stdinfrom collections import defaultdictinput = stdin . readline NEW_LINE


import java . util . * ; import static java . lang . Math . * ; import java . io . * ;   public class SolutionB { public static void main ( String args [ ] ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; Arrays . sort ( a ) ; int ans = 0 ; int cnt = 0 ; for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( cnt % k == 0 ) { ans += ( ( a [ i ] - 1 ) * 2 ) ; } cnt ++ ; } System . out . println ( ans ) ; } }


import java . util . * ;   public class life { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , k = in . nextInt ( ) ; ArrayList < Integer > f = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) f . add ( in . nextInt ( ) ) ; Collections . sort ( f , Collections . reverseOrder ( ) ) ; int c = 0 ; for ( int i = 0 ; i < n ; i += k ) c += f . get ( i ) - 1 ; System . out . println ( 2 * c ) ; } }


import java . util . * ;   public class CodeForces1036B { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int q = input . nextInt ( ) ; for ( int i = 0 ; i < q ; i ++ ) { long n = input . nextLong ( ) ; long m = input . nextLong ( ) ; long k = input . nextLong ( ) ; long max = Math . max ( n , m ) ; long ans = 0 ; if ( max > k ) { ans = - 1 ; } else if ( n % 2 != m % 2 ) { ans = k - 1 ; } else if ( k % 2 == max % 2 ) { ans = k ; } else { ans = k - 2 ; }   System . out . println ( ans ) ; } } }

q = int ( input ( ) ) for _ in range ( q ) : n , m , k = map ( int , input ( ) . split ( ) ) if n > k or m > k : print ( - 1 ) continue ans = k if k % 2 == 0 : NEW_LINE


import sys , os , iodef rs ( ) : return sys . stdin . readline ( ) . rstrip ( ) def ri ( ) : return int ( sys . stdin . readline ( ) ) def ria ( ) : return list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) def ws ( s ) : sys . stdout . write ( s + ' \n ' ) def wi ( n ) : sys . stdout . write ( str ( n ) + ' \n ' ) def wia ( a ) : sys . stdout . write ( ' ▁ ' . join ( [ str ( x ) for x in a ] ) + ' \n ' ) import math , datetime , functools , itertools , operator , bisect , fractions , statisticsfrom collections import deque , defaultdict , OrderedDict , Counterfrom fractions import Fractionfrom decimal import Decimalfrom sys import stdoutfrom heapq import heappush , heappop , heapify , _heapify_max , _heappop_max , nsmallest , nlargest   def main ( ) : NEW_LINE


def solve ( n , m , k ) : n , m = max ( abs ( n ) , abs ( m ) ) , min ( abs ( n ) , abs ( m ) ) if ( n - m ) % 2 != 0 : k -= 1 n -= 1 elif ( n - k ) % 2 != 0 : n -= 1 m -= 1 k -= 2 if k < n : return - 1 else : return k     q = int ( input ( ) ) for case in range ( q ) : print ( solve ( * [ int ( x ) for x in input ( ) . split ( ' ▁ ' ) ] ) ) NEW_LINE


def solve ( n , m , k ) : if n < m : n , m = m , n if k < n : return - 1 if ( k - n ) % 2 == 1 : m -= 1 k -= 1 return k - ( n - m ) % 2   for _ in range ( int ( input ( ) ) ) : n , m , k = map ( int , input ( ) . split ( ) ) print ( solve ( n , m , k ) ) NEW_LINE


q = int ( input ( ) )   for i in range ( q ) : n , m , k = map ( int , input ( ) . split ( ) ) if ( n < m ) : n , m = m , n if ( n % 2 != m % 2 ) : k -= 1 n -= 1 elif ( n % 2 != k % 2 ) : k -= 2 n -= 1 m -= 1 print ( - 1 if k < n else k ) NEW_LINE


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


import java . util . Scanner ; public class test48 { private static long testCase48 ( long n , long m , long k ) { long max = Math . max ( n , m ) ; long x = 0 ; long min = Math . min ( n , m ) ; long dif = k - max ; if ( dif == 1 || dif % 2 != 0 ) { x = dif - 1 ; k += ( 1 - dif ) ; dif = x ; } else k -= dif ; if ( ( k % 2 != 0 && min % 2 == 0 ) || ( ( min == 1 || min % 2 != 0 ) && k % 2 == 0 ) ) max -= 1 ; return max + dif ; } public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; long t = input . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { long n = input . nextLong ( ) ; long m = input . nextLong ( ) ; long k = input . nextLong ( ) ; if ( n > k || m > k ) System . out . println ( " - 1" ) ; else if ( k == n && k == m ) System . out . println ( k ) ; else System . out . println ( testCase48 ( n , m , k ) ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . Random ; import java . util . Arrays ; import java . util . StringTokenizer ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Collections ;   public class A { public static void main ( String [ ] args ) { FastReader sc = new FastReader ( ) ; StringBuffer ans = new StringBuffer ( ) ; int test = sc . nextInt ( ) ; while ( test -- > 0 ) { long n = sc . nextLong ( ) , m = sc . nextLong ( ) , k = sc . nextLong ( ) ; long curx = 0 ; long cury = 0 ; long steps = 0 ; boolean flag = true ;