# include < bits / stdc ++ . h > # define it register int # define ct const int # define il inlineusing namespace std ; typedef long long ll ; # define rll register ll # define cll const ll # define P 998244353 const int N = 1000005 ; int n , a [ N ] , ans ; multiset < int > S ; namespace io { il char nc ( ) { static char buf [ 100000 ] , * p1 = buf , * p2 = buf ; return p1 == p2 && ( p2 = ( p1 = buf ) + fread ( buf , 1 , 100000 , stdin ) , p1 == p2 ) ? EOF : * p1 ++ ; } template < class I > il void fr ( I & num ) { num = 0 ; register char c = nc ( ) ; it p = 1 ; while ( c < '0' || c > '9' ) c == ' - ' ? p = - 1 , c = nc ( ) : c = nc ( ) ; while ( c >= '0' && c <= '9' ) num = num * 10 + c - '0' , c = nc ( ) ; num *= p ; } } using namespace io ; map < int , int > cn ; int main ( ) { fr ( n ) ; it i ; for ( i = 1 ; i <= n ; ++ i ) fr ( a [ i ] ) , ++ cn [ a [ i ] ] , cn [ a [ i ] ] > ans ? ans = cn [ a [ i ] ] : 0 ;

import sysinput = sys . stdin . readline   '''   '''   n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( reverse = True ) count = 0 l , r = 0 , 1   while l < n and r < n : if a [ l ] > a [ r ] : l += 1 r += 1 count += 1 else : r += 1   print ( count ) NEW_LINE


n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) map = { } for i in arr : if i not in map : map [ i ] = 1 else : map [ i ] += 1 max = 0 for i in map : if map [ i ] > max : max = map [ i ] print ( n - max ) NEW_LINE


z , zz = input , lambda : list ( map ( int , z ( ) . split ( ) ) ) fast = lambda : stdin . readline ( ) . strip ( ) zzz = lambda : [ int ( i ) for i in fast ( ) . split ( ) ] szz , graph , mod , szzz = lambda : sorted ( zz ( ) ) , { } , 10 ** 9 + 7 , lambda : sorted ( zzz ( ) ) from string import * from re import * from collections import * from queue import * from sys import * from collections import * from math import * from heapq import * from itertools import * from bisect import * from collections import Counter as ccfrom math import factorial as ffrom bisect import bisect as bsfrom bisect import bisect_left as bslfrom itertools import accumulate as acdef lcd ( xnum1 , xnum2 ) : return ( xnum1 * xnum2 // gcd ( xnum1 , xnum2 ) ) def prime ( x ) : p = ceil ( x ** .5 ) + 1 for i in range ( 2 , p ) : if ( x % i == 0 and x != 2 ) or x == 0 : return 0 return 1 def dfs ( u , visit , graph ) : visit [ u ] = 1 for i in graph [ u ] : if not visit [ i ] : dfs ( i , visit , graph )   NEW_LINE


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


import java . io . BufferedWriter ; import java . io . ByteArrayInputStream ; import java . io . FileInputStream ; import java . io . FileWriter ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . InputMismatchException ;   public class Main { private static final long MOD = ( long ) 1e9 + 7 ; static InputStream is ; static PrintWriter out ; static String INPUT = " " ; static int lenbuf = 0 , ptrbuf = 0 ; private static byte [ ] inbuf = new byte [ 1024 ] ; static boolean readFile = true ;

file = open ( ' input . txt ' , ' r ' ) n = int ( file . readline ( ) ) - 1 lis = sorted ( list ( map ( int , file . readline ( ) . split ( ) ) ) ) i , j = 0 , 0 for i in range ( n + 1 ) : if lis [ i ] <= lis [ j ] * 2 : continue j += 1 open ( " output . txt " , " w " ) . write ( str ( j ) ) NEW_LINE


from math import ceil as cefrom collections import Counter as cc   import syssys . stdin = open ( " input . txt " ) sys . stdout = open ( " output . txt " , ' w ' )   n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) d = dict ( cc ( l ) ) l = sorted ( list ( d . items ( ) ) , key = lambda x : x [ 0 ] )   co = [ 0 ] * 5001j = 0       for i in range ( 1 , 5001 ) : if j < len ( l ) and l [ j ] [ 0 ] == i : co [ i ] += l [ j ] [ 1 ] j += 1 co [ i ] += co [ i - 1 ] NEW_LINE


f = open ( ' input . txt ' , ' r ' ) n = int ( f . readline ( ) ) c = sorted ( map ( int , f . readline ( ) . split ( ) ) ) j , v = 0 , n - 1 for i in range ( n ) : while j < n - 1 and 2 * c [ i ] >= c [ j + 1 ] : j += 1 v = min ( v , n + i - j - 1 ) open ( ' output . txt ' , ' w ' ) . write ( str ( v ) ) NEW_LINE


import bisectimport syssys . stdin = open ( ' input . txt ' , ' r ' ) sys . stdout = open ( ' output . txt ' , ' w ' ) n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( ) ans = 10 ** 18 for i in range ( n ) : x = a [ i ] * 2 idx = bisect . bisect_right ( a , x ) cnt = i + ( n - idx ) ans = min ( ans , cnt ) print ( ans ) NEW_LINE


file = open ( ' input . txt ' , ' r ' ) n = int ( file . readline ( ) ) - 1 lis = sorted ( list ( map ( int , file . readline ( ) . split ( ) ) ) ) i , j = 0 , 0 for i in range ( n + 1 ) : if lis [ i ] <= lis [ j ] * 2 : continue j += 1 out = n - i + jprint ( out ) open ( " output . txt " , " w " ) . write ( str ( out ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . FileReader ; import java . io . FileWriter ; import java . io . IOException ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . Deque ; import java . util . LinkedList ; import java . util . StringTokenizer ;   public class Main { static StringTokenizer st ; static BufferedReader in ;   public static void main ( String [ ] args ) throws IOException { in = new BufferedReader ( new FileReader ( " input . txt " ) ) ; PrintWriter pw = new PrintWriter ( new BufferedWriter ( new FileWriter ( " output . txt " ) ) ) ; int n = nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = nextInt ( ) ; } Arrays . sort ( a ) ; int min = Integer . MAX_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { int j = upper_bound ( a , i , 2 * a [ i ] ) ; min = Math . min ( min , i + n - j ) ; } pw . println ( min ) ;   pw . close ( ) ; }   private static int upper_bound ( int [ ] a , int l , int target ) { int r = a . length ; while ( l < r ) { int mid = l + ( r - l ) / 2 ; if ( a [ mid ] > target ) { r = mid ; } else { l = mid + 1 ; } } return l ; }   private static int nextInt ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; }   private static long nextLong ( ) throws IOException { return Long . parseLong ( next ( ) ) ; }   private static double nextDouble ( ) throws IOException { return Double . parseDouble ( next ( ) ) ; }   private static String next ( ) throws IOException { while ( st == null || ! st . hasMoreTokens ( ) ) { st = new StringTokenizer ( in . readLine ( ) ) ; } return st . nextToken ( ) ; } }


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ;   public class CloningToys { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] input = br . readLine ( ) . split ( " ▁ " ) ; int copied = Integer . parseInt ( input [ 0 ] ) ; int original = Integer . parseInt ( input [ 1 ] ) ; if ( original <= 0 ) { System . out . println ( " No " ) ; } else if ( original == 1 ) { if ( copied == 0 ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } else { original -- ; copied -= original ; if ( copied % 2 == 0 && copied >= 0 ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } } }

x , y = map ( int , input ( ) . split ( ) ) if ( y == 0 ) or ( y == 1 and x != 0 ) : print ( " No " ) else : if ( x - ( y - 1 ) ) % 2 == 0 and x >= ( y - 1 ) and y != 0 : print ( " Yes " ) else : print ( " No " ) NEW_LINE


x , y = map ( int , input ( ) . split ( ) ) a = 1 b = 0   if ( y == 0 or ( y == 1 and x > 0 ) ) : print ( " No " ) exit ( )   else : a = a + a * ( y - 1 ) b = b + y - 1   x = x - b   if ( x % 2 == 0 and x >= 0 ) : print ( " Yes " )                   else : print ( " No " ) NEW_LINE


x , y = map ( int , input ( ) . split ( ) ) if y == 0 : print ( ' No ' ) exit ( 0 ) if y == 1 : if x == 0 : print ( ' Yes ' ) else : print ( ' No ' ) exit ( 0 ) print ( ' Yes ' if x - y + 1 >= 0 and ( x - y + 1 ) % 2 == 0 else ' No ' ) NEW_LINE


x , y = map ( int , input ( ) . split ( ) )   if y == 0 : print ( ' No ' ) exit ( 0 )   if y == 1 : if x == 0 : print ( ' Yes ' ) else : print ( ' No ' ) exit ( 0 )   print ( ' Yes ' if x >= y - 1 and ( x - y + 1 ) % 2 == 0 else ' No ' ) NEW_LINE


import java . util . * ;   public class CodeForces922A { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int x = input . nextInt ( ) ; int y = input . nextInt ( ) ; y -- ; x -= y ; if ( x % 2 == 0 && x >= 0 && y > 0 || y == 0 && x == 0 ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }


import java . util . Scanner ;   public class P922A {   public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; long desiredClones = s . nextLong ( ) ; long desiredOriginals = s . nextLong ( ) ; long startingClones = desiredOriginals - 1 ; long neededClones = desiredClones - startingClones ; if ( neededClones != 0 ) { if ( neededClones > 0 && neededClones % 2 == 0 && startingClones >= 1 ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } else { if ( desiredOriginals >= 1 ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } } }


import java . util . Scanner ;   public class CloningToys { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int x = in . nextInt ( ) , y = in . nextInt ( ) - 1 ;   in . close ( ) ; System . out . println ( ( y > 0 && x >= y && ( x - y ) % 2 == 0 ) || ( y == 0 && x == y ) ? " Yes " : " No " ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class R {   public static void main ( String [ ] args ) { FastReader fr = new FastReader ( ) ; long a [ ] = new long [ 3 ] ; a [ 0 ] = fr . nextLong ( ) ; a [ 1 ] = fr . nextLong ( ) ; a [ 2 ] = fr . nextLong ( ) ; Arrays . parallelSort ( a ) ; long result = 0 ; if ( a [ 0 ] == 0 && a [ 1 ] == 1 ) { System . out . println ( a [ 2 ] ) ; } else if ( a [ 0 ] == a [ 1 ] ) { System . out . println ( a [ 0 ] ) ; } else if ( a [ 2 ] == a [ 1 ] ) { System . out . println ( a [ 2 ] ) ; } else if ( ( a [ 1 ] - a [ 0 ] ) % 2 == 1 ) { result += a [ 2 ] - a [ 1 ] ; result += a [ 1 ] ; System . out . println ( result ) ; } else { result += ( a [ 1 ] - a [ 0 ] ) / 2 ; result += ( a [ 1 ] + a [ 0 ] ) / 2 ; System . out . println ( result ) ; } }    static class FastReader { BufferedReader bf ; StringTokenizer st ;   public FastReader ( ) { bf = new BufferedReader ( new InputStreamReader ( System . in ) ) ;

import sysinput = sys . stdin . readlinel = input ( ) . split ( ) li = [ int ( i ) for i in l ] maxa = 10 ** 18 li . sort ( ) if ( ( li [ 2 ] - li [ 1 ] ) % 2 == 0 ) : maxa = min ( maxa , li [ 2 ] ) if ( ( li [ 2 ] - li [ 0 ] ) % 2 == 0 ) : maxa = min ( maxa , li [ 2 ] ) if ( ( li [ 1 ] - li [ 0 ] ) % 2 == 0 ) : maxa = min ( maxa , li [ 1 ] ) if ( maxa == 10 ** 18 ) : print ( - 1 ) else : print ( maxa ) NEW_LINE


a = list ( map ( int , input ( ) . split ( ) ) ) def calc ( a ) : return int ( ( ( ( a [ 1 ] - a [ 0 ] ) + ( a [ 1 ] + a [ 0 ] ) ) / 2 ) ) a . sort ( ) if a [ 1 ] % 2 == 0 and a [ 0 ] % 2 == 0 : print ( calc ( a ) ) elif a [ 1 ] % 2 == 0 or a [ 0 ] % 2 == 0 : print ( a [ 2 ] ) else : print ( calc ( a ) ) NEW_LINE


def pixel ( input ) : red , green , blue = input . split ( ) red = int ( red ) green = int ( green ) blue = int ( blue )   plist = [ red , green , blue ] plist . sort ( )   lowestChet = is_chet ( plist [ 0 ] ) midChet = is_chet ( plist [ 1 ] )   if ( ( midChet + lowestChet ) == 2 ) or ( ( midChet + lowestChet ) == 0 ) : return plist [ 1 ] else : return plist [ 2 ]     def is_chet ( n ) : return 1 if n % 2 == 0 else 0 print ( pixel ( input ( ) ) ) NEW_LINE


import java . util . Scanner ;   public class Pixel { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; long i , j , k , n , a , b , c , big , middle , small , sum ; boolean is ; while ( input . hasNext ( ) ) { a = input . nextLong ( ) ; b = input . nextLong ( ) ; c = input . nextLong ( ) ; sum = 0 ; is = false ;   big = ( a >= b ) ? ( ( a >= c ) ? a : c ) : ( ( b >= c ) ? b : c ) ; small = ( a >= b ) ? ( ( b >= c ) ? c : b ) : ( ( a >= c ) ? c : a ) ; middle = a > b ? ( c > a ? a : ( b > c ) ? b : c ) : ( c > b ? b : a > c ? a : c ) ;


import java . util . Arrays ; import java . util . Scanner ;   public class Main { static Scanner input = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { long [ ] data = new long [ 3 ] ; data [ 0 ] = input . nextLong ( ) ; data [ 1 ] = input . nextLong ( ) ; data [ 2 ] = input . nextLong ( ) ; Arrays . sort ( data ) ; if ( ( data [ 1 ] - data [ 0 ] ) % 2 == 0 ) { System . out . println ( data [ 1 ] ) ; } else { System . out . println ( data [ 2 ] ) ; } } }


import java . util . Arrays ; import java . util . Scanner ;   public class Main { static long [ ] a = new long [ 3 ] ; public static void main ( String [ ] args ) { Scanner reader = new Scanner ( System . in ) ; a [ 0 ] = reader . nextLong ( ) ; a [ 1 ] = reader . nextLong ( ) ; a [ 2 ] = reader . nextLong ( ) ; Arrays . sort ( a ) ; System . out . println ( ( a [ 1 ] - a [ 0 ] ) % 2 == 0 ? a [ 1 ] : a [ 2 ] ) ; } }


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigDecimal ; import java . math . BigInteger ; import java . util . StringTokenizer ;   public class Main { public static void main ( String [ ] args )

n , m = map ( int , input ( ) . split ( ) ) k = 2 * ( m - 1 ) p = [ 0 ] * nfor i in range ( n ) : s , f , t = map ( int , input ( ) . split ( ) ) d = t % k if s < f : p [ i ] = ( k if s <= d else 0 ) + f - 1 + t - d elif f < s : p [ i ] = ( k if d + s > k + 1 else 0 ) + k + 1 - f + t - d else : p [ i ] = tprint ( ' \n ' . join ( map ( str , p ) ) ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) k = 2 * ( m - 1 ) for i in range ( n ) : s , f , t = map ( int , input ( ) . split ( ) ) d = t % k if s < f : print ( k * ( s <= d ) + f - 1 + t - d ) elif f < s : print ( k * ( d + s > k + 1 ) + k + 1 - f + t - d ) else : print ( t ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Aorangy1 {   static int m ;   static long f ( long v , int floor ) { if ( floor == 1 ) { return ( v - 1 ) * ( m - 1 ) * 2 ; } if ( floor == m ) { return ( m - 1 ) + ( ( v - 1 ) * ( m - 1 ) * 2 ) ; } long ret = 0 ; long even = v / 2 ; long odd = v / 2 ; if ( v % 2 == 0 ) even -- ; long sumEven = even * ( m - floor ) * 2 ; long sumOdd = odd * ( floor - 1 ) * 2 ; sumOdd = sumOdd - ( floor - 1 ) ; ret = sumEven + sumOdd ; return ret ; }   public static void main ( String [ ] args ) throws IOException {


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigDecimal ; import java . math . BigInteger ; import java . util . StringTokenizer ;   public class Main {   public static void main ( String [ ] args ) { InputReader in = new InputReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ;


import java . util . * ; import java . io . * ; public class Bdiv1 { public static void main ( String ... thegame ) { FastScanner sc = new FastScanner ( ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] [ ] map = new int [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { map [ i ] [ j ] = sc . nextInt ( ) ; } } if ( n > 10 ) { int res = k + 1 ; for ( int t = 0 ; t < n ; t ++ ) {

from functools import * read_line = lambda : [ int ( i ) for i in input ( ) . split ( ) ] n , m , k = read_line ( ) a = [ read_line ( ) for i in range ( n ) ] if n < m : n , m , a = m , n , zip ( * a ) xs = [ reduce ( lambda x , b : 2 * x + b , y ) for y in a ] minm = lambda a : min ( a , m - a ) work = lambda y : sum ( minm ( bin ( x ^ y ) . count ( '1' ) ) for x in xs ) ans = min ( map ( work , xs if m > k else range ( 1 << m ) ) ) print ( ans if ans <= k else - 1 ) NEW_LINE


from functools import *   read_line = lambda : [ int ( i ) for i in input ( ) . split ( ) ]   n , m , k = read_line ( ) a = [ read_line ( ) for i in range ( n ) ] if n < m : n , m , a = m , n , zip ( * a )   xs = [ reduce ( lambda x , b : 2 * x + b , y ) for y in a ] minm = lambda a : min ( a , m - a ) work = lambda y : sum ( minm ( bin ( x ^ y ) . count ( '1' ) ) for x in xs ) ans = min ( map ( work , xs if m > k else range ( 1 << m ) ) )   print ( ans if ans <= k else - 1 )   NEW_LINE


from functools import *   read_line = lambda : [ int ( i ) for i in input ( ) . split ( ) ]   n , m , k = read_line ( ) a = [ read_line ( ) for i in range ( n ) ] if n < m : n , m , a = m , n , zip ( * a )   xs = [ reduce ( lambda x , b : 2 * x + b , y ) for y in a ] minm = lambda a : min ( a , m - a ) work = lambda y : sum ( minm ( bin ( x ^ y ) . count ( '1' ) ) for x in xs ) ans = min ( map ( work , xs if m > k else range ( 1 << m ) ) )   print ( ans if ans <= k else - 1 )         NEW_LINE


import java . io . * ; import java . util . * ; import java . util . stream . * ;   public class a implements Runnable { public static void main ( String [ ] args ) { new Thread ( null , new a ( ) , " process " , 1 << 26 ) . start ( ) ; } public void run ( ) { FastReader scan = new FastReader ( ) ; PrintWriter out = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ;


import java . io . ByteArrayInputStream ; import java . io . File ; import java . io . FileInputStream ; import java . io . FileNotFoundException ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . nio . charset . StandardCharsets ; import java . util . Arrays ; import java . util . InputMismatchException ;   public class B425 {   static class Solver {   int N , M , K , grid [ ] [ ] , g2 [ ] [ ] ;   int fix ( int [ ] model , int [ ] cand , int cap ) {


import java . util . * ;   public class CF102 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; long low = 0 ; long high = n ; while ( low <= high ) { long mid = low + ( high - low ) / 2 ;

n , k = map ( int , input ( ) . split ( ) ) i = 0j = nwhile ( i <= j ) : a = ( i + j ) // 2 s = ( n - a ) * ( n - a + 1 ) // 2 if ( s - a == k ) : print ( a ) break elif ( s - a > k ) : i = a else : j = a NEW_LINE


n , k = map ( int , input ( ) . split ( ) )   c = 0 i = 1 while 1 : c += i if n - i == c - k : print ( n - i ) break i += 1   NEW_LINE


n , k = list ( map ( int , input ( ) . split ( ) ) )   for t in range ( 1 , n + 1 ) : total = t * ( t + 1 ) // 2 eat = total - k if eat + t == n : print ( eat ) break NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) for r in range ( 1 , 10 ** 5 ) : if ( r * ( r + 1 ) ) // 2 + r == k + n : print ( n - r ) exit ( ) NEW_LINE


def bs ( l , h ) : while l <= h : m = ( l + h ) // 2 if gf ( m ) == 0 : return m if gf ( m ) == 1 : l = m + 1 else : h = m - 1   def gf ( x ) : if ( n - x ) * ( n - x + 1 ) // 2 - x == k : return 0 if ( n - x ) * ( n - x + 1 ) / 2 - x > k : return 1 return - 1     n , k = map ( int , input ( ) . split ( ) ) print ( bs ( 0 , n ) ) NEW_LINE


import java . sql . SQLOutput ; import java . util . * ; import java . lang . * ; import java . io . * ;   public class codeforces { static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } public static void main ( String [ ] args ) {   FastReader sc = new FastReader ( ) ; long n = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; long x = ( long ) ( - 3 + ( Math . sqrt ( 9 + 8 * ( n + k ) ) ) ) / 2 ; System . out . println ( n - x ) ;   } }


import java . util . * ; public class Sport_Mafia { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; long sum = 0 ; long i = 1 ; for ( i = 1 ; i <= n ; i ++ ) { sum = i * ( i + 1 ) ; sum = sum / 2 ; sum -= ( n - i ) ; if ( sum == k ) { System . out . println ( n - i ) ; break ; } } } }


import java . util . * ; import java . io . * ; public class main { public static void main ( String [ ] args ) { FastScanner scan = new main ( ) . new FastScanner ( ) ; long a = scan . nextLong ( ) ; long b = scan . nextLong ( ) ; long ans = ( long ) ( - 3 + Math . sqrt ( 9 + 8 * ( a + b ) ) ) / 2 ; System . out . print ( a - ans ) ; } class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Deque ; import java . util . LinkedList ; import java . util . StringTokenizer ;   public class CF1063B { static final int [ ] dx = { + 1 , - 1 , 0 , 0 } ; static final int [ ] dy = { 0 , 0 , + 1 , - 1 } ;   public static void main ( String [ ] args ) throws IOException { FastScanner sc = new FastScanner ( ) ; PrintWriter pw = new PrintWriter ( System . out ) ;   int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; int xS = sc . nextInt ( ) - 1 , yS = sc . nextInt ( ) - 1 ; int l = sc . nextInt ( ) , r = sc . nextInt ( ) ; boolean [ ] g = new boolean [ n * m ] ; for ( int i = 0 ; i < n ; i ++ ) { char [ ] line = sc . nextToken ( ) . toCharArray ( ) ; for ( int j = 0 ; j < m ; j ++ ) if ( line [ j ] == ' . ' ) g [ i * m + j ] = true ; }

from collections import dequen , m = [ int ( x ) for x in input ( ) . split ( ) ] x , y = [ int ( x ) for x in input ( ) . split ( ) ] left , right = [ int ( x ) for x in input ( ) . split ( ) ] s = [ ] ans = 0 d = [ None ] * 2007 for i in range ( 0 , 2007 ) : d [ i ] = [ 0 for j in range ( 0 , 2007 ) ]   for i in range ( 0 , n ) : s . append ( input ( ) )   q = deque ( )   q . append ( [ x - 1 , y - 1 , left , right ] )   while ( len ( q ) ) : v = q [ 0 ] q . popleft ( ) if ( v [ 0 ] < 0 or v [ 0 ] >= n or v [ 1 ] < 0 or v [ 1 ] >= m or d [ v [ 0 ] ] [ v [ 1 ] ] == 1 or v [ 2 ] < 0 or v [ 3 ] < 0 or s [ v [ 0 ] ] [ v [ 1 ] ] == ' * ' ) : continue d [ v [ 0 ] ] [ v [ 1 ] ] = 1 q . appendleft ( [ v [ 0 ] + 1 , v [ 1 ] , v [ 2 ] , v [ 3 ] ] ) q . appendleft ( [ v [ 0 ] - 1 , v [ 1 ] , v [ 2 ] , v [ 3 ] ] ) q . append ( [ v [ 0 ] , v [ 1 ] + 1 , v [ 2 ] , v [ 3 ] - 1 ] ) q . append ( [ v [ 0 ] , v [ 1 ] - 1 , v [ 2 ] - 1 , v [ 3 ] ] ) for i in range ( 0 , n ) : for j in range ( 0 , m ) : ans += d [ i ] [ j ]   print ( ans ) NEW_LINE


import sysimport mathfrom collections import defaultdictfrom collections import deque   MAXNUM = math . infMINNUM = - 1 * math . infASCIILOWER = 97 ASCIIUPPER = 65     def getInt ( ) : return int ( sys . stdin . readline ( ) . rstrip ( ) )     def getInts ( ) : return map ( int , sys . stdin . readline ( ) . rstrip ( ) . split ( " ▁ " ) )     def getString ( ) : return sys . stdin . readline ( ) . rstrip ( )     def printOutput ( ans ) : sys . stdout . write ( ) pass     def successors ( grid , curPos , moves ) : r , c = curPos x , y = moves   succStates = [ ] for a , b in [ ( 1 , 0 ) , ( - 1 , 0 ) ] : if ( 0 <= r + a < len ( grid ) and 0 <= c + b <= len ( grid [ 0 ] ) and grid [ r + a ] [ c + b ] != " * " ) : succStates . append ( ( ( r + a , c + b ) , moves ) )   NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Deque ; import java . util . LinkedList ; import java . util . StringTokenizer ;   public class CF1063B { static final int [ ] dx = { + 1 , - 1 , 0 , 0 } ; static final int [ ] dy = { 0 , 0 , + 1 , - 1 } ;   public static void main ( String [ ] args ) throws IOException { FastScanner sc = new FastScanner ( ) ; PrintWriter pw = new PrintWriter ( System . out ) ;   int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; int xS = sc . nextInt ( ) - 1 , yS = sc . nextInt ( ) - 1 ; int l = sc . nextInt ( ) , r = sc . nextInt ( ) ; boolean [ ] [ ] g = new boolean [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { char [ ] line = sc . nextToken ( ) . toCharArray ( ) ; for ( int j = 0 ; j < m ; j ++ ) if ( line [ j ] == ' . ' ) g [ i ] [ j ] = true ; }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Deque ; import java . util . LinkedList ; import java . util . StringTokenizer ;   public class CF1063B { static final int [ ] dx = { + 1 , - 1 , 0 , 0 } ; static final int [ ] dy = { 0 , 0 , + 1 , - 1 } ;   public static void main ( String [ ] args ) throws IOException { FastScanner sc = new FastScanner ( ) ; PrintWriter pw = new PrintWriter ( System . out ) ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; int xS = sc . nextInt ( ) - 1 , yS = sc . nextInt ( ) - 1 ; int l = sc . nextInt ( ) , r = sc . nextInt ( ) ; boolean [ ] [ ] grid = new boolean [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { char [ ] line = sc . nextToken ( ) . toCharArray ( ) ; for ( int j = 0 ; j < m ; j ++ ) if ( line [ j ] == ' . ' ) grid [ i ] [ j ] = true ; }


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

import sysfrom collections import Counterinput = sys . stdin . buffer . readline   m , k , n , s = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) b = Counter ( map ( int , input ( ) . split ( ) ) )   counts = Counter ( ) unsatisfied = len ( b ) to_remove = m + 1 mn_len = m + 1 remove_idx = - 1   j = 0 for i in range ( m ) : while j < m and unsatisfied != 0 : counts [ a [ j ] ] += 1 if counts [ a [ j ] ] == b [ a [ j ] ] : unsatisfied -= 1   j += 1   if unsatisfied == 0 : curr_remove = i % k + max ( 0 , j - i - k ) if curr_remove < to_remove : to_remove = curr_remove mn_len = j - i remove_idx = i   if counts [ a [ i ] ] == b [ a [ i ] ] : unsatisfied += 1   counts [ a [ i ] ] -= 1   if m - to_remove < n * k : print ( - 1 ) else : print ( to_remove )   indexes = { } for i in range ( remove_idx , remove_idx + mn_len ) : if a [ i ] in indexes : indexes [ a [ i ] ] . append ( i + 1 ) else : indexes [ a [ i ] ] = [ i + 1 ]   removed = list ( range ( 1 , remove_idx % k + 1 ) ) to_remove -= remove_idx % k   for i in indexes : if to_remove == 0 : break else : removed . extend ( indexes [ i ] [ : min ( len ( indexes [ i ] ) - b [ i ] , to_remove ) ] ) to_remove -= min ( len ( indexes [ i ] ) - b [ i ] , to_remove )   print ( * removed )             NEW_LINE


def main ( ) : m , k , n , s = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE


import java . util . * ;   public class Main {   public static void main ( String [ ] args ) {   Scanner sc = new Scanner ( System . in ) ; String cards = sc . next ( ) ; sc . close ( ) ;   char [ ] str = cards . toCharArray ( ) ;   int min = 0 ;   for ( int i = 0 ; i < str . length ; i ++ ) { if ( str [ i ] == ' a ' || str [ i ] == ' e ' || str [ i ] == ' i ' || str [ i ] == ' u ' || str [ i ] == ' o ' ) { min ++ ; } else if ( str [ i ] == '1' || str [ i ] == '3' || str [ i ] == '5' || str [ i ] == '7' || str [ i ] == '9' ) { min ++ ; } }   System . out . println ( min ) ;   }   }

import math   def main_function ( ) : output_list = [ ] s = input ( ) count = 0 vowels = [ " a " , " e " , " o " , " i " , " u " , "1" , "3" , "5" , "7" , "9" ] hash_list = [ 0 for i in vowels ] dict = { } for i in range ( len ( vowels ) ) : dict [ vowels [ i ] ] = i for i in s : if i in vowels : hash_list [ dict [ i ] ] += 1 return sum ( hash_list )               print ( main_function ( ) ) NEW_LINE


vowels_and_even_numbers = [ '1' , '3' , '5' , '7' , '9' , ' a ' , ' e ' , ' i ' , ' o ' , ' u ' ] minimum = 0 s = input ( )   for char in s : if char in vowels_and_even_numbers : minimum += 1   print ( minimum ) NEW_LINE


cards = input ( ) numbers = "0123456789" even = "02468" vowals = " aeiou " count = 0   for s in range ( len ( cards ) ) : if cards [ s ] in vowals : count += 1 else : if cards [ s ] in numbers and cards [ s ] not in even : count += 1   print ( count ) NEW_LINE


a = input ( )   lista = [ '1' , '3' , '5' , '7' , '9' , ' a ' , ' e ' , ' i ' , ' o ' , ' u ' ]   i = 0   for x in range ( len ( a ) ) : if a [ x ] in lista : i = i + 1   print ( i ) NEW_LINE


import sys   def main ( ) : s = sys . stdin . read ( ) . strip ( ) return sum ( i in set ( ' aeiou13579' ) for i in s ) print ( main ( ) ) NEW_LINE


import java . util . Scanner ;   public class NewYearAndCountingCards {   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . nextLine ( ) ; int c = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == ' a ' || s . charAt ( i ) == ' e ' || s . charAt ( i ) == ' i ' || s . charAt ( i ) == ' o ' || s . charAt ( i ) == ' u ' || s . charAt ( i ) == '1' || s . charAt ( i ) == '3' || s . charAt ( i ) == '5' || s . charAt ( i ) == '7' || s . charAt ( i ) == '9' ) { c ++ ; } } System . out . println ( c ) ; }   }


import java . util . Scanner ;   public class CountCards { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; String s = in . next ( ) ; in . close ( ) ; int c = 0 , i ;   for ( i = 0 ; i < s . length ( ) ; i ++ ) { char v = s . charAt ( i ) ; if ( v == ' a ' || v == ' e ' || v == ' i ' || v == ' o ' || v == ' u ' || ( Character . isDigit ( v ) && Integer . parseInt ( String . valueOf ( v ) ) % 2 != 0 ) ) { c ++ ; } } System . out . println ( c ) ; } }


import java . lang . * ; import java . util . * ; import java . io . * ; public class test { Scanner sc = new Scanner ( System . in ) ; PrintWriter pr = new PrintWriter ( System . out , true ) ; public static void main ( String ... args ) { test c = new test ( ) ; c . prop ( ) ; } public void prop ( ) { String s = sc . next ( ) ; int n = s . length ( ) , count = 0 , count2 = 0 ; for ( int i = 0 ; i < n ; ++ i ) { char c = s . charAt ( i ) ; if ( c == ' a ' || c == ' e ' || c == ' i ' || c == ' o ' || c == ' u ' || c == '1' || c == '3' || c == '5' || c == '7' || c == '9' ) ++ count ; } pr . println ( count ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . util . StringTokenizer ;    public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ; solver . solve ( in , out ) ; out . close ( ) ; } static class TaskA { public void solve ( InputReader in , PrintWriter out ) { String s = in . next ( ) ; int ans = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( pd ( s . charAt ( i ) ) ) ans ++ ; } out . println ( ans ) ; } static boolean pd ( char c ) { if ( c <= '9' && c >= '0' ) { if ( ( int ) ( c - '0' ) % 2 == 1 ) return true ; } if ( c == ' a ' || c == ' e ' || c == ' i ' || c == ' o ' || c == ' u ' ) return true ; return false ; } } static class InputReader { public BufferedReader reader ; public StringTokenizer tokenizer ; public InputReader ( InputStream stream ) { reader = new BufferedReader ( new InputStreamReader ( stream ) ) ; tokenizer = null ; } public String next ( ) { while ( tokenizer == null || ! tokenizer . hasMoreElements ( ) ) { try { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } return tokenizer . nextToken ( ) ; } public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } } }


import java . util . Arrays ; import java . util . Scanner ; public class _0640BalancedRemainders { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int cases = sc . nextInt ( ) ; while ( cases > 0 ) { int n = sc . nextInt ( ) ; int [ ] arr = new int [ 3 ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ sc . nextInt ( ) % 3 ] ++ ; } int count = 0 ; while ( arr [ 0 ] != arr [ 1 ] || arr [ 0 ] != arr [ 2 ] ) { for ( int i = 0 ; i < 3 ; i ++ ) { if ( arr [ i ] > n / 3 ) { arr [ i ] -- ; arr [ ( i + 1 ) % 3 ] ++ ; count ++ ; } } } System . out . println ( count ) ; cases -- ; } } }

for s in [ * open ( 0 ) ] [ 2 : : 2 ] : NEW_LINE INDENT c = [ 0 ] * 3 NEW_LINE for x in s . split ( ) : c [ int ( x ) % 3 ] += 1 NEW_LINE print ( max ( c [ i ] - c [ i - 1 ] for i in ( 0 , 1 , 2 ) ) ) NEW_LINE DEDENT


for s in [ * open ( 0 ) ] [ 2 : : 2 ] : NEW_LINE INDENT c = [ 0 ] * 3 ; NEW_LINE r = i = 0 NEW_LINE for x in s . split ( ) : c [ int ( x ) % 3 ] += 1 NEW_LINE while len ( { * c } ) > 1 : j = ( i + 1 ) % 3 ; f = c [ i ] > c [ j ] ; c [ i ] -= f ; c [ j ] += f ; r += f ; i = j NEW_LINE print ( r ) NEW_LINE DEDENT


for i in [ * open ( 0 ) ] [ 2 : : 2 ] : NEW_LINE INDENT q = [ 0 ] * 3 NEW_LINE for _ in map ( int , i . split ( ) ) : q [ _ % 3 ] += 1 NEW_LINE print ( max ( q [ i ] - q [ i - 1 ] for i in ( 0 , 1 , 2 ) ) ) NEW_LINE DEDENT


for s in [ * open ( 0 ) ] [ 2 : : 2 ] : NEW_LINE INDENT c = [ 0 ] * 3 NEW_LINE for x in s . split ( ) : c [ int ( x ) % 3 ] += 1 NEW_LINE print ( max ( c [ i ] - c [ i - 1 ] for i in range ( 3 ) ) ) NEW_LINE DEDENT


import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; int res = 0 ; int [ ] cnt = new int [ 3 ] ; for ( int i = 0 ; i < n ; i ++ ) cnt [ a [ i ] % 3 ] ++ ; while ( Math . min ( cnt [ 0 ] , Math . min ( cnt [ 1 ] , cnt [ 2 ] ) ) != n / 3 ) { for ( int i = 0 ; i < 3 ; i ++ ) if ( cnt [ i ] > n / 3 ) { res ++ ; cnt [ i ] -- ; cnt [ ( i + 1 ) % 3 ] ++ ; } } System . out . println ( res ) ; } } }


import java . util . * ; public class S { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner scan = new Scanner ( System . in ) ; int t = scan . nextInt ( ) ; while ( t -- != 0 ) { int n = scan . nextInt ( ) ; int [ ] arr = new int [ 3 ] ; for ( int i = 0 ; i < n ; i ++ ) { int num = scan . nextInt ( ) ; arr [ num % 3 ] ++ ; } int maxi = - 1 , max = - 1 ; for ( int i = 0 ; i < 3 ; i ++ ) { if ( arr [ i ] > max ) { maxi = i ; max = arr [ i ] ; } } int ans = ( arr [ maxi ] - ( n / 3 ) ) ; arr [ ( maxi + 1 ) % 3 ] += ans ; if ( arr [ ( maxi + 1 ) % 3 ] > arr [ ( maxi + 2 ) % 3 ] ) ans += ( ( n / 3 ) - arr [ ( maxi + 2 ) % 3 ] ) ; else ans += 2 * ( ( arr [ ( maxi + 2 ) % 3 ] ) - ( n / 3 ) ) ; System . out . println ( ans ) ; } } }


import java . util . Scanner ; public class Solution_2 { public static void main ( String [ ] args ) { int t , n ; Scanner sc = new Scanner ( System . in ) ; t = sc . nextInt ( ) ; while ( t -- > 0 ) { n = sc . nextInt ( ) ; int [ ] c = new int [ 3 ] ; for ( int i = 0 ; i < n ; i ++ ) { c [ sc . nextInt ( ) % 3 ] ++ ; } System . out . println ( solve ( c , n / 3 ) ) ; } } static int solve ( int [ ] c , int b ) { int res = 0 ; for ( int i = 0 ; i < 2 ; i ++ ) { if ( c [ 0 ] > b ) { res += c [ 0 ] - b ; c [ 1 ] += c [ 0 ] - b ; c [ 0 ] = b ; } if ( c [ 1 ] > b ) { res += c [ 1 ] - b ; c [ 2 ] += c [ 1 ] - b ; c [ 1 ] = b ; } if ( c [ 2 ] > b ) { res += c [ 2 ] - b ; c [ 0 ] += c [ 2 ] - b ; c [ 2 ] = b ; } } return res ; } }


import java . util . * ; public class CodeForces1490B { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int t = input . nextInt ( ) ; for ( int j = 0 ; j < t ; j ++ ) { int n = input . nextInt ( ) ; int [ ] a = new int [ 3 ] ; for ( int i = 0 ; i < n ; i ++ ) { int c = input . nextInt ( ) ; a [ c % 3 ] ++ ; } int count = 0 ; n /= 3 ; for ( int i = 0 ; i < 5 ; i ++ ) { if ( a [ i % 3 ] > n ) { a [ ( i + 1 ) % 3 ] += a [ i % 3 ] - n ; count += a [ i % 3 ] - n ; a [ i % 3 ] = n ; } } System . out . println ( count ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class A_Tram { public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; int n = fs . nextInt ( ) , ans = 0 , total = 0 , a , b ; for ( int i = 0 ; i < n ; i ++ ) { a = fs . nextInt ( ) ; b = fs . nextInt ( ) ; total = total - a + b ; ans = max ( ans , total ) ; }   System . out . println ( ans ) ; }   static int min ( int a , int b ) { return Math . min ( a , b ) ; }   static int max ( int a , int b ) { return Math . max ( a , b ) ; }   static long min ( long a , long b ) { return Math . min ( a , b ) ; }   static long max ( long a , long b ) { return Math . max ( a , b ) ; }   static class FastScanner { BufferedReader br ; StringTokenizer st ;   public FastScanner ( ) { 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 ( ) ) ; } char nextChar ( ) { return next ( ) . charAt ( 0 ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }

p = q = 0 for x in [ 0 ] * int ( input ( ) ) : q -= eval ( input ( ) . replace ( ' ▁ ' , ' - ' ) ) ; p = max ( p , q ) print ( p ) NEW_LINE


n = int ( input ( ) ) x = 0 y = 0 for i in range ( 0 , n ) : z = list ( map ( int , input ( ) . rstrip ( ) . split ( ) ) ) x = x - z [ 0 ] x = x + z [ 1 ] if y < x : y = xprint ( y ) NEW_LINE


stop_n = int ( input ( ) ) in_tram = [ ] out_tram = [ ] for i in range ( stop_n ) : exit_a , enter_b = map ( int , input ( ) . split ( ) ) in_tram . append ( enter_b ) out_tram . append ( exit_a )   NEW_LINE


n = int ( input ( ) ) li = list ( ) for i in range ( n ) : a , b = input ( ) . split ( ) a = int ( a ) ; b = int ( b ) if ( i == 0 ) : npass = b li . append ( npass ) else : cpss = npass - a + b npass = cpss li . append ( cpss ) print ( max ( li ) ) NEW_LINE


n = int ( input ( ) ) stop = [ ] person = 0 count = 0 for i in range ( n ) : a = list ( map ( int , input ( ) . split ( ) ) ) stop . append ( a )   for i in stop : person = person - i [ 0 ] + i [ 1 ] if count < person : count = person print ( count ) NEW_LINE


import java . util . Scanner ;   public class BigO {   public static void main ( String [ ] args ) { int a , b , n ; int minCapacity = 0 ; int du = 0 ; int peopleAtStop = 0 ; Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ;   for ( int i = 0 ; i < n ; i ++ ) { a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; peopleAtStop = b - a + du ; du = peopleAtStop ; if ( peopleAtStop > minCapacity ) { minCapacity = peopleAtStop ; } } System . out . println ( minCapacity ) ;   }   }


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


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int tran = 0 ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int a = scan . nextInt ( ) ;


import java . io . * ; import java . lang . * ; import java . util . * ;    public class Main {   static Main . MyScanner sc = new Main . MyScanner ( ) ; static PrintStream out = System . out ;   public static void main ( String [ ] args ) throws Exception { int n = sc . nextInt ( ) , count = 0 , x = 0 , y = 0 , temp = 0 ; for ( int i = 0 ; i < n ; i ++ ) { x = sc . nextInt ( ) ; y = sc . nextInt ( ) ; temp += y - x ; if ( count < temp ) count = temp ; } out . print ( count ) ; out . close ( ) ; } static private class MyScanner { BufferedReader br ; StringTokenizer st ;   public MyScanner ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   public long mod ( long x ) {


import java . util . * ; import java . util . stream . * ; public class Solution { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int k = scan . nextInt ( ) ; List < Integer > a = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { a . add ( scan . nextInt ( ) ) ; } Collections . sort ( a ) ; String result = ( n < k ) ? " - 1" : a . get ( n - k ) + " ▁ " + a . get ( n - k ) ; System . out . println ( result ) ; } }

n , k = list ( map ( int , input ( ) . split ( ) ) ) a = list ( map ( int , input ( ) . split ( ) ) )   if k <= n : a . sort ( reverse = True ) print ( f " { a [ k ▁ - ▁ 1 ] } ▁ { a [ k ▁ - ▁ 1 ] } " ) else : print ( - 1 ) NEW_LINE


n , k = list ( map ( int , input ( ) . split ( ) ) ) a = list ( map ( int , input ( ) . split ( ) ) ) if ( k > n ) : print ( - 1 ) elif ( k == n ) : print ( 0 , 0 ) else : a . sort ( reverse = True ) for i in range ( k ) : if ( i == k - 1 ) : print ( a [ i ] , 0 ) break NEW_LINE


import sys   def input ( ) : return sys . stdin . readline ( ) . strip ( ) def iinput ( ) : return int ( input ( ) ) def rinput ( ) : return map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) def get_list ( ) : return list ( map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) )       n , k = rinput ( ) a = get_list ( )   if ( k > n ) : print ( - 1 ) else : a . sort ( ) a = list ( reversed ( a ) ) print ( a [ k - 1 ] , 0 ) NEW_LINE


from sys import stdin   def read_lines ( sep = ' ▁ ' , input_type = None ) : NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) arr = [ int ( i ) for i in input ( ) . split ( ) ] arr . sort ( ) if k > n : print ( - 1 ) else : print ( arr [ n - k ] , arr [ n - k ] ) NEW_LINE


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , k = sc . nextInt ( ) ; Integer [ ] ar = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { ar [ i ] = sc . nextInt ( ) ; } if ( k > n ) { System . out . println ( - 1 ) ; } else { Arrays . sort ( ar , Collections . reverseOrder ( ) ) ; System . out . println ( ar [ k - 1 ] + " ▁ " + ar [ k - 1 ] ) ; } } }


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


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


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


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 B129 {   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 ) ) ) ; static ArrayList < HashSet < Integer > > al ; static boolean vis [ ] ; public static void main ( String args [ ] ) {   int tc = 1 ;

import sysinput = sys . stdin . readlineimport math   def inpit ( ) : NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) g = [ set ( ) for i in range ( n ) ] for _ in range ( m ) : a , b = map ( int , input ( ) . split ( ) ) g [ a - 1 ] . add ( b - 1 ) g [ b - 1 ] . add ( a - 1 ) cnt = 0 while True : p = set ( ) for i in range ( n ) : if len ( g [ i ] ) == 1 : p . add ( i ) g [ i ] = set ( ) if len ( p ) == 0 : break cnt += 1 for i in range ( n ) : g [ i ] -= pprint ( cnt ) NEW_LINE


def mingrid ( ) : for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) segcost = input ( ) . split ( ) minodd = int ( segcost [ 0 ] ) mineven = int ( segcost [ 1 ] ) sumodd = minodd sumeven = mineven codd = 1 ceven = 1 res = sumodd + minodd * ( n - codd ) + sumeven + mineven * ( n - ceven ) for i in range ( 2 , n ) : now = int ( segcost [ i ] ) if ( i + 1 ) % 2 : NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) arr = [ ] for i in range ( m ) : arr . append ( list ( map ( int , input ( ) . split ( ) ) ) ) s = set ( ) ans = 0 while True : count = [ 0 ] * ( n ) for a , b in arr : if a not in s and b not in s : count [ a - 1 ] += 1 count [ b - 1 ] += 1 flag = False for i in range ( n ) : if count [ i ] == 1 : flag = True s . add ( i + 1 ) if flag is False : print ( ans ) exit ( ) ans += 1 NEW_LINE


import java . util . * ; import java . io . * ;   public class B {   public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] [ ] edge = new int [ 101 ] [ 101 ] ; while ( m -- > 0 ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; edge [ a ] [ b ] = 1 ; edge [ b ] [ a ] = 1 ; edge [ a ] [ 0 ] ++ ; edge [ b ] [ 0 ] ++ ; }   Queue < Integer > queue = new LinkedList < > ( ) ; for ( int i = 1 ; i <= n ; i ++ ) if ( edge [ i ] [ 0 ] == 1 ) queue . offer ( i ) ;   int count = 0 ; while ( ! queue . isEmpty ( ) ) { int size = queue . size ( ) ; for ( int j = 0 ; j < size ; j ++ ) { int a = queue . poll ( ) ; for ( int i = 1 ; i < 101 ; i ++ ) { if ( edge [ a ] [ i ] == 1 ) { edge [ a ] [ i ] = 0 ; edge [ i ] [ a ] = 0 ; edge [ i ] [ 0 ] -- ; edge [ a ] [ 0 ] -- ; } } }   for ( int i = 1 ; i <= n ; i ++ ) if ( edge [ i ] [ 0 ] == 1 ) queue . offer ( i ) ;   count ++ ; } System . out . println ( count ) ; }   }


import java . util . LinkedList ; import java . util . Queue ; import java . util . Scanner ; public class Section { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int c = 0 , c1 = 0 ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] [ ] l = new int [ 101 ] [ 101 ] ; while ( m -- > 0 ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; l [ a ] [ b ] = 1 ; l [ b ] [ a ] = 1 ; l [ a ] [ 0 ] ++ ; l [ b ] [ 0 ] ++ ; } Queue < Integer > q = new LinkedList < > ( ) ; for ( int i = 1 ; i <= n ; i ++ ) if ( l [ i ] [ 0 ] == 1 ) q . offer ( i ) ; while ( ! q . isEmpty ( ) ) { int size = q . size ( ) ; for ( int j = 0 ; j < size ; j ++ ) { int a = q . poll ( ) ; for ( int i = 0 ; i < 101 ; i ++ ) { if ( l [ a ] [ i ] == 1 ) { l [ a ] [ i ] = 0 ; l [ i ] [ a ] = 0 ; l [ i ] [ 0 ] -- ; l [ a ] [ 0 ] -- ; } } } for ( int i = 1 ; i <= n ; i ++ ) { if ( l [ i ] [ 0 ] == 1 ) { q . offer ( i ) ; } } c ++ ; } System . out . println ( c ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class ArithmeticOrGeometric {   private static BufferedReader bufferedReader ; private static StringTokenizer st ;   public static void main ( String [ ] args ) throws IOException {   bufferedReader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int a1 = Integer . parseInt ( next ( ) ) ; int a2 = Integer . parseInt ( next ( ) ) ; int a3 = Integer . parseInt ( next ( ) ) ; int a4 = Integer . parseInt ( next ( ) ) ;   int d = a2 - a1 ;   if ( d == a3 - a2 && d == a4 - a3 ) { System . out . println ( a4 + d ) ; } else if ( a1 * a3 == a2 * a2 && a2 * a4 == a3 * a3 && a4 * a4 % a3 == 0 ) { System . out . println ( ( a4 * a4 ) / a3 ) ; } else { System . out . println ( 42 ) ; }   }   static String next ( ) throws IOException {   while ( st == null || ! st . hasMoreElements ( ) ) { st = new StringTokenizer ( bufferedReader . readLine ( ) ) ; }   return st . nextToken ( ) ; } }

def test_arithmetic ( in_list ) : arithmetic = True current_nr = in_list [ 0 ] dif = in_list [ 1 ] - in_list [ 0 ] for nr in in_list [ 1 : ] : if nr - current_nr != dif : arithmetic = False else : current_nr = nr if arithmetic : next = nr + dif return next else : return 42     def test_geometric ( in_list ) : geometric = True for nr in in_list : if nr == 0 : return False else : quotient = in_list [ 1 ] / in_list [ 0 ] current_nr = in_list [ 0 ] for nr in in_list [ 1 : ] : if nr / current_nr != quotient : geometric = False else : current_nr = nr if geometric : next = nr * quotient if int ( next ) == 0 or int ( next ) / nr != quotient : return 42 else : return next else : return 42     if __name__ == " _ _ main _ _ " : in_numbers = list ( map ( int , input ( ) . split ( ) ) ) answer_ari = test_arithmetic ( in_numbers ) answer_geo = test_geometric ( in_numbers ) if answer_ari != 42 : print ( int ( answer_ari ) ) else : print ( int ( answer_geo ) ) NEW_LINE


def main ( ) : a , b , c , d = [ int ( i ) for i in input ( ) . split ( ) ] p1 , p2 , p3 = b - a , c - b , d - c q1 , q2 , q3 = b / a , c / b , d / c if ( p1 == p2 == p3 ) : print ( d + p3 ) elif ( q1 == q2 == q3 and q1 != 1 and int ( d * q3 ) == d * q3 ) : print ( int ( d * q3 ) ) else : print ( 42 ) main ( ) NEW_LINE


import sysn = input ( ) . split ( ) a = int ( n [ 0 ] ) b = int ( n [ 1 ] ) c = int ( n [ 2 ] ) d = int ( n [ 3 ] ) if ( b - a == c - b == d - c ) : print ( 2 * d - c ) sys . exit ( ) if ( b * b == a * c and c * c == b * d ) : if ( d * d % c == 0 ) : print ( d * d // c ) else : print ( 42 ) sys . exit ( ) print ( 42 ) NEW_LINE


a , b , c , d = list ( map ( int , input ( ) . split ( ) ) )   a1 = b - aa2 = c - ba3 = d - c   g1 = b / ag2 = c / bg3 = d / c NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . text . DecimalFormat ; import java . util . StringTokenizer ;   public class ArithmeticOrGeometric {   private static BufferedReader bufferedReader ; private static StringTokenizer st ;   public static void main ( String [ ] args ) throws IOException {   bufferedReader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int a1 = Integer . parseInt ( next ( ) ) ; int a2 = Integer . parseInt ( next ( ) ) ; int a3 = Integer . parseInt ( next ( ) ) ; int a4 = Integer . parseInt ( next ( ) ) ;   int d = a2 - a1 ; double r = ( double ) a2 / a1 ;   if ( d == a3 - a2 && d == a4 - a3 ) { System . out . println ( a4 + d ) ; } else if ( a1 * a3 == a2 * a2 && a2 * a4 == a3 * a3 && a4 * a4 % a3 == 0 ) { DecimalFormat decimalFormat = new DecimalFormat ( " # # # # # # " ) ; System . out . println ( decimalFormat . format ( a4 * r ) ) ; } else { System . out . println ( 42 ) ; }   }   static String next ( ) throws IOException {   while ( st == null || ! st . hasMoreElements ( ) ) { st = new StringTokenizer ( bufferedReader . readLine ( ) ) ; }   return st . nextToken ( ) ; } }


import java . io . * ; import java . util . * ; public class Main {   public static void main ( String [ ] args ) { InputReader sc = new InputReader ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; Random gen = new Random ( ) ; int test = 1 ;


import java . util . Scanner ;   public class IQTestTwo {    public static void main ( String [ ] args ) {   Scanner z = new Scanner ( System . in ) ; String line = z . nextLine ( ) ;   String [ ] arrayOfNumberString = line . split ( " ▁ " ) ;      int [ ] a = new int [ 4 ] ;    a [ 0 ] = Integer . valueOf ( arrayOfNumberString [ 0 ] ) ; a [ 1 ] = Integer . valueOf ( arrayOfNumberString [ 1 ] ) ; a [ 2 ] = Integer . valueOf ( arrayOfNumberString [ 2 ] ) ; a [ 3 ] = Integer . valueOf ( arrayOfNumberString [ 3 ] ) ;     int d = a [ 1 ] - a [ 0 ] ;   if ( a [ 2 ] - a [ 1 ] == d && a [ 3 ] - a [ 2 ] == d ) System . out . println ( a [ 3 ] + d ) ; else if ( ( a [ 0 ] * a [ 2 ] == a [ 1 ] * a [ 1 ] ) && ( a [ 1 ] * a [ 3 ] == a [ 2 ] * a [ 2 ] ) && ( a [ 3 ] * a [ 3 ] % a [ 2 ] == 0 ) ) System . out . println ( a [ 3 ] * a [ 3 ] / a [ 2 ] ) ; else System . out . println ( 42 ) ; }   }


import java . util . Scanner ;   public class _0718ChungaChanga {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; long y = sc . nextLong ( ) ; long z = sc . nextLong ( ) ; if ( x % z == 0 && y % z == 0 ) { System . out . print ( ( x / z + y / z ) + " ▁ " + 0 ) ; } else { System . out . print ( ( x + y ) / z + " ▁ " ) ; if ( ( x % z + y % z ) >= z ) { System . out . print ( z - Math . max ( x % z , y % z ) ) ; } else { System . out . print ( 0 ) ; } } }   }

x , y , z = map ( int , input ( ) . split ( ) ) total = x // z + y // zif total == ( x + y ) // z : print ( total , 0 ) else : print ( total + 1 , min ( ( z - x % z ) , ( z - y % z ) ) ) NEW_LINE


import sysinput = sys . stdin . readlinefrom collections import defaultdict as dcfrom collections import Counterfrom bisect import bisect_right , bisect_leftimport mathfrom operator import itemgetterfrom heapq import heapify , heappop , heappushfrom queue import PriorityQueue as pqx , y , z = map ( int , input ( ) . split ( ) ) c = ( x + y ) // zp = ( x + y ) % zx = x % zy = y % z NEW_LINE


x , y , z = map ( int , input ( ) . split ( ) ) n = ( x + y ) // zans = 0 if x // z + y // z < n : print ( n , min ( z - x % z , z - y % z ) ) else : print ( n , 0 ) NEW_LINE


x , y , z = map ( int , input ( ) . split ( ) ) cnt = ( x + y ) // zif x % z + y % z < z : given = 0 else : given = min ( z - x % z , z - y % z ) print ( cnt , given ) NEW_LINE


import java . util . * ;   public class CodeForces1181A { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; long x = input . nextLong ( ) ; long y = input . nextLong ( ) ; long z = input . nextLong ( ) ;   long count = x / z + y / z ; x = x % z ; y = y % z ; long min = Long . MAX_VALUE ; if ( y >= z - x ) { min = z - x ; } if ( x >= z - y ) { min = Math . min ( min , z - y ) ; }   if ( min == Long . MAX_VALUE ) { System . out . println ( count + " ▁ " + 0 ) ; } else { count ++ ; System . out . println ( count + " ▁ " + min ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   import static java . lang . Integer . * ;   public class Example {   public static void main ( String [ ] args ) {    Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; long y = sc . nextLong ( ) ; long z = sc . nextLong ( ) ; long ans = x / z + y / z ; long re = x % z + y % z ; if ( re / z >= 1 ) { long ans2 = 0 ; long xre = x % z ; long yre = y % z ; if ( xre > yre ) { ans2 = z - xre ; } else { ans2 = z - yre ; } System . out . println ( ++ ans + " ▁ " + ans2 ) ; } else { System . out . println ( ans + " ▁ " + 0 ) ; }   }   }


import java . util . * ;   public class CF102 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; long y = sc . nextLong ( ) ; long z = sc . nextLong ( ) ;   long case1coco1 = x / z ; long exc1 = x % z ; long case1coco2 = ( y + exc1 ) / z ; long diff1 = ( y + exc1 ) % z ; if ( diff1 >= exc1 ) { exc1 = 0 ; } else { exc1 = exc1 - diff1 ; }   long sum1 = case1coco1 + case1coco2 ;   long cas2coco2 = y / z ; long exc2 = y % z ; long case2coco1 = ( x + exc2 ) / z ; long diff2 = ( x + exc2 ) % z ; if ( diff2 >= exc2 ) { exc2 = 0 ; } else { exc2 = exc2 - diff2 ; }   long sum2 = cas2coco2 + case2coco1 ;   if ( exc1 == 0 || exc2 == 0 ) { if ( exc1 == 0 && exc2 != 0 ) { System . out . println ( sum1 + " ▁ " + exc1 ) ; } else if ( exc1 != 0 && exc2 == 0 ) { System . out . println ( sum2 + " ▁ " + exc2 ) ; } else { if ( ( sum1 ) >= ( sum2 ) ) { System . out . println ( sum1 + " ▁ " + exc1 ) ; } else { System . out . println ( sum2 + " ▁ " + exc2 ) ; } }   } else { if ( ( ( sum1 * exc2 ) ) > ( ( sum2 * exc1 ) ) ) { System . out . println ( sum1 + " ▁ " + exc1 ) ; } else if ( ( ( sum1 * exc2 ) ) < ( ( sum2 * exc1 ) ) ) { System . out . println ( sum2 + " ▁ " + exc2 ) ; } else { if ( ( sum1 ) >= ( sum2 ) ) { System . out . println ( sum1 + " ▁ " + exc1 ) ; } else { System . out . println ( sum2 + " ▁ " + exc2 ) ; } } }    } }


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


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashMap ; import java . util . LinkedList ; import java . util . Locale ; import java . util . Objects ; import java . util . Queue ; import java . util . Scanner ; import java . util . Stack ; import java . util . TreeSet ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . lang . reflect . Array ; import java . math . BigInteger ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Map ; import java . util . Vector ;   public class Main {   public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int casos = Integer . parseInt ( br . readLine ( ) ) ; while ( casos > 0 ) { String [ ] entry = br . readLine ( ) . split ( " ▁ " ) ; long x = Long . parseLong ( entry [ 0 ] ) ; long y = Long . parseLong ( entry [ 1 ] ) ; long a = Long . parseLong ( entry [ 2 ] ) ; long b = Long . parseLong ( entry [ 3 ] ) ; long up = y - x ; long down = a + b ; if ( up % down != 0 ) { System . out . println ( " - 1" ) ; } else { System . out . println ( up / down ) ; }   casos -- ; } } }


def main ( ) : allans = [ ] t = int ( input ( ) ) for _ in range ( t ) : x , y , a , b = readIntArr ( ) relativeV = a + b d = y - x if d % relativeV == 0 : allans . append ( d // relativeV ) else : allans . append ( - 1 ) multiLineArrayPrint ( allans ) return import sysinput = sys . stdin . buffer . readline NEW_LINE


t = int ( input ( ) ) lst = [ ] for i in range ( t ) : var = list ( map ( int , input ( ) . split ( ) ) ) lst . append ( var ) for i in range ( t ) : x , y , a , b = lst [ i ] n = ( x - y ) % ( a + b ) if n == 0 : print ( abs ( int ( ( x - y ) / ( a + b ) ) ) ) else : print ( - 1 )               NEW_LINE


t = input ( ) t = int ( t ) while t != 0 : res = input ( ) res = res . split ( ) x = int ( res [ 0 ] ) y = int ( res [ 1 ] ) a = int ( res [ 2 ] ) b = int ( res [ 3 ] ) res = ( y - x ) % ( a + b ) if res == 0 : print ( ( y - x ) // ( a + b ) ) else : print ( - 1 ) t = t - 1 NEW_LINE


exec ( int ( input ( ) ) * ' x , y , a , b = map ( int , input ( ) . split ( ) ) ; y - = x ; a + = b ; print ( ( y / / a , -1 ) [ y % a > 0 ] ) ; ' ) NEW_LINE


import java . util . Scanner ;   public class Nk { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ;   int t = input . nextInt ( ) ; int m = 0 ;   while ( t -- > 0 ) {   int x = input . nextInt ( ) ; int y = input . nextInt ( ) ; int a = input . nextInt ( ) ; int b = input . nextInt ( ) ;   if ( ( y - x ) % ( a + b ) == 0 ) { System . out . println ( ( y - x ) / ( a + b ) ) ; }   else { System . out . println ( - 1 ) ; } } } }


import java . util . * ; import java . io . * ; import java . math . * ;     public class A {   private static long INF = 2000000000000000000L , M = 1000000007 , MM = 998244353 ; private static int N = 0 ;   public static void process ( ) throws IOException {   long x = sc . nextLong ( ) , y = sc . nextLong ( ) , a = sc . nextLong ( ) , b = sc . nextLong ( ) ; long l = 0 , r = Integer . MAX_VALUE ; while ( l <= r ) { long mid = ( l + r ) / 2 ; long curr = mid * a + x ; long other = y - mid * b ; if ( curr > other ) { r = mid - 1 ; } else if ( curr < other ) { l = mid + 1 ; } else { System . out . println ( mid ) ; return ; } } System . out . println ( - 1 ) ;   }


import java . util . Scanner ;   public class A1304 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = scanner . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int x = scanner . nextInt ( ) , y = scanner . nextInt ( ) , a = scanner . nextInt ( ) , b = scanner . nextInt ( ) ; int distance = y - x , oneSecond = a + b ; System . out . println ( distance % oneSecond == 0 ? distance / oneSecond : - 1 ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . List ; import java . util . Random ; import java . util . StringTokenizer ;   public class Main implements Runnable {   int INF = ( int ) 1e9 ; int sz [ ] ; int id [ ] ; List < Integer > edges [ ] ;   private void solve ( ) throws IOException { int n = nextInt ( ) ; int a [ ] = new int [ n ] ; int ev = 0 ; for ( int i = 0 ; i < n ; ++ i ) { a [ i ] = nextInt ( ) ; if ( ( ( i + 1 ) & 1 ) == 0 ) ev ++ ; } int dp [ ] [ ] [ ] = new int [ n + 1 ] [ n + 1 ] [ 2 ] ;

def main ( ) : n = int ( input ( ) ) a = readIntArr ( ) arr = [ ] NEW_LINE


a = int ( input ( ) ) z = list ( map ( int , input ( ) . split ( ) ) ) import math   odd = 0 eve = 0 for i in range ( len ( z ) ) : if ( z [ i ] % 2 == 1 ) : odd += 1 elif ( z [ i ] % 2 == 0 and z [ i ] > 0 ) : eve += 1   odd = ( a // 2 ) + ( a % 2 ) - oddeve = ( a // 2 ) - eve + ( ( a % 2 ) ) cnt = 0   dp = [ [ [ math . inf for i in range ( 2 ) ] for i in range ( odd + 2 ) ] for i in range ( len ( z ) ) ]   NEW_LINE


def abc ( l , odd , even , i , x ) : try : return dp [ i , odd , even , x ] except : pass if i == len ( l ) : return 0 if l [ i ] : c = 0 if x != l [ i ] % 2 : c += 1 return c + abc ( l , odd , even , i + 1 , l [ i ] % 2 ) ans = n if odd : c = 0 if not x % 2 : c += 1 ans = min ( ans , c + abc ( l , odd - 1 , even , i + 1 , 1 ) ) if even : c = 0 if x % 2 : c += 1 ans = min ( ans , c + abc ( l , odd , even - 1 , i + 1 , 0 ) ) dp [ i , odd , even , x ] = ans return ansn = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) dp = { } odd = 0 even = 0 d = [ 0 ] * ( n + 1 ) for i in l : d [ i ] += 1 for i in range ( 1 , n + 1 ) : if i % 2 and not d [ i ] : odd += 1 if not i % 2 and not d [ i ] : even += 1 if l [ 0 ] : print ( abc ( l , odd , even , 1 , l [ 0 ] % 2 ) ) else : ans = n if odd : ans = min ( ans , abc ( l , odd - 1 , even , 1 , 1 ) ) if even : ans = min ( ans , abc ( l , odd , even - 1 , 1 , 0 ) ) print ( ans ) NEW_LINE


n = int ( input ( ) ) p = list ( map ( int , input ( ) . split ( ) ) ) odd = ( n + 1 ) // 2 memo = { } def best ( i , odd_count , last ) : if i == n : return 0 key = ( i , odd_count , last ) if key in memo : return memo [ key ] poss = range ( 2 ) if p [ i ] == 0 else [ p [ i ] % 2 ] res = 10 ** 9 for parity in poss : new_odd_count = odd_count - parity new_even_count = n - i - odd_count - ( parity ^ 1 ) if new_odd_count < 0 or new_even_count < 0 : continue res = min ( res , best ( i + 1 , new_odd_count , parity ) + ( 1 if i > 0 and last != parity else 0 ) ) memo [ key ] = res return resprint ( best ( 0 , odd , 0 ) ) NEW_LINE


import java . io . * ; import java . util . * ; public class Main { public static void main ( String args [ ] ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int t = Integer . parseInt ( br . readLine ( ) ) ; while ( t -- > 0 ) { int n = Integer . parseInt ( br . readLine ( ) ) ; int arr [ ] = new int [ n ] ; String s [ ] = br . readLine ( ) . split ( " ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = Integer . parseInt ( s [ i ] ) ; int even = 0 , odd = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] % 2 != 0 && i % 2 == 0 ) odd ++ ; else if ( arr [ i ] % 2 == 0 && i % 2 != 0 ) even ++ ; } if ( odd == even ) System . out . println ( even ) ; else if ( odd == 0 && even == 0 ) System . out . println ( "0" ) ; else System . out . println ( " - 1" ) ; } } }

t = int ( input ( ) ) while t : t -= 1 n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) o = 0 e = 0 for i in range ( n ) : if i % 2 != l [ i ] % 2 : if i % 2 == 0 : e += 1 else : o += 1 if e == o : print ( e ) else : print ( - 1 ) NEW_LINE


t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) o = 0 e = 0 for i in range ( 0 , len ( l ) , 2 ) : if i % 2 != l [ i ] % 2 : e += 1 for j in range ( 1 , len ( l ) , 2 ) : if j % 2 != l [ j ] % 2 : o += 1 if e == o : print ( e ) else : print ( - 1 ) NEW_LINE


def main ( ) : t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) o_cnt = 0 e_cnt = 0 for i in range ( n ) : if i % 2 != 0 and arr [ i ] % 2 == 0 : e_cnt += 1 elif i % 2 == 0 and arr [ i ] % 2 != 0 : o_cnt += 1 if e_cnt == o_cnt : print ( e_cnt ) else : print ( - 1 )     if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE


for t in range ( int ( input ( ) ) ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) e , o = 0 , 0 for x in range ( n ) : if x % 2 == 0 and a [ x ] % 2 != 0 : e += 1 if x % 2 != 0 and a [ x ] % 2 == 0 : o += 1 if e != o : print ( - 1 ) else : print ( e ) NEW_LINE


def evenArray ( arr , n ) : evenIdxOddCount = 0 oddIdxEvenCount = 0 for i in range ( 0 , n ) : if i % 2 == 0 : if arr [ i ] & 1 : evenIdxOddCount += 1 else : if not ( arr [ i ] & 1 ) : oddIdxEvenCount += 1 if evenIdxOddCount == oddIdxEvenCount : print ( evenIdxOddCount ) else : print ( - 1 ) returntc = int ( input ( ) ) for _ in range ( 0 , tc ) : n = int ( input ( ) ) arr = [ int ( i ) for i in input ( ) . split ( ) ] [ : n ] evenArray ( arr , n ) NEW_LINE


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


import java . util . * ; public class Main { public static void main ( String ared [ ] ) { Scanner sc = new Scanner ( System . in ) ; int test = sc . nextInt ( ) ; while ( test -- > 0 ) { int n = sc . nextInt ( ) ; int b [ ] = new int [ 2 ] ; int a [ ] = new int [ n ] ; b [ 0 ] = 0 ; b [ 1 ] = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; if ( a [ i ] % 2 != i % 2 ) b [ i % 2 ] ++ ; } if ( b [ 0 ] == b [ 1 ] ) System . out . println ( b [ 0 ] ) ; else System . out . println ( " - 1" ) ; } } }


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


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

import math   n = int ( input ( ) )   a = [ int ( x ) for x in input ( ) . split ( ) ] a . sort ( reverse = True )   area = 0 mult = 1   for i in range ( 0 , n ) : area += mult * ( a [ i ] ** 2 ) mult *= - 1   print ( area * math . pi ) NEW_LINE


import mathI = lambda : list ( map ( int , input ( ) . split ( ) ) ) n = int ( input ( ) ) a = sorted ( I ( ) , reverse = True ) area = 0 for i in range ( len ( a ) ) : if i % 2 == 0 : area += a [ i ] ** 2 * math . pi else : area -= a [ i ] ** 2 * math . piprint ( area ) NEW_LINE


import math   n = int ( input ( ) ) a = sorted ( list ( map ( int , input ( ) . split ( ) ) ) ) ans = 0 for i in range ( n ) : if i % 2 != n % 2 : if i == 0 : ans += math . pi * a [ i ] ** 2 else : ans += math . pi * ( a [ i ] ** 2 - a [ i - 1 ] ** 2 ) print ( ans ) NEW_LINE


from math import pi   n = int ( input ( ) ) r = lambda : list ( map ( int , input ( ) . split ( ) ) ) arr = r ( ) arr . sort ( reverse = True ) arr . append ( 0 ) ans = 0.0 i = 0 while i < n : ans += pi * ( arr [ i ] ** 2 - arr [ i + 1 ] ** 2 ) i += 2   print ( f " { ans : .10f } " ) NEW_LINE


import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; import java . lang . Math ; public class Account { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] rad = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { rad [ i ] = sc . nextInt ( ) ; } Arrays . sort ( rad ) ; int mul = 1 , sum = 0 ; for ( int i = n - 1 ; i >= 0 ; i -- ) { sum += rad [ i ] * rad [ i ] * mul ; mul *= - 1 ; } System . out . println ( Math . PI * sum ) ; } }


import java . io . * ; import java . util . * ;   public class TheFibonacciSegment { public static void main ( String [ ] args ) { FastReader ( ) ; int t = 1 ; while ( t > 0 ) { solve ( ) ; -- t ; } write . flush ( ) ; write . close ( ) ; } static void solve ( ) { int n = ni ( ) ; List < Integer > arr = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; ++ i ) { arr . add ( ni ( ) ) ; } Collections . sort ( arr ) ; if ( n % 2 != 0 ) { int k = 0 ; long sum = 0 ; for ( int i = 0 ; i < n ; i = i + 2 ) { sum = sum + arr . get ( i ) * arr . get ( i ) - k * k ; if ( i != n - 1 ) { k = arr . get ( i + 1 ) ; } } double ans = Math . PI * ( double ) sum ; out ( ans ) ; } else { int k = arr . get ( 0 ) ; long sum = 0 ; for ( int i = 1 ; i < n ; i = i + 2 ) { sum = sum + arr . get ( i ) * arr . get ( i ) - k * k ; if ( i != n - 1 ) { k = arr . get ( i + 1 ) ; } } double ans = Math . PI * ( double ) sum ; out ( ans ) ; } }


import java . util . Arrays ; import java . util . Scanner ;   public class _0734Trace {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; boolean flag = true ; if ( n % 2 == 0 ) { flag = false ; } int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } Arrays . sort ( arr ) ; double area = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( flag ) { if ( i == 0 ) { area += Math . PI * arr [ i ] * arr [ i ] * 1d ; } else { area += Math . PI * arr [ i ] * arr [ i ] * 1d - Math . PI * arr [ i - 1 ] * arr [ i - 1 ] * 1d ; } } flag = ! flag ; } System . out . println ( area ) ; }   }


import java . util . * ; public class Trace { public static void main ( String arg [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; if ( n == 1 ) { int temp = sc . nextInt ( ) ; System . out . println ( Math . PI * temp * temp ) ; System . exit ( 0 ) ; }    int [ ] ar = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { ar [ i ] = sc . nextInt ( ) ; }   int res = 0 ; Arrays . sort ( ar ) ; for ( int i = n - 1 ; i > 0 ; i = i - 2 ) { res += ( ar [ i ] * ar [ i ] - ar [ i - 1 ] * ar [ i - 1 ] ) ; }   if ( n % 2 != 0 ) { res += ar [ 0 ] * ar [ 0 ] ; }    System . out . println ( Math . PI * res ) ;   } }


import java . util . * ; import java . math . * ; public class XXXXX { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int runs = sc . nextInt ( ) ; while ( runs -- > 0 ) { int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int sum = 0 ; int ans = - 1 ; for ( int i = 1 ; i <= n ; i ++ ) { if ( ( sum += sc . nextInt ( ) ) % x != 0 ) ans = Math . max ( ans , Math . max ( i , n - i ) ) ; } System . out . println ( ans ) ; } } }

t = int ( input ( ) ) for i in range ( t ) : n , x = map ( int , input ( ) . split ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) s = 0 left = - 1 for i in range ( n ) : if l [ i ] % x != 0 : if left == - 1 : left = i   r = i s = s + l [ i ] if s % x != 0 : print ( n ) elif left == - 1 : print ( - 1 ) else : pre = left + 1 suf = n - r print ( n - min ( pre , suf ) ) NEW_LINE


def answer ( n , x , a ) : if sum ( a ) % x != 0 : return n NEW_LINE


def longestNonDivisibleSubArray ( arr , n , x ) : s , individual = 0 , True   for i in range ( n ) : if arr [ i ] % x != 0 : individual = False s += arr [ i ] if individual : return - 1 if s % x != 0 : return n ;   s = 0 index = - 1 for i in range ( n ) : s += arr [ i ] if s % x != 0 : index = i prefix = index + 1   s = 0 index = n for i in range ( n - 1 , - 1 , - 1 ) : s += arr [ i ] if s % x != 0 : index = i suffix = n - index   return max ( prefix , suffix ) t = int ( input ( ) ) for i in range ( t ) : [ n , x ] = list ( map ( int , input ( ) . split ( ) ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) print ( longestNonDivisibleSubArray ( arr , n , x ) ) NEW_LINE


t = int ( input ( ) ) for _ in range ( t ) : n , x = map ( int , input ( ) . split ( ) ) a = [ int ( x ) for x in input ( ) . split ( ) ] ok = False for i in a : ok |= ( i % x ) if ( not ok ) : print ( - 1 ) elif ( sum ( a ) % x ) : print ( n ) else : ans = n for i in range ( n ) : if ( a [ i ] % x ) : ans = i + 1 break for i in range ( n - 1 , 0 , - 1 ) : if ( a [ i ] % x ) : ans = min ( ans , n - i ) break print ( n - ans ) NEW_LINE


t = int ( input ( ) ) b = [ ] for k in range ( t ) : n , x = list ( map ( int , input ( ) . split ( ) ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a1 = list ( reversed ( a ) ) suma = sum ( a ) count = 0 if suma % x != 0 : b . append ( n ) else : for i in range ( n ) : number1 = suma - a [ i ] number2 = suma - a1 [ i ] if number1 % x != 0 or number2 % x != 0 : count += 1 b . append ( n - i - 1 ) break if count == 0 : b . append ( - 1 ) for i in b : print ( i )   NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ;   public class Main implements Runnable { int n , m , k ; static boolean use_n_tests = true ; long [ ] res ;   void solve ( FastScanner in , PrintWriter out , int testNumber ) { n = in . nextInt ( ) ; int x = in . nextInt ( ) ; int [ ] a = in . nextArray ( n ) ; int s = 0 ; int c = 0 ; for ( int i = 0 ; i < a . length ; i ++ ) { a [ i ] %= x ; s += a [ i ] ; s %= x ; if ( a [ i ] == 0 ) { c ++ ; } } if ( s != 0 ) { out . println ( n ) ; return ; } if ( c == n ) { out . println ( - 1 ) ; return ; } s = 0 ; int ans = 0 ; for ( int i = 0 ; i < a . length ; i ++ ) { s += a [ i ] ; if ( s % x != 0 ) { ans = Math . max ( ans , i + 1 ) ; ans = Math . max ( ans , n - i - 1 ) ; } } out . println ( ans ) ;   }


import java . lang . reflect . Array ; import java . text . CollationElementIterator ; import java . util . * ; import java . util . Map . Entry ; import java . io . * ; import java . lang . Math . * ; import java . math . BigInteger ;   import static java . lang . System . * ; import static java . util . Arrays . fill ; import static java . lang . Math . log ; import static java . lang . Math . abs ; import static java . lang . Math . pow ; import static java . lang . Math . sqrt ; import static java . lang . Math . floor ; import static java . lang . Math . ceil ; import static java . lang . Math . sin ; import static java . lang . Math . cos ; import static java . lang . Math . tan ; import static java . util . Arrays . spliterator ; public class ContestMain implements Runnable { private static Reader in = new Reader ( ) ; private static StringBuilder ans = new StringBuilder ( ) ; private static long MOD = 998244353 ; private static final int N = ( int ) ( 2e5 + 7 ) ;


import java . util . * ; import java . io . * ; import java . io . FileInputStream ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ; import java . math . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class sol { public static void main ( String args [ ] ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int [ ] ar = new int [ n ] ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { ar [ i ] = sc . nextInt ( ) ; sum += ar [ i ] ; } int max = Integer . MIN_VALUE ;   int sum1 = sum ; for ( int i = 0 ; i < n ; i ++ ) { if ( sum % x != 0 ) { max = n - i ; break ; } else { sum -= ar [ i ] ; } } for ( int j = n - 1 ; j >= 0 ; j -- ) { if ( sum1 % x != 0 ) { if ( j + 1 > max ) { max = j + 1 ; break ; } } else { sum1 -= ar [ j ] ; } } if ( max == Integer . MIN_VALUE ) { System . out . println ( - 1 ) ; } else { System . out . println ( max ) ; } } } }


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

a = input ( ) k = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) t = max ( arr ) count = 0 for i in range ( 1 , len ( a ) + 1 ) : count += arr [ ( ord ( a [ i - 1 ] ) - 97 ) ] * ( i ) for i in range ( 1 , k + 1 ) : count += ( i + len ( a ) ) * tprint ( count ) NEW_LINE


try : s = input ( ) k = int ( input ( ) ) c = list ( map ( int , input ( ) . split ( ) ) ) x = max ( c ) cost = 0 for i in range ( len ( s ) ) : cost += c [ ord ( s [ i ] ) - 97 ] * ( i + 1 ) for i in range ( len ( s ) , len ( s ) + k ) : cost += ( i + 1 ) * max ( c ) print ( cost ) except : pass NEW_LINE


s = input ( ) k = int ( input ( ) ) lst = list ( map ( int , input ( ) . split ( ) ) ) lst2 = [ chr ( i ) for i in range ( 97 , 123 ) ] dct = { } for i in range ( len ( lst2 ) ) : dct [ lst2 [ i ] ] = lst [ i ] value = 0 alpha = max ( dct . values ( ) )   for i in range ( len ( s ) ) : value += ( i + 1 ) * dct [ s [ i ] ] NEW_LINE


s = input ( ) k = int ( input ( ) ) w = list ( map ( int , input ( ) . split ( ) ) ) fs = 0 for i in range ( len ( s ) ) : fs += w [ ord ( s [ i ] ) - 97 ] * ( i + 1 ) m = max ( w ) for i in range ( len ( s ) , len ( s ) + k ) : fs += m * ( i + 1 ) print ( fs ) NEW_LINE


str1 = input ( ' ' ) k = int ( input ( ' ' ) ) w = list ( map ( int , input ( ) . split ( ) ) ) p = max ( w ) pidx = w . index ( p ) + 97 q = chr ( pidx ) str2 = k * qstr3 = str1 + str2f = 0 for i in range ( 0 , len ( str3 ) ) : a = ord ( str3 [ i ] ) - 97 f = f + ( i + 1 ) * w [ a ] print ( f ) NEW_LINE


import java . util . * ; public class Practice { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char inp [ ] = sc . next ( ) . toCharArray ( ) ; int k = sc . nextInt ( ) ; int max = 0 ; int num [ ] = new int [ 26 ] ; for ( int i = 0 ; i < num . length ; i ++ ) { num [ i ] = sc . nextInt ( ) ; if ( i == 0 ) { max = num [ i ] ; } else { if ( max < num [ i ] ) { max = num [ i ] ; } } } int ans = 0 ; for ( int i = 0 ; i < inp . length ; i ++ ) { ans += num [ inp [ i ] - ' a ' ] * ( i + 1 ) ; } for ( int i = 1 ; i <= k ; i ++ ) { ans += max * ( inp . length + i ) ; } System . out . println ( ans ) ; } }


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


import java . util . * ; public class DZY_loveStrings { public static void main ( String arg [ ] ) { Scanner sc = new Scanner ( System . in ) ; String st = sc . nextLine ( ) ; int n = sc . nextInt ( ) ; int [ ] w = new int [ 26 ] ; for ( int i = 0 ; i < 26 ; i ++ ) { w [ i ] = sc . nextInt ( ) ; } int max = w [ 0 ] ; for ( int i = 0 ; i < 26 ; i ++ ) { if ( max < w [ i ] ) max = w [ i ] ; } int sum = 0 ; int i ; for ( i = 0 ; i < st . length ( ) ; i ++ ) { sum += ( i + 1 ) * w [ st . charAt ( i ) - ' a ' ] ; }   for ( int j = 0 ; j < n ; j ++ ) { sum += ( i + 1 ) * max ; i ++ ; }   System . out . println ( sum ) ; } }


import java . util . * ; import java . io . * ; public class MainClass { static long INF = Long . MAX_VALUE / 2 ; public static void main ( String [ ] args ) throws IOException { Reader in = new Reader ( ) ; int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; long [ ] A = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) A [ i ] = in . nextLong ( ) ; new MergeSortLong ( ) . sort ( A , 0 , n - 1 ) ; int full = n % k ; if ( full == 0 ) full = k ; int half = k - full ; int fullLength = ( n + k - 1 ) / k ; int halfLength = fullLength - 1 ; long [ ] [ ] dp = new long [ k + 1 ] [ k + 1 ] ; for ( int i = 0 ; i <= k ; i ++ ) Arrays . fill ( dp [ i ] , INF ) ; dp [ 0 ] [ 0 ] = 0L ; for ( int i = 0 ; i <= k ; i ++ ) { for ( int j = 0 ; j <= k ; j ++ ) { int totalLen = i * fullLength + j * halfLength ; if ( totalLen > n ) continue ; if ( i > 0 ) { long mm = A [ totalLen - 1 ] - A [ totalLen - fullLength ] + dp [ i - 1 ] [ j ] ; dp [ i ] [ j ] = Math . min ( dp [ i ] [ j ] , mm ) ; } if ( j > 0 ) { long mm = A [ totalLen - 1 ] - A [ totalLen - halfLength ] + dp [ i ] [ j - 1 ] ; dp [ i ] [ j ] = Math . min ( dp [ i ] [ j ] , mm ) ; } } } System . out . println ( dp [ full ] [ half ] ) ; } } class MergeSortLong {

f = lambda : map ( int , input ( ) . split ( ) ) n , k = f ( ) p = sorted ( f ( ) ) m , d = n // k , n % ku , v = d + 1 , k - d + 1 g = [ 0 ] * u * v i = 0 for a in range ( u ) : j = a * m + a - 1 for b in range ( v ) : x = g [ i - 1 ] + p [ j ] - p [ j - m + 1 ] if b else 9e9 y = g [ i - v ] + p [ j ] - p [ j - m ] if a else 9e9 if i : g [ i ] = min ( x , y ) i += 1 j += mprint ( g [ - 1 ] ) NEW_LINE


f = lambda : map ( int , input ( ) . split ( ) ) n , k = f ( ) p = sorted ( f ( ) )   m , d = n // k , n % ku , v = d + 1 , k - d + 1 g = [ 0 ] * u * v   i = 0 for a in range ( u ) : j = a * m + a - 1 for b in range ( v ) : x = g [ i - 1 ] + p [ j ] - p [ j - m + 1 ] if b else 9e9 y = g [ i - v ] + p [ j ] - p [ j - m ] if a else 9e9 if i : g [ i ] = min ( x , y ) i += 1 j += mprint ( g [ - 1 ] ) NEW_LINE


import java . io . BufferedOutputStream ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . io . Reader ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . List ; import java . util . StringTokenizer ;   public class B2 {   static final long MODULO = ( long ) ( 1e9 + 7 ) ; private static final long INF = Long . MAX_VALUE / 2 ; private static int n , k ; private static int [ ] a ; private static int minLen ;   public static void main ( String [ ] args ) { BufferedScanner scanner = new BufferedScanner ( ) ; PrintWriter writer = new PrintWriter ( new BufferedOutputStream ( System . out ) ) ;   int t = 1 ;


import java . util . * ; import java . io . * ; public class Solution { static void merge ( long arr [ ] , int l , int m , int r ) {


import java . util . * ;   public class P3 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; if ( t == 0 ) System . out . println ( " O - | - OOOO " ) ; while ( t > 0 ) { int n = t % 10 ; if ( n == 1 ) { System . out . println ( " O - | O - OOO " ) ; } else if ( n == 2 ) { System . out . println ( " O - | OO - OO " ) ; } else if ( n == 3 ) { System . out . println ( " O - | OOO - O " ) ; } else if ( n == 4 ) { System . out . println ( " O - | OOOO - " ) ; } else if ( n == 5 ) { System . out . println ( " - O | - OOOO " ) ; } else if ( n == 6 ) { System . out . println ( " - O | O - OOO " ) ; } else if ( n == 7 ) { System . out . println ( " - O | OO - OO " ) ; } else if ( n == 8 ) { System . out . println ( " - O | OOO - O " ) ; } else if ( n == 9 ) { System . out . println ( " - O | OOOO - " ) ; } else if ( n == 0 ) { System . out . println ( " O - | - OOOO " ) ; } t /= 10 ; } } }

chot = { 0 : " O - | - OOOO " , 1 : " O - | O - OOO " , 2 : " O - | OO - OO " , 3 : " O - | OOO - O " , 4 : " O - | OOOO - " , 5 : " - O | - OOOO " , 6 : " - O | O - OOO " , 7 : " - O | OO - OO " , 8 : " - O | OOO - O " , 9 : " - O | OOOO - " }   num = int ( input ( ) )   divs = [ ]   if num == 0 : print ( chot [ 0 ] ) exit ( )   while num > 0 : divs . append ( ( num % 10 ) ) num //= 10   for i in divs : print ( chot [ i ] ) NEW_LINE


import com . sun . org . apache . bcel . internal . generic . AALOAD ; import com . sun . org . apache . bcel . internal . generic . GOTO ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . * ; import java . util . stream . IntStream ; import javafx . util . Pair ; import static jdk . nashorn . internal . runtime . regexp . joni . Syntax . Java ;   public class Main { public static String setNumber ( char n ) { if ( n == '0' ) { return " O - | - OOOO " ; } else if ( n == '1' ) { return " O - | O - OOO " ; } else if ( n == '2' ) { return " O - | OO - OO " ; } else if ( n == '3' ) { return " O - | OOO - O " ; } else if ( n == '4' ) { return " O - | OOOO - " ; } else if ( n == '5' ) { return " - O | - OOOO " ; } else if ( n == '6' ) { return " - O | O - OOO " ; } else if ( n == '7' ) { return " - O | OO - OO " ; } else if ( n == '8' ) { return " - O | OOO - O " ; } else if ( n == '9' ) { return " - O | OOOO - " ; } return " " ; } public static void main ( String [ ] args ) throws IOException {   Scanner input = new Scanner ( System . in ) ; String n = input . next ( ) ; StringBuilder ans = new StringBuilder ( ) ; for ( int i = n . length ( ) - 1 ; i >= 0 ; i -- ) { ans . append ( setNumber ( n . charAt ( i ) ) + " \n " ) ; } System . out . println ( ans ) ; }       }


import java . io . * ; import java . math . * ; import java . security . * ; import java . text . * ; import java . util . * ; import java . util . concurrent . * ; import java . util . regex . * ; import java . util . Arrays ; import java . util . ArrayList ; import java . lang . Math ; public class project { static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } }       static int binarySearch ( long a [ ] , long k , int l , int h ) { int min = Integer . MAX_VALUE ; while ( l <= h ) { int mid = ( l + h ) / 2 ; if ( a [ mid ] == k ) return mid ; else if ( a [ mid ] > k ) h = mid - 1 ; else if ( a [ mid ] < k ) l = mid + 1 ; } return min ; } static int gcd ( int a , int b ) {


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


import java . util . Scanner ;   public class Task139A { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = scanner . nextInt ( ) ; int [ ] w = new int [ 7 ] ; int sum = 0 ; for ( int i = 0 ; i < w . length ; i ++ ) { w [ i ] = scanner . nextInt ( ) ; sum += w [ i ] ; } int days = 0 ; if ( t % sum != 0 ) t = t % sum ; else t = sum ; if ( t != 0 ) for ( int i : w ) { t -= i ; days ++ ; if ( t <= 0 ) { break ; } } System . out . println ( days ) ; } }

pages = int ( input ( ) ) page_sum = 0 lst = [ * map ( int , input ( ) . split ( ) ) ] for idx , daily_pages in enumerate ( lst ) : page_sum += daily_pages pages -= daily_pages if pages <= 0 : print ( idx + 1 ) breakelse : if page_sum == 1 : print ( lst . index ( 1 ) + 1 ) else : pages = pages % page_sum if pages > page_sum else pages for idx , daily_pages in enumerate ( lst ) : pages -= daily_pages if pages <= 0 : print ( idx + 1 ) break NEW_LINE


n = int ( input ( ) ) w = list ( map ( int , input ( ) . split ( ) ) ) i = 0 s = 0 while ( 1 ) : s += w [ i ] if ( s >= n ) : print ( i + 1 ) break i = ( i + 1 ) % 7 NEW_LINE


n = int ( input ( ) ) A = list ( map ( int , input ( ) . split ( ) ) ) t = A [ 0 ] i = 0 while t < n : i += 1 i %= 7 t += A [ i ] print ( i + 1 ) NEW_LINE


sum = 0   count = 0   n = int ( input ( ) )   things = [ int ( x ) for x in input ( ) . split ( ) ] while sum < n : sum += things [ count ] count = ( count + 1 ) % 7   if count == 0 : print ( 7 ) else : print ( count ) NEW_LINE


import java . util . Scanner ;   public class PetrandBook { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int [ ] numbers = new int [ 7 ] ;   for ( int i = 0 ; i < 7 ; i ++ ) { numbers [ i ] = scanner . nextInt ( ) ; } System . out . println ( solve ( n , numbers ) ) ;   }   public static int solve ( int n , int [ ] nums ) { while ( n >= 0 ) { for ( int i = 0 ; i < nums . length ; i ++ ) { if ( n > 0 ) { n -= nums [ i ] ; if ( n <= 0 ) { return i + 1 ; } } } } return 0 ; } }


import java . util . Arrays ; import java . util . Scanner ;   public class A139 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ;   int n ; int [ ] y = new int [ 8 ] ; n = scanner . nextInt ( ) ; for ( int i = 1 ; i <= 7 ; ++ i ) { y [ i ] = scanner . nextInt ( ) ; y [ i ] += y [ i - 1 ] ; } n = ( n - 1 ) % y [ 7 ] + 1 ; for ( int i = 1 ; i <= 7 ; ++ i ) { if ( y [ i ] >= n ) { System . out . print ( i ) ; System . out . print ( " \n " ) ; break ; }   } } }


import java . util . Scanner ;   public class PetrBook { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int length = scanner . nextInt ( ) ; int a [ ] = new int [ 7 ] ; for ( int i = 0 ; i < 7 ; i ++ ) { a [ i ] = scanner . nextInt ( ) ; } while ( length > 0 ) { for ( int j = 0 ; j < 7 ; j ++ ) { length -= a [ j ] ; if ( length <= 0 ) { System . out . println ( j + 1 ) ; return ; } } } } }


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 ( ) ;

k = int ( input ( ) ) s = str ( input ( ) ) s = list ( s ) d = { } for i in s : d [ i ] = s . count ( i ) cnt = 0 s1 = ' ' for j in d : if d [ j ] % k == 0 : cnt += 1 s1 += ( j * int ( d [ j ] / k ) ) if cnt != len ( d ) : print ( - 1 ) else : print ( s1 * k ) NEW_LINE


def solution ( ) : k = int ( input ( ) )   st = input ( )   cnt = [ 0 ] * 26   for i in st : cnt [ ord ( i ) - ord ( ' a ' ) ] += 1 for cnts in cnt : if cnts % k != 0 : print ( - 1 ) return ans = ' '   for i in range ( 26 ) : ans += chr ( 97 + i ) * ( cnt [ i ] // k ) print ( ans * k )     return         if __name__ == ' _ _ main _ _ ' : solution ( ) NEW_LINE


k = int ( input ( ) ) st = input ( ) s = list ( st ) e = [ ] ec = [ ] f = 0 for i in s : if i not in e : e . append ( i ) ec . append ( s . count ( i ) ) j = 0 while j < len ( ec ) : temp = ec [ j ] if temp % k != 0 : print ( - 1 ) f = 1 break ec [ j ] = int ( ec [ j ] / k ) j += 1 if f != 1 : q = 0 a = ' ' while q < len ( e ) : temp = ec [ q ] while temp > 0 : a += str ( e [ q ] ) temp -= 1 q += 1 print ( a * k ) NEW_LINE


def solve ( s , n ) : d = { } for i in s : if not d . get ( i ) : d [ i ] = 1 else : d [ i ] += 1 res = ' ' for i in d : if d [ i ] % n != 0 : return - 1 for i in d : res += i * ( d [ i ] // n ) return res * n           def main ( ) : NEW_LINE


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = Integer . parseInt ( sc . next ( ) ) ; String s = sc . next ( ) ; int [ ] count = new int [ 26 ] ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { count [ s . charAt ( i ) - ' a ' ] ++ ; } for ( int i : count ) { if ( i % k != 0 ) { System . out . println ( " - 1" ) ; return ; } } StringBuilder ans = new StringBuilder ( s . length ( ) ) ; for ( char c = ' a ' ; c <= ' z ' ; c ++ ) { int times = count [ c - ' a ' ] / k ; while ( times -- > 0 ) { ans . append ( c ) ; } } String appender = ans . toString ( ) ; for ( int i = 1 ; i < k ; i ++ ) { ans . append ( appender ) ; } System . out . println ( ans ) ; } }


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 ( ) ; scan . nextLine ( ) ; String s = scan . nextLine ( ) ; char [ ] temp = s . toCharArray ( ) ; Arrays . sort ( temp ) ; String l = String . valueOf ( temp ) ;


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

n = int ( input ( ) ) arr = sorted ( map ( int , input ( ) . split ( ) ) )   print ( arr [ n // 2 ] ) NEW_LINE


nennum = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) arr . sort ( ) print ( arr [ ( len ( arr ) - 1 ) // 2 ] ) NEW_LINE


n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) arr . sort ( ) print ( arr [ len ( arr ) // 2 ] ) NEW_LINE


a = int ( input ( ) ) b = sorted ( list ( map ( int , input ( ) . split ( ) ) ) ) if a == 1 : print ( b [ 0 ] ) if a == 3 : print ( b [ 1 ] ) if a == 5 : print ( b [ 2 ] ) NEW_LINE