import sysn , m = ( list ( map ( int , input ( ) . split ( ) ) ) ) a = ( list ( map ( int , input ( ) . split ( ) ) ) ) b = ( list ( map ( int , input ( ) . split ( ) ) ) ) a . sort ( ) def findPos ( arr , l , r , x ) : m = 0 while l <= r : m = ( l + r ) // 2 if arr [ m ] <= x : l = m + 1 else : r = m - 1 return lans = [ ] for x in b : ans . append ( str ( findPos ( a , 0 , n - 1 , x ) ) ) print ( ' ▁ ' . join ( ans ) ) NEW_LINE


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

def answer ( n , m , a , b ) : a . sort ( ) ans = [ 0 ] * m tup_b = [ ( b [ i ] , i ) for i in range ( m ) ] tup_b . sort ( key = lambda t : t [ 0 ] ) NEW_LINE


import java . util . ArrayList ; import java . util . Scanner ;   public class InterestingDrink {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; ArrayList < Integer > inputA = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int x = sc . nextInt ( ) ; inputA . add ( x ) ; } inputA . sort ( ( e1 , e2 ) -> e1 . compareTo ( e2 ) ) ; for ( int i = 0 ; i < m ; i ++ ) { int x = sc . nextInt ( ) ; System . out . print ( calc ( inputA , x ) + " ▁ " ) ; } }   public static int calc ( ArrayList < Integer > input , int value ) { int answer = - 1 ; int l = 0 , r = input . size ( ) - 1 , mid ; while ( l <= r ) { mid = ( l + r ) / 2 ; if ( input . get ( mid ) <= value ) { answer = mid ; l = mid + 1 ; } else { r = mid - 1 ; } }   return answer + 1 ; } }

import sysimport bisectt , r = map ( int , sys . stdin . readline ( ) . split ( ) ) a , b = sorted ( [ int ( x ) for x in sys . stdin . readline ( ) . split ( ) ] ) , [ int ( x ) for x in sys . stdin . readline ( ) . split ( ) ] R = sorted ( a ) out = [ ] for x in b : out . append ( bisect . bisect ( R , x ) ) print ( * out ) NEW_LINE


import math , sys , bisect , heapq , osfrom collections import defaultdict , Counter , dequefrom itertools import groupby , accumulatefrom functools import lru_cache # sys . setrecursionlimit ( 200000000 ) int1 = lambda x : int ( x ) - 1d ef input ( ) : return sys . stdin . readline ( ) . rstrip ( ' \r \n ' ) # input = iter ( sys . stdin . buffer . read ( ) . decode ( ) . splitlines ( ) ) . __next__aj = lambda : list ( map ( int , input ( ) . split ( ) ) ) def list3d ( a , b , c , d ) : return [ [ [ d ] * c for j in range ( b ) ] for i in range ( a ) ] # MOD = 1000000000 + 7d ef Y ( c ) : print ( [ " NO " , " YES " ] [ c ] ) def y ( c ) : print ( [ " no " , " yes " ] [ c ] ) def Yy ( c ) : print ( [ " No " , " Yes " ] [ c ] )   def gcd ( a , b ) : if b == 0 : return a return gcd ( b , a % b )   def solve ( ) : n , = aj ( ) if n <= 2 : print ( n ) exit ( 0 ) a = n * ( n - 1 ) b = ( n - 1 ) * ( n - 2 ) ans = 0 # print ( a , b ) for i in range ( n - 2 , 0 , - 1 ) : if gcd ( i , a ) == 1 : ans = max ( ans , a * i ) if i <= n - 3 and gcd ( b , i ) == 1 : ans = max ( ans , b * i ) print ( ans ) try : # os . system ( " online _ judge . py " ) sys . stdin = open ( ' input . txt ' , ' r ' ) sys . stdout = open ( ' output . txt ' , ' w ' ) except : pass   solve ( )

import mathn = int ( input ( ) )   if n == 1 : print ( 1 ) elif n == 2 : print ( 2 ) elif n == 3 : print ( 6 ) else : if n % 2 != 0 : print ( n * ( n - 1 ) * ( n - 2 ) ) elif math . gcd ( n , n - 3 ) == 1 : print ( n * ( n - 1 ) * ( n - 3 ) ) else : print ( ( n - 1 ) * ( n - 2 ) * ( n - 3 ) ) NEW_LINE


import math , sys , bisect , heapq , osfrom 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


from math import gcdn = int ( input ( ) ) if ( n < 3 ) : print ( n ) else : if ( n % 2 == 1 ) : print ( n * ( n - 1 ) * ( n - 2 ) ) else : if ( gcd ( n , n - 3 ) == 1 ) : print ( n * ( n - 1 ) * ( n - 3 ) ) else : print ( ( n - 3 ) * ( n - 1 ) * ( n - 2 ) ) NEW_LINE


import java . util . * ; import java . lang . * ; import java . io . * ;   public class Codechef { public static long LCM ( long A , long B , long C ) { long temp = A * B / GCD ( A , B ) ; return temp * C / GCD ( temp , C ) ; } public static long GCD ( long A , long B ) { long a = Math . max ( A , B ) ; long b = Math . min ( A , B ) ; while ( true ) { if ( a % b == 0 ) return b ; long temp = a ; a = b ; b = temp % b ; } } public static void main ( String [ ] args ) throws java . lang . Exception { Scanner scan = new Scanner ( System . in ) ; long n = scan . nextLong ( ) ; if ( n < 3 ) System . out . println ( n ) ; else if ( n % 2 != 0 ) System . out . println ( LCM ( n , n - 1 , n - 2 ) ) ; else { if ( GCD ( n , n - 3 ) == 1 ) System . out . println ( LCM ( n , n - 1 , n - 3 ) ) ; else System . out . println ( LCM ( n - 1 , n - 2 , n - 3 ) ) ; } } }


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


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


import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . LinkedHashMap ; import java . util . Map ; import java . util . Scanner ; import java . util . * ; import java . util . stream . Collectors ;   public class absolute { static List < Integer > primes ; static int [ ] nextprime ; static void sieveOfEratosthenes ( ) { int n = 100004 ; boolean prime [ ] = new boolean [ n + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) prime [ i ] = true ; for ( int p = 2 ; p * p <= n ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * p ; i <= n ; i += p ) prime [ i ] = false ; } } int next = 2 , pos = 0 ; nextprime [ 0 ] = nextprime [ 1 ] = 2 ; for ( int i = n ; i >= 2 ; i -- ) { if ( prime [ i ] == true ) { nextprime [ i ] = i ; next = i ; } else { nextprime [ i ] = next ; } } } public static int binary ( int n ) { int st = 0 , end = primes . size ( ) - 1 , pos = - 1 ; while ( st <= end ) { int mid = st + ( end - st ) / 2 ; if ( primes . get ( mid ) > n ) { pos = mid ; end = mid - 1 ; } else st = mid + 1 ; }

import sysMAX_SIZE = 100001 isprime = [ True ] * MAX_SIZEprime = [ ] SPF = [ None ] * ( MAX_SIZE ) d = dict ( ) def manipulated_seive ( N ) : isprime [ 0 ] = isprime [ 1 ] = False for i in range ( 2 , N ) : if isprime [ i ] == True : prime . append ( i ) d . setdefault ( i , 1 ) SPF [ i ] = i j = 0 while ( j < len ( prime ) and i * prime [ j ] < N and prime [ j ] <= SPF [ i ] ) : isprime [ i * prime [ j ] ] = False d . setdefault ( i * prime [ j ] , 0 ) SPF [ i * prime [ j ] ] = prime [ j ] j += 1 if __name__ == ' _ _ main _ _ ' : manipulated_seive ( 100001 ) d . setdefault ( 1 , 0 ) prev = 100003 for i in range ( 100000 , 0 , - 1 ) : if d [ i ] == 0 : d [ i ] = prev else : d [ i ] = i prev = i   ans = sys . maxsize n , m = map ( int , input ( ) . split ( ) ) l = [ ] for i in range ( n ) : l . append ( list ( map ( int , input ( ) . split ( ) ) ) ) for i in range ( n ) : c = 0 for j in range ( m ) : c += ( d [ l [ i ] [ j ] ] - l [ i ] [ j ] ) ans = min ( c , ans ) for j in range ( m ) : c = 0 for i in range ( n ) : c += ( d [ l [ i ] [ j ] ] - l [ i ] [ j ] ) ans = min ( c , ans ) print ( ans ) NEW_LINE


import mathn , m = map ( int , input ( ) . rstrip ( ) . split ( ) ) row = [ 0 ] * ncol = [ 0 ] * mdef isPrime ( x ) : if x in [ 2 , 3 , 5 , 7 , 11 , 13 , 17 , 19 ] : return True if x == 1 : return False for i in range ( 2 , int ( math . sqrt ( x ) ) + 2 ) : if x % i == 0 : return False return Trueprimes = [ 0 ] * 100011 for i in range ( 1 , 100011 ) : if isPrime ( i ) : primes [ i ] = 1 for i in range ( n ) : li = list ( map ( int , input ( ) . rstrip ( ) . split ( ) ) ) for j in range ( m ) : x = li [ j ] while primes [ x ] != 1 : x += 1 row [ i ] += x - li [ j ] col [ j ] += x - li [ j ] minm = min ( row + col ) print ( minm ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) matrix = [ [ * map ( int , input ( ) . split ( ) ) ] for _ in range ( n ) ]   MAX_ELEM = int ( 2e5 )   def sieve ( ) : prime = [ 1 ] * MAX_ELEM i = 2 while i * i < MAX_ELEM : if prime [ i ] : j = 2 while i * j < MAX_ELEM : prime [ i * j ] = False j += 1 i += 1 prime [ 0 ] = prime [ 1 ] = False nxtPrime = [ 0 ] * MAX_ELEM cur = - 1 for i in range ( MAX_ELEM - 1 , - 1 , - 1 ) : if prime [ i ] : cur = i nxtPrime [ i ] = cur return nxtPrime   nxtPrime = sieve ( )   ans = int ( 1e9 )   for i in range ( n ) : res = 0 for k in range ( m ) : res += nxtPrime [ matrix [ i ] [ k ] ] - matrix [ i ] [ k ] ans = min ( ans , res )   for j in range ( m ) : res = 0 for k in range ( n ) : res += nxtPrime [ matrix [ k ] [ j ] ] - matrix [ k ] [ j ] ans = min ( ans , res )   print ( ans )     NEW_LINE


import java . util . ArrayList ; import java . util . Scanner ;   public class PrimeMatrix {   private static ArrayList < Integer > primes ; public static void main ( String [ ] args ) { Boolean [ ] PrimeGetter = new Boolean [ 100004 ] ; primes = new ArrayList < > ( ) ;   for ( int i = 2 ; i < 100004 ; i ++ ) { if ( PrimeGetter [ i ] == null ) { for ( int j = 2 * i ; j < 100004 ; j += i ) { PrimeGetter [ j ] = false ; }   primes . add ( i ) ; } }   Scanner scanner = new Scanner ( System . in ) ;   int n = scanner . nextInt ( ) ; int m = scanner . nextInt ( ) ;   long [ ] row = new long [ n ] ; long [ ] col = new long [ m ] ;   for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { int x = scanner . nextInt ( ) ;   int diff = primes . get ( search ( x ) ) - x ;   row [ i ] += diff ; col [ j ] += diff ; } }   long min = row [ 0 ] ;   for ( int i = 1 ; i < n ; i ++ ) min = Math . min ( min , row [ i ] ) ; for ( int i = 0 ; i < m ; i ++ ) min = Math . min ( min , col [ i ] ) ;   System . out . println ( min ) ; }   private static int search ( int x ) { int first = 0 , last = primes . size ( ) - 1 ; int result = - 1 ;   while ( first <= last ) { int mid = ( first + last ) / 2 ;   if ( x <= primes . get ( mid ) ) { result = mid ; last = mid - 1 ; } else first = mid + 1 ; }   return result ; } }


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

n , xs , ys = map ( int , input ( ) . split ( ) ) s = input ( ) for x in range ( n // xs + 1 ) : if ( n - x * xs ) % ys == 0 : y = ( n - x * xs ) // ys print ( x + y ) for i in range ( x ) : print ( s [ i * xs : ( i + 1 ) * xs ] ) s = s [ x * xs : len ( s ) ] for j in range ( y ) : print ( s [ j * ys : ( j + 1 ) * ys ] ) exit ( ) print ( - 1 )       NEW_LINE


from math import ceil     n , p , q = map ( int , input ( ) . split ( ) ) s = input ( )   if p == n or q == n : print ( f ' 1 \n { s } ' ) else : if p > q : p , q = q , p   P = ceil ( n / p ) Q = ceil ( n / q ) cnts = [ - 1 , - 1 ] i = P while i >= 0 : _sum = p * i j = 0 while j <= Q and _sum < n : _sum += q j += 1   if _sum == n : cnts = [ i , j ] break   i -= 1   if _sum == n : cnts = [ i , j ] if cnts [ 0 ] == - 1 : print ( - 1 ) else : print ( sum ( cnts ) ) _i = 0 for i in range ( cnts [ 0 ] ) : print ( s [ _i : _i + p ] ) _i += p for j in range ( cnts [ 1 ] ) : print ( s [ _i : _i + q ] ) _i += q NEW_LINE


try : import re   def cg ( string , length ) : return re . findall ( ' . { % d } ' % length , string ) n , p , q = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) s = input ( ) u = 0 if len ( s ) % p == 0 : u = 1 elif len ( s ) % q == 0 : u = 2 else : u = 3 if u == 1 : print ( n // p ) k = cg ( s , p ) for i in k : print ( i ) elif u == 2 : print ( n // q ) k = cg ( s , q ) for i in k : print ( i ) elif u == 3 : flag = 0 for i in range ( 1 , n ) : for j in range ( 1 , n ) : if p * i + q * j == n : op = [ i , j ] flag = 1 break if flag == 1 : print ( sum ( op ) ) u = cg ( s [ 0 : p * op [ 0 ] ] , p ) v = cg ( s [ p * op [ 0 ] : ] , q ) ko = ( u + v ) for i in ko : print ( i ) else : print ( - 1 ) except : pass NEW_LINE


def yo ( ma , mi , n , s ) : main1 = n // ma main2 = n // mi flag = 0   for i in range ( main1 , - 1 , - 1 ) : for j in range ( 0 , main2 + 1 ) : NEW_LINE


sn = list ( map ( int , input ( ) . split ( ) ) ) n = sn [ 0 ] p = sn [ 1 ] q = sn [ 2 ]   s = input ( )   lim = 0 flag = Falseflag2 = Falsestrings = [ ] while ( lim <= n ) : if ( ( n - lim ) % p == 0 ) : flag = True break elif ( ( n - lim ) % q == 0 ) : flag = True break lim += p   lim = 0 if ( flag ) : NEW_LINE


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


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; import java . util . TreeSet ;   public class Main {    public static void main ( String [ ] args ) throws IOException { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) , p = s . nextInt ( ) , q = s . nextInt ( ) ; String word = s . next ( ) ;   boolean flag = false ;    for ( int i = 0 ; i <= n ; i ++ ) { int pp = i ; int qq = ( n - ( pp * Math . min ( p , q ) ) ) / Math . max ( p , q ) ;   if ( pp >= 0 && qq >= 0 && ( pp * p ) + ( qq * q ) == n ) { flag = true ;   System . out . println ( pp + qq ) ;


import java . util . * ;   public class Main {   static int countp = 0 ; static int countq = 0 ;   public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int a [ ] = new int [ 2 ] ; a [ 0 ] = input . nextInt ( ) ; a [ 1 ] = input . nextInt ( ) ; String s = input . next ( ) ; if ( s . length ( ) % a [ 0 ] == 0 ) { countp = s . length ( ) / a [ 0 ] ; } else if ( s . length ( ) % a [ 1 ] == 0 ) { countq = s . length ( ) / a [ 1 ] ;   } else { for ( int i = 0 ; i <= 100 ; i ++ ) { if ( ( s . length ( ) - ( a [ 0 ] * i ) ) % a [ 1 ] == 0 && ( ( s . length ( ) - ( a [ 0 ] * i ) ) / a [ 1 ] ) >= 0 ) { countp = i ; countq = ( s . length ( ) - ( a [ 0 ] * i ) ) / a [ 1 ] ; break ; } } } int start = 0 ; if ( countp == 0 && countq == 0 ) { System . out . println ( " - 1" ) ; } else { System . out . println ( countp + countq ) ; while ( countp -- > 0 ) { System . out . println ( s . substring ( start , start + a [ 0 ] ) ) ; start = start + a [ 0 ] ; } while ( countq -- > 0 ) { System . out . println ( s . substring ( start , start + a [ 1 ] ) ) ; start += a [ 1 ] ; } } }   }


import java . util . * ; public class MyClass { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; ArrayList < Integer > a = new ArrayList < Integer > ( ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; int p = 0 , s = 0 , c = 0 ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = sc . nextInt ( ) ; int [ ] e = arr . clone ( ) ; Arrays . sort ( arr ) ; int start = 0 , end = n - 1 ; while ( start <= end ) { int temp = arr [ start ] ; arr [ start ] = arr [ end ] ; arr [ end ] = temp ; start ++ ; end -- ; } while ( p < n ) { for ( int i = 0 ; i < n ; i ++ ) { int k = arr [ p ] ; if ( k == e [ i ] ) { e [ i ] = - 1 ; a . add ( i + 1 ) ; p ++ ; if ( i == 0 ) s = s + 1 ; else s = s + ( arr [ i ] * i ) + 1 ; break ; } } } System . out . println ( s ) ; for ( int i : a ) System . out . print ( i + " ▁ " ) ; } }

if __name__ == " _ _ main _ _ " : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) dic = { } s = set ( a ) ans = [ ] for i in range ( n ) : dic . setdefault ( a [ i ] , [ ] ) dic [ a [ i ] ] . append ( i + 1 ) a . sort ( reverse = True ) sum = 0 for i in range ( n ) : num = dic [ a [ i ] ] [ 0 ] sum = sum + ( ( a [ i ] * i ) + 1 ) ans . append ( num ) dic [ a [ i ] ] . remove ( num ) print ( sum ) print ( * ans )     NEW_LINE


n = int ( input ( ) )   daf = list ( map ( int , input ( ) . split ( ) ) ) mul = [ x for x in range ( n ) ] has = 0 daf2 = sorted ( daf , reverse = True ) daf_has = [ ]   for i in range ( n ) : x = daf2 [ i ] y = daf . index ( x ) daf_has . append ( str ( y + 1 ) ) daf [ y ] = 0 has += daf2 [ i ] * mul [ i ] has += nprint ( has ) print ( ' ▁ ' . join ( daf_has ) ) NEW_LINE


n = int ( input ( ) ) s = list ( map ( int , input ( ) . split ( ) ) ) a = sorted ( s , reverse = True ) sum_a = sum ( [ a [ x ] * x + 1 for x in range ( 0 , n ) ] ) print ( sum_a ) i = 0 while i < n : print ( s . index ( a [ i ] ) + 1 , end = " ▁ " ) s [ s . index ( a [ i ] ) ] = 0 i += 1 NEW_LINE


''' a = [ int ( i ) ▁ for ▁ i ▁ in ▁ input ( ) . split ( ) ] x = a [ 0 ] y = a [ 1 ] z = a [ 2 ] if ▁ y = = x ▁ and ▁ z = = 0 : ▁ ▁ ▁ ▁ print ( '0 ' ) elif ▁ x > y + z : ▁ ▁ ▁ ▁ print ( ' + ' ) elif ▁ y > x + z : ▁ ▁ ▁ ▁ print ( ' - ' ) else : ▁ ▁ ▁ ▁ print ( ' ? ' ) ''' n = int ( input ( ) ) z = [ int ( i ) for i in input ( ) . split ( ) ] x = [ ] d = 0 v = ' ' for i in range ( n ) : c = 0 e = 0 for f in range ( len ( z ) ) : if z [ f ] > c and f + 1 not in x : c = z [ f ] e = f + 1 d += ( i * c ) + 1 x . append ( e ) print ( d ) for i in x : v += str ( i ) v += ' ▁ ' print ( v ) NEW_LINE


import java . util . * ;   public class B { public static < K , V > K getKey ( Map < K , V > map , V value ) { for ( Map . Entry < K , V > entry : map . entrySet ( ) ) { if ( value . equals ( entry . getValue ( ) ) ) { return entry . getKey ( ) ; } } return null ; }   public static final class Pair { public int first ; public int second ; public Pair ( int first , int second ) { this . first = first + 1 ; this . second = second ; }


import java . util . * ;   public class B { public static < K , V > K getKey ( Map < K , V > map , V value ) { for ( Map . Entry < K , V > entry : map . entrySet ( ) ) { if ( value . equals ( entry . getValue ( ) ) ) { return entry . getKey ( ) ; } } return null ; }   public static final class Pair implements Comparable < Pair > { public int first ; public int second ; public Pair ( int first , int second ) { this . first = first + 1 ; this . second = second ; }   public int compareTo ( Pair o ) { return Integer . compare ( o . second , second ) ; }


import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { PrintWriter out ; FastReader sc ; long mod = ( long ) ( 1e9 + 7 ) ; long maxlong = Long . MAX_VALUE ; long minlong = Long . MIN_VALUE ; public void sol ( ) { int n = ni ( ) ; int [ ] [ ] ar = new int [ n ] [ 2 ] ; for ( int i = 0 ; i < n ; i ++ ) { ar [ i ] [ 0 ] = ni ( ) ; ar [ i ] [ 1 ] = i ; } Arrays . sort ( ar , new Comparator < int [ ] > ( ) { public int compare ( int [ ] a , int [ ] b ) { return Integer . compare ( b [ 0 ] , a [ 0 ] ) ; } } ) ; StringBuilder sb = new StringBuilder ( ) ; long ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { ans += ( ar [ i ] [ 0 ] * 1l * ( i ) ) + 1 ; sb . append ( ar [ i ] [ 1 ] + 1 + " ▁ " ) ; } pl ( ans ) ; pl ( sb ) ; } public static void main ( String [ ] args ) { Main g = new Main ( ) ; g . out = new PrintWriter ( System . out ) ; g . sc = new FastReader ( ) ; int t = 1 ;


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

[ w , h ] = [ int ( x ) for x in input ( ) . split ( ) ]   image = [ ]   for i in range ( h ) : image . append ( input ( ) )     for x in range ( w * 2 ) : for y in range ( h * 2 ) : final_x = int ( y / 2 ) final_y = int ( x / 2 ) NEW_LINE


w , h = map ( int , input ( ) . split ( ) ) l = [ ] for i in range ( h ) : s = input ( ) l . append ( s ) for i in range ( w ) : s = ' ' for j in range ( h - 1 , - 1 , - 1 ) : s += l [ j ] [ i ] * 2 s = s [ : : - 1 ] print ( s ) print ( s ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Main { public static void main ( String [ ] args ) { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; try { StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int col = Integer . parseInt ( st . nextToken ( ) ) ; int row = Integer . parseInt ( st . nextToken ( ) ) ; char [ ] [ ] arr = new char [ row ] [ col ] ; for ( int i = 0 ; i < row ; i ++ ) { String line = br . readLine ( ) ; arr [ i ] = line . toCharArray ( ) ; } for ( int j = 0 ; j < col ; j ++ ) { String nl = " " ; for ( int i = 0 ; i < row ; i ++ ) { nl = nl + arr [ i ] [ j ] + arr [ i ] [ j ] ; } System . out . println ( nl ) ; System . out . println ( nl ) ; } } catch ( IOException e ) { } } }


import java . util . * ; import java . lang . * ; import java . io . * ; import java . math . * ;    public class file {

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


n = int ( input ( ) )   if n % 2 : print ( " YES " ) ls = [ 0 ] * 2 * n c = 1 i = - 1 while c <= 2 * n : i = i + 1 ls [ i ] = c i = ( i + n ) % ( 2 * n ) ls [ i ] = c + 1 c = c + 2 print ( * ls ) else : print ( " NO " ) NEW_LINE


n = int ( input ( ) ) if n & 1 : NEW_LINE


n = int ( input ( ) ) lst = [ 0 ] * ( 2 * n ) f = 0 lst [ 0 ] = 1 ind = 0 for i in range ( 2 , ( 2 * n ) + 1 ) : if f == 0 : ind = ( ind + n ) % ( 2 * n ) lst [ ind ] = i f = 1 else : ind -= 1 lst [ ind ] = i f = 0   if n % 2 : print ( " YES " ) print ( * lst ) else : print ( " NO " ) NEW_LINE


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


import java . util . * ; import java . lang . * ; import java . io . * ;   public class Codechef { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = sc . nextInt ( ) ; if ( n % 2 == 0 ) { out . println ( " NO " ) ; out . close ( ) ; return ; } out . println ( " YES " ) ; StringBuilder f = new StringBuilder ( ) ; StringBuilder s = new StringBuilder ( ) ; int k = 1 ; boolean flag = true ; while ( k + 1 <= 2 * n ) { if ( flag ) { f . append ( k + " ▁ " ) ; s . append ( ( k + 1 ) + " ▁ " ) ; k += 2 ; } else { f . append ( ( k + 1 ) + " ▁ " ) ; s . append ( k + " ▁ " ) ; k += 2 ; } flag = ! flag ; } out . println ( f . toString ( ) + s . toString ( ) ) ; out . close ( ) ; } }


import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; if ( n % 2 == 0 ) { System . out . println ( " NO " ) ; } else { System . out . println ( " YES " ) ; int arr [ ] = new int [ 2 * n ] ; int k = 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( i % 2 == 0 ) { arr [ i ] = k ; arr [ i + n ] = k + 1 ; } else { arr [ i ] = k + 1 ; arr [ i + n ] = k ; } k = k + 2 ; } for ( int i = 0 ; i < 2 * n ; i ++ ) { System . out . print ( arr [ i ] + " ▁ " ) ; } } } }


import java . io . * ; import java . util . * ;   public class GFG { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ;

import sys   def main ( ) : n = int ( sys . stdin . read ( ) . strip ( ) ) d = { 1 : '0 ▁ A ' , 3 : '2 ▁ A ' , 2 : '1 ▁ B ' , 0 : '1 ▁ A ' } return d [ n % 4 ]   print ( main ( ) ) NEW_LINE


s = int ( input ( ) ) g = s % 4 if g == 1 : print ( "0 ▁ A " ) if g == 2 : print ( "1 ▁ B " ) if g == 0 : print ( "1 ▁ A " ) if g == 3 : print ( "2 ▁ A " ) NEW_LINE


print ( [ '1 ▁ A ' , '0 ▁ A ' , '1 ▁ B ' , '2 ▁ A ' ] [ int ( input ( ) ) % 4 ] ) NEW_LINE


x = int ( input ( ) ) if ( x % 4 == 1 ) : print ( "0 ▁ A " ) elif ( x % 4 == 0 ) : print ( "1 ▁ A " ) elif ( x % 4 == 2 ) : print ( "1 ▁ B " ) else : print ( "2 ▁ A " ) NEW_LINE


import java . io . * ; import java . util . * ; import java . math . * ; public class Maths { static final Random random = new Random ( ) ; static PrintWriter out = new PrintWriter ( ( System . out ) ) ; static Reader sc = new Reader ( ) ; public static void main ( String args [ ] ) throws IOException {


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


import java . util . * ; public class problem { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; if ( x % 4 == 1 ) { System . out . println ( "0" + " ▁ A " ) ; } else if ( x % 4 == 3 ) { System . out . println ( "2" + " ▁ A " ) ; } else if ( x % 4 == 2 ) { System . out . println ( "1" + " ▁ B " ) ; } else { System . out . println ( "1" + " ▁ A " ) ; } } }


import java . util . * ; public class P2 {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int c = 1 ; int k = 2 ; System . out . print ( 2 + " ▁ " ) ; for ( int i = 0 ; i < n - 2 ; i ++ ) { c ++ ; k += c ; if ( k % n == 0 ) { System . out . print ( n + " ▁ " ) ; } else System . out . print ( k % n + " ▁ " ) ; } } }

n = int ( input ( ) ) s = 1 result = [ ] t = 1 for i in range ( 1 , n ) : t += s if t > n : t -= n result . append ( t ) s += 1 print ( * result ) NEW_LINE


n = int ( input ( ) )   arr = [ i for i in range ( 1 , n + 1 ) ] * 100   ans = [ ] i = 1j = 1 while n > 1 : ans . append ( arr [ i ] ) i += j + 1 j += 1 n -= 1   print ( * ans ) NEW_LINE


n = int ( input ( ) )   x = 0   for i in range ( 1 , n ) : x = ( x + i ) % n print ( x + 1 , end = ' ▁ ' ) NEW_LINE


n = int ( input ( ) ) a = 0 b = [ ] for i in range ( 1 , n ) : a = ( a + i ) % n b . append ( a + 1 ) print ( * b ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . * ;   public class Main {   public static void main ( String [ ] args ) throws IOException { FastScanner input = new FastScanner ( ) ; int n = input . nextInt ( ) ; StringBuilder ans = new StringBuilder ( ) ; int current = 1 ; for ( int i = 1 ; i < n ; i ++ ) { current += i ; if ( current != n ) { ans . append ( current % n + " ▁ " ) ; current = current % ( n ) ; } else { ans . append ( current + " ▁ " ) ; } } System . out . println ( ans ) ; }   static class FastScanner {   BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) {   return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } }   }


import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int total = n - 1 ; int ans = 1 ; for ( int i = 1 ; i <= total ; i ++ ) { ans += i ; if ( ans > n ) { ans = ans % n ; } if ( i == total ) { System . out . print ( ans ) ; } else { System . out . print ( ans + " ▁ " ) ; } } System . out . println ( ) ; scan . close ( ) ; }   }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; public class C { static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   int [ ] nextArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } } static class FastWriter extends PrintWriter { FastWriter ( ) { super ( System . out ) ; }   void println ( int [ ] array ) { for ( int i = 0 ; i < array . length ; i ++ ) { print ( array [ i ] + " ▁ " ) ; } println ( ) ; }   void println ( long [ ] array ) { for ( int i = 0 ; i < array . length ; i ++ ) { print ( array [ i ] + " ▁ " ) ; } println ( ) ; } } public static void main ( String [ ] args ) {


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . io . PrintWriter ; import java . io . StreamTokenizer ; import java . util . Arrays ;   public class Main { public static void main ( String [ ] args ) throws IOException { StreamTokenizer st = new StreamTokenizer ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; PrintWriter pw = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ; int MOD = 1000000007 ; st . nextToken ( ) ; int n = ( int ) st . nval ; st . nextToken ( ) ; int k = ( int ) st . nval ; int [ ] dp = new int [ n + 1 ] ; int [ ] tmp = new int [ n + 1 ] ; Arrays . fill ( dp , 1 ) ; for ( int i = 2 ; i <= k ; i ++ ) { Arrays . fill ( tmp , 0 ) ; for ( int j = 1 ; j <= n ; j ++ ) { for ( int t = 1 ; t * j <= n ; t ++ ) { tmp [ t * j ] = ( tmp [ t * j ] + dp [ j ] ) % MOD ; } } for ( int j = 1 ; j <= n ; j ++ ) { dp [ j ] = tmp [ j ] ; } } int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { ans = ( ans + dp [ i ] ) % MOD ; } pw . print ( ans % MOD ) ; pw . flush ( ) ; }   }

n , k = map ( int , input ( ) . split ( ) ) mod = 10 ** 9 + 7 l = [ [ ] for i in range ( 2 * 10 ** 3 + 1 ) ] for i in range ( 1 , 2 * 10 ** 3 + 1 ) : for j in range ( 1 , i + 1 ) : if i % j == 0 : l [ i ] . append ( j ) dp = [ [ 0 ] * ( n + 1 ) for i in range ( k + 1 ) ] for i in range ( 1 , n + 1 ) : dp [ 1 ] [ i ] = 1 for i in range ( 2 , k + 1 ) : for j in range ( 1 , n + 1 ) : for x in l [ j ] : dp [ i ] [ j ] += dp [ i - 1 ] [ j // x ] dp [ i ] [ j ] %= modprint ( sum ( dp [ - 1 ] ) % mod ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ;   import java . util . * ; import javafx . util . Pair ;   public class Main { static long mod = ( long ) ( 1e9 + 7 ) ; public static void main ( String args [ ] ) { FastScanner input = new FastScanner ( ) ; int n = input . nextInt ( ) ; int size = input . nextInt ( ) ; int len = Math . max ( n , size ) + 1 ; long dp [ ] [ ] = new long [ len ] [ len ] ; for ( int i = 1 ; i <= n ; i + + ) { dp [ 1 ] [ i ] = 1 ; } for ( int i = 1 ; i < len ; i + + ) { for ( int j = 1 ; j < len ; j + + ) { for ( int k = j ; k < len ; k += j ) { dp [ i ] [ k ] = ( dp [ i ] [ k ] + dp [ i - 1 ] [ j ] ) % mod ; } } } long ans = 0 ; for ( int i = 1 ; i <= n ; i + + ) { ans += ( dp [ size ] [ i ] ) ; ans = ans % mod ; } System . out . println ( ans ) ; }   static class FastScanner {   BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) {   return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) throws IOException { return br . readLine ( ) ; } }   } NEW_LINE


import java . util . Arrays ; import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int MOD = 1000000007 ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; sc . close ( ) ; int [ ] dp = new int [ n + 1 ] ; int [ ] tmp = new int [ n + 1 ] ; Arrays . fill ( dp , 1 ) ; for ( int i = 2 ; i <= k ; i ++ ) { Arrays . fill ( tmp , 0 ) ; for ( int j = 1 ; j <= n ; j ++ ) { for ( int t = 1 ; t * j <= n ; t ++ ) { tmp [ t * j ] = ( tmp [ t * j ] + dp [ j ] ) % MOD ; } } for ( int j = 1 ; j <= n ; j ++ ) { dp [ j ] = tmp [ j ] ; } } int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { ans = ( ans + dp [ i ] ) % MOD ; } System . out . println ( ans % MOD ) ; }   }


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


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ;   import java . util . * ; import javafx . util . Pair ;   public class Main { static long mod = ( long ) ( 1e9 + 7 ) ; public static void main ( String args [ ] ) { FastScanner input = new FastScanner ( ) ; int n = input . nextInt ( ) ; int size = input . nextInt ( ) ; int len = Math . max ( n , size ) + 1 ; long dp [ ] [ ] = new long [ len ] [ len ] ; for ( int i = 1 ; i <= n ; i ++ ) { dp [ 1 ] [ i ] = 1 ; } for ( int i = 1 ; i < len ; i ++ ) { for ( int j = 1 ; j < len ; j ++ ) { for ( int k = j ; k < len ; k += j ) { dp [ i ] [ k ] = ( dp [ i ] [ k ] + dp [ i - 1 ] [ j ] ) % mod ; } } } long ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { ans += ( dp [ size ] [ i ] ) ; ans = ans % mod ; } System . out . println ( ans ) ; }   static class FastScanner {   BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) {   return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) throws IOException { return br . readLine ( ) ; } }   }


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 A803 {   public static void main ( String args [ ] ) {   FastReader in = new FastReader ( ) ; PrintWriter pr = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; int tc = 1 ;

n , k = list ( map ( int , input ( ) . split ( ) ) ) ans = Noneif ( k > n ** 2 ) : print ( - 1 ) elif ( k == n ** 2 ) : ans = [ [ 1 ] * n for arr in range ( n ) ] for i in range ( n ) : print ( " ▁ " . join ( j for j in map ( str , ans [ i ] ) ) ) elif ( k == 0 ) : ans = [ [ 0 ] * n for arr in range ( n ) ] for i in range ( n ) : print ( " ▁ " . join ( j for j in map ( str , ans [ i ] ) ) ) else : ans = [ [ 0 ] * n for arr in range ( n ) ] for i in range ( n - 1 , 0 , - 1 ) : loc = n - i - 1 k -= 1 ans [ loc ] [ loc ] = 1 if ( k >= 2 * i ) : for j in range ( loc + 1 , n ) : ans [ loc ] [ j ] = ans [ j ] [ loc ] = 1 if ( k == 2 * i ) : break k -= 2 * i else : if ( k % 2 == 1 ) : ans [ loc + 1 ] [ loc + 1 ] = 1 k -= 1 for j in range ( loc + 1 , loc + 1 + ( k // 2 ) ) : ans [ loc ] [ j ] = ans [ j ] [ loc ] = 1 break for i in range ( n ) : print ( " ▁ " . join ( j for j in map ( str , ans [ i ] ) ) ) NEW_LINE


def maximal_binary_matrix ( n , k ) : matrix = [ [ 0 ] * n for _ in range ( n ) ] for i in range ( n ) : for j in range ( i , n ) : if i == j and k >= 1 : matrix [ i ] [ j ] = 1 k -= 1 elif k >= 2 : matrix [ i ] [ j ] = 1 matrix [ j ] [ i ] = 1 k -= 2 return matrix if k == 0 else None     n , k = map ( int , input ( ) . split ( ) ) m = maximal_binary_matrix ( n , k ) if m : for row in m : print ( * row ) else : print ( - 1 ) NEW_LINE


import sysinput = sys . stdin . readline   '''   '''   def pprint ( mat ) : for r in mat : print ( " ▁ " . join ( r ) )   n , k = map ( int , input ( ) . split ( ) ) mat = [ [ "0" ] * n for _ in range ( n ) ] N = n   if n ** 2 < k : print ( - 1 ) sys . exit ( ) else : num_cells = 2 * n - 1 rc = 0 while num_cells > 0 and num_cells <= k : for x in range ( rc , N ) : mat [ x ] [ rc ] = "1" mat [ rc ] [ x ] = "1"   rc += 1 k -= num_cells n -= 1 num_cells = 2 * n - 1   if k == 0 : pprint ( mat ) sys . exit ( ) elif k % 2 == 0 : mat [ rc + 1 ] [ rc + 1 ] = "1" k -= 1   for x in range ( rc , rc + k // 2 + 1 ) : mat [ x ] [ rc ] = "1" mat [ rc ] [ x ] = "1"   pprint ( mat ) NEW_LINE


import java . util . Scanner ;   public class A1358 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ;   int t = scanner . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = scanner . nextInt ( ) ; int m = scanner . nextInt ( ) ; int exp = n * m ; if ( exp % 2 == 0 ) { System . out . println ( exp / 2 ) ; } else { System . out . println ( ( exp + 1 ) / 2 ) ; } } } }

t = int ( input ( ) ) for j in range ( t ) : a , b = map ( int , input ( ) . split ( ) ) print ( ( a * b + 1 ) // 2 ) NEW_LINE


import mathfor _ in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) ) print ( math . ceil ( n * m / 2 ) ) NEW_LINE


t = int ( input ( ' ' ) ) for i in range ( t ) : n , m = map ( int , input ( ' ' ) . split ( ) ) if ( n * m % 2 == 0 ) : print ( int ( ( n * m ) / 2 ) ) else : print ( int ( ( ( n * m ) + 1 ) / 2 ) ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) ) if m % 2 : print ( m // 2 * n + n // 2 + n % 2 ) else : print ( m // 2 * n ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) ) if ( n * m % 2 == 0 ) : print ( n * m // 2 ) else : print ( ( n * m - 1 ) // 2 + 1 ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; import java . util . Arrays ; import java . util . HashMap ; import java . util . HashSet ; import java . util . LinkedList ; import java . util . List ; import java . util . Map ; import java . util . Set ;   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 sc = new FastReader ( ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; System . out . println ( ( n * m ) % 2 == 0 ? ( n * m ) / 2 : ( n * m ) / 2 + 1 ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ;   public class CF1358A { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int t = Integer . parseInt ( br . readLine ( ) ) ; while ( t -- > 0 ) { int [ ] a = Arrays . stream ( br . readLine ( ) . split ( " \\ s + " ) ) . mapToInt ( Integer :: parseInt ) . toArray ( ) ; System . out . println ( ( a [ 0 ] * a [ 1 ] + 1 ) / 2 ) ; } } }


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

import sysn = int ( input ( ) ) A = list ( map ( int , input ( ) . split ( ) ) ) minn = sys . maxsizeindex = 0 count = 0 for i in range ( n ) : if A [ i ] < minn : minn = A [ i ] index = i count = 1 elif A [ i ] == minn : count += 1 if count == 1 : print ( index + 1 ) else : print ( " Still ▁ Rozdil " ) NEW_LINE


from sys import stdinfrom bisect import bisect_right as br   input = stdin . readline   n = int ( input ( ) ) lst = list ( map ( int , input ( ) . strip ( ) . split ( ) ) ) arr = sorted ( lst ) ind = br ( arr , arr [ 0 ] ) - 1 if ind == 0 : print ( lst . index ( arr [ 0 ] ) + 1 ) else : print ( ' Still ▁ Rozdil ' ) NEW_LINE


num = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) mn = min ( arr ) if arr . count ( mn ) > 1 : print ( " Still ▁ Rozdil " ) else : print ( arr . index ( mn ) + 1 )     NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) x = min ( a ) if a . count ( x ) > 1 : print ( ' Still ▁ Rozdil ' ) else : print ( a . index ( x ) + 1 ) NEW_LINE


n = int ( input ( ) ) min_idx = - 1 min_dist = float ( " inf " )   for idx , d in enumerate ( map ( int , input ( ) . split ( ) ) ) : if d == min_dist : min_idx = - 1 elif d < min_dist : min_idx = idx + 1 min_dist = min ( min_dist , d )   if min_idx >= 0 : print ( min_idx ) else : print ( " Still ▁ Rozdil " ) NEW_LINE


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


import java . util . Scanner ; import java . util . * ;    public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int min = Integer . MAX_VALUE ; int count = 1 ; int index = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { int r = scan . nextInt ( ) ; if ( r < min ) { index = i ; min = r ; count = 1 ; } else if ( r == min ) { count ++ ; } } if ( count > 1 ) { System . out . print ( " Still ▁ Rozdil " ) ; } else { System . out . print ( index + 1 ) ; } scan . close ( ) ; } }


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


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Random ; import java . util . StringTokenizer ;   public class Main implements Runnable {   long INF = ( long ) 1e9 + 9 ;   private void solve ( ) throws IOException {

import mathdef binpow ( a , b , m ) : a %= m res = int ( 1 ) while b > 0 : if b & 1 : res = ( res * a ) % m a = ( a * a ) % m b >>= 1 return res   def inv ( a , m : int = 1000000009 ) : return binpow ( a , m - 2 , m )   m = int ( 1000000009 )   n , a , b , k = input ( ) . split ( ) n = int ( n ) ; a = int ( a ) ; b = int ( b ) ; k = int ( k ) st = input ( ) res = int ( 1 ) p = int ( ( b * inv ( a , m ) ) % m ) itr = ( n + 1 ) // kmul1 = 0 for i in range ( len ( st ) ) : if st [ i ] == ' + ' : mul1 = ( mul1 + binpow ( p , i , m ) ) % m else : mul1 = ( mul1 - binpow ( p , i , m ) ) % mif binpow ( p , k , m ) == 1 : mul2 = itr % melse : mul2 = ( ( binpow ( p , k * itr , m ) - 1 ) * inv ( ( binpow ( p , k , m ) - 1 ) % m ) ) % mres = ( mul1 * mul2 ) % mleft = n - k * itr + 1 mul1 = binpow ( p , k * itr , m ) mul2 = 0 for i in range ( left ) : if st [ i ] == ' + ' : mul2 = ( mul2 + binpow ( p , i , m ) ) % m else : mul2 = ( mul2 - binpow ( p , i , m ) ) % mres = ( res + mul1 * mul2 ) % mres = ( res * binpow ( a , n , m ) ) % mprint ( res )     NEW_LINE


n , a , b , k = map ( int , input ( ) . split ( ) ) mod = 10 ** 9 + 9 NEW_LINE


inp = input ( " " ) . split ( ' \n ' ) nums = inp [ 0 ] . split ( ' ▁ ' )   n = int ( nums [ 0 ] ) a = int ( nums [ 1 ] ) b = int ( nums [ 2 ] ) k = int ( nums [ 3 ] )   st = str ( input ( " " ) . strip ( ) )   tot = 0 mod = 10 ** 9 + 9   def inv ( a ) : return pow ( a , mod - 2 , mod ) for i in range ( 0 , k ) : vl = 1 if ( st [ i ] == ' - ' ) : vl = - 1 tot += vl * pow ( a , n - i , mod ) * pow ( b , i , mod ) tot %= mod   mult = ( pow ( b , k , mod ) * inv ( pow ( a , k , mod ) ) ) % mod   p = ( ( n + 1 ) // k ) - 1   NEW_LINE


MOD = int ( 1e9 + 9 ) n , a , b , k = map ( int , input ( ) . split ( ) ) s = input ( )   def solve ( ) : res = 0 q = pow ( b , k , MOD ) * pow ( pow ( a , k , MOD ) , MOD - 2 , MOD ) % MOD max_pow = pow ( a , n , MOD ) c = b * pow ( a , MOD - 2 , MOD ) % MOD for i in range ( k ) : res += max_pow if s [ i ] == ' + ' else - max_pow res = ( res % MOD + MOD ) % MOD max_pow = max_pow * c % MOD t = ( n + 1 ) // k if q == 1 : return t * res % MOD z = ( pow ( q , t , MOD ) - 1 ) * pow ( q - 1 , MOD - 2 , MOD ) % MOD return z * res % MOD   print ( solve ( ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . DataInputStream ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ; public class D_1296 { public static Scanner sc = new Scanner ( System . in ) ; public static long mod = 1000000000 + 9 ; public static boolean flag [ ] ; public static void main ( String [ ] args ) {   long n = sc . nextLong ( ) ; long a = sc . nextLong ( ) % mod ; long b = sc . nextLong ( ) % mod ; int k = sc . nextInt ( ) ; sc . nextLine ( ) ; long ar = quickPow ( a , mod - 2 ) ; long ans = 0 ; long ab = ar * b % mod ; long cycle = 0 ; long tmp = 1 ; long start = quickPow ( a , n ) ; String flag = sc . next ( ) ;   for ( int i = 0 ; i < k ; i ++ ) { if ( flag . charAt ( i ) == ' + ' ) cycle = ( cycle + tmp + mod ) % mod ; else cycle = ( cycle - tmp + mod ) % mod ; tmp = tmp * ab % mod ; } long cx = quickPow ( ab , k ) ;


import java . io . * ; import java . util . * ; public class Solution { public static void main ( String [ ] args ) throws Exception { FastReader fr = new FastReader ( ) ; int t = fr . nextInt ( ) ; while ( t -- > 0 ) { int n = fr . nextInt ( ) ; int digs = 4 * n - n ; int nines = digs / 4 ; int eights = n - nines ; StringBuilder sb = new StringBuilder ( ) ; while ( nines > 0 ) { sb . append ( "9" ) ; nines -- ; } while ( eights > 0 ) { sb . append ( "8" ) ; eights -- ; } System . out . println ( sb . toString ( ) ) ; } } } class Pair implements Comparable < Pair > { int x ; int y ; Pair ( int x , int y ) { this . x = x ; this . y = y ; } public int compareTo ( Pair o ) { if ( this . x != o . x ) return this . x - o . x ; else return this . y - o . y ; } } 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 ; } }

for _ in range ( int ( input ( ) ) ) : NEW_LINE INDENT n = int ( input ( ) ) NEW_LINE tmp = ( n + 3 ) // 4 NEW_LINE for i in range ( n - tmp ) : NEW_LINE INDENT print ( 9 , end = ' ' ) NEW_LINE DEDENT for i in range ( tmp ) : NEW_LINE INDENT print ( 8 , end = ' ' ) NEW_LINE DEDENT print ( ) NEW_LINE DEDENT


from math import * NEW_LINE import sys NEW_LINE input = sys . stdin . readline NEW_LINE a = int ( input ( ) ) NEW_LINE for x in range ( a ) : NEW_LINE INDENT b = int ( input ( ) ) NEW_LINE if b == 1 : NEW_LINE INDENT print ( 8 ) NEW_LINE DEDENT else : NEW_LINE INDENT n = ceil ( b / 4 ) NEW_LINE t = ( ( b - n ) * "9" ) + ( ( n ) * "8" ) NEW_LINE print ( t ) NEW_LINE DEDENT DEDENT


from sys import stdin , stdout , setrecursionlimit NEW_LINE from math import floor , gcd , fabs , factorial , fmod , sqrt , inf , log , log2 NEW_LINE from random import seed , randint NEW_LINE from datetime import datetime NEW_LINE from collections import defaultdict as dd , deque NEW_LINE from heapq import merge , heapify , heappop , heappush , nsmallest NEW_LINE from bisect import bisect_left as bl , bisect_right as br , bisect NEW_LINE from collections import defaultdict as dd NEW_LINE mod = pow ( 10 , 9 ) + 7 NEW_LINE mod2 = 998244353 NEW_LINE def inp ( ) : return stdin . readline ( ) . strip ( ) NEW_LINE def iinp ( ) : return int ( inp ( ) ) NEW_LINE def out ( var , end = " \n " ) : stdout . write ( str ( var ) + " \n " ) NEW_LINE def outa ( * var , end = " \n " ) : stdout . write ( ' ▁ ' . join ( map ( str , var ) ) + end ) NEW_LINE def lmp ( ) : return list ( mp ( ) ) NEW_LINE def mp ( ) : return map ( int , inp ( ) . split ( ) ) NEW_LINE def smp ( ) : return map ( str , inp ( ) . split ( ) ) NEW_LINE def l1d ( n , val = 0 ) : return [ val for i in range ( n ) ] NEW_LINE def l2d ( n , m , val = 0 ) : return [ l1d ( m , val ) for j in range ( n ) ] NEW_LINE def remadd ( x , y ) : return 1 if x % y else 0 NEW_LINE def ceil ( a , b ) : return ( a + b - 1 ) // b NEW_LINE def def_value ( ) : return 0 NEW_LINE for _ in range ( iinp ( ) ) : NEW_LINE INDENT n = iinp ( ) NEW_LINE k = ceil ( n , 4 ) NEW_LINE s = "9" * ( n - k ) + "8" * k NEW_LINE print ( s ) NEW_LINE DEDENT


import sys NEW_LINE from collections import defaultdict , deque NEW_LINE import math NEW_LINE INF = float ( ' inf ' ) NEW_LINE MOD = 10 ** 9 + 7 ; NEW_LINE read = lambda : [ int ( s ) for s in sys . stdin . readline ( ) . split ( ) ] NEW_LINE _ = 1 NEW_LINE _ = int ( input ( ) ) NEW_LINE while _ : NEW_LINE INDENT n , = read ( ) NEW_LINE n8 = math . ceil ( n / 4 ) NEW_LINE n9 = n - n8 NEW_LINE res = " " NEW_LINE for i in range ( n9 ) : NEW_LINE INDENT res += "9" NEW_LINE DEDENT for i in range ( n8 ) : NEW_LINE INDENT res += "8" NEW_LINE DEDENT print ( res ) NEW_LINE _ -= 1 NEW_LINE DEDENT


import java . util . Scanner ; public class Div2B { private static int ceiling ( int a , int b ) { return ( a % b == 0 ) ? ( a / b ) : ( a / b ) + 1 ; } public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = Integer . parseInt ( scanner . nextLine ( ) ) ; int n ; int ceil ; StringBuilder sb ; for ( int i = 0 ; i < t ; i ++ ) { n = Integer . parseInt ( scanner . nextLine ( ) ) ; ceil = ceiling ( n , 4 ) ; sb = new StringBuilder ( n ) ; for ( int j = 0 ; j < n - ceil ; j ++ ) { sb . append ( 9 ) ; } for ( int j = 0 ; j < ceil ; j ++ ) { sb . append ( 8 ) ; } System . out . println ( sb . toString ( ) ) ; } scanner . close ( ) ; } }


import java . util . * ; import java . io . * ;   public class Bear_and_Compressing { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter pw = new PrintWriter ( System . out ) ;   int t = 1 ;   while ( t -- > 0 ) {   String str [ ] = br . readLine ( ) . trim ( ) . split ( " ▁ " ) ; int n = Integer . parseInt ( str [ 0 ] ) ; int m = Integer . parseInt ( str [ 1 ] ) ;   HashMap < String , ArrayList < String > > mp = new HashMap < > ( ) ; ArrayList < String > temp ; for ( int i = 0 ; i < m ; i ++ ) { str = br . readLine ( ) . trim ( ) . split ( " ▁ " ) ;   if ( mp . get ( str [ 1 ] ) != null ) { temp = ( ArrayList ) mp . get ( str [ 1 ] ) ; temp . add ( str [ 0 ] ) ; mp . put ( str [ 1 ] , temp ) ; } else { temp = new ArrayList < > ( ) ; temp . add ( str [ 0 ] ) ; mp . put ( str [ 1 ] , temp ) ; } }   long ans = 0 ; LinkedList < String > q = new LinkedList < > ( ) ; LinkedList < String > p = new LinkedList < > ( ) ; q . add ( " a " ) ; while ( ! q . isEmpty ( ) ) { String x = q . poll ( ) ; int z = x . length ( ) ; if ( z == n ) { ans ++ ;

l = [ ] n , q = map ( int , input ( ) . split ( ) ) al = [ " a " , " b " , " c " , " d " , " e " , " f " ] qu = [ ] qu . append ( ( " " , 0 ) ) while qu : s , cnt = qu . pop ( 0 ) if cnt == n : l . append ( s ) continue for i in range ( 6 ) : ss = s + al [ i ] qu . append ( ( ss , cnt + 1 ) ) l = list ( set ( l ) ) cnt = 0 item = [ input ( ) . split ( " ▁ " ) for i in range ( q ) ] def df ( s ) : global cnt if s == " a " : cnt += 1 return elif len ( s ) == 1 : return for t1 , t2 in item : if s [ 0 : 2 ] == t1 : t = t2 + s [ 2 : ] df ( t ) for s in l : df ( s ) print ( cnt ) NEW_LINE


n , q = map ( int , input ( ) . split ( ) ) from collections import defaultdict   def DFS ( d , s , t ) : if len ( s ) == t : NEW_LINE


links = [ [ ] , [ ] , [ ] , [ ] , [ ] , [ ] ] n , q = map ( int , input ( ) . split ( ) ) for _ in range ( q ) : a , b = input ( ) . split ( ) links [ ord ( b ) - ord ( ' a ' ) ] . append ( a [ 0 ] )     def func ( b , depth ) : if depth == n : return 1 count = 0 for a in links [ ord ( b ) - ord ( ' a ' ) ] : count += func ( a , depth + 1 ) return countprint ( func ( ' a ' , 1 ) ) NEW_LINE


p = [ " a " , " b " , " c " , " d " , " e " , " f " ]     def cond ( item ) : return item [ 0 ] in p and item [ 1 ] in p     def dp ( ) : arr = [ [ 0 for j in range ( 6 ) ] for i in range ( n ) ] for j in range ( 6 ) : arr [ 0 ] [ j ] = 1 for i in range ( 1 , n ) : for j in range ( 6 ) : for item in d : if cond ( item ) and d [ item ] == j : x = ord ( item [ 0 ] ) - ord ( " a " ) arr [ i ] [ j ] += arr [ i - 1 ] [ x ] return arr [ - 1 ] [ 0 ]     n , k = map ( int , input ( ) . split ( ) ) d = { } for i in range ( k ) : a , b = input ( ) . split ( ) d [ a ] = ord ( b ) - ord ( " a " ) print ( dp ( ) ) NEW_LINE


from itertools import product     def bear_and_compressing ( ) : n , q = input ( ) . split ( ) n , q = int ( n ) , int ( q ) o = [ ] j = [ ] for _ in range ( q ) : o . append ( list ( input ( ) ) ) s = list ( product ( ' abcdef ' , repeat = n ) ) for i in s : j . append ( list ( i ) ) for _ in range ( n ) : for i in j : for x in o : try : if i [ 0 ] == x [ 0 ] and i [ 1 ] == x [ 1 ] : i . pop ( 0 ) i [ 0 ] = x [ 3 ] except IndexError : continue count = j . count ( [ ' a ' ] ) print ( count )     if __name__ == ' _ _ main _ _ ' : bear_and_compressing ( )     NEW_LINE


import java . util . ArrayList ; import java . util . HashMap ; import java . util . HashSet ; import java . util . List ; import java . util . Map ; import java . util . Scanner ; import java . util . Set ;   public class B653 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; int Q = in . nextInt ( ) ; Map < Character , List < String > > map = new HashMap < > ( ) ; for ( char c = ' a ' ; c <= ' f ' ; c ++ ) { map . put ( c , new ArrayList < > ( ) ) ; } for ( int q = 0 ; q < Q ; q ++ ) { String expansion = in . next ( ) ; String compression = in . next ( ) ; map . get ( compression . charAt ( 0 ) ) . add ( expansion ) ; } Set < String > set = new HashSet < > ( ) ; set . add ( " a " ) ; for ( int n = 2 ; n <= N ; n ++ ) { Set < String > newSet = new HashSet < > ( ) ; for ( String compression : set ) { char c = compression . charAt ( 0 ) ; for ( String expansion : map . get ( c ) ) { newSet . add ( expansion + compression . substring ( 1 ) ) ; } } set = newSet ; } System . out . println ( set . size ( ) ) ; }   }


numberoParticipantes = int ( input ( ) ) participantes = [ ' temp ' ] * numberoParticipantes primeraLinea = [ ] segundaLinea = [ ] terceraLinea = [ ] cuartaLinea = [ ] for k in range ( 0 , 11 ) : for l in range ( 0 , 4 ) : if ( l == 0 and len ( participantes ) > 0 ) : primeraLinea . append ( ' O ' ) participantes . pop ( 0 ) elif ( l == 1 and len ( participantes ) > 0 ) : segundaLinea . append ( ' O ' ) participantes . pop ( 0 ) elif ( k == 0 and l == 2 and len ( participantes ) > 0 ) : terceraLinea . append ( ' O ' ) participantes . pop ( 0 ) elif ( l == 3 and len ( participantes ) > 0 ) : cuartaLinea . append ( ' O ' ) participantes . pop ( 0 ) print ( ' + - - - - - - - - - - - - - - - - - - - - - - - - + ' ) for i in range ( 0 , 4 ) : for j in range ( 0 , 27 ) : if ( j == 0 or ( j == 23 and i != 2 ) or j == 25 ) : print ( ' | ' , end = ' ' ) elif ( j == 26 and ( i == 0 or i == 3 ) ) : print ( ' ) ' , end = ' ' ) elif ( j == 26 and ( i == 1 or i == 2 ) ) : print ( ' ' , end = ' ' ) elif ( j == 24 and i == 0 ) : print ( ' D ' , end = ' ' ) elif ( j % 2 == 0 or ( j > 1 and i == 2 ) ) : print ( ' . ' , end = ' ' ) elif ( i == 0 and len ( primeraLinea ) ) : print ( primeraLinea . pop ( ) , end = ' ' ) elif ( i == 1 and len ( segundaLinea ) ) : print ( segundaLinea . pop ( ) , end = ' ' ) elif ( i == 2 and len ( terceraLinea ) ) : print ( terceraLinea . pop ( ) , end = ' ' ) elif ( i == 3 and len ( cuartaLinea ) ) : print ( cuartaLinea . pop ( ) , end = ' ' ) else : print ( ' # ' , end = ' ' ) print ( ' ' ) print ( ' + - - - - - - - - - - - - - - - - - - - - - - - - + ' ) NEW_LINE


def listToStr ( arr ) : res = ' ' for i in arr : res += i   return res     def solve ( k ) : border = " + - - - - - - - - - - - - - - - - - - - - - - - - + "   row1 = list ( " | " + ( " # . " * 11 ) + " | D | ) " )   row2 = list ( " | " + ( " # . " * 11 ) + " | . | " )   row4 = list ( " | " + ( " # . " * 11 ) + " | . | ) " )   row3 = list ( " | # . . . . . . . . . . . . . . . . . . . . . . . | " )   rem = k   if rem == 1 : row1 [ 1 ] = " O " rem = 0 if rem == 2 : row1 [ 1 ] = " O " row2 [ 1 ] = " O " rem = 0 if rem == 3 : row1 [ 1 ] = " O " row2 [ 1 ] = " O " row3 [ 1 ] = " O " rem = 0   if rem == 4 : row1 [ 1 ] , row2 [ 1 ] , row3 [ 1 ] , row4 [ 1 ] = " O " , " O " , " O " , " O " rem = 0 if rem == 0 : row1 = listToStr ( row1 ) row2 = listToStr ( row2 ) row3 = listToStr ( row3 ) row4 = listToStr ( row4 ) print ( border ) print ( row1 ) print ( row2 ) print ( row3 ) print ( row4 ) print ( border ) return if rem > 4 : row1 [ 1 ] , row2 [ 1 ] , row3 [ 1 ] , row4 [ 1 ] = " O " , " O " , " O " , " O " rem -= 4 rowsPossible = rem // 3   rem = rem % 3   pos = 1   for i in range ( 1 , rowsPossible + 1 ) : pos = ( 2 * i ) + 1   row1 [ pos ] = " O " row2 [ pos ] = " O " row4 [ pos ] = " O " pos += 2   if rem == 1 : row1 [ pos ] = " O " if rem == 2 : row1 [ pos ] = " O " row2 [ pos ] = " O " row1 = listToStr ( row1 ) row2 = listToStr ( row2 ) row3 = listToStr ( row3 ) row4 = listToStr ( row4 ) print ( border ) print ( row1 ) print ( row2 ) print ( row3 ) print ( row4 ) print ( border ) return             k = int ( input ( ) )   solve ( k )   NEW_LINE


import java . util . * ; import java . util . stream . * ;   public class BayanBus { private static final int numRowsWithoutBack = 10 ; public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int k = in . nextInt ( ) ; System . out . println ( solve ( k ) ) ; } private static String solve ( int k ) { StringBuilder sb = new StringBuilder ( ) ; String edge = makeEdge ( numRowsWithoutBack + 2 ) ; sb . append ( edge + " \n " ) ;


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

n = int ( input ( ) ) found = Falsebus = [ ] for i in range ( n ) : row = list ( input ( ) ) for seat in range ( len ( row ) - 1 ) : if ( row [ seat ] == row [ seat + 1 ] and row [ seat ] == ' O ' and not found ) : found = True row [ seat ] = ' + ' row [ seat + 1 ] = ' + ' bus . append ( row )   if found : print ( " YES " ) for i in range ( n ) : print ( " " . join ( map ( str , bus [ i ] ) ) ) else : print ( " NO " ) NEW_LINE


n = int ( input ( ) )   bus = [ ]   for x in range ( n ) : s = input ( )   row = [ s [ 0 ] , s [ 1 ] , s [ 3 ] , s [ 4 ] ]   bus . append ( row )   result = ' NO '   for x in bus : if x [ 0 ] == ' O ' and x [ 1 ] == ' O ' : result = ' YES ' x [ 0 ] = ' + ' x [ 1 ] = ' + ' break if x [ 2 ] == ' O ' and x [ 3 ] == ' O ' : result = ' YES ' x [ 2 ] = ' + ' x [ 3 ] = ' + ' break   if result == ' NO ' : print ( ' NO ' ) else : print ( ' YES ' ) for x in bus : print ( ' % s % s | % s % s ' % ( x [ 0 ] , x [ 1 ] , x [ 2 ] , x [ 3 ] ) ) NEW_LINE


n = int ( input ( ) )   bus = [ ]   for x in range ( n ) : s = input ( ) row = [ s [ 0 ] , s [ 1 ] , s [ 3 ] , s [ 4 ] ] bus . append ( row )   result = ' NO '   for x in bus : if x [ 0 ] == ' O ' and x [ 1 ] == ' O ' : result = ' YES ' x [ 0 ] = ' + ' x [ 1 ] = ' + ' break if x [ 2 ] == ' O ' and x [ 3 ] == ' O ' : result = ' YES ' x [ 2 ] = ' + ' x [ 3 ] = ' + ' break   if result == ' NO ' : print ( ' NO ' ) else : print ( ' YES ' )   for x in bus : print ( ' % s % s | % s % s ' % ( x [ 0 ] , x [ 1 ] , x [ 2 ] , x [ 3 ] ) ) NEW_LINE


n = int ( input ( ) ) l = [ ] for i in range ( n ) : l . append ( input ( ) ) c = 0 for i in range ( n ) : if " OO " in l [ i ] : c = 1 if l [ i ] [ 0 ] == ' O ' and l [ i ] [ 1 ] == ' O ' : l [ i ] = " + + " + l [ i ] [ 2 : ] else : l [ i ] = l [ i ] [ : 3 ] + " + + " breakif c : print ( " YES " ) for i in l : print ( i ) else : print ( " NO " ) NEW_LINE


num_rows = int ( input ( ) ) rows = [ ] vacancy = Falsefor i in range ( num_rows ) : row = input ( ) NEW_LINE


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s = " ▁ " ; while ( n -- > 0 ) { s = s + sc . next ( ) + " \n " ; } String s1 = s . replaceFirst ( " OO " , " + + " ) ; if ( s1 . equals ( s ) ) { System . out . println ( " NO " ) ; } else { System . out . println ( " YES " ) ; System . out . println ( s1 ) ; } } }


import java . util . Scanner ;   public class BusToUdayland { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = Integer . parseInt ( scanner . nextLine ( ) ) ;   StringBuilder sb = new StringBuilder ( ) ; boolean didReplaceEmptySeats = false ;   for ( int i = 0 ; i < n ; i ++ ) { String line = scanner . nextLine ( ) ; if ( didReplaceEmptySeats ) {   } else { if ( line . contains ( " OO " ) ) { line = line . replaceFirst ( " OO " , " + + " ) ; didReplaceEmptySeats = true ; } } sb . append ( line + System . lineSeparator ( ) ) ; }   if ( didReplaceEmptySeats ) { System . out . println ( " YES " ) ; System . out . println ( sb . toString ( ) ) ; } else { System . out . println ( " NO " ) ; }   } }


import java . util . * ; public class CounterExample { public static long co_prime ( long n1 , long n2 ) {

import sys   def answer ( l , r ) : if ( r - l ) < 2 : print ( ' - 1' ) return NEW_LINE


from math import gcdl , r = map ( int , input ( ) . split ( ) ) if ( r - l < 2 ) : print ( - 1 ) exit ( ) for a in range ( l , r + 1 ) : for b in range ( a + 1 , r + 1 ) : for c in range ( b + 1 , r + 1 ) : if ( gcd ( a , b ) == 1 and gcd ( b , c ) == 1 and gcd ( a , c ) != 1 ) : print ( a , b , c ) exit ( ) else : print ( - 1 ) NEW_LINE


def gcd ( a , b ) : while ( b ) : a , b = b , a % b return a   a , b = map ( int , input ( ) . split ( ) ) s1 , s2 , s3 = 0 , 0 , 0 if b - a < 2 : print ( - 1 ) exit ( )   else : for i in range ( a , b ) : for j in range ( i + 1 , b + 1 ) : if gcd ( i , j ) == 1 : s1 , s2 = i , j for k in range ( s2 + 1 , b + 1 ) : if gcd ( s1 , k ) != 1 and gcd ( s2 , k ) == 1 : s3 = k print ( s1 , s2 , s3 ) exit ( ) print ( - 1 ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) ) if a % 2 : a += 1 if a + 2 > b : print ( - 1 ) else : print ( a , a + 1 , a + 2 ) NEW_LINE


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 ( ) ; if ( x % 2 != 0 ) { x ++ ; } if ( x + 2 > y ) { System . out . println ( " - 1" ) ; } else { System . out . println ( x + " ▁ " + ( x + 1 ) + " ▁ " + ( x + 2 ) ) ; }   } }


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


import java . util . * ; public class CounterExample { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long l = sc . nextLong ( ) ; long r = sc . nextLong ( ) ;   long a = 0 ; long b = 0 ; long c = 0 ; sc . close ( ) ;   for ( long i = l ; i <= r ; i ++ ) { if ( i % 2 == 0 && a == 0 ) { a = i ; }   else if ( i % 2 != 0 && a != 0 ) { b = i ; } else if ( i % 2 == 0 && ( a != 0 && b != 0 ) ) { c = i ; break ; } } if ( a != 0 && b != 0 && c != 0 ) System . out . println ( a + " ▁ " + b + " ▁ " + c ) ; else System . out . println ( - 1 ) ; } }


import java . util . * ; public class CodeForces { static Scanner input = new Scanner ( System . in ) ; public static void main ( String args [ ] ) { String s = input . next ( ) ; String ss = " " ; String sk = " " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == s . toLowerCase ( ) . charAt ( i ) ) ss += s . charAt ( i ) ; else sk += s . charAt ( i ) ; } if ( ss . length ( ) >= sk . length ( ) ) System . out . println ( s . toLowerCase ( ) ) ; else System . out . println ( s . toUpperCase ( ) ) ; } }

s = input ( ) NEW_LINE countc = 0 NEW_LINE counts = 0 NEW_LINE for i in s : if NEW_LINE INDENT ( ord ( i ) >= 97 and ord ( i ) <= 122 ) : counts += 1 elif ( ord ( i ) >= 65 and ord ( i ) <= 90 ) : countc += 1 NEW_LINE DEDENT if ( countc > counts ) : NEW_LINE INDENT print ( s . upper ( ) ) else : NEW_LINE print ( s . lower ( ) ) NEW_LINE DEDENT


word = input ( ' ' ) NEW_LINE upper = 0 l NEW_LINE ower = 0 NEW_LINE for x in word : if NEW_LINE x >= " A " and x <= " Z " : upper += 1 elif x >= " a " and x <= " z " : lower += 1 NEW_LINE if lower >= upper : NEW_LINE INDENT print ( word . lower ( ) ) else : NEW_LINE print ( word . upper ( ) ) NEW_LINE DEDENT


s1 = input ( )   lowers = 0 u NEW_LINE ppers = 0   for c in s1 : if NEW_LINE c . isupper ( ) : uppers += 1 else : lowers += 1   if lowers < uppers : NEW_LINE INDENT print ( s1 . upper ( ) ) else : NEW_LINE print ( s1 . lower ( ) )   NEW_LINE DEDENT


s = input ( ) NEW_LINE c = 0 NEW_LINE def f ( ) : for NEW_LINE i in range ( 2 ) : ddd = 999 NEW_LINE for x in s : if NEW_LINE x . isupper ( ) : c += 1   if c > len ( s ) // 2 : NEW_LINE INDENT s = s . upper ( ) else : NEW_LINE s = s . lower ( ) NEW_LINE DEDENT f ( ) NEW_LINE print ( s ) NEW_LINE


Into = list ( input ( ) ) NEW_LINE big = 0 NEW_LINE small = 0 NEW_LINE out = [ ] NEW_LINE for i in Into : if NEW_LINE ord ( i ) < 97 : big += 1 else : small += 1 NEW_LINE if big > small : for NEW_LINE j in Into : NEW_LINE if ord ( j ) >= 97 : j = chr ( ord ( j ) - 32 ) NEW_LINE out . append ( j ) else : out . append ( j ) else : for j in Into : if NEW_LINE ord ( j ) < 97 : j = chr ( ord ( j ) + 32 ) NEW_LINE out . append ( j ) else : out . append ( j ) NEW_LINE s = ' ' NEW_LINE for k in out : s += kprint ( s ) NEW_LINE


import java . util . Scanner ; public class java { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String ch = s . next ( ) ; int k = 0 ; int m = 0 ; for ( int i = 0 ; i < ( ch . length ( ) ) ; i ++ ) { if ( ch . charAt ( i ) >= ' a ' && ch . charAt ( i ) <= ' z ' ) k = k + 1 ; else m = m + 1 ; } if ( m > k ) System . out . println ( ch . toUpperCase ( ) ) ; else System . out . println ( ch . toLowerCase ( ) ) ; } }


import java . util . Scanner ; public class Word { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String ch = s . next ( ) ; int i = 0 ; int j = 0 ; char c ; for ( int r = 0 ; r < ch . length ( ) ; r ++ ) { c = ch . charAt ( r ) ; if ( Character . isUpperCase ( c ) ) { i ++ ; } else { j ++ ; } } if ( j >= i ) { ch = ch . toLowerCase ( ) ; } else { ch = ch . toUpperCase ( ) ; } System . out . println ( ch ) ; } }


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


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Flipping_Game { static class RealScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } }   public static void main ( String [ ] args ) { RealScanner sc = new RealScanner ( ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } int count1 = 0 , count0 = 0 , max = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { int val = arr [ i ] ; if ( val == 1 ) { count1 ++ ; if ( count0 > 0 ) { count0 -- ; } } if ( val == 0 ) { count0 ++ ; if ( count0 > max ) { max = count0 ; } } } System . out . println ( count1 + max ) ; } }

x = int ( input ( ) )   difference = [ 0 ]   ones = 0 zeros = 0   line = input ( ) . split ( " ▁ " )   for i in line : if ( int ( i ) == 1 ) : ones += 1 else : zeros += 1 difference . append ( zeros - ones )   minimum = 0 maximum = 0   for i in range ( 1 , len ( difference ) ) : result = difference [ i ] - minimum maximum = max ( ones + result , maximum ) minimum = min ( difference [ i ] , minimum )   print ( maximum )   NEW_LINE


n = int ( input ( ) ) zeros_and_ones = list ( map ( int , input ( ) . split ( ) ) ) num_of_ones = zeros_and_ones . count ( 1 ) cnt = 0 max_arr = [ ] print_ans = Truefor i in zeros_and_ones : if 0 not in zeros_and_ones : print_ans = False print ( num_of_ones - 1 ) break if cnt >= 0 : if i == 1 and cnt != 0 : cnt -= 1 if i == 0 : cnt += 1 max_arr . append ( cnt ) if print_ans : print ( num_of_ones + max ( max_arr ) ) NEW_LINE


n = int ( input ( ) ) array = list ( map ( int , input ( ) . split ( ) ) ) maxOnes = sum ( array ) newArray = [ ] for i in array : newArray . append ( 1 if i == 0 else - 1 )   curMaxSum = 0 totalMaxSum = 0 for i in newArray : curMaxSum = max ( 0 , curMaxSum + i ) totalMaxSum = max ( totalMaxSum , curMaxSum )   print ( maxOnes + totalMaxSum if maxOnes != n else n - 1 ) NEW_LINE


def run2 ( ) : numberOfBits = int ( input ( ) ) line = input ( ) . split ( " ▁ " ) bits = [ int ( element ) for element in line ] scores = [ 1 - 2 * element for element in bits ] NEW_LINE


import java . io . * ; import java . util . * ;   public class P1 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Map < Integer , ArrayList < Integer > > map = new HashMap < > ( ) ; int n = sc . nextInt ( ) ;   int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { int cursum = 0 ; int min = Integer . MAX_VALUE ; for ( int j = i ; j < n ; j ++ ) { ArrayList < Integer > al = new ArrayList < > ( ) ; if ( a [ j ] == 0 ) { cursum -= 1 ; } else { cursum += 1 ; } if ( cursum < min ) { min = cursum ; al . add ( i ) ; al . add ( j ) ; map . put ( min , al ) ; } } } int min = Integer . MAX_VALUE ; for ( int k : map . keySet ( ) ) { if ( min > k ) min = k ; }   ArrayList < Integer > p = map . get ( min ) ; int x = p . get ( 0 ) ; int y = p . get ( 1 ) ;   for ( int i = x ; i <= y ; i ++ ) { if ( a [ i ] == 1 ) a [ i ] = 0 ; else a [ i ] = 1 ; } int sum = 0 ;   for ( int i = 0 ; i < n ; i ++ ) { sum += a [ i ] ; } System . out . println ( sum ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Flipping_Game { static class RealScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } }   public static void main ( String [ ] args ) { RealScanner sc = new RealScanner ( ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; }


import java . util . * ; import java . io . * ; import java . math . * ;   public class Practice   { static FastReader sc = new FastReader ( ) ; static int mod = ( int ) Math . pow ( 10 , 9 ) + 7 ; static int dp [ ] [ ] ; static ArrayList < Integer > l = new ArrayList < Integer > ( ) ; public static void main ( String [ ] args ) { PrintWriter out = new PrintWriter ( System . out ) ;

n = int ( input ( ) ) g = [ [ ] for i in range ( n ) ] for i in range ( n - 1 ) : a , b = map ( int , input ( ) . split ( ) ) g [ a - 1 ] . append ( b - 1 ) g [ b - 1 ] . append ( a - 1 ) start = list ( map ( int , input ( ) . split ( ) ) ) goal = list ( map ( int , input ( ) . split ( ) ) ) q = [ ( 0 , 0 , 0 , 0 ) ] ans = [ ] while q : node , dst , a , b = q . pop ( ) if dst : if a != ( start [ node ] != goal [ node ] ) : ans . append ( node + 1 ) a = 1 - a else : if b != ( start [ node ] != goal [ node ] ) : ans . append ( node + 1 ) b = 1 - b dst = 1 - dst for to in g [ node ] : g [ to ] . remove ( node ) q . append ( ( to , dst , a , b ) ) print ( len ( ans ) ) print ( " \n " . join ( map ( str , ans ) ) ) NEW_LINE


n = int ( input ( ) ) adj = [ [ ] for i in range ( n + 1 ) ] for i in range ( n - 1 ) : a , b = map ( int , input ( ) . split ( ) ) adj [ a ] . append ( b ) adj [ b ] . append ( a ) u = [ - 1 ] + list ( map ( int , input ( ) . split ( ) ) ) v = [ - 1 ] + list ( map ( int , input ( ) . split ( ) ) ) q = [ ( 1 , 0 , 0 , 0 ) ] ans = [ ] while q : x , a , b , c = q . pop ( ) if a : if b != ( u [ x ] != v [ x ] ) : ans . append ( x ) b = 1 - b else : if c != ( u [ x ] != v [ x ] ) : ans . append ( x ) c = 1 - c a = 1 - a for i in adj [ x ] : adj [ i ] . remove ( x ) q . append ( ( i , a , b , c ) ) print ( len ( ans ) ) print ( ' \n ' . join ( map ( str , ans ) ) ) NEW_LINE


from sys import stdin , stdoutfrom collections import defaultdict , dequenmbr = lambda : int ( stdin . readline ( ) ) lst = lambda : list ( map ( int , stdin . readline ( ) . split ( ) ) ) def bfs ( ) : global ans q = deque ( ) p [ 1 ] = - 1 q . append ( 1 ) while q : src = q . popleft ( ) if p [ src ] != - 1 and p [ p [ src ] ] != - 1 : dp [ src ] = dp [ p [ p [ src ] ] ] if dp [ src ] ^ init [ src - 1 ] != goal [ src - 1 ] : dp [ src ] ^= 1 ans += [ src ] for neigh in g [ src ] : if neigh == p [ src ] : continue p [ neigh ] = src q . append ( neigh )   for _ in range ( 1 ) : NEW_LINE


n = int ( input ( ) ) g = [ [ ] for i in range ( n ) ] for i in range ( n - 1 ) : a , b = map ( int , input ( ) . split ( ) ) g [ a - 1 ] . append ( b - 1 ) g [ b - 1 ] . append ( a - 1 ) start = list ( map ( int , input ( ) . split ( ) ) ) goal = list ( map ( int , input ( ) . split ( ) ) ) q = [ ( 0 , 0 , 0 , 0 ) ] ans = [ ] while q : node , dst , a , b = q . pop ( ) if dst : if a != ( start [ node ] != goal [ node ] ) : ans . append ( node + 1 ) a = 1 - a else : if b != ( start [ node ] != goal [ node ] ) : ans . append ( node + 1 ) b = 1 - b dst = 1 - dst for to in g [ node ] : g [ to ] . remove ( node ) q . append ( ( to , dst , a , b ) ) print ( len ( ans ) ) print ( " \n " . join ( map ( str , ans ) ) )


import java . util . Arrays ; import java . util . Scanner ;   public class hello { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; long t = in . nextLong ( ) ; String num = in . next ( ) ; int dec = num . indexOf ( " . " ) ; num = num . replace ( " . " , " " ) ; char [ ] cs = num . toCharArray ( ) ;   int len = cs . length ; for ( int i = dec ; i < len ; i ++ ) { if ( cs [ i ] - '0' >= 5 ) { len = i + 1 ; break ; } } while ( t > 0 ) { int roundIdx = - 1 ; for ( int i = len - 1 ; i >= dec ; i -- ) { int v = cs [ i ] - '0' ; if ( v >= 5 ) { roundIdx = i ; break ; } } if ( roundIdx == - 1 ) break ; len = roundIdx ; while ( len > 0 && cs [ len - 1 ] == '9' ) { cs [ len - 1 ] = '0' ; len -- ; } if ( len == 0 ) { System . out . print ( "1" ) ; break ; } cs [ len - 1 ] ++ ; t -- ; } System . out . print ( new String ( cs , 0 , dec ) ) ; if ( len - dec > 0 ) { System . out . print ( " . " ) ; System . out . println ( new String ( cs , dec , len - dec ) ) ; } else { System . out . println ( ) ; } } }

n , t = map ( int , input ( ) . split ( ) ) s = '0' + input ( ) f = s . find ( ' . ' ) if f == - 1 : print ( s [ 1 : ] ) exit ( ) r = list ( s [ : f ] + s [ f + 1 : ] ) for i in range ( f , len ( r ) ) : execute = False while r [ i ] >= '5' and r [ i ] <= '9' : if i < f or t <= 0 : break i -= 1 z = ord ( r [ i ] ) + 1 while z == ord ( "9" ) + 1 : i -= 1 z = ord ( r [ i ] ) + 1 while len ( r ) != i + 1 : r . pop ( ) r [ - 1 ] = chr ( z ) t -= 1 execute = True if execute : breakif r [ 0 ] == '0' : r = r [ 1 : ] f -= 1 r += [ '0' ] * max ( f - len ( r ) , 0 ) if len ( r ) == f : print ( ' ' . join ( map ( str , r ) ) ) else : print ( * r [ : f ] , ' . ' , * r [ f : ] , sep = ' ' ) NEW_LINE


import sysn , t = map ( int , sys . stdin . readline ( ) . split ( ) ) x = sys . stdin . readline ( ) y = x . find ( ' . ' ) for i in range ( y + 1 , n ) : if x [ i ] > '4' : for j in range ( t ) : i -= 1 if x [ i ] != '4' : break if i == y : i -= 1 while i and x [ i ] == '9' : i -= 1 x = x [ : i ] + str ( int ( x [ i ] ) + 1 ) + '0' * ( y - i - 1 ) else : x = x [ : i ] + str ( int ( x [ i ] ) + 1 ) breakprint ( x )             NEW_LINE


from sys import * input = stdin . readlinen , t = map ( int , input ( ) . split ( ) ) num = input ( ) idx = num . find ( " . " ) if idx < 0 : print ( num ) exit ( ) cnt = 1 for i in range ( idx + 1 , n ) : if num [ i ] < "5" : if 5 - int ( num [ i ] ) == 1 : cnt += 1 else : cnt = 1 if num [ i ] >= "5" : j = min ( cnt , t ) if num [ i - j ] != " . " : num = num [ : i - j ] + str ( int ( num [ i - j ] ) + 1 ) else : curr = 0 while num [ idx - curr - 1 ] == "9" and ( idx - curr ) != 0 : curr += 1 num = num [ : idx - curr - 1 ] + str ( int ( num [ idx - curr - 1 ] ) + 1 ) + "0" * curr if curr != idx else "1" + "0" * curr breakprint ( num ) NEW_LINE


import java . io . BufferedReader ; import java . io . FileReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . * ; import java . io . * ; public class codeforces { static class Student { int x , y ; Student ( int x , int y ) { this . x = x ; this . y = y ;


import java . util . Scanner ;   public class A1348 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = scanner . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = scanner . nextInt ( ) ; int index = n / 2 ; int sum = ( int ) ( 2 * ( Math . pow ( 2 , index ) - 1 ) ) ; System . out . println ( sum ) ; } } }

t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) l = [ 2 ** i for i in range ( 1 , n + 1 ) ] NEW_LINE


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


t = int ( input ( ) ) for i in range ( t ) : n = int ( input ( ) ) sa = ( 1 << n ) for i in range ( 1 , n // 2 ) : sa += ( 1 << i ) sb = 0 for i in range ( n // 2 , n ) : sb += ( 1 << i ) print ( abs ( sb - sa ) ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) a = 2 k = 4 for i in range ( 1 , n // 2 ) : a += k k *= 2 print ( a ) NEW_LINE


t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) li = [ ] for i in range ( 1 , n + 1 ) : li . append ( 2 ** i ) NEW_LINE


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


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;   public class CF1348A { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int t = Integer . parseInt ( br . readLine ( ) ) ; while ( t -- > 0 ) { int n = Integer . parseInt ( br . readLine ( ) ) ; System . out . println ( ( int ) ( Math . pow ( 2 , Math . floor ( n / 2.0 ) + 1 ) - 2 ) ) ; } } }


import java . util . Scanner ; import java . lang . Math ; public class NewMain { public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; int t ; t = in . nextInt ( ) ; for ( int j = 0 ; j < t ; j ++ ) { int n ; n = in . nextInt ( ) ; int sum1 = 0 , sum2 = 0 ; sum1 += Math . pow ( 2 , n ) ; for ( int i = 1 ; i < n / 2 ; i ++ ) { sum1 += Math . pow ( 2 , i ) ; } for ( int i = n / 2 ; i < n ; i ++ ) { sum2 += Math . pow ( 2 , i ) ; } System . out . println ( sum1 - sum2 ) ; } } }


import java . util . * ;   public class balance { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int c1 = 1 << n ; int c2 = 0 ; for ( int i = 1 ; i < n ; ++ i ) { if ( i < n / 2 ) c1 += 1 << i ; else c2 += 1 << i ; }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = Integer . parseInt ( sc . next ( ) ) ; int [ ] map = new int [ 10 ] ; for ( int i = 0 ; i < 4 ; i ++ ) { for ( char c : sc . next ( ) . toCharArray ( ) ) { if ( c != ' . ' ) { map [ c - '0' ] ++ ; if ( map [ c - '0' ] > 2 * k ) { System . out . println ( " NO " ) ; return ; } } } } System . out . println ( " YES " ) ; } }

k = int ( input ( ) ) l = [ 0 ] * 10 for i in range ( 4 ) : for j in input ( ) : if ( j != ' . ' ) : l [ int ( j ) ] += 1 for i in range ( 10 ) : if l [ i ] > k * 2 : print ( " NO " ) exit ( ) print ( " YES " ) NEW_LINE


k = int ( input ( ) ) a = [ ] for i in range ( 4 ) : s = input ( ) for j in s : if j . isdigit ( ) : a . append ( int ( j ) ) for i in range ( 1 , 10 ) : if a . count ( i ) > k * 2 : print ( " NO " ) breakelse : print ( " YES " ) NEW_LINE


k = int ( input ( ) ) d = { } t = [ ] for i in range ( 10 ) : d [ i ] = 0 for i in range ( 4 ) : arr = input ( ) t . append ( arr ) for i in range ( 4 ) : for j in range ( 4 ) : if t [ i ] [ j ] == " . " : continue else : d [ int ( t [ i ] [ j ] ) ] += 1 for i in range ( 10 ) : if d [ i ] > 2 * k : print ( " NO " ) breakelse : print ( " YES " ) NEW_LINE


from collections import Counterk = int ( input ( ) ) * 2 x = [ ] for i in range ( 4 ) : x . extend ( list ( input ( ) ) ) c = Counter ( x ) v = 0 del c [ ' . ' ] for i in c : if c [ i ] > k : v = 1 breakif v == 1 : print ( " NO " ) else : print ( " YES " ) NEW_LINE


n = int ( input ( ) )   arr = [ ] for i in range ( 4 ) : arr . append ( input ( ) )   flag = Truefor i in arr : for j in i : if j == ' . ' : continue else : c = 0 for k in arr : c += k . count ( j ) if c > ( 2 * n ) : flag = False break   if not flag : break if not flag : break   if flag : print ( " YES " ) else : print ( " NO " ) NEW_LINE


import java . util . * ; import java . util . stream . * ; public class Solution { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int k = scan . nextInt ( ) ; scan . nextLine ( ) ; Map < Integer , Integer > count = new HashMap < > ( ) ; String result = " YES " ; for ( int i = 0 ; i < 4 ; i ++ ) { String s = scan . nextLine ( ) ; for ( int j = 0 ; j < 4 ; j ++ ) { char ch = s . charAt ( j ) ; if ( ch == ' . ' ) continue ; int num = Integer . parseInt ( String . valueOf ( ch ) ) ; if ( ! count . containsKey ( num ) ) { count . put ( num , 0 ) ; } int c = count . get ( num ) ; if ( c == 2 * k ) { result = " NO " ; break ; } else { count . put ( num , c + 1 ) ; } } } System . out . println ( result ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ; import java . util . StringTokenizer ; public class Main { static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( newInputStreamReader ( 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 fs = new FastReader ( ) ; int l = fs . nextInt ( ) ;   HashMap < Integer , Integer > hs = new HashMap < > ( ) ;   for ( int i = 0 ; i < 4 ; i ++ ) { String k = fs . nextLine ( ) ; for ( char ch : k . toCharArray ( ) ) { if ( ch >= '0' && ch <= '9' ) { hs . putIfAbsent ( ( int ) ch , 0 ) ; hs . put ( ( int ) ch , hs . get ( ( int ) ch ) + 1 ) ; } } }   boolean flag = true ;   for ( Integer key : hs . keySet ( ) ) { if ( hs . get ( key ) > l * 2 ) { flag = false ; break ; } }   if ( flag ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; }    } }


import java . util . * ; public class CollectingBeatsIsFun { public static void main ( String [ ] args ) {   Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; Map < Integer , Integer > map = new HashMap < > ( ) ; boolean flag = true ;   for ( int i = 0 ; i < 4 ; i ++ ) { String temp = sc . next ( ) ; for ( int j = 0 ; j < temp . length ( ) ; j ++ ) { if ( temp . charAt ( j ) != ' . ' ) { int num = temp . charAt ( j ) - '0' ; if ( map . containsKey ( num ) ) { map . put ( num , map . get ( num ) + 1 ) ; } else map . put ( num , 1 ) ; } } } sc . close ( ) ; for ( Map . Entry < Integer , Integer > entry : map . entrySet ( ) ) { if ( entry . getValue ( ) > 2 * k ) { flag = false ; break ; } } if ( flag ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }


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

pos = [ 0 , 0 , 0 ] NEW_LINE for i in range ( int ( input ( ) ) ) : forces = input ( ) . split ( ) NEW_LINE for j in range ( 3 ) : pos [ j ] += int ( forces [ j ] ) NEW_LINE if all ( i == 0 for i in pos ) : NEW_LINE INDENT print ( " YES " ) else : NEW_LINE print ( " NO " ) NEW_LINE DEDENT


n = int ( input ( ) ) NEW_LINE x , y , z = 0 , 0 , 0 NEW_LINE for _ in range ( n ) : [ xi , yi , zi ] = [ int ( i ) for i in input ( ) . split ( ' ▁ ' ) ] NEW_LINE x += xi NEW_LINE y += yi NEW_LINE z += zi   if x == 0 and y == 0 and z == 0 : NEW_LINE INDENT print ( " YES " ) else : NEW_LINE print ( " NO " )   NEW_LINE DEDENT


n = int ( input ( ) ) NEW_LINE res = [ [ None , None , None ] for i in range ( n ) ] NEW_LINE for i in range ( n ) : res [ i ] [ 0 ] , res [ i ] [ 1 ] , res [ i ] [ 2 ] = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE ans = [ 0 ] * 3   for i in range ( n ) : ans [ 0 ] += res [ i ] [ 0 ]   for i in range ( n ) : ans [ 1 ] += res [ i ] [ 1 ]   for i in range ( n ) : NEW_LINE ans [ 2 ] += res [ i ] [ 2 ]   if ans [ 0 ] == 0 and ans [ 1 ] == 0 and ans [ 2 ] == 0 : print ( " YES " ) NEW_LINE exit ( ) NEW_LINE print ( " NO " ) NEW_LINE


n = int ( input ( ) ) NEW_LINE x = 0 NEW_LINE y = 0 NEW_LINE z = 0 NEW_LINE for i in range ( n ) : inp = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE x += inp [ 0 ] NEW_LINE y += inp [ 1 ] NEW_LINE z += inp [ 2 ] NEW_LINE if ( x == 0 and y == 0 and z == 0 ) : NEW_LINE INDENT print ( " YES " ) else : NEW_LINE print ( " NO " ) NEW_LINE DEDENT


n = int ( input ( ) ) NEW_LINE x = 0 ; NEW_LINE y = 0 ; NEW_LINE z = 0 NEW_LINE for _ in range ( n ) : a , b , c = map ( int , input ( ) . split ( ) ) NEW_LINE x += a NEW_LINE y += b NEW_LINE z += c NEW_LINE if x == 0 and y == 0 and z == 0 : NEW_LINE INDENT print ( " YES " ) else : NEW_LINE print ( " NO " ) NEW_LINE DEDENT


import java . io . * ; import java . util . * ; public class MyClass { public static void main ( String args [ ] ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int arr [ ] = new int [ 3 ] ; while ( n -- > 0 ) { String s [ ] = br . readLine ( ) . split ( " ▁ " ) ; for ( int i = 0 ; i < 3 ; i ++ ) { arr [ i ] += Integer . parseInt ( s [ i ] ) ; } } for ( int i = 0 ; i < 3 ; i ++ ) { if ( arr [ i ] != 0 ) { System . out . println ( " NO " ) ; return ; } } System . out . println ( " YES " ) ; } }


import java . util . Scanner ; public class YoungPhysicist { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n , x , y , z , Sum_X = 0 , Sum_Y = 0 , Sum_Z = 0 ; n = in . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { x = in . nextInt ( ) ; y = in . nextInt ( ) ; z = in . nextInt ( ) ; Sum_X = Sum_X + x ; Sum_Y = Sum_Y + y ; Sum_Z = Sum_Z + z ; } if ( Sum_X == 0 && Sum_Y == 0 && Sum_Z == 0 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }


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


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

s = input ( ) s1 = s . split ( ' < ' ) NEW_LINE


a = input ( ) . split ( ' > ' ) NEW_LINE


s = input ( ) s = " " . join ( s . split ( ' > ' ) ) s = " " . join ( s . split ( ' < ' ) ) a = [ ] i = 0 tab = 0 ws = ' ▁ ' while i < len ( s ) : if s [ i ] != ' / ' : a . append ( ws * tab + ' < ' + s [ i ] + ' > ' ) tab += 2 i += 1 if s [ i ] == ' / ' : tab -= 2 a . append ( ws * tab + ' < / ' + s [ i + 1 ] + ' > ' ) i += 2 for i in a : print ( i ) NEW_LINE


str_input = input ( ) queue = [ ] indentation = 0 while ( str_input != " " ) : if ( str_input [ 1 ] == ' / ' ) : print ( " % s % s " % ( indentation * " ▁ " , str_input [ 0 : 4 ] ) ) queue . pop ( ) str_input = str_input [ 4 : ] if ( str_input != " " and str_input [ 1 ] == " / " ) : indentation -= 2 else : print ( " % s % s " % ( indentation * " ▁ " , str_input [ 0 : 3 ] ) ) queue . append ( str_input [ 1 : 2 ] ) str_input = str_input [ 3 : ] if ( str_input != " " and str_input [ 0 : 3 ] != " < / % s " % ( queue [ - 1 ] ) ) : indentation += 2 NEW_LINE


s = input ( ) . split ( ' < ' ) [ 1 : ] level = - 1 arr = set ( ) f = Falsefor i in s : f = False if i [ 0 ] != ' / ' : f = True   if f : level += 1 print ( " ▁ " * ( 2 * level ) + ' < ' + i ) if not f : level -= 1 NEW_LINE


import java . util . * ;   public class Main {    public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; String [ ] c = s . split ( " > < " ) ; c [ 0 ] = c [ 0 ] . substring ( 1 ) ; c [ c . length - 1 ] = c [ c . length - 1 ] . substring ( 0 , 2 ) ; int spaces = 0 ; for ( int i = 0 ; i < c . length ; i ++ ) { if ( c [ i ] . charAt ( 0 ) != ' / ' ) { for ( int j = spaces ; j > 0 ; j -- ) System . out . print ( " ▁ " ) ; System . out . println ( " < " + c [ i ] + " > " ) ; spaces += 2 ; } else { spaces -= 2 ; for ( int j = spaces ; j > 0 ; j -- ) System . out . print ( " ▁ " ) ; System . out . println ( " < " + c [ i ] + " > " ) ; } }   }   }


import java . util . Scanner ; public class Ishu1 { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String str ; int nested = 0 , i , j ; int [ ] degree = new int [ 26 ] ; char [ ] ch = new char [ 1000 ] ; str = scan . next ( ) ; ch = str . toCharArray ( ) ; for ( i = 0 ; i < str . length ( ) ; ++ i ) if ( ch [ i ] >= ' a ' && ch [ i ] <= ' z ' ) { if ( ch [ i - 1 ] == ' < ' ) { for ( j = 1 ; j <= 2 * nested ; ++ j ) System . out . print ( " ▁ " ) ; System . out . println ( " < " + ch [ i ] + " > " ) ; ++ nested ; } else if ( ch [ i - 1 ] == ' / ' ) { -- nested ; for ( j = 1 ; j <= 2 * nested ; ++ j ) System . out . print ( " ▁ " ) ; System . out . println ( " < / " + ch [ i ] + " > " ) ; } } } }


import java . util . * ; import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ;   public final class Xml { public static void main ( String [ ] args ) throws IOException {   BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = br . readLine ( ) ;   int h = 0 ; int i = 0 ;   while ( i + 1 < s . length ( ) ) { if ( s . charAt ( i + 1 ) == ' / ' ) { h -- ; for ( int j = 0 ; j < 2 * h ; j ++ ) { System . out . print ( ' ▁ ' ) ; } System . out . println ( s . substring ( i , i + 4 ) ) ; i += 4 ; } else { for ( int j = 0 ; j < 2 * h ; j ++ ) { System . out . print ( ' ▁ ' ) ; } System . out . println ( s . substring ( i , i + 3 ) ) ; i += 3 ; h ++ ; } } } }


import java . io . * ; import java . math . * ; import java . security . * ; import java . text . * ; import java . util . * ; import javafx . util . Pair ; public class CodeForce { static BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; static StringBuilder sb = new StringBuilder ( ) ; static boolean flag = false ; static int next ( String [ ] sr , int ind ) { return Integer . parseInt ( sr [ ind ] ) ; } public static void main ( String [ ] args ) throws IOException { String sr = br . readLine ( ) ; char [ ] arr = sr . toCharArray ( ) ; int i = sr . length ( ) - 1 ; int count = 0 ; while ( i > 0 ) { if ( arr [ i ] == '0' ) { count ++ ; } else { int j = i - 1 ; while ( j >= 0 && arr [ j ] != '0' ) { arr [ j ] = '0' ; j -- ; } count = count + 2 ; if ( j >= 0 ) arr [ j ] = 1 ; else { count += i ; System . out . println ( count ) ; return ; } } i -- ; } if ( arr [ 0 ] == '0' ) count ++ ; System . out . println ( count ) ; } }

s = list ( input ( ) [ : : - 1 ] ) NEW_LINE i = 0 NEW_LINE l = len ( s ) NEW_LINE carry = False NEW_LINE c = 0 NEW_LINE if s . count ( '1' ) == 1 : NEW_LINE INDENT print ( l - 1 ) NEW_LINE exit ( 0 ) NEW_LINE DEDENT while i < l : NEW_LINE INDENT if s [ i ] == '1' : NEW_LINE INDENT if not carry : NEW_LINE INDENT c += 2 NEW_LINE i += 1 NEW_LINE carry = True NEW_LINE DEDENT else : NEW_LINE INDENT s [ i ] = '0' NEW_LINE c += 1 NEW_LINE i += 1 NEW_LINE DEDENT DEDENT else : NEW_LINE INDENT if carry : NEW_LINE INDENT s [ i ] = '1' NEW_LINE carry = False NEW_LINE DEDENT else : NEW_LINE INDENT c += 1 NEW_LINE i += 1 NEW_LINE DEDENT DEDENT DEDENT print ( c ) NEW_LINE