import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; boolean is = false ; if ( n < 0 ) { n = n * - 1 ; is = true ; } int last , lastSecond ; if ( is ) { last = n % 10 ; lastSecond = n % 100 ; lastSecond = lastSecond / 10 ; if ( last >= lastSecond ) { n = n / 10 ; } else { n = n / 100 ; n = n * 10 ; n = n + last ; } n = n * - 1 ; } System . out . println ( n ) ; } }

import java . util . * ;   public class Codeforces { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; if ( n >= 0 ) { System . out . println ( n ) ; } else { int max = Math . max ( n / 10 , n / 100 * 10 + n % 10 ) ; System . out . println ( max ) ; } System . out . println ( ) ;   }   }

import java . io . * ; import java . util . StringTokenizer ;   public class A313 { public static void main ( String [ ] args ) throws IOException { PrintWriter out = new PrintWriter ( System . out ) ; FastScanner fs = new FastScanner ( ) ; long N ; N = fs . nextInt ( ) ; if ( N > 0 ) { out . println ( N ) ; } else { out . println ( Math . max ( ( int ) ( N / 10 ) , ( int ) ( ( N / 100 ) * 10 ) + ( N % 10 ) ) ) ; } out . close ( ) ; }   static class FastScanner { BufferedReader br ; StringTokenizer st ;   public FastScanner ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   public FastScanner ( String filePath ) throws FileNotFoundException { try { br = new BufferedReader ( new FileReader ( filePath ) ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } }   String next ( ) throws IOException { while ( st == null || ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; throw e ; } } return st . nextToken ( ) ; }   String nextLine ( ) throws IOException { String str ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; throw e ; } return str ; }   int nextInt ( ) throws IOException { return Integer . parseInt ( this . next ( ) ) ; }   long nextLong ( ) throws IOException { return Long . parseLong ( this . next ( ) ) ; } } }

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

n = input ( ) n = int ( n )   if n >= 0 : print ( n ) else : n = str ( n ) print ( max ( int ( n [ 0 : - 2 ] + n [ - 1 : ] ) , int ( n [ 0 : - 1 ] ) ) ) NEW_LINE

n = int ( input ( ) ) if n < 0 : print ( max ( int ( str ( n ) [ : - 1 ] ) , int ( str ( n ) [ : - 2 ] + str ( n ) [ - 1 ] ) ) ) else : print ( n ) NEW_LINE

n = int ( input ( ) ) a = abs ( n ) % 10 b = abs ( n ) // 10 % 10 if n > 0 : print ( n ) elif a > b : print ( int ( str ( n ) [ 0 : - 1 ] ) ) else : n = str ( n ) print ( int ( n [ 0 : - 2 ] + n [ - 1 ] ) ) NEW_LINE

s1 = input ( ) n = int ( s1 ) if n > 0 : print ( n ) else : b = s1 [ len ( s1 ) - 1 ] a = s1 [ len ( s1 ) - 2 ] s2 = s1 [ 0 : len ( s1 ) - 2 ] aa = s2 + a bb = s2 + b n1 = int ( aa ) n2 = int ( bb ) if n1 >= n2 : print ( n1 ) else : print ( n2 ) NEW_LINE


import java . util . * ; import java . io . * ;   public class A_Elevator {   public static void main ( String [ ] args ) throws Exception { Scanner in = new Scanner ( new File ( " input . txt " ) ) ; PrintWriter pw = new PrintWriter ( new File ( " output . txt " ) ) ;

import java . io . PrintWriter ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . Scanner ; import java . util . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . BufferedWriter ; import java . io . DataInputStream ; import java . io . File ; import java . io . FileInputStream ; import java . io . OutputStreamWriter ; import java . util . InputMismatchException ; import jdk . nashorn . internal . codegen . CompilerConstants ; public class Solution { public static void main ( String [ ] args ) throws IOException {

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

import syssys . stdin = open ( ' input . txt ' , ' r ' ) sys . stdout = open ( ' output . txt ' , ' w ' ) s = input ( ) n = input ( ) if s == " front " and n == '1' : print ( ' L ' ) elif s == " front " and n == '2' : print ( ' R ' ) elif s == " back " and n == '1' : print ( " R " ) elif s == " back " and n == '2' : print ( " L " ) NEW_LINE

import syssys . stdin = open ( " input . txt " , " r " ) sys . stdout = open ( " output . txt " , " w " ) match = input ( ) rail = int ( input ( ) ) if match == " front " : if rail == 1 : print ( " L " ) else : print ( " R " ) else : if rail == 1 : print ( " R " ) else : print ( " L " ) NEW_LINE

input_file = open ( " input . txt " , " r " ) door = input_file . readline ( ) [ : - 1 ] rail_no = int ( input_file . readline ( ) )   if ( door == " front " ) : d_num = 1 else : d_num = 2   output_file = open ( " output . txt " , " w " ) if ( ( rail_no + d_num ) % 2 == 0 ) : output_file . write ( " L " ) else : output_file . write ( " R " ) NEW_LINE

a = open ( " input . txt " , " r " ) . read ( ) . split ( ) f = open ( " output . txt " , " w " ) if a [ 0 ] [ 0 ] == " f " and a [ 1 ] == "1" or a [ 0 ] [ 0 ] == " b " and a [ 1 ] == "2" : f . write ( " L " ) else : f . write ( " R " ) f . close ( ) NEW_LINE

f = open ( ' input . txt ' , ' r ' ) n1 = f . readline ( ) n2 = f . readline ( ) n2 = int ( n2 ) n1 = n1 [ : n1 . index ( ' \n ' ) ] g = open ( ' output . txt ' , ' w ' ) if n1 == ' front ' and n2 == 1 : g . write ( ' L ' ) elif n1 == ' back ' and n2 == 1 : g . write ( ' R ' ) elif n1 == ' back ' and n2 == 2 : g . write ( ' L ' ) elif n1 == ' front ' and n2 == 2 : g . write ( ' R ' ) NEW_LINE


import java . util . * ; public class Main {   public static void main ( String [ ] args ) { int t , n ;   Scanner sc = new Scanner ( System . in ) ;   t = sc . nextInt ( ) ;   while ( t -- > 0 ) { n = sc . nextInt ( ) ;   System . out . println ( ( n <= 3 ) ? n - 1 : 2 + ( n & 1 ) ) ; }

import java . util . * ;   import static java . lang . Math . * ;   public class WayTooLongWords { public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; int x = in . nextInt ( ) ; while ( x > 0 ) { x -- ; int n = in . nextInt ( ) ; if ( n == 1 ) System . out . println ( 0 ) ; else if ( n == 2 ) System . out . println ( 1 ) ; else if ( n == 3 ) System . out . println ( 2 ) ; else if ( n > 3 && n % 2 == 0 ) System . out . println ( 2 ) ; else System . out . println ( 3 ) ; } } }

import java . util . Scanner ;    public class JavaApplication71 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int size = in . nextInt ( ) ; for ( int i = 0 ; i < size ; i ++ ) { int n = in . nextInt ( ) ; if ( n == 1 ) { System . out . println ( 0 ) ; continue ; } if ( n == 2 ) { System . out . println ( 1 ) ; continue ; } if ( n == 3 ) { System . out . println ( 2 ) ; continue ; } if ( n % 2 == 0 ) { System . out . println ( 2 ) ; continue ; } else { System . out . println ( 3 ) ; continue ; } } } }

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

import java . util . Scanner ;   public class A1451 { 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 ( ) ; if ( n == 1 ) { System . out . println ( 0 ) ; continue ; } else if ( n == 2 ) { System . out . println ( 1 ) ; } else if ( n == 3 ) { System . out . println ( 2 ) ; } else { System . out . println ( n % 2 == 1 ? 3 : 2 ) ; } } } }

def solve ( n ) : if NEW_LINE n == 1 : NEW_LINE return 0 elif n == 2 : NEW_LINE return 1 elif n == 3 : NEW_LINE return 2 else : if n % 2 == 0 : NEW_LINE INDENT return 2 else : NEW_LINE return 3   t = int ( input ( ) ) NEW_LINE DEDENT for tc in range ( t ) : n = int ( input ( ) ) NEW_LINE print ( solve ( n ) ) NEW_LINE

for i in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE if n == 1 : NEW_LINE INDENT print ( 0 ) elif n == 2 : NEW_LINE print ( 1 ) elif n == 3 : NEW_LINE print ( 2 ) elif n % 2 == 0 : NEW_LINE print ( 2 ) else : NEW_LINE print ( 3 ) NEW_LINE DEDENT

for _ in range ( int ( input ( ) ) ) : n = input ( ) NEW_LINE if n == "1" : NEW_LINE INDENT count = 0 elif n == "2" : NEW_LINE count = 1 elif int ( n [ - 1 ] ) % 2 == 0 or n == "3" : NEW_LINE count = 2 else : NEW_LINE count = 3 NEW_LINE DEDENT print ( count ) NEW_LINE

t = int ( input ( ) ) NEW_LINE while t > 0 : t = t - 1 NEW_LINE n = int ( input ( ) ) NEW_LINE if n == 1 : NEW_LINE INDENT print ( 0 ) elif n == 2 : NEW_LINE print ( 1 ) elif n == 3 : NEW_LINE print ( 2 ) elif n % 2 == 0 : NEW_LINE print ( 2 ) else : NEW_LINE print ( 3 ) NEW_LINE DEDENT


import java . util . * ; import java . io . * ; import java . math . * ; public class Main { static BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; static StringTokenizer st ; static PrintWriter pr = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; public static void main ( String [ ] args ) throws IOException { int n = readInt ( ) , q = readInt ( ) , a [ ] = new int [ n ] ; Set < Integer > s = new HashSet ( ) ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = readInt ( ) ; edge [ ] arr = new edge [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { int b = readInt ( ) ; arr [ i ] = new edge ( i , b , a [ i ] ) ; s . add ( i ) ; } Arrays . sort ( arr ) ; Map < Integer , Integer > mp = new HashMap ( ) ; for ( int i = 0 ; i < n ; i ++ ) { mp . put ( arr [ i ] . v , i ) ; } int cur = 0 ;

import sysinput = sys . stdin . readlinen , m = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) c = list ( map ( int , input ( ) . split ( ) ) ) l = [ ] for i in range ( len ( c ) ) : l . append ( ( c [ i ] , i ) )   l . sort ( ) ptr = 0 NEW_LINE

import math , sys , bisect , heapqfrom collections import defaultdict , Counter , dequefrom itertools import groupby , accumulate NEW_LINE

import sysfrom collections import dequeinput_ = lambda : sys . stdin . readline ( ) . strip ( " \n " ) ii = lambda : int ( input_ ( ) ) il = lambda : list ( map ( int , input_ ( ) . split ( ) ) ) ilf = lambda : list ( map ( float , input ( ) . split ( ) ) ) ip = lambda : input ( ) fi = lambda : float ( input ( ) ) li = lambda : list ( input ( ) ) pr = lambda x : print ( x )   n , m = il ( ) a = il ( ) c = il ( )   z = [ [ c [ i ] , i ] for i in range ( n ) ]   z . sort ( ) z = deque ( z )   for _ in range ( m ) : x , y = il ( )   ans = 0   x -= 1   t = min ( y , a [ x ] ) a [ x ] -= t ans += t * c [ x ] y -= t   while y > 0 and z : f = z [ 0 ] t = min ( a [ f [ 1 ] ] , y ) a [ f [ 1 ] ] -= t y -= t ans += f [ 0 ] * t   if a [ f [ 1 ] ] == 0 : z . popleft ( )   if y == 0 : print ( ans ) else : print ( 0 ) NEW_LINE

import sys , math , itertoolsfrom collections import Counter , deque , defaultdictfrom bisect import bisect_left , bisect_right from heapq import heappop , heappush , heapify , nlargestfrom copy import deepcopymod = 10 ** 9 + 7 INF = float ( ' inf ' ) def inp ( ) : return int ( sys . stdin . readline ( ) ) def inpl ( ) : return list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) def inpl_1 ( ) : return list ( map ( lambda x : int ( x ) - 1 , sys . stdin . readline ( ) . split ( ) ) )   MM = 10 ** 10 n , m = inpl ( ) a = inpl ( ) c = inpl ( ) q = [ ] NEW_LINE


import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int t = s . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = s . nextInt ( ) ; int a [ ] = new int [ n ] ; for ( int j = 0 ; j < n ; j ++ ) a [ j ] = s . nextInt ( ) ; Arrays . sort ( a ) ; int c [ ] = new int [ n ] ; int p = 0 ; for ( int g = n - 1 ; g >= 0 ; g -- ) { c [ p ] = a [ g ] ; p ++ ; } int b [ ] = new int [ n ] ; for ( int k = 0 ; k < n ; k ++ ) { b [ k ] = Math . min ( c [ k ] , ( k + 1 ) ) ; } int max = b [ 0 ] ; for ( int y = 0 ; y < n ; y ++ ) { if ( b [ y ] > max ) max = b [ y ] ; } System . out . println ( max ) ; } } }

import java . util . * ; import java . util . Arrays ; public class program { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { a [ j ] = sc . nextInt ( ) ; } Arrays . sort ( a ) ; int k = 0 , count = 0 ; for ( int j = n - 1 ; j >= 0 ; j -- ) { if ( a [ j ] >= k + 1 ) { count ++ ; } k ++ ; } System . out . println ( count ) ; } } }

import java . io . * ; import java . util . * ; import javax . print . attribute . standard . Finishings ;   import java . math . * ;   public class Square { 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 { int t = sc . nextInt ( ) ; while ( t -- > 0 ) {

import java . util . ArrayList ; import java . util . Arrays ; import java . util . Scanner ;   public class Singleton_Pattern { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; for ( int i = 0 ; i < k ; i ++ ) { int n = sc . nextInt ( ) ; int x [ ] = new int [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { x [ j ] = sc . nextInt ( ) ; }   int res = 0 ; for ( int j = 1 ; j <= n ; j ++ ) { int check = 0 ; int c = 0 ; for ( int l = 0 ; l < n ; l ++ ) { c ++ ; if ( j <= x [ l ] ) check ++ ; }

for _ in range ( int ( input ( ) ) ) : n , A = int ( input ( ) ) , sorted ( ( int ( _ ) for _ in input ( ) . split ( ) ) ) print ( next ( ( i for i , a in enumerate ( A [ : : - 1 ] ) if i >= a ) , n ) ) NEW_LINE

k = int ( input ( ) )   for _ in range ( k ) :   n = int ( input ( ) ) planks_in = input ( ) planks = planks_in . split ( ) planks = list ( map ( int , planks ) ) planks . sort ( )   for i in range ( n ) : if planks [ i ] >= ( n - i ) : print ( n - i ) break NEW_LINE

def main_function ( ) : output_list = [ ] t = int ( input ( ) ) for i in range ( t ) : hash_list = [ 0 for i in range ( 1002 ) ] n = int ( input ( ) ) l = [ int ( i ) for i in input ( ) . split ( " ▁ " ) ] for i in range ( len ( l ) ) : hash_list [ l [ i ] ] += 1 count = 0 for i in range ( len ( hash_list ) ) : j = len ( hash_list ) - 1 - i NEW_LINE

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) l = [ int ( i ) for i in input ( ) . split ( ) ] mx = max ( l ) mxsq = 0 for i in range ( 1 , mx + 1 ) : c = 0 for j in l : if j >= i : c += 1 if c >= i : mxsq = max ( mxsq , i ) print ( mxsq ) NEW_LINE

def sol ( a : list ) : n = len ( a ) a . sort ( reverse = True ) ans = 0   for i in range ( n ) : if a [ i ] >= i + 1 : ans = i + 1 else : break print ( ans )     n = int ( input ( ) ) for i in range ( n ) : z = int ( input ( ) ) x = list ( map ( int , input ( ) . split ( ) ) ) sol ( x ) NEW_LINE


import java . util . Scanner ;    public class Bicycle { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int k = input . nextInt ( ) ; input . nextLine ( ) ; int [ ] x = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) x [ i ] = input . nextInt ( ) ; int count = 1 ; int d = k ; boolean flag = true ; for ( int i = 1 ; ( i < n ) && flag ; i ++ ) { d -= x [ i ] - x [ i - 1 ] ; if ( d < 0 ) flag = false ; else if ( i != n - 1 && d >= ( x [ i + 1 ] - x [ i ] ) ) { continue ; } else { count ++ ; d = k ; } } count -- ; if ( flag ) System . out . println ( count ) ;   else System . out . println ( " - 1" ) ;   }   }

import java . io . BufferedInputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . util . LinkedList ; import java . util . List ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . TreeSet ;   public class Main extends Thread {

n , k = [ int ( i ) for i in input ( ) . split ( ) ] X = [ int ( i ) for i in input ( ) . split ( ) ] rem = kcnt = 1 for i in range ( len ( X ) - 1 ) : if X [ i + 1 ] - X [ i ] > rem : rem = k cnt += 1 if X [ i + 1 ] - X [ i ] > rem : print ( - 1 ) break rem -= X [ i + 1 ] - X [ i ] else : print ( cnt ) NEW_LINE

n , k = map ( int , input ( ) . split ( ) ) t = list ( map ( int , input ( ) . split ( ) ) ) l = [ 0 ] ch = 1 i = 0 p2 = 0 while i < n - 1 : pepe = 0 j = i + 1 while j < n : if t [ j ] - t [ i ] <= k : j += 1 else : c1 = j - 1 ch += 1 pepe = 5 break if pepe == 5 : i = j - 1 else : i += 1 if i in l : p2 = 5 break else : l . append ( i ) print ( ch if p2 == 0 else " - 1" ) NEW_LINE

n , k = ( int ( x ) for x in input ( ) . split ( ) ) x = [ int ( x ) for x in input ( ) . split ( ) ] flag = Trueif flag : for i in range ( 1 , n ) : if x [ i ] - x [ i - 1 ] > k : print ( - 1 ) flag = False breakif flag : ans = 1 stop = x [ - 1 ] - k i = 2 while i < n + 1 : if stop <= x [ 0 ] : break if x [ - i ] > stop : i += 1 elif x [ - i ] == stop : ans += 1 stop = x [ - i ] - k i += 1 else : ans += 1 stop = x [ - i + 1 ] - k   print ( ans ) NEW_LINE

n , k = map ( int , input ( ) . split ( " ▁ " ) )   x = list ( map ( int , input ( ) . split ( " ▁ " ) ) )   r = 1   cK = k   for i in range ( n ) :   try :   rr = x [ i + 1 ] - x [ i ]   if k < rr :   r = - 1   break   if rr <= cK :   cK -= rr   else :   r += 1   cK = k - rr   except :   break ;   print ( r )       NEW_LINE

n , k = list ( map ( int , input ( ) . split ( ) ) ) x = list ( map ( int , input ( ) . split ( ) ) ) dists = [ x [ i ] - x [ i - 1 ] for i in range ( 1 , n ) ] if max ( dists ) > k : print ( - 1 ) else : cnt , rest = 0 , 0 for dist in dists : if rest < dist : cnt += 1 rest = k - dist else : rest -= dist print ( cnt ) NEW_LINE


import java . util . * ; public class GregsWorkout { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String trains [ ] = { " chest " , " biceps " , " back " } ; int n = in . nextInt ( ) ; int arr [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = in . nextInt ( ) ; int sum [ ] = new int [ 3 ] ; for ( int i = 0 ; i < n ; i ++ ) { sum [ i % 3 ] += arr [ i ] ; } int maxI = 0 ; for ( int i = 1 ; i < sum . length ; i ++ ) if ( sum [ i ] > sum [ maxI ] ) maxI = i ; System . out . println ( trains [ maxI ] ) ; } }

import java . util . * ;   public class Main {   public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int [ ] a = new int [ n ] ; int chest = 0 , bicep = 0 , back = 0 , k = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = scanner . nextInt ( ) ; if ( k == 0 ) chest += a [ i ] ; else if ( k == 1 ) bicep += a [ i ] ; else { back += a [ i ] ; k = - 1 ; } k ++ ; } int max = Math . max ( chest , Math . max ( bicep , back ) ) ; if ( max == chest ) System . out . println ( " chest " ) ; else if ( max == bicep ) System . out . println ( " biceps " ) ; else System . out . println ( " back " ) ;   } }

import java . util . Scanner ;   public class A255 {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int i = 0 ; int a = 0 , b = 0 , c = 0 ; while ( i <= n ) { a += sc . nextInt ( ) ; i ++ ; if ( i == n ) break ; b += sc . nextInt ( ) ; i ++ ; if ( i == n ) break ; c += sc . nextInt ( ) ; i ++ ; if ( i == n ) break ; } if ( a > b && a > c ) System . out . println ( " chest " ) ; if ( b > a && b > c ) System . out . println ( " biceps " ) ; if ( c > a && c > b ) System . out . println ( " back " ) ; } }

import java . lang . * ; import java . util . * ; import java . io . * ;   public class _temp2 { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; String [ ] st = br . readLine ( ) . split ( " ▁ " ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = Integer . parseInt ( st [ i ] ) ; } int chest = 0 , bicep = 0 , back = 0 ; int state = 0 ; for ( int i = 0 ; i < n ; i ++ ) { state = state % 3 ; if ( state == 0 ) { chest += a [ i ] ; } else if ( state == 1 ) { bicep += a [ i ] ; } else if ( state == 2 ) { back += a [ i ] ; } state ++ ; } if ( chest > bicep ) { if ( chest > back ) { System . out . println ( " chest " ) ; } else { System . out . println ( " back " ) ; } } else { if ( bicep > back ) { System . out . println ( " biceps " ) ; } else { System . out . println ( " back " ) ; } } } }

import java . util . Scanner ;   public class A255 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) , ch = 0 , bic = 0 , back = 0 ; int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = scanner . nextInt ( ) ; } for ( int i = 0 ; i < n ; i += 3 ) { ch += a [ i ] ; } for ( int i = 1 ; i < n ; i += 3 ) { bic += a [ i ] ; } for ( int i = 2 ; i < n ; i += 3 ) { back += a [ i ] ; } int max = Math . max ( Math . max ( ch , bic ) , back ) ; if ( max == ch ) { System . out . println ( " chest " ) ; } else if ( max == bic ) { System . out . println ( " biceps " ) ; } else { System . out . println ( " back " ) ; } } }

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) l = [ sum ( a [ i : : 3 ] ) for i in [ 0 , 1 , 2 ] ] print ( [ " chest " , " biceps " , " back " ] [ l . index ( max ( l ) ) ] ) NEW_LINE

n = int ( input ( ) ) array = list ( map ( int , input ( ) . split ( ) ) ) answer = [ " chest " , " biceps " , " back " , 0 , 0 , 0 ]   for i in range ( n ) : if i % 3 == 0 : answer [ 3 ] += array [ i ] elif i % 3 == 1 : answer [ 4 ] += array [ i ] elif i % 3 == 2 : answer [ 5 ] += array [ i ]   print ( answer [ answer . index ( max ( answer [ 3 : ] ) ) - 3 ] ) NEW_LINE

n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) a , b , c = 0 , 0 , 0 for i in range ( n ) : if i % 3 == 0 : a += l [ i ] elif i % 3 == 1 : b += l [ i ] else : c += l [ i ] if max ( a , b , c ) == a : print ( ' chest ' ) elif max ( a , b , c ) == b : print ( ' biceps ' ) else : print ( ' back ' ) NEW_LINE

n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) a , b , c = 0 , 0 , 0 for i in range ( n ) : if i % 3 == 0 : a += l [ i ] elif i % 3 == 1 : b += l [ i ] else : c += l [ i ] if a >= b and a >= c : print ( " chest " ) elif b >= a and b >= c : print ( " biceps " ) else : print ( " back " ) NEW_LINE


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

import java . util . * ; public class ternary_logic { long ter ( int x ) { String s = " " ; if ( x == 0 ) s = "0" ; while ( x > 0 ) { s = x % 3 + s ; x /= 3 ; } return Long . valueOf ( s ) ; } public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int a = in . nextInt ( ) ; int c = in . nextInt ( ) ; ternary_logic ob = new ternary_logic ( ) ; long at = ob . ter ( a ) ; long ct = ob . ter ( c ) ;

import java . util . Scanner ; import java . util . Arrays ; public class Codechef { public static void main ( String [ ] args ) throws java . lang . Exception { try { Scanner sc = new Scanner ( System . in ) ; int a , b , i , n ; long k = 0 ; String s , w , c ; s = w = c = " " ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; while ( a > 0 ) { n = a % 3 ; s = n + s ; a = a / 3 ; } while ( b > 0 ) { n = b % 3 ; w = n + w ; b = b / 3 ; } n = s . length ( ) ; for ( i = 0 ; i < 20 - n ; i ++ ) s = "0" + s ; n = w . length ( ) ; for ( i = 0 ; i < 20 - n ; i ++ ) w = "0" + w ;

a , b = map ( int , input ( ) . split ( ) ) sum = 0 k = 1   while a or b : sum += k * ( ( ( b % 3 ) - ( a % 3 ) ) % 3 ) a //= 3 b //= 3 k *= 3 print ( sum ) NEW_LINE


import java . io . * ; import java . util . * ;   public class E {   public static void main ( String [ ] args ) { FastScanner in = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int t = in . nextInt ( ) ; while ( t -- > 0 ) { int n = in . nextInt ( ) , xx = in . nextInt ( ) ; int d = 0 , h = 0 ; int maxDiff = 0 , max = 0 ; for ( int i = 0 ; i < n ; i ++ ) { d = in . nextInt ( ) ; h = in . nextInt ( ) ; maxDiff = Math . max ( maxDiff , d - h ) ; max = Math . max ( max , d ) ; } if ( maxDiff == 0 && max < xx ) out . println ( - 1 ) ; else if ( max >= xx ) out . println ( 1 ) ; else out . println ( 1 + ( ( xx - max ) + ( maxDiff - 1 ) ) / maxDiff ) ; } out . flush ( ) ; }

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

import java . util . * ;    public class B_Zmei_Gorynich { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int q = sc . nextInt ( ) ; while ( q -- > 0 ) { int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; IntegerPair ar [ ] = new IntegerPair [ n ] ; int i = 0 ; int max = - 1 ; for ( i = 0 ; i < n ; i ++ ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; max = Math . max ( max , a ) ; IntegerPair temp = new IntegerPair ( a , b ) ; ar [ i ] = temp ; } Arrays . sort ( ar ) ; int dif = ar [ 0 ] . first ( ) - ar [ 0 ] . second ( ) ; if ( max >= x ) { System . out . println ( 1 ) ; continue ; } if ( dif <= 0 ) { System . out . println ( - 1 ) ; continue ; } int ans = ( ( x - 1 - max ) / dif ) + 2 ; System . out . println ( ans ) ; } } } class IntegerPair implements Comparable < IntegerPair > { Integer f ; Integer s ; Integer d ; public IntegerPair ( Integer first , Integer second ) { f = first ; s = second ; d = second - first ; } public int compareTo ( IntegerPair o ) { if ( this . diff ( ) . equals ( o . diff ( ) ) ) { return o . first ( ) - this . first ( ) ; } else { return this . diff ( ) - o . diff ( ) ; } } public Integer diff ( ) { return d ; } public Integer first ( ) { return f ; } public Integer second ( ) { return s ; } }

t = int ( input ( ) ) for _ in range ( t ) : n , l = map ( int , input ( ) . split ( ) ) a = [ ] m = 0 ans = 10 ** 10 for i in range ( n ) : x , y = map ( int , input ( ) . split ( ) ) m = max ( m , x ) a . append ( [ x , y ] ) d = 0 for i in range ( n ) : if a [ i ] [ 0 ] > a [ i ] [ 1 ] : d = max ( d , a [ i ] [ 0 ] - a [ i ] [ 1 ] ) if d == 0 : if m < l : print ( - 1 ) else : print ( 1 ) else : l = l - m ans = max ( l // d + bool ( l % d ) + 1 , 1 ) print ( ans ) NEW_LINE

import mathfor _ in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) ) maxDH = - 10 ** 9 arr = [ ] for i in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) maxDH = max ( maxDH , a - b ) arr . append ( [ a , b ] ) res = 1 maxD = - 1 for i in arr : maxD = max ( maxD , i [ 0 ] ) m -= maxD if m > 0 : if maxDH <= 0 : res = - 1 else : res += ( m + maxDH - 1 ) // maxDH print ( res ) NEW_LINE

from collections import defaultdict , deque , Counterfrom sys import stdin , stdoutfrom heapq import heappush , heappopimport mathimport ioimport osimport mathimport bisect   NEW_LINE

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

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


import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String args [ ] ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int m = scan . nextInt ( ) ; int [ ] arr = new int [ n ] ; int c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int a = scan . nextInt ( ) ; if ( a < 0 ) { arr [ i ] = a ; c ++ ; } } int sum = 0 ; Arrays . sort ( arr ) ; if ( c >= m ) { for ( int i = 0 ; i < m ; i ++ ) { sum = sum + Math . abs ( arr [ i ] ) ; } } else { for ( int i = 0 ; i < arr . length ; i ++ ) { sum = sum + Math . abs ( arr [ i ] ) ; } } System . out . print ( sum ) ; } }

import java . util . Arrays ; import java . util . Comparator ; import java . util . Scanner ;   public class Sale { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int m = scanner . nextInt ( ) ; scanner . nextLine ( ) ;   int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = scanner . nextInt ( ) ; }   int [ ] ints = Arrays . stream ( arr ) . filter ( e -> e < 0 ) . sorted ( ) . limit ( m ) . toArray ( ) ;   int gain = 0 ; for ( int i = ints . length - 1 ; i >= 0 ; i -- ) { int item = ints [ i ] ; if ( item < 0 ) { gain += Math . abs ( item ) ; } }   System . out . println ( gain ) ;    } }

import java . util . * ; public class MyClass { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; int s = 0 ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } Arrays . sort ( arr ) ; for ( int i = 0 ; i < m ; i ++ ) { if ( arr [ i ] >= 0 ) break ; s = s + arr [ i ] ; } System . out . println ( - s ) ; } }

import java . util . * ; public class Sale { public static void main ( String arg [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] ar = new int [ n ] ;    for ( int i = 0 ; i < n ; i ++ ) { ar [ i ] = sc . nextInt ( ) ; }   Arrays . sort ( ar ) ; int res = 0 ;   for ( int i = 0 ; i < m ; i ++ ) { if ( ar [ i ] < 0 ) res += ar [ i ] ; }   System . out . println ( Math . abs ( res ) ) ;   }   }

import sysfrom math import * input = sys . stdin . readline   def solve ( n , k , arr ) : arr . sort ( ) tot = 0 for i in range ( n ) : if i + 1 > k : print ( tot ) return else : if arr [ i ] <= 0 : tot += abs ( arr [ i ] ) else : print ( tot ) return else : print ( tot )   NEW_LINE

n , m = map ( int , input ( ) . split ( ) ) lst = [ * map ( int , input ( ) . split ( ) ) ] lst . sort ( )   total = 0   for num in lst [ : m ] : if num > 0 : break else : total += numprint ( abs ( total ) ) NEW_LINE

n , m = map ( int , input ( ) . split ( ) ) l = sorted ( list ( map ( int , input ( ) . split ( ) ) ) ) c = 0 s = 0 for i in l : if ( i < 0 and c < m ) : s += i c += 1 else : break print ( - s ) NEW_LINE

import math   def solve ( ) : a , b = list ( map ( int , input ( ) . split ( ) ) ) arr = [ int ( i ) for i in input ( ) . split ( ) ] arr . sort ( )   sum = 0   for i in range ( b ) : if arr [ i ] > 0 : break sum += - 1 * arr [ i ]   return sum         print ( solve ( ) ) NEW_LINE

n , m = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) count = mans = 0 for i in range ( len ( a ) ) : k = min ( a ) if k < 0 : ans = ans - k count -= 1 a [ a . index ( k ) ] = 1 else : break if count == 0 : breakprint ( ans ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ;   import javafx . util . Pair ;   public class Main {   public static void main ( String [ ] args ) {   FastScanner input = new FastScanner ( ) ; int n = input . nextInt ( ) ;   int a [ ] [ ] = new int [ n ] [ 2 ] ; int freq [ ] = new int [ 2001 ] ; TreeSet < Integer > set = new TreeSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] [ 1 ] = input . nextInt ( ) ; a [ i ] [ 0 ] = i ; freq [ a [ i ] [ 1 ] ] ++ ; set . add ( a [ i ] [ 1 ] ) ;   }   long total = 1 ; for ( Integer integer : set ) {   total *= freq [ integer ] ; if ( total >= 3 ) { break ; } } Arrays . sort ( a , new Comparator < int [ ] > ( ) { @ Override public int compare ( int [ ] t , int [ ] t1 ) { return t [ 1 ] - t1 [ 1 ] ; }   } ) ;

a = int ( input ( ) ) b = [ [ ] for _ in " ▁ " * ( 2001 ) ] ok2 = 0 ; ok3 = 0 ; k5 , k6 , k7 = 0 , 1 , 1 for i , j in enumerate ( map ( int , input ( ) . split ( ) ) ) : b [ j ] . append ( i + 1 ) k = [ [ ] for _ in " ▁ " * 3 ] for i in range ( 2001 ) : if len ( b [ i ] ) : if len ( b [ i ] ) > 2 : ok3 = 1 k2 , k3 , k4 = 0 , 1 , 2 for j in range ( len ( b [ i ] ) ) : k [ 0 ] . append ( b [ i ] [ ( j + k2 ) % len ( b [ i ] ) ] ) k [ 1 ] . append ( b [ i ] [ ( j + k3 ) % len ( b [ i ] ) ] ) k [ 2 ] . append ( b [ i ] [ ( j + k4 ) % len ( b [ i ] ) ] ) elif len ( b [ i ] ) == 2 : ok2 += 1 for j in range ( len ( b [ i ] ) ) : k [ 0 ] . append ( b [ i ] [ ( j + k5 ) % len ( b [ i ] ) ] ) k [ 1 ] . append ( b [ i ] [ ( j + k6 ) % len ( b [ i ] ) ] ) k [ 2 ] . append ( b [ i ] [ ( j + k7 ) % len ( b [ i ] ) ] ) k5 , k6 , k7 = 1 , 1 , 0 else : k [ 0 ] . append ( b [ i ] [ 0 ] ) k [ 1 ] . append ( b [ i ] [ 0 ] ) k [ 2 ] . append ( b [ i ] [ 0 ] )   if ok3 or ok2 > 1 : print ( " YES " ) for i in k : print ( * i ) else : print ( " NO " ) NEW_LINE

n , a , q , w , r = int ( input ( ) ) , list ( map ( int , input ( ) . split ( ) ) ) , [ ] , [ ] , [ 0 ] for i in range ( n ) : q . append ( [ a [ i ] , i + 1 ] ) q . sort ( ) for i in range ( 1 , n ) : if q [ i ] [ 0 ] == q [ i - 1 ] [ 0 ] : r [ 0 ] += 1 ; r . append ( i + 1 ) if r [ 0 ] == 2 : breakfor i in q : w . append ( i [ 1 ] ) if r [ 0 ] == 2 : print ( " YES " ) print ( * w ) for i in range ( 1 , 3 ) : w [ r [ i ] - 1 ] , w [ r [ i ] - 2 ] = w [ r [ i ] - 2 ] , w [ r [ i ] - 1 ] ; print ( * w ) else : print ( " NO " ) NEW_LINE

from collections import Counter n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) counter = Counter ( a ) extra = 0 for i in counter : extra += counter [ i ] - 1 if extra <= 1 : print ( ' NO ' ) else : b = [ ( a [ i ] , i + 1 ) for i in range ( n ) ] b . sort ( ) print ( ' YES ' ) x = [ b [ i ] [ 1 ] for i in range ( n ) ] print ( ' ▁ ' . join ( map ( str , x ) ) ) times = 0 for i in range ( n - 1 ) : if b [ i ] [ 0 ] == b [ i + 1 ] [ 0 ] : tmp = b [ i ] b [ i ] = b [ i + 1 ] b [ i + 1 ] = tmp times += 1 x = [ b [ j ] [ 1 ] for j in range ( n ) ] print ( ' ▁ ' . join ( map ( str , x ) ) ) if times == 2 : break NEW_LINE

n = int ( input ( ) ) arr = sorted ( enumerate ( map ( int , input ( ) . split ( ) ) , 1 ) , key = lambda x : x [ 1 ] ) ans = [ str ( x [ 0 ] ) for x in arr ] q = [ ' YES ' , ' ▁ ' . join ( ans ) ] for i in range ( n - 1 ) : if arr [ i ] [ 1 ] == arr [ i + 1 ] [ 1 ] : ans [ i ] , ans [ i + 1 ] = ans [ i + 1 ] , ans [ i ] q . append ( ' ▁ ' . join ( ans ) ) if len ( q ) > 3 : breakprint ( ' \n ' . join ( q ) if len ( q ) > 3 else " NO " ) NEW_LINE


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

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

import java . util . Arrays ; import java . util . Scanner ;   public class A1249 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int q = scanner . nextInt ( ) ; for ( int i = 0 ; i < q ; i ++ ) { int n = scanner . nextInt ( ) ; int a [ ] = new int [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { a [ j ] = scanner . nextInt ( ) ; } Arrays . sort ( a ) ; boolean flag = false ; for ( int j = 1 ; j < n ; j ++ ) { if ( Math . abs ( a [ j - 1 ] - a [ j ] ) == 1 ) { flag = true ; break ; } else { flag = false ; } } System . out . println ( flag ? 2 : 1 ) ;   } } }

import sysinput = sys . stdin . readline   for test in range ( int ( input ( ) ) ) : n = int ( input ( ) ) a = sorted ( [ int ( i ) for i in input ( ) . split ( ) ] ) ans = 1 for i in range ( n - 1 ) : if a [ i + 1 ] - a [ i ] == 1 : ans = 2 print ( ans ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) a = [ int ( x ) for x in input ( ) . split ( ) ] a . sort ( ) flag = 0 for i in range ( n - 1 ) : if a [ i + 1 ] == a [ i ] + 1 : flag = 1 break if flag : print ( 2 ) else : print ( 1 ) NEW_LINE

n = int ( input ( ) ) for i in range ( n ) : _ = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( ) res = list ( ) for i in range ( len ( a ) ) : if len ( res ) == 0 : res . append ( [ a [ i ] ] ) continue if a [ i ] - res [ - 1 ] [ - 1 ] > 1 : res [ - 1 ] . append ( a [ i ] ) else : if len ( res ) == 1 : res . append ( [ a [ i ] ] ) else : res [ - 2 ] . append ( a [ i ] ) print ( len ( res ) ) NEW_LINE

def teams_counter ( skills ) : res = 1 bucket_1 = [ skills [ 0 ] ] for i in range ( 1 , len ( skills ) ) : if abs ( skills [ i ] - bucket_1 [ - 1 ] ) > 1 : bucket_1 . append ( skills [ i ] ) else : res = 2 break return res                   q = int ( input ( ) )   for i in range ( q ) : size = int ( input ( ) ) skills = sorted ( map ( int , input ( ) . split ( ) ) ) print ( teams_counter ( skills ) )           NEW_LINE

ll = lambda : map ( int , input ( ) . split ( ) ) t = lambda : int ( input ( ) ) ss = lambda : input ( ) lx = lambda x : map ( int , input ( ) . split ( x ) ) NEW_LINE


import java . io . File ; import java . util . Arrays ; import java . util . HashSet ; import java . util . Scanner ; import java . util . StringTokenizer ;   public class p015 { public static void main ( String args [ ] ) throws Exception { StringTokenizer stok = new StringTokenizer ( new Scanner ( System . in ) . useDelimiter ( " \\ A " ) . next ( ) ) ; StringBuilder sb = new StringBuilder ( ) ; int n = Integer . parseInt ( stok . nextToken ( ) ) ; int I = ( Integer . parseInt ( stok . nextToken ( ) ) * 8 ) / n ; Integer [ ] a = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = Integer . parseInt ( stok . nextToken ( ) ) ; } Arrays . sort ( a ) ; int [ ] b = new int [ n ] ; int cnt = 0 ; int i = 0 ; while ( i < n ) { b [ i ] = cnt ; while ( ++ i < n && a [ i ] . intValue ( ) == a [ i - 1 ] . intValue ( ) ) b [ i ] = cnt ; cnt ++ ; } cnt = 0 ; int v = b [ n - 1 ] ; for ( ; v > 0 ; cnt ++ , v >>= 1 ) ; if ( cnt <= I ) System . out . println ( "0" ) ; else { i = 0 ; int min = Integer . MAX_VALUE ; while ( i < n ) { int lo = i , hi = n ; while ( lo != hi ) { int md = ( lo + hi ) / 2 ; if ( b [ md ] < b [ i ] + ( 1 << I ) ) lo = md + 1 ; else hi = md ; } min = Math . min ( min , i + n - lo ) ; while ( ++ i < n && a [ i ] == a [ i - 1 ] ) ; } System . out . println ( min ) ; } } }

from math import ceil , log2from collections import Counterdef read ( ) : return [ int ( i ) for i in input ( ) . split ( ) ] NEW_LINE

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

import osimport sysfrom io import BytesIO , IOBasefrom collections import Counterimport math NEW_LINE


import java . util . * ;    public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n , d , m ; n = input . nextInt ( ) ; d = input . nextInt ( ) ; int a [ ] = new int [ n ] ; long sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = input . nextInt ( ) ; } m = input . nextInt ( ) ; Arrays . sort ( a ) ; if ( m <= n ) { for ( int i = 0 ; i < m ; i ++ ) { sum += a [ i ] ; } System . out . println ( sum ) ; } else { for ( int i = 0 ; i < n ; i ++ ) { sum += a [ i ] ; } sum = sum - ( ( m - n ) * d ) ; System . out . println ( sum ) ; } } }

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

import java . util . Arrays ; import java . util . Scanner ;   public class CoatRackProfit { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ;   int n = scan . nextInt ( ) ; int d = scan . nextInt ( ) ; int [ ] price = new int [ n ] ;   int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { price [ i ] = scan . nextInt ( ) ; sum += price [ i ] ; }   int m = scan . nextInt ( ) ;   if ( m >= n ) { System . out . println ( sum - d * ( m - n ) ) ; } else { Arrays . sort ( price ) ;   sum = 0 ; for ( int i = 0 ; i < m ; i ++ ) { sum += price [ i ] ; } System . out . println ( sum ) ; } } }

datos_n_d = input ( ) . split ( ) n = int ( datos_n_d [ 0 ] ) d = int ( datos_n_d [ 1 ] )   costo_gancho = [ ] datos_gancho = input ( ) . split ( ) for dato in datos_gancho : costo_gancho . append ( int ( dato ) ) m = int ( input ( ) )   balance = 0 costo_gancho . sort ( ) if n >= m : for i in range ( m ) : balance = balance + costo_gancho [ i ] else : balance = sum ( costo_gancho ) - ( ( m - n ) * d )   print ( balance ) NEW_LINE

n , d = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) m = int ( input ( ) ) if m == n : print ( sum ( a ) ) elif m < n : a = sorted ( a ) print ( sum ( a [ : m ] ) ) else : x = sum ( a ) print ( x - ( m - len ( a ) ) * d ) NEW_LINE

n , d = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) m = int ( input ( ) ) a . sort ( ) k = 0 s = 0 for i in range ( m ) : if i < len ( a ) : k += a [ s ] s += 1 else : k -= dprint ( k )   NEW_LINE

n , x = map ( int , input ( ) . split ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) m = int ( input ( ) ) if m >= n : print ( sum ( l ) - ( m - n ) * x ) NEW_LINE


import java . util . * ; public class SpecialOfferSuperPrice999Bourles { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; long p = sc . nextLong ( ) ; long d = sc . nextLong ( ) ; String s = Long . toString ( p ) ; long temp ; for ( int i = s . length ( ) - 1 ; i >= 0 ; i -- ) { s = Long . toString ( p ) ; if ( s . charAt ( i ) != '9' ) { temp = ( long ) Math . pow ( 10 , s . length ( ) - i - 1 ) * ( Long . parseLong ( " " + s . charAt ( i ) ) + 1 ) ; if ( d >= temp ) { d -= temp ; p -= temp ; } } } System . out . println ( p ) ; } }

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 abc { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long p = sc . nextLong ( ) ; long d = sc . nextLong ( ) , ans = ++ p ; for ( long t = 10 ; ; t *= 10 ) { if ( p % t > d ) break ; ans = p - p % t ; } System . out . println ( ans - 1 ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashMap ; import java . util . HashSet ; import java . util . List ; import java . util . PriorityQueue ; import java . util . Random ; import java . util . StringTokenizer ;   public class A {   public static void main ( String [ ] args ) throws IOException {   FastScanner sc = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; ArrayList < String > lis = new ArrayList < String > ( ) ; String str = sc . next ( ) ; long cost = Long . parseLong ( str ) ; char [ ] extra = str . toCharArray ( ) ; long p = sc . nextLong ( ) ; int n = str . length ( ) ; for ( int i = n - 1 ; i >= 1 ; i -- ) { if ( extra [ i ] != '9' ) { extra [ i ] = '9' ; int j = i - 1 ; while ( j >= 0 ) { if ( extra [ j ] == '0' ) { extra [ j ] = '9' ; j -- ; continue ; } else { String val = ( extra [ j ] - '0' - 1 ) + " " ; extra [ j ] = val . charAt ( 0 ) ; break ; } } } StringBuilder ans = new StringBuilder ( ) ; for ( char e : extra ) ans . append ( e ) ; lis . add ( ans . toString ( ) ) ; } if ( lis . size ( ) == 0 ) { System . out . println ( cost ) ; return ; }

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

a , b = map ( int , input ( ) . split ( ) ) a = a + 1 n = ak = 10 while ( True ) : if ( ( a % k ) > b ) : break n = a - ( a % k ) k *= 10 print ( n - 1 ) NEW_LINE

import mathimport sysimport collectionsimport bisectimport stringimport timedef get_ints ( ) : return map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) def get_list ( ) : return list ( map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) ) def get_string ( ) : return sys . stdin . readline ( ) . strip ( ) def num ( arr ) : ans = " " for i in arr : ans += i return int ( ans ) for t in range ( 1 ) : n , m = get_ints ( ) ans = n no = str ( n ) pos = len ( no ) - 1 c = 0 while pos >= 0 : if no [ pos ] == "9" : c += 1 pos -= 1 else : break for k in range ( c + 1 , 20 ) : no = ( n ) - ( n % ( 10 ** k ) ) - 1 NEW_LINE

n , p = map ( int , input ( ) . split ( ) )   ans = n   l = len ( str ( n ) ) for nine in range ( 0 , l ) : m = int ( str ( n ) [ : l - nine ] + '9' * nine ) while m > n : m -= 10 ** nine if n - m <= p : ans = m   print ( ans ) NEW_LINE

p , d = ( int ( k ) for k in input ( ) . split ( ) )   test_price = presult = pmax_num_of_nines = 0 i = 1   while test_price >= p - d : test_price_size = len ( str ( test_price ) ) num_of_nines = 0 for c in range ( test_price_size ) : if str ( test_price ) [ - c - 1 ] == '9' : num_of_nines += 1 else : break if num_of_nines == test_price_size and num_of_nines > max_num_of_nines : result = test_price break else : if num_of_nines > max_num_of_nines : max_num_of_nines = num_of_nines result = test_price NEW_LINE


import java . util . * ; public class Main { public static double calcTime ( double d , int vd , int vp ) { return d / ( vd - vp ) ; } public static void main ( String [ ] args ) throws java . lang . Exception { Scanner in = new Scanner ( System . in ) ;

import java . util . Scanner ;   public class Run_Crazy {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; float vp , vd , t , f , c ; vp = in . nextFloat ( ) ; vd = in . nextFloat ( ) ; t = in . nextFloat ( ) ; f = in . nextFloat ( ) ; c = in . nextFloat ( ) ;   double posd , posp , time ; int cnt = 0 ; posp = vp * t ; posd = 0 ; if ( vp > vd ) { System . out . println ( 0 ) ; System . exit ( 0 ) ; } while ( true ) { time = Math . abs ( posd - posp ) / Math . abs ( vd - vp ) ; posp += vp * time ; if ( posp >= c ) break ; else cnt ++ ; posp += vp * ( time + f ) ; posd = 0 ; } System . out . println ( cnt ) ;   }   }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Escape { public static void main ( String [ ] args ) { FastReader fs = new FastReader ( ) ; StringBuilder sb = new StringBuilder ( ) ; int vp = fs . nextInt ( ) ; int vd = fs . nextInt ( ) ; int t = fs . nextInt ( ) ; int f = fs . nextInt ( ) ; int c = fs . nextInt ( ) ; if ( vd <= vp ) { System . out . println ( 0 ) ; return ; } int bijous = 0 ; double distance = vp * t ; double time = 0 ; while ( Double . compare ( c , distance ) > 0 ) { time = distance / ( vd - vp ) ; distance = time * vd ; if ( Double . compare ( c , distance ) <= 0 ) break ; bijous ++ ; distance += ( ( distance / vd ) + f ) * vp ; } System . out . println ( bijous ) ; }   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 ( ) ) ; }   float nextFloat ( ) { return Float . parseFloat ( next ( ) ) ; } } }

import java . util . * ; import java . io . * ;     public class A {    public static void main ( String [ ] args ) throws IOException { FastReader sc = new FastReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int vp = sc . nextInt ( ) , vd = sc . nextInt ( ) , t = sc . nextInt ( ) , f = sc . nextInt ( ) , c = sc . nextInt ( ) ; int count = 0 ; double pd = vp * t ;   if ( vd > vp ) { while ( pd < c ) { double tt = pd / ( vd - vp ) ; pd = vd * tt ; if ( pd >= c ) break ; count ++ ; tt += f ; pd += vp * tt ;   } }   out . println ( count ) ; out . close ( ) ; } }

vp = int ( input ( ) ) vd = int ( input ( ) ) t = int ( input ( ) ) f = int ( input ( ) ) c = int ( input ( ) )   dist = 0 cnt = 0 if vd <= vp : print ( 0 ) else : while True : time = t + vp * t / ( vd - vp ) if time * vp >= c : print ( cnt ) break else : t = t + 2 * ( time - t ) + f cnt += 1 NEW_LINE

vp = int ( input ( ) ) vd = int ( input ( ) ) t = int ( input ( ) ) f = int ( input ( ) ) c = int ( input ( ) )   pp = t * vpbijoux = 0 pd = 0 while ( pp < c ) : if vp >= vd : break pp = ( vd * pp ) / ( vd - vp ) if pp >= c : break bijoux += 1 pp += ( pp / vd + f ) * vpprint ( bijoux ) NEW_LINE

import sysimport mathimport collectionsimport bisectdef get_ints ( ) : return map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) def get_list ( ) : return list ( map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) ) def get_string ( ) : return sys . stdin . readline ( ) . strip ( ) princess = int ( input ( ) ) dragon = int ( input ( ) ) t = int ( input ( ) ) f = int ( input ( ) ) c = int ( input ( ) ) start = t * princesscount = 0 if dragon <= princess : print ( 0 ) quit ( ) while start < c : d1 = start + ( princess ) d2 = dragon time = start / ( dragon - princess ) start += princess * time if start < c : count += 1 start += princess * ( time + f ) print ( count ) NEW_LINE

x , y , t , f , c = [ int ( input ( ) ) for i in range ( 5 ) ] a = x * t NEW_LINE

p , vd , t , f , c = [ int ( input ( ) ) for i in range ( 5 ) ] if p >= vd : exit ( print ( 0 ) ) cur = ( p * t * vd ) / ( vd - p ) ans = 0 while c > cur : ans += 1 cur += p * ( 2 * cur + f * vd ) / ( vd - p ) print ( ans ) NEW_LINE


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

import java . util . Arrays ; import java . util . Scanner ;   public class PashmakAndFlowers { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = Integer . parseInt ( scanner . nextLine ( ) ) ; String [ ] beauty = scanner . nextLine ( ) . split ( " ▁ " ) ; int [ ] bs = Arrays . stream ( beauty ) . mapToInt ( Integer :: parseInt ) . sorted ( ) . toArray ( ) ; long min = 0 , max = 0 ; for ( int i : bs ) { if ( i == bs [ 0 ] ) min ++ ; if ( i == bs [ n - 1 ] ) max ++ ; } if ( bs [ 0 ] != bs [ n - 1 ] ) { System . out . println ( ( bs [ n - 1 ] - bs [ 0 ] ) + " ▁ " + ( max * min ) ) ; } else { System . out . println ( "0 ▁ " + ( max * ( max - 1L ) ) / 2L ) ; } } }

import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long minValue = Integer . MAX_VALUE ; long maxValue = Integer . MIN_VALUE ; long minCnt = 0 ; long maxCnt = 0 ;   for ( int i = 0 ; i < n ; i ++ ) { long temp = sc . nextLong ( ) ; if ( temp < minValue ) { minValue = temp ; minCnt = 1 ; } else if ( temp == minValue ) { minCnt ++ ; } if ( temp > maxValue ) { maxValue = temp ; maxCnt = 1 ; } else if ( temp == maxValue ) { maxCnt ++ ; } }   if ( minValue == maxValue ) { System . out . println ( "0 ▁ " + n * ( n - 1 ) / 2 ) ; } else { System . out . println ( maxValue - minValue + " ▁ " + minCnt * maxCnt ) ; } } }

import java . util . * ;   public class solution { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long [ ] flower = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { flower [ i ] = sc . nextInt ( ) ; } HashMap < Integer , Integer > map = new HashMap < > ( ) ; long min = Integer . MAX_VALUE ; long max = 0 ; for ( long i : flower ) { min = Math . min ( min , i ) ; max = Math . max ( max , i ) ; } long count_max = 0 ; long count_min = 0 ; for ( long i : flower ) { if ( i == max ) { count_max ++ ; } if ( i == min ) { count_min ++ ; } } if ( max == min ) { if ( count_max % 2 == 0 ) { System . out . println ( 0 + " ▁ " + ( count_max / 2 ) * ( count_max - 1 ) ) ; } else { System . out . println ( 0 + " ▁ " + ( ( count_max - 1 ) / 2 ) * count_max ) ; } } else { System . out . print ( ( max - min ) + " ▁ " ) ; System . out . println ( count_max * count_min ) ; } } }

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

def solution ( ) : n = int ( input ( ) ) count = { } arr = list ( map ( int , input ( ) . split ( ) ) )   for i in arr : if i not in count : count [ i ] = 1 else : count [ i ] += 1 	   mx = max ( arr ) mn = min ( arr ) if mx == mn : print ( 0 , int ( count [ mx ] * ( count [ mx ] - 1 ) / 2 ) ) else : print ( mx - mn , count [ mx ] * count [ mn ] )       solution ( ) NEW_LINE

n = int ( input ( ) ) flowers = list ( sorted ( list ( map ( int , input ( ) . split ( ) ) ) ) ) madiff = flowers [ n - 1 ] - flowers [ 0 ] i = 0 count0 = countn = 0 while ( i < n and flowers [ i ] == flowers [ 0 ] ) : count0 += 1 i += 1 i = n - 1 while ( i >= 0 and flowers [ i ] == flowers [ n - 1 ] ) : countn += 1 i -= 1 if ( flowers [ 0 ] != flowers [ n - 1 ] ) : print ( madiff , count0 * countn ) else : print ( madiff , n * n - ( 1 + n ) * n // 2 ) NEW_LINE


import java . util . Arrays ; import java . util . Scanner ;   public class _0633Towers {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ 1001 ] ; int max = 0 ; int pos = 0 ; for ( int i = 0 ; i < n ; i ++ ) { arr [ sc . nextInt ( ) ] ++ ; } int count = 0 ; for ( int i = 1 ; i < arr . length ; i ++ ) { if ( arr [ i ] != 0 ) { count ++ ; } max = Math . max ( max , arr [ i ] ) ; } System . out . println ( max + " ▁ " + count ) ; }   }

import java . io . * ; import java . util . * ;   public class MAIN {   private static BufferedReader reader = null ; private static BufferedWriter writer = null ;   public static void main ( String [ ] args ) throws Exception {

import java . util . Scanner ; import java . lang . Math ;   public class Day4_37A { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] A = new int [ n ] ; int max = Integer . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { A [ i ] = scan . nextInt ( ) ; if ( A [ i ] > max ) max = A [ i ] ; }   int [ ] count = new int [ max + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) count [ A [ i ] ] ++ ;   int [ ] res = new int [ 2 ] ; for ( int i = 0 ; i < max + 1 ; i ++ ) { if ( count [ i ] > 0 ) res [ 1 ] ++ ;   if ( count [ i ] > res [ 0 ] ) res [ 0 ] = count [ i ] ; }   for ( int a : res ) System . out . print ( a + " ▁ " ) ;   }   }

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

n = int ( input ( ) ) m = list ( map ( int , input ( ) . split ( ) ) ) high = 0 x = [ ] for i in range ( n ) : if m [ i ] not in x : x . append ( m [ i ] ) if m . count ( m [ i ] ) > high : high = m . count ( m [ i ] ) print ( high , len ( x ) ) NEW_LINE

import sysdef get_ints ( ) : return map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) def get_ints_lists ( ) : return list ( map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) ) def get_string ( ) : return sys . stdin . readline ( ) . strip ( ) input ( ) li = get_ints_lists ( ) li1 = [ ] s = set ( li ) for i in s : p = li . count ( i ) li1 . append ( p ) print ( max ( li1 ) , len ( s ) )   NEW_LINE

t = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE

n = int ( input ( ) ) data = list ( map ( int , input ( ) . split ( ) ) )   uniqueness , great_l = [ ] , 0 for i in data : if i not in uniqueness : uniqueness . append ( i ) if data . count ( i ) > great_l : great_l = data . count ( i )   print ( great_l , len ( uniqueness ) )   NEW_LINE


import java . util . * ; import java . math . * ; public class BeltedRooms { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int runs = sc . nextInt ( ) ; while ( runs -- > 0 ) { int size = sc . nextInt ( ) ; String s = sc . next ( ) ; char [ ] arr = s . toCharArray ( ) ; if ( ! ( s . contains ( " > " ) && s . contains ( " < " ) ) ) System . out . println ( size ) ; else { int count = 0 ; for ( int i = 0 ; i < size ; i ++ ) { if ( i == 0 ) { if ( arr [ size - 1 ] == ' - ' || arr [ i ] == ' - ' ) count ++ ; } else if ( i == size - 1 ) { if ( arr [ size - 2 ] == ' - ' || arr [ size - 1 ] == ' - ' ) count ++ ; } else { if ( arr [ i ] == ' - ' || arr [ i - 1 ] == ' - ' ) count ++ ; } } System . out . println ( count ) ; } } } }

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

import java . util . * ; import java . io . * ; import java . lang . * ;    public class graph { static long mod = 10000_00007 ; public static void main ( String [ ] args ) throws Exception { InputStreamReader ip = new InputStreamReader ( System . in ) ; BufferedReader br = new BufferedReader ( ip ) ; int t = Integer . parseInt ( br . readLine ( ) ) ; StringBuilder sb = new StringBuilder ( ) ; while ( t -- > 0 ) { int n = Integer . parseInt ( br . readLine ( ) ) ; String str = ( br . readLine ( ) ) . trim ( ) ;   int cw = 0 , acw = 0 , bh = 0 ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( str . charAt ( i ) == ' - ' ) { if ( str . charAt ( ( ( i - 1 ) + n ) % n ) == str . charAt ( i ) ) { ans ++ ; } else { ans += 2 ; } bh ++ ; } else if ( str . charAt ( i ) == ' > ' ) { cw ++ ; } else { acw ++ ; } }   if ( acw == n || cw == n || bh == n ) { System . out . println ( n ) ; } else if ( ( acw + bh ) == n || ( cw + bh ) == n ) { System . out . println ( n ) ; } else { System . out . println ( ans ) ; } } }   }

import java . util . Scanner ;   public class B1428 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int N = in . nextInt ( ) ; String S = in . next ( ) ; boolean cycle = ( S . indexOf ( ' > ' ) == - 1 ) || ( S . indexOf ( ' < ' ) == - 1 ) ; int answer ; if ( cycle ) { answer = N ; } else { answer = 0 ; for ( int n = 0 ; n < N ; n ++ ) { int next = ( n + 1 ) % N ; if ( S . charAt ( n ) == ' - ' || S . charAt ( next ) == ' - ' ) { answer ++ ; } } } System . out . println ( answer ) ; } }   }

t = int ( input ( ) ) NEW_LINE while t > 0 : n = int ( input ( ) ) NEW_LINE s = str ( input ( ) ) NEW_LINE flag1 = 1 NEW_LINE for i in range ( len ( s ) ) : if NEW_LINE s [ i ] == ' < ' : flag1 = 0 NEW_LINE break NEW_LINE flag2 = 1 NEW_LINE for i in range ( len ( s ) ) : if NEW_LINE s [ i ] == ' > ' : flag2 = 0 NEW_LINE break NEW_LINE if flag1 == 1 or flag2 == 1 : NEW_LINE INDENT ans = n else : NEW_LINE ans = 0 NEW_LINE DEDENT s = s + s [ 0 ] NEW_LINE for i in range ( 0 , n , + 1 ) : if NEW_LINE s [ i ] == ' - ' or s [ i + 1 ] == ' - ' : ans = ans + 1 NEW_LINE print ( ans )       t = t - 1 NEW_LINE

T = int ( input ( ) ) NEW_LINE for _ in range ( T ) : N = int ( input ( ) ) NEW_LINE s = input ( ) NEW_LINE c = N NEW_LINE if ' < ' not in s : NEW_LINE INDENT print ( N ) elif ' > ' not in s : NEW_LINE print ( N ) else : NEW_LINE l = srt = s . index ( ' > ' ) NEW_LINE DEDENT C = 0 NEW_LINE for i in range ( N ) : r = s [ ( i + 1 ) % N ] NEW_LINE if ' - ' in [ s [ i ] , r ] : C += 1 NEW_LINE print ( C ) NEW_LINE

from collections import defaultdict   for t in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE s = input ( )   d = " . " NEW_LINE ok = True NEW_LINE result = 0 NEW_LINE for i in range ( n ) : NEW_LINE

t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n = int ( input ( ) ) NEW_LINE s = input ( ) NEW_LINE ans = 0 NEW_LINE if " < " not in s or " > " not in s : NEW_LINE INDENT ans = n else : NEW_LINE char = set ( ) NEW_LINE DEDENT i = 0 NEW_LINE while True : if NEW_LINE i == n : NEW_LINE break NEW_LINE i = i % n NEW_LINE if s [ i ] == " - " : char . add ( i ) NEW_LINE char . add ( ( i + 1 ) % n ) NEW_LINE i += 1 NEW_LINE ans = len ( char ) NEW_LINE print ( ans ) NEW_LINE

import mathfrom NEW_LINE collections NEW_LINE import Countert = int ( input ( ) ) NEW_LINE for i in range ( t ) : n = int ( input ( ) ) NEW_LINE l = list ( input ( ) ) NEW_LINE if ( l . count ( ' > ' ) == 0 or l . count ( ' < ' ) == 0 ) : NEW_LINE INDENT print ( n ) else : NEW_LINE count = 0 NEW_LINE DEDENT for j in range ( n ) : if NEW_LINE INDENT ( l [ j ] == ' - ' or l [ j - 1 ] == ' - ' ) : count += 1 NEW_LINE DEDENT print ( count )   NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; public class test6 {   public static final int mod = 1000000007 ; static LinkedList < Integer > idx = new LinkedList < > ( ) ; static int a , b , n ; static String s ; static int dp [ ] ; public static void main ( String [ ] args ) throws IOException { BufferedReader sc = new BufferedReader ( new InputStreamReader ( System . in ) ) ;

import java . util . Scanner ;   public class CF174B {   static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String input = sc . nextLine ( ) ; StringBuilder output = new StringBuilder ( " YES \n " ) ;   int pointer = 0 ; while ( pointer < input . length ( ) ) { int i = pointer ; while ( i < input . length ( ) && input . charAt ( i ) != ' . ' ) i ++ ; int noOfCharsInName = i - pointer ; if ( noOfCharsInName < 1 || noOfCharsInName > 8 || i >= input . length ( ) ) { System . out . println ( " NO " ) ; return ; }   pointer = i ++ ; int noOfCharsToConsiderAfterDot = 1 ; while ( i < input . length ( ) && input . charAt ( i ) != ' . ' && i < pointer + 4 ) i ++ ; if ( i >= input . length ( ) && i - pointer - 1 > 3 || i - pointer - 1 == 0 ) { System . out . println ( " NO " ) ; return ; }   if ( i >= input . length ( ) || input . charAt ( i ) != ' . ' ) noOfCharsToConsiderAfterDot = i - pointer - 1 ;   String completeFileName = input . substring ( pointer - noOfCharsInName , pointer + noOfCharsToConsiderAfterDot + 1 ) ; output . append ( completeFileName ) ; output . append ( " \n " ) ;   pointer += noOfCharsToConsiderAfterDot + 1 ; }   System . out . println ( output ) ; } }

s = list ( input ( ) . split ( " . " ) ) if len ( s ) == 1 : print ( " NO " ) exit ( ) x = s [ 0 ] y = " " ans = [ ] for i in range ( 1 , len ( s ) - 1 ) : if not 1 <= len ( x ) <= 8 : print ( " NO " ) exit ( ) if 2 <= len ( s [ i ] ) <= 3 : y = s [ i ] [ : 1 ] ans . append ( x + " . " + y ) x = s [ i ] [ 1 : ] elif 4 <= len ( s [ i ] ) <= 11 : y = s [ i ] [ : 3 ] ans . append ( x + " . " + y ) x = s [ i ] [ 3 : ] else : print ( " NO " ) exit ( ) y = s [ - 1 ] if not ( 1 <= len ( x ) <= 8 and 1 <= len ( y ) <= 3 ) : print ( " NO " ) exit ( ) else : ans . append ( x + " . " + y ) print ( " YES " ) print ( * ans , sep = " \n " ) NEW_LINE

a = input ( ) . split ( " . " ) l = [ [ a [ 0 ] ] ] for i in a [ 1 : - 1 ] : m = min ( 3 , len ( i ) - 1 ) l [ - 1 ] += [ i [ : m ] ] l += [ [ i [ m : ] ] ] l [ - 1 ] += [ a [ - 1 ] ] if len ( a ) < 2 or any ( len ( i ) not in range ( 1 , 9 ) or len ( j ) not in range ( 1 , 4 ) for i , j in l ) : print ( " NO " ) else : print ( " YES " ) print ( " \n " . join ( " . " . join ( i ) for i in l ) ) NEW_LINE

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


import java . util . * ;   public class Main {   public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n , d ; n = scanner . nextInt ( ) ; d = scanner . nextInt ( ) ; int [ ] nums = new int [ n ] ; for ( int i = 0 ; i < n ; ++ i ) { nums [ i ] = scanner . nextInt ( ) ; } Arrays . sort ( nums ) ; int ans = n ; for ( int i = 0 , j = 0 ; j < n ; ++ i ) { for ( ; j < n && nums [ j ] - nums [ i ] <= d ; ++ j ) ; ans = Math . min ( ans , n - ( j - i ) ) ; } System . out . println ( " " + ans ) ; } }

n , d = ( int ( x ) for x in input ( ) . strip ( ) . split ( ' ▁ ' ) ) a = [ int ( x ) for x in input ( ) . strip ( ) . split ( ' ▁ ' ) ] a . sort ( ) res = nout = [ ] for i in range ( n ) : for j in range ( i , n ) : if abs ( a [ j ] - a [ i ] ) <= d : res = res - 1 out . append ( res ) res = n   print ( min ( out ) ) NEW_LINE

n , k = map ( int , input ( ) . split ( ) ) l = [ int ( i ) for i in input ( ) . split ( ) ] l . sort ( ) if max ( l ) - min ( l ) <= k : print ( 0 ) exit ( ) maxlen = 0 for i in range ( n ) : for j in range ( i , n ) : if max ( l [ i : j + 1 ] ) - min ( l [ i : j + 1 ] ) <= k : maxlen = max ( maxlen , j - i + 1 ) print ( n - maxlen ) NEW_LINE

n , k = map ( int , input ( ) . split ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) arr = sorted ( arr ) ; d = [ 0 ] * ( 101 ) for i in arr : d [ i ] += 1 ans = 10 ** 18 for i in range ( 0 , 101 ) : if i + k + 1 > 101 : break else : ans = min ( n - sum ( d [ i : i + k + 1 ] ) , ans ) print ( ans ) NEW_LINE

n , d = map ( int , input ( ) . split ( ) ) a = sorted ( list ( map ( int , input ( ) . split ( ) ) ) ) if n == 1 : print ( 0 ) exit ( ) ans = nfor i in range ( n ) : for j in range ( i , n ) : if a [ j ] - a [ i ] <= d : ans = min ( ans , i + n - j - 1 ) print ( ans ) NEW_LINE


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

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Main { static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } public String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } } public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; Graph grafo = new Graph ( ) ; int respostaFinal = 0 ; StringBuilder sentençaFinal = new StringBuilder ( ) ; String str1 = in . next ( ) ; String str2 = in . next ( ) ; if ( str1 . length ( ) == str2 . length ( ) ) { for ( int contador = in . nextInt ( ) ; contador > 0 ; contador -- ) { String vertice1 = in . next ( ) ; String vertice2 = in . next ( ) ; int peso = in . nextInt ( ) ; grafo . setEdge ( vertice1 . charAt ( 0 ) , vertice2 . charAt ( 0 ) , peso ) ; }   int [ ] [ ] matriz = grafo . floydWarshall ( ) ;   for ( int contador = 0 ; contador < str1 . length ( ) ; contador ++ ) {

import java . util . HashMap ; import java . util . Map ; 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 ) { FastReader fs = new FastReader ( ) ;   String line1 = fs . nextLine ( ) ; String line2 = fs . nextLine ( ) ;   int n = fs . nextInt ( ) ;   int graph [ ] [ ] = new int [ 26 ] [ 26 ] ;

import osimport sysfrom math import * from collections import * NEW_LINE

s = input ( ) t = input ( )   if ( len ( s ) != len ( t ) ) : print ( - 1 ) exit ( )   dist = [ [ 10 ** 15 for j in range ( 26 ) ] for i in range ( 26 ) ]   for i in range ( 26 ) : dist [ i ] [ i ] = 0   n = int ( input ( ) ) for i in range ( n ) : a = input ( ) . split ( ) x = ord ( a [ 0 ] ) - 97 y = ord ( a [ 1 ] ) - 97 w = int ( a [ - 1 ] )   dist [ x ] [ y ] = min ( dist [ x ] [ y ] , w )   for k in range ( 26 ) : for i in range ( 26 ) : for j in range ( 26 ) : dist [ i ] [ j ] = min ( dist [ i ] [ j ] , dist [ i ] [ k ] + dist [ k ] [ j ] )   ans = ' ' res = 0   n = len ( s )   for i in range ( n ) : if ( s [ i ] == t [ i ] ) : ans += s [ i ] continue cost = 10 ** 15 pos = - 1   x = ord ( s [ i ] ) - 97 y = ord ( t [ i ] ) - 97   for j in range ( 26 ) : if ( dist [ x ] [ j ] + dist [ y ] [ j ] < cost ) : cost = dist [ x ] [ j ] + dist [ y ] [ j ] pos = j   if ( pos == - 1 ) : print ( - 1 ) exit ( ) res += cost ans += chr ( pos + 97 )   print ( res ) print ( ans ) NEW_LINE

def code ( c ) : return ord ( c ) - ord ( ' a ' )   def main ( ) : a = input ( ) b = input ( ) m = int ( input ( ) ) n = 26 d = [ [ 10 ** 9 for i in range ( n ) ] for j in range ( n ) ] for i in range ( n ) : d [ i ] [ i ] = 0 for i in range ( m ) : s , t , w = input ( ) . split ( ) w = int ( w ) s = code ( s ) t = code ( t ) d [ s ] [ t ] = min ( d [ s ] [ t ] , w )   for k in range ( n ) : for i in range ( n ) : for j in range ( n ) : d [ i ] [ j ] = min ( d [ i ] [ j ] , d [ i ] [ k ] + d [ k ] [ j ] )   if len ( a ) != len ( b ) : print ( - 1 ) else : ans = 0 res = [ ] for i in range ( len ( a ) ) : x = code ( a [ i ] ) y = code ( b [ i ] ) min_c = ' a ' min_cost = 10 ** 9 for j in range ( n ) : cur = d [ x ] [ j ] + d [ y ] [ j ] if cur < min_cost : min_cost = cur min_c = chr ( j + ord ( ' a ' ) ) res . append ( min_c ) ans += min_cost if ans >= 10 ** 9 : print ( - 1 ) else : print ( ans ) for j in res : print ( j , end = ' ' ) print ( )   main ( ) NEW_LINE


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

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   public class Codeforces {   private static final Scanner sc = new Scanner ( System . in ) ; private static final BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; private static final long MOD = ( long ) ( 1e9 + 7 ) ;   public static int [ ] LPS ( String p ) { int [ ] lps = new int [ p . length ( ) ] ;   int i = 1 ; int j = 0 ; while ( i < p . length ( ) ) { if ( p . charAt ( i ) == p . charAt ( j ) ) { lps [ i ] = j + 1 ; i ++ ; j ++ ; } else { if ( j == 0 ) { lps [ i ] = 0 ; i ++ ; } else { j = lps [ j - 1 ] ; } } } return lps ; }   public static void KMP ( String text , String pattern ) { int [ ] lps = LPS ( pattern ) ; int i = 0 ; int j = 0 ; ArrayList < Integer > matches = new ArrayList < > ( ) ; while ( i < text . length ( ) ) { if ( text . charAt ( i ) == pattern . charAt ( j ) ) { i ++ ; j ++ ; } else { if ( j != 0 ) { j = lps [ j - 1 ] ; } else { i ++ ; } } if ( j == pattern . length ( ) ) { matches . add ( i - j ) ; j = lps [ j - 1 ] ; } } for ( int x : matches ) { System . out . println ( " Match ▁ at ▁ : ▁ " + x ) ; } }   private static class SegmentTree { private long [ ] st ; private int size ; private int n ; private long [ ] a ; SegmentTree ( long [ ] a , int n ) { this . size = 4 * n ; this . n = n ; this . a = a ; st = new long [ size ] ;

import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int k = s . nextInt ( ) ; s . nextLine ( ) ; String s1 = s . nextLine ( ) ; int min = Integer . MAX_VALUE ; HashMap < Character , Integer > h = new HashMap < > ( ) ; for ( int i = 0 ; i < s1 . length ( ) ; i ++ ) { if ( h . containsKey ( s1 . charAt ( i ) ) ) { h . put ( s1 . charAt ( i ) , h . get ( s1 . charAt ( i ) ) + 1 ) ; } else { h . put ( s1 . charAt ( i ) , 1 ) ; } } for ( Map . Entry e : h . entrySet ( ) ) { int a = ( int ) e . getValue ( ) ; if ( a < min ) min = a ; } int y = 0 ; if ( h . size ( ) == k ) y = min * k ; System . out . println ( y ) ; } }

import java . io . * ; import java . util . * ; import javax . print . attribute . standard . Finishings ;   import java . math . * ;   public class Equality { 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 {

def main_function ( ) : n , m = [ int ( i ) for i in input ( ) . split ( " ▁ " ) ] s = list ( input ( ) ) d = { } for i in s : if i in d : d [ i ] += 1 else : d [ i ] = 1 if len ( d ) < m : return 0 f = min ( d , key = lambda i : d [ i ] ) return d [ f ] * m       print ( main_function ( ) ) NEW_LINE

n , k = map ( int , input ( ) . split ( " ▁ " ) ) s = input ( ) l = [ ] for i in range ( k ) : l . append ( s . count ( chr ( i + ord ( " A " ) ) ) ) print ( min ( l ) * k ) NEW_LINE

n , k = map ( int , input ( ) . split ( " ▁ " ) ) s = input ( ) l = [ ] a = 0 for i in range ( k ) : NEW_LINE


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n , x , y , r ; int i , j ; n = in . nextInt ( ) ; x = in . nextInt ( ) ; y = in . nextInt ( ) ; r = n / 2 ; if ( ( x == r || x == r + 1 ) && ( y == r || y == r + 1 ) ) System . out . println ( " NO " ) ; else System . out . println ( " YES " ) ; } }

import java . util . * ; public class Main {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; if ( ( x == n / 2 || x == n / 2 + 1 ) && ( y == n / 2 || y == n / 2 + 1 ) ) System . out . println ( " NO " ) ; else System . out . println ( " YES " ) ; }   }

import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int side = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; if ( side == 2 ) System . out . println ( " NO " ) ; else { if ( ( x == side / 2 && y == side / 2 ) || ( x == side / 2 && y == side / 2 + 1 ) || ( x == side / 2 + 1 && y == side / 2 ) || ( x == side / 2 + 1 && y == side / 2 + 1 ) ) System . out . println ( " NO " ) ; else System . out . println ( " YES " ) ; } } }

import java . util . * ;   public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , x = sc . nextInt ( ) , y = sc . nextInt ( ) ; int h = n / 2 ; if ( x == h && y == h || x == h && y == h + 1 || x == h + 1 && y == h || x == h + 1 && y == h + 1 ) System . out . println ( " NO " ) ; else System . out . println ( " YES " ) ; } }

import java . util . Scanner ; public class Codeforces112B { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n , x , y ; n = sc . nextInt ( ) ; x = sc . nextInt ( ) ; y = sc . nextInt ( ) ; boolean ok = true ; int row = n / 2 ; int col = n / 2 ; if ( ( row == x && col == y ) || ( row + 1 == x && col == y ) || ( row == x && col + 1 == y ) || ( row + 1 == x && col + 1 == y ) ) ok = false ; if ( ok ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }

x , y , z = list ( map ( int , input ( ) . split ( ) ) ) if x == 2 : print ( ' NO ' ) elif x > 2 : p = x // 2 if y in [ p , p + 1 ] and z in [ p , p + 1 ] : print ( ' NO ' ) else : print ( ' YES ' ) NEW_LINE

a , b , c = map ( int , input ( ) . split ( ' ▁ ' ) ) if ( b == a // 2 or b == a // 2 + 1 ) and ( c == a // 2 or c == a // 2 + 1 ) : print ( " NO " ) else : print ( " YES " ) NEW_LINE

x , y , z = [ int ( x ) for x in input ( " " ) . split ( ) ]   n = x / 2   if ( ( y == n or y == n + 1 ) and ( z == n or z == n + 1 ) ) : print ( " NO " ) else : print ( " YES " ) NEW_LINE

import mathn , x , y = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) NEW_LINE


import java . io . * ; import java . util . * ; public class Main { public static void main ( String args [ ] ) { FastReader input = new FastReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int T = input . nextInt ( ) ; while ( T -- > 0 ) { int n = input . nextInt ( ) ; int k = input . nextInt ( ) ; int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = input . nextInt ( ) ; } Arrays . sort ( a ) ; int v = a [ 0 ] + k ; int flag = 0 ; for ( int i = 1 ; i < n ; i ++ ) { int d = Math . abs ( v - a [ i ] ) ; if ( d > k ) { flag = 1 ; break ; } } if ( flag == 1 ) { out . println ( - 1 ) ; } else { out . println ( v ) ; } } out . close ( ) ; } static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }

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

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

T_ON = 1 DEBUG_ON = 0 MOD = 998244353     def solve ( ) : n , k = read_ints ( ) A = read_ints ( ) MIN = min ( A ) MAX = max ( A ) if 2 * k < MAX - MIN : print ( - 1 ) return print ( MIN + k )     def main ( ) : T = read_int ( ) if T_ON else 1 for i in range ( T ) : solve ( )     def debug ( * xargs ) : if DEBUG_ON : print ( * xargs )     from collections import * import math     NEW_LINE

def check ( a , x ) : for i in a : if ( abs ( i - x ) > k ) : return False return True     for i in range ( int ( input ( ) ) ) : n , k = [ int ( u ) for u in input ( ) . split ( " ▁ " ) ] a = [ int ( u ) for u in input ( ) . split ( " ▁ " ) ] ans = - 1 low = max ( a ) - k high = min ( a ) + k while ( low <= high ) : mid = low + ( ( high - low ) // 2 ) if ( check ( a , mid ) ) : ans = mid low = mid + 1 else : high = mid - 1 print ( ans ) NEW_LINE

cases = int ( input ( ) ) while cases : cases -= 1 a , b = map ( int , input ( ) . split ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) )   mn = min ( arr ) mx = max ( arr ) if mx - mn > 2 * b : print ( - 1 ) else : print ( mn + b ) NEW_LINE


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

import java . io . DataInputStream ; import java . io . FileInputStream ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . ArrayList ; import java . util . StringTokenizer ;   public class a1 { 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 . * ; import java . util . * ; public class test1 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; long x = 1 , counter = 0 ; List < Long > result = new ArrayList < > ( ) ; for ( int digitSum = 1 ; digitSum <= 81 ; digitSum ++ ) { x = b * ( ( long ) Math . pow ( digitSum , a ) ) + c ;

def getSum ( n ) : ans = 0 while ( n != 0 ) : ans += int ( n % 10 ) n = int ( n // 10 ) return ansa , b , c = map ( int , input ( ) . split ( ) ) ans = [ ] for i in range ( 82 ) : x = b * ( i ** a ) + c if x > 0 and x < 1e9 and i == getSum ( x ) : ans . append ( x ) print ( len ( ans ) ) if len ( ans ) != 0 : print ( * ans ) NEW_LINE

a , b , c = map ( int , input ( ) . split ( ) ) ans = [ ] for i in range ( 1 , 82 ) : t = b * i ** a + c if t > 0 and t <= 10 ** 9 : k = t s = 0 while k : s += k % 10 k //= 10 if s == i : ans . append ( t ) print ( len ( ans ) ) print ( * ans ) NEW_LINE

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

def sumDigit ( n ) : n = str ( n ) answer = 0 for i in n : answer += int ( i ) return answer s = input ( ) . strip ( ) . split ( ) a , b , c = int ( s [ 0 ] ) , int ( s [ 1 ] ) , int ( s [ 2 ] ) answer = list ( ) for i in range ( 1 , 82 ) : _sum = i temp = _sum ** a x = temp * b + c if x < 0 or x > 10 ** 9 : continue if _sum == sumDigit ( x ) : answer . append ( x )   print ( len ( answer ) ) if len ( answer ) != 0 : for i in answer : print ( i , end = ' ▁ ' ) NEW_LINE

a , b , c = map ( int , input ( ) . split ( " ▁ " ) )     ans = [ ] for s in range ( 1 , 81 ) : x = b * s ** a + c if x < 1 or x >= 10 ** 9 : continue z = len ( str ( x ) ) d = 0 for i in range ( z ) : d += int ( str ( x ) [ i ] ) if d == s : ans . append ( x )   print ( len ( ans ) ) for i in range ( len ( ans ) ) : print ( ans [ i ] , end = " ▁ " ) NEW_LINE


import java . util . Scanner ;   public class GameShopping { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , m = in . nextInt ( ) , a [ ] = new int [ n ] , b [ ] = new int [ m ] , i , j = 0 , c = 0 ;   for ( i = 0 ; i < n ; i ++ ) { a [ i ] = in . nextInt ( ) ; } for ( i = 0 ; i < m ; i ++ ) { b [ i ] = in . nextInt ( ) ; } in . close ( ) ; for ( i = 0 ; i < n ; i ++ ) { if ( j < m && b [ j ] >= a [ i ] ) { c ++ ; j ++ ; } } System . out . println ( c ) ; } }

import java . util . Scanner ;   public class GameShoping {   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int m = scan . nextInt ( ) ; int [ ] a = new int [ n ] ; int [ ] b = new int [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = scan . nextInt ( ) ; } for ( int i = 0 ; i < m ; i ++ ) { b [ i ] = scan . nextInt ( ) ; } int c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( c < b . length && b [ c ] >= a [ i ] ) { c += 1 ; } } System . out . println ( c ) ;   }   }

import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int m = s . nextInt ( ) ; int [ ] arr = new int [ n ] ; int [ ] brr = new int [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = s . nextInt ( ) ; } for ( int i = 0 ; i < m ; i ++ ) { brr [ i ] = s . nextInt ( ) ; } int count = 0 ; int ptr = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] <= brr [ ptr ] ) { count ++ ; ptr ++ ; } if ( ptr == m ) break ; } System . out . println ( count ) ; } }

import java . util . Scanner ;   public class main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; int [ ] a = new int [ 1001 ] ; int [ ] b = new int [ 1001 ] ; int j = 0 ;   int o = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = in . nextInt ( ) ; } for ( int i = 0 ; i < m ; i ++ ) { b [ i ] = in . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] <= b [ j ] ) { j ++ ; } } System . out . println ( j ) ; }   }

import sys   def main ( ) : inp = sys . stdin . read ( ) . strip ( ) . split ( ' \n ' ) w = list ( map ( int , inp [ 2 ] . split ( ) ) ) c , j = 0 , 0 for i in map ( int , inp [ 1 ] . split ( ) ) : if j == len ( w ) : break if w [ j ] >= i : c += 1 ; j += 1 return c   print ( main ( ) ) NEW_LINE

n , m = map ( int , input ( ) . split ( ) ) c = list ( map ( int , input ( ) . split ( ) ) ) a = list ( map ( int , input ( ) . split ( ) ) ) j = count = 0 for i in range ( n ) : if c [ i ] <= a [ j ] : j += 1 count += 1 else : continue if j == m : breakprint ( count ) NEW_LINE

import sysfrom array import array     def readline ( ) : return sys . stdin . buffer . readline ( ) . decode ( ' utf - 8' )     n , m = map ( int , readline ( ) . split ( ) ) c = list ( map ( int , readline ( ) . split ( ) ) ) a = list ( map ( int , readline ( ) . split ( ) ) ) i , ans = 0 , 0   for bill in a : while i < n and bill < c [ i ] : i += 1 if i < n : ans += 1 i += 1   print ( ans ) NEW_LINE

n , m = map ( int , input ( ) . split ( ) ) c = list ( map ( int , input ( ) . split ( ) ) ) a = list ( map ( int , input ( ) . split ( ) ) ) j = 0 ans = 0 for i in c : if i <= a [ j ] : j += 1 ans += 1 if j == m : breakprint ( ans ) NEW_LINE

inp = input ( ) . split ( ' ▁ ' ) n , m = int ( inp [ 0 ] ) , int ( inp [ 1 ] ) c = input ( ) . split ( ' ▁ ' ) a = input ( ) . split ( ' ▁ ' ) bill = 0 for i in range ( n ) : if bill == len ( a ) : break if int ( a [ bill ] ) >= int ( c [ i ] ) : bill += 1 print ( bill ) NEW_LINE


import javafx . collections . transformation . SortedList ; import javafx . util . Pair ;   import java . io . IOException ; import java . net . Inet4Address ; import java . util . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; while ( n -- > 0 ) { int s = scanner . nextInt ( ) ; Pair [ ] pairs = new Pair [ s ] ; for ( int i = 0 ; i < s ; i ++ ) { pairs [ i ] = new Pair ( scanner . nextInt ( ) , scanner . nextInt ( ) ) ; } Arrays . sort ( pairs ) ; int x = 0 , y = 0 ; boolean can = true ; String res = " " ; for ( int i = 0 ; i < s ; i ++ ) { if ( x <= pairs [ i ] . first && y <= pairs [ i ] . second ) { for ( int j = 0 ; j < pairs [ i ] . first - x ; j ++ ) { res += " R " ; } for ( int j = 0 ; j < pairs [ i ] . second - y ; j ++ ) { res += " U " ; } x = pairs [ i ] . first ; y = pairs [ i ] . second ; } else { can = false ; break ; } } if ( can ) { println ( " YES \n " + res ) ; } else { println ( " NO " ) ; } } } static class Pair implements Comparable < Pair > { int first ; int second ;   public Pair ( int first , int second ) { this . first = first ; this . second = second ; }   public int compareTo ( Pair o ) { if ( first != o . first ) return Integer . compare ( first , o . first ) ; return Integer . compare ( second , o . second ) ; } }

import java . util . * ; import java . io . * ; import java . io . FileInputStream ; import java . io . IOException ; import java . io . InputStreamReader ;    public class Sol { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int robots = sc . nextInt ( ) ; TreeSet < Integer > xpoints = new TreeSet < > ( ) ; TreeSet < Integer > ypoints = new TreeSet < > ( ) ; HashMap < Integer , HashSet < Integer > > map = new HashMap < > ( ) ; for ( int i = 0 ; i < robots ; i ++ ) { int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; if ( map . containsKey ( x ) ) { map . get ( x ) . add ( y ) ; } else { HashSet < Integer > temp = new HashSet < > ( ) ; temp . add ( y ) ; map . put ( x , temp ) ; } xpoints . add ( x ) ; ypoints . add ( y ) ; } int count = 0 ; int max_x = 0 ; int max_y = 0 ; String direction = " " ; for ( int y : ypoints ) { for ( int x : xpoints ) { if ( map . containsKey ( x ) && map . get ( x ) . contains ( y ) && max_x <= x && max_y <= y ) { count ++ ; int i = x - max_x ; int j = y - max_y ; while ( i > 0 ) { direction += " R " ; i -- ; } while ( j > 0 ) { direction += " U " ; j -- ; } max_x = x ; max_y = y ; } } } if ( count == robots ) { System . out . println ( " YES " ) ; System . out . println ( direction ) ; } else { System . out . println ( " NO " ) ; } } } }

t = int ( input ( ) ) for i in range ( t ) : n = int ( input ( ) ) li = [ ] for i in range ( n ) : x = list ( map ( int , input ( ) . split ( ) ) ) li . append ( x ) li . sort ( ) s = ' R ' * li [ 0 ] [ 0 ] + ' U ' * li [ 0 ] [ 1 ] for i in range ( 1 , n ) : if li [ i - 1 ] [ 0 ] > li [ i ] [ 0 ] or li [ i - 1 ] [ 1 ] > li [ i ] [ 1 ] : print ( " NO " ) break x = li [ i ] [ 0 ] - li [ i - 1 ] [ 0 ] y = li [ i ] [ 1 ] - li [ i - 1 ] [ 1 ] s = s + ( ' R ' * x ) + ' U ' * y else : print ( " YES " ) print ( s )                     NEW_LINE

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) s = " " shan = 0 sree = [ ] for i in range ( n ) : l , k = map ( int , input ( ) . split ( ) ) sree . append ( [ l , k ] ) sree . sort ( ) NEW_LINE

from sys import stdininput = stdin . readlinefrom heapq import heapify , heappush , heappop , heappushpopfrom collections import defaultdict as dd , deque as dq , Counter as Cfrom math import factorial as f , ceil , gcd , sqrt , logfrom bisect import bisect_left as bl , bisect_right as brfrom itertools import combinations as c , permutations as pfrom math import factorial as f , ceil , gcd , sqrt , logmp = lambda : map ( int , input ( ) . split ( ) ) it = lambda : int ( input ( ) ) ls = lambda : list ( input ( ) . strip ( ) . split ( ) ) mt = lambda r : [ list ( mp ( ) ) for _ in range ( r ) ] lcm = lambda a , b : ( a * b ) // gcd ( a , b ) def fibo_n ( n ) : return ( ( ( 1 + sqrt ( 5 ) ) / 2 ) ** n ) / sqrt ( 5 ) mod = 1000000007 for _ in range ( it ( ) ) : a = it ( ) v = [ ] for i in range ( a ) : v . append ( list ( mp ( ) ) ) v . sort ( ) x , y = 0 , 0 flag = 0 ans = " " v = dq ( v ) while v : x1 , y1 = v . popleft ( ) if x1 >= x and y1 >= y : k = x1 - x ans += " R " * k l = y1 - y ans += " U " * l x += k y += l else : flag = 1 break if flag : print ( " NO " ) else : print ( " YES " ) print ( ans ) NEW_LINE

import sysfrom collections import defaultdict   t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) 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 c705a {

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

import syscoins = [ 4 , 7 ] sum = int ( input ( ) ) def minCoins ( coins , m , n ) : dp = [ [ 1e9 , 0 ] for i in range ( n + 1 ) ] dp [ 0 ] [ 0 ] = 0 for i in range ( n + 1 ) : for j in range ( 2 ) : NEW_LINE

n = int ( input ( ) ) count = n // 7 ans = float ( ' inf ' ) val = Nonefor i in range ( count , - 1 , - 1 ) : remaining = n - 7 * i if remaining % 4 == 0 : if ans > i + remaining // 4 : ans = i + remaining // 4 val = ( remaining // 4 , i ) NEW_LINE

n = int ( input ( ) ) base = ( n // 4 + 1 ) * '9' ans = basei = j = 1 f = Truefor i in range ( 0 , n + 1 ) : j = 0 while i * 4 + j * 7 < n : j += 1 if i * 4 + j * 7 == n : x = ( '4' * i + '7' * j ) print ( x ) f = False break     if f : print ( - 1 )     NEW_LINE