import java . util . Scanner ;   public class _0844InitialBet {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int c1 = sc . nextInt ( ) ; int c2 = sc . nextInt ( ) ; int c3 = sc . nextInt ( ) ; int c4 = sc . nextInt ( ) ; int c5 = sc . nextInt ( ) ; int sum = c1 + c2 + c3 + c4 + c5 ; if ( sum % 5 == 0 && sum != 0 ) { System . out . println ( sum / 5 ) ; } else { System . out . println ( - 1 ) ; } }   }

import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) {   Scanner sc = new Scanner ( System . in ) ; int c [ ] = new int [ 5 ] ; for ( int i = 0 ; i < 5 ; i ++ ) { c [ i ] = sc . nextInt ( ) ; } int sum = 0 ; for ( int x : c ) { sum += x ; } if ( sum % 5 != 0 || sum == 0 ) { System . out . println ( - 1 ) ; } else { System . out . println ( sum / 5 ) ; } }   }

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

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

inp = input ( ) nums = [ int ( i ) for i in inp . split ( ) ] temp = sum ( nums ) if temp == 0 : print ( ' - 1' ) elif temp % len ( nums ) == 0 : print ( int ( temp / len ( nums ) ) ) else : print ( ' - 1' )       NEW_LINE

L = [ int ( X ) for X in input ( ) . split ( ) ] S = sum ( L ) if S == 0 : print ( - 1 ) else : if S % 5 == 0 : print ( S // 5 ) else : print ( - 1 ) NEW_LINE

x = list ( map ( int , input ( ) . split ( ) ) ) s = sum ( x ) if s % 5 == 0 and s / 5 != 0 : print ( int ( s / 5 ) ) else : print ( - 1 ) NEW_LINE


# include < bits / stdc ++ . h > using namespace std ; const int N = 1e6 + 100 ; typedef long long LL ; # define debug ( x ) cout << " debug ▁ : ▁ " << x << endl ;

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

n , m = [ int ( j ) for j in input ( ) . split ( ) ] adj = [ set ( ) for i in range ( n ) ] for i in range ( m ) : l , r = [ int ( j ) - 1 for j in input ( ) . split ( ) ] adj [ l ] . add ( r ) adj [ r ] . add ( l ) if n < 7 : print ( m ) else : deg = 1e12 for i in range ( n ) : for j in range ( i + 1 , n ) : l = adj [ i ] . intersection ( adj [ j ] ) NEW_LINE

n , m = [ int ( j ) for j in input ( ) . split ( ) ] adj = [ set ( ) for i in range ( n ) ] for i in range ( m ) : l , r = [ int ( j ) - 1 for j in input ( ) . split ( ) ] adj [ l ] . add ( r ) adj [ r ] . add ( l ) if n < 7 : print ( m ) else : deg = 10 ** 12 for i in range ( n ) : for j in range ( i + 1 , n ) : l = adj [ i ] . intersection ( adj [ j ] ) tmp = len ( l ) if tmp < deg : deg = tmp print ( m - deg ) NEW_LINE


import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . util . ArrayList ; import java . util . Random ; import java . util . StringTokenizer ;   public class DifferentRules { static final int MAXN = 1000_006 ; static final long MOD = ( long ) 1e9 + 7 ; public static void main ( String [ ] args ) throws IOException { MyScanner s = new MyScanner ( ) ; Print p = new Print ( ) ; int t = s . nextInt ( ) ; while ( t -- > 0 ) { int n = s . nextInt ( ) ; int x = s . nextInt ( ) ; int y = s . nextInt ( ) ; int max = Math . max ( 1 , Math . min ( n , x + y - n + 1 ) ) ; int min = Math . min ( n , x + y - 1 ) ; p . println ( ( max ) + " ▁ " + min ) ; } p . close ( ) ; } public static class Pair implements Comparable < Pair > { int first ; int second ; public Pair ( int a , int b ) { this . first = a ; this . second = b ; } @ Override public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = prime * result + first ; result = prime * result + second ; return result ; } @ Override public boolean equals ( Object obj ) { if ( this == obj ) return true ; if ( obj == null ) return false ; if ( getClass ( ) != obj . getClass ( ) ) return false ; Pair other = ( Pair ) obj ; if ( first != other . first ) return false ; if ( second != other . second ) return false ; return true ; } @ Override public int compareTo ( Pair o ) {

import java . util . * ; import java . io . * ; import java . math . * ;     public class C {   private static long INF = 2000000000000000000L , M = 1000000007 , MM = 998244353 ; private static int N = 0 ;   public static void process ( ) throws IOException {   long n = sc . nextLong ( ) , x = sc . nextLong ( ) , y = sc . nextLong ( ) ; long val = ( x + y ) - n ; long max = - 1 ; if ( val <= 0 ) max = 1 ; else max = min ( n , val + 1 ) ; long min = - 1 ; val = min ( n - x , y - 1 ) ; min = val ; min += x ; System . out . println ( max + " ▁ " + min ) ;   }

import java . io . * ; import java . lang . Math ; import java . util . * ;   public class Main {   public BufferedReader in ; public PrintStream out ;   public boolean log_enabled = false ; public boolean multiply_tests = true ;   public static boolean do_gen_test = false ; public void gen_test ( ) { } private class TestCase {   public Object solve ( ) { int n = readInt ( ) , x = readInt ( ) , y = readInt ( ) ; int i , j , max = 0 ; if ( x + y < n + 1 ) { max = 1 ; } else if ( x + y >= 2 * n - 1 ) { max = n ; } else { max = x + y - ( n - 1 ) ; } int min = 0 ; if ( x + y == 2 ) { min = 1 ; } else if ( x + y == 3 ) { min = 2 ; } else if ( x + y >= n + 1 ) { min = n ; } else { min = x + y - 1 ; } return strf ( " % d ▁ % d " , max , min ) ;

import java . util . * ; import java . io . * ; public class Main { static int [ ] A ;

for _ in range ( int ( input ( ) ) ) : n , x , y = map ( int , input ( ) . split ( ) )   print ( max ( 1 , min ( n , x + y - n + 1 ) ) , min ( n , x + y - 1 ) ) NEW_LINE

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

t = int ( input ( ) ) arr_1 = [ ] arr_2 = [ ] for x in range ( t ) : n , x , y = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) arr_1 . append ( max ( 1 , min ( n , x + y - n + 1 ) ) ) arr_2 . append ( min ( n , x + y - 1 ) ) for x in range ( t ) : print ( arr_1 [ x ] , arr_2 [ x ] ) NEW_LINE


import java . util . * ; public class P2 {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int a [ ] = new int [ n ] ; int neg = 0 ; int pos = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; if ( a [ i ] == - 1 ) { neg ++ ; } else { pos ++ ; } } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < m ; i ++ ) { int l = sc . nextInt ( ) ; int r = sc . nextInt ( ) ; int k = r - l + 1 ; sb . append ( ( r - l + 1 ) % 2 == 0 && ( r - l + 1 ) / 2 <= neg && ( r - l + 1 ) / 2 <= pos ? 1 : 0 ) ; sb . append ( ' \n ' ) ;

import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; ArrayList < Integer > pos = new ArrayList < Integer > ( ) ; ArrayList < Integer > neg = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int x = in . nextInt ( ) ; if ( x == 1 ) pos . add ( x ) ; else neg . add ( x ) ; } StringBuilder sb = new StringBuilder ( ) ; while ( m -- > 0 ) { int l = in . nextInt ( ) ; int r = in . nextInt ( ) ; if ( ( r - l + 1 ) % 2 == 0 && pos . size ( ) >= ( r - l + 1 ) / 2 && neg . size ( ) >= ( r - l + 1 ) / 2 ) sb . append ( 1 + " \n " ) ; else sb . append ( 0 + " \n " ) ; } System . out . println ( sb ) ; } }

import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; int c1 = 0 , c0 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x = in . nextInt ( ) ; if ( x == 1 ) c1 ++ ; else c0 ++ ; } StringBuilder sb = new StringBuilder ( ) ; while ( m -- > 0 ) { int l = in . nextInt ( ) ; int r = in . nextInt ( ) ; if ( ( r - l + 1 ) % 2 == 0 && c1 >= ( r - l + 1 ) / 2 && c0 >= ( r - l + 1 ) / 2 ) sb . append ( 1 + " \n " ) ; else sb . append ( 0 + " \n " ) ; } System . out . println ( sb ) ; } }

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

I = lambda : map ( int , input ( ) . split ( ) ) n , m = I ( ) arr = I ( ) one , m_one = 0 , 0 for i in arr : if i == - 1 : m_one += 1 else : one += 1 arr = [ ] for i in range ( m ) : l , r = I ( ) temp = r - l + 1 if temp % 2 == 0 and one >= temp // 2 and m_one >= temp // 2 : arr . append ( 1 ) else : arr . append ( 0 ) print ( * arr ) NEW_LINE

from sys import stdin   n , m = map ( int , stdin . readline ( ) . strip ( ) . split ( ) ) arr = list ( map ( int , stdin . readline ( ) . strip ( ) . split ( ) ) ) a , b = arr . count ( - 1 ) , arr . count ( 1 )   for i in range ( m ) : l , r = map ( int , stdin . readline ( ) . strip ( ) . split ( ) ) d = r - l + 1 if d % 2 == 0 : print ( 1 if min ( a , b ) >= d // 2 else 0 ) else : print ( 0 ) NEW_LINE

from collections import Counter   num , cases = map ( int , input ( ) . split ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) count = Counter ( arr ) minus = count [ - 1 ] plus = count [ 1 ] mn = min ( plus , minus ) ans = [ ] while cases : cases -= 1 a , b = map ( int , input ( ) . split ( ) )   if ( b - a + 1 ) % 2 != 0 : ans . append ( 0 ) elif ( b - a + 1 ) // 2 <= mn : ans . append ( 1 ) else : ans . append ( 0 )   print ( * ans )     NEW_LINE

from collections import Counter   num , cases = map ( int , input ( ) . split ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) count = Counter ( arr ) minus = count [ - 1 ] plus = count [ 1 ] mn = min ( plus , minus ) ans = [ ] mat = [ ] while cases : cases -= 1 a , b = map ( int , input ( ) . split ( ) ) mat . append ( ( a , b ) ) for a , b in mat : if ( b - a + 1 ) % 2 != 0 : ans . append ( 0 ) elif ( b - a + 1 ) // 2 <= mn : ans . append ( 1 ) else : ans . append ( 0 )   print ( * ans )   NEW_LINE

from collections import Counter   num , cases = map ( int , input ( ) . split ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) count = Counter ( arr ) minus = count [ - 1 ] plus = count [ 1 ] mn = min ( plus , minus ) ans = [ ] mat = [ ] while cases : cases -= 1 a , b = map ( int , input ( ) . split ( ) ) mat . append ( ( a , b ) ) for a , b in mat : if ( b - a + 1 ) % 2 != 0 : print ( 0 ) elif ( b - a + 1 ) // 2 <= mn : print ( 1 ) else : print ( 0 )     NEW_LINE


n , A , cf , cm , mN = map ( int , input ( ) . split ( ) )   a = list ( map ( int , input ( ) . split ( ) ) ) aCOPY = [ ] for elem in a : aCOPY . append ( elem ) a . sort ( )   aPartialSum = [ 0 ]   for elem in a : aPartialSum . append ( aPartialSum [ - 1 ] + elem )   maxScore = 0 ansMAXIBound = 0 ansMAXI = 0 ansMIN = 0 for MAXI in range ( n + 1 ) : currentScore = cf * MAXI if MAXI >= 1 : mN -= ( A - a [ - MAXI ] ) if mN < 0 : break if MAXI == n : maxScore = currentScore + A * cm ansMAXIBound = 0 ansMAXI = 10 ** 10 ansMIN = 0 NEW_LINE

f = lambda : map ( int , input ( ) . split ( ) ) g = lambda : m - l * p [ l - 1 ] + s [ l ]   n , A , x , y , m = f ( ) t = sorted ( ( q , i ) for i , q in enumerate ( f ( ) ) ) p = [ q for q , i in t ] s = [ 0 ] * ( n + 1 ) for j in range ( n ) : s [ j + 1 ] = p [ j ] + s [ j ]   l = r = nF = L = R = B = - 1 while 1 : if p : while l > r or g ( ) < 0 : l -= 1 b = min ( p [ l - 1 ] + g ( ) // l , A ) else : b , l = A , 0   f = x * ( n - r ) + y * b if F < f : F , L , R , B = f , l , r , b   if not p : break m += p . pop ( ) - A r -= 1 if m < 0 : break   print ( F )   p = [ ( i , B if j < L else q if j < R else A ) for j , ( q , i ) in enumerate ( t ) ] for i , q in sorted ( p ) : print ( q ) NEW_LINE

def main ( ) : from bisect import bisect n , A , cf , cm , m = map ( int , input ( ) . split ( ) ) skills = list ( map ( int , input ( ) . split ( ) ) ) xlat = sorted ( range ( n ) , key = skills . __getitem__ ) sorted_skills = [ skills [ _ ] for _ in xlat ] bottom_lift , a , c = [ ] , 0 , 0 for i , b in enumerate ( sorted_skills ) : c += i * ( b - a ) bottom_lift . append ( c ) a = b root_lift , a = [ 0 ] , 0 for b in reversed ( sorted_skills ) : a += A - b root_lift . append ( a ) max_level = - 1 for A_width , a in enumerate ( root_lift ) : if m < a : break money_left = m - a floor_width = bisect ( bottom_lift , money_left ) if floor_width > n - A_width : floor_width = n - A_width money_left -= bottom_lift [ floor_width - 1 ] if floor_width > 0 : floor = sorted_skills [ floor_width - 1 ] + money_left // floor_width if floor > A : floor = A else : floor = A level = cf * A_width + cm * floor if max_level < level : max_level , save = level , ( A_width , floor , floor_width ) A_width , floor , floor_width = save for id in xlat [ : floor_width ] : skills [ id ] = floor for id in xlat [ n - A_width : ] : skills [ id ] = A print ( max_level ) print ( ' ▁ ' . join ( map ( str , skills ) ) )     if __name__ == ' _ _ main _ _ ' : main ( )         NEW_LINE


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

import java . util . Scanner ;   public class B1436 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int N = in . nextInt ( ) ;

import java . util . Scanner ; public class Task6 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int tt ; tt = Integer . parseInt ( scanner . nextLine ( ) ) ; while ( ( tt -- ) != 0 ) { int n ; n = Integer . parseInt ( scanner . nextLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( i == j || j == ( i + 1 ) % n ) { System . out . print ( 1 ) ; System . out . print ( " ▁ " ) ; } else { System . out . print ( 0 ) ; System . out . print ( " ▁ " ) ; } } System . out . print ( " \n " ) ; } } } }

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE arr = [ 1 , 1 ] + [ 0 ] * ( n - 2 ) NEW_LINE arr = arr + arr NEW_LINE for i in range ( n ) : for NEW_LINE j in range ( i , n + i ) : print ( arr [ j ] , end = ' ▁ ' ) NEW_LINE print ( ) NEW_LINE

def isPrime ( n ) :     NEW_LINE if n <= 1 : return False NEW_LINE if n <= 3 : return True   if n % 2 == 0 or n % 3 == 0 : return False   i = 5 NEW_LINE while i * i <= n : if NEW_LINE n % i == 0 or n % ( i + 2 ) == 0 : NEW_LINE return False NEW_LINE i = i + 6 NEW_LINE return True     t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n = int ( input ( ) ) NEW_LINE lst = [ ] NEW_LINE

for i in range ( int ( input ( ) ) ) : num = int ( input ( ) ) NEW_LINE a = [ 0 for j in range ( num - 2 ) ] NEW_LINE a . append ( 1 ) NEW_LINE a . append ( 4 ) NEW_LINE for k in range ( num ) : print ( * a ) NEW_LINE a . append ( a [ 0 ] ) NEW_LINE a . pop ( 0 ) NEW_LINE

import mathfor NEW_LINE _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE if n % 2 == 0 : for NEW_LINE i in range ( n ) : NEW_LINE for j in range ( n ) : if NEW_LINE i == j or i + j == n - 1 : print ( 1 , end = " ▁ " ) else : print ( 0 , end = " ▁ " ) NEW_LINE print ( ) else : for i in range ( n ) : for NEW_LINE j in range ( n ) : NEW_LINE if i == j or i + j == n - 1 : NEW_LINE INDENT print ( 1 , end = " ▁ " ) elif i == 0 and j == n // 2 or j == n - 1 and i == n // 2 : NEW_LINE print ( 1 , end = " ▁ " ) else : NEW_LINE print ( 0 , end = " ▁ " ) NEW_LINE DEDENT print ( ) NEW_LINE

cases = int ( input ( ) ) NEW_LINE while cases : cases -= 1 NEW_LINE num = int ( input ( ) )   matrix = [ [ 0 for i in range ( num ) ] for j in range ( num ) ] NEW_LINE matrix [ 0 ] [ 0 ] = 1 NEW_LINE for i in range ( 1 , num ) : matrix [ i ] [ i ] = 1 NEW_LINE matrix [ i - 1 ] [ i ] = 1 NEW_LINE matrix [ i ] [ i - 1 ] = 1   for i in matrix : print ( * i )   NEW_LINE


import java . util . Scanner ;   public class Vsa {   public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ;   int n , m , k ; n = in . nextInt ( ) ; m = in . nextInt ( ) ; k = in . nextInt ( ) ;   boolean b = m >= n && k >= n ; System . out . println ( ( b ) ? " YES " : " NO " ) ;   } }

import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; if ( m >= n & k >= n ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }

import java . util . Scanner ;   public class VusTheCossackAndContest {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int z = sc . nextInt ( ) ; if ( x > y || x > z ) { System . out . println ( " NO " ) ; } else { System . out . println ( " YES " ) ; } } }

import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n , m , k ; n = sc . nextInt ( ) ; m = sc . nextInt ( ) ; k = sc . nextInt ( ) ; if ( ( n <= m ) && ( n <= k ) ) { System . out . println ( " yes " ) ; } else System . out . println ( " No " ) ; } }

import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int m = s . nextInt ( ) ; int k = s . nextInt ( ) ; String ans = Math . min ( m , k ) >= n ? " YES " : " NO " ; System . out . println ( ans ) ; } }

n , m , k = ( int ( i ) for i in input ( ) . split ( ) ) if ( m >= n and k >= n ) : print ( " Yes " ) else : print ( " No " ) NEW_LINE

n , m , k = map ( int , input ( ) . split ( ) ) if m >= n and k >= n : print ( ' Yes ' ) else : print ( ' No ' ) NEW_LINE

x , y , z = map ( int , input ( ) . split ( ) ) if y >= x and z >= x : print ( " YES " ) else : print ( " NO " ) NEW_LINE

x , y , z = map ( int , input ( ) . split ( ) ) if y >= x and z >= x : print ( " Yes " ) else : print ( " No " ) NEW_LINE


import javax . swing . plaf . basic . BasicInternalFrameTitlePane ; import java . nio . file . LinkOption ; import java . util . * ; public class Example { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;

import java . util . * ;   public class CF102 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] ar = new int [ n ] ; int index = 0 ; for ( int i = 0 ; i < n ; i ++ ) { ar [ i ] = sc . nextInt ( ) ; if ( ar [ i ] == n ) { index = i ; } }

import java . util . Scanner ;   public class _0694Pillars {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; int pos = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; if ( arr [ i ] == n ) pos = i ; } int left = pos - 1 ; int right = pos + 1 ; boolean flag = true ; int val = n - 1 ; while ( ( left >= 0 || right < n ) && n >= 1 ) {

import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int maxi = 0 , max = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; if ( a [ i ] > max ) { maxi = i ; max = a [ i ] ; } } boolean f = true ; for ( int i = maxi - 1 , j = maxi + 1 ; i >= 0 || j < n ; i -- , j ++ ) { if ( i >= 0 && a [ i ] > a [ i + 1 ] ) { f = false ; break ; } if ( j < n && a [ j ] > a [ j - 1 ] ) { f = false ; break ; } } if ( f ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } }

import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int arr [ ] = new int [ n ] ; int max = - 1 , index = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = s . nextInt ( ) ; if ( arr [ i ] > max ) { max = arr [ i ] ; index = i ; } } for ( int i = 0 ; i < index ; i ++ ) { if ( arr [ i ] >= arr [ i + 1 ] ) { System . out . println ( " NO " ) ; return ; } } for ( int i = index + 1 ; i < n ; i ++ ) { if ( arr [ i ] >= arr [ i - 1 ] ) { System . out . println ( " NO " ) ; return ; } } System . out . println ( " YES " ) ; } }

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) i = a . index ( max ( a ) ) if a [ : i ] == sorted ( a [ : i ] ) and a [ i : ] == sorted ( a [ i : ] , reverse = True ) : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) q = 0 for i in range ( 1 , n - 1 ) : if a [ i ] < a [ i - 1 ] and a [ i ] < a [ i + 1 ] : q = 1 print ( ' NO ' ) breakif q == 0 : print ( ' YES ' ) NEW_LINE

from math import ceil , floorfrom collections import defaultdict for _ in range ( 1 ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) arr = [ [ a [ i ] , i ] for i in range ( n ) ] arr . sort ( ) flag = True x = arr [ - 1 ] [ 1 ] l = 0 r = 0 if n > 1 and abs ( x - arr [ - 2 ] [ 1 ] ) > 1 : flag = False print ( ' NO ' ) else : for i in range ( n - 2 , - 1 , - 1 ) : if arr [ i ] [ 1 ] > x and abs ( x - ( arr [ i ] [ 1 ] - r ) ) > 1 : print ( ' NO ' ) flag = False break elif arr [ i ] [ 1 ] < x and abs ( x - ( arr [ i ] [ 1 ] + l ) ) > 1 : print ( ' NO ' ) flag = False break elif arr [ i ] [ 1 ] > x : r += 1 elif arr [ i ] [ 1 ] < x : l += 1 if flag : print ( ' YES ' ) NEW_LINE

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) if len ( set ( a ) ) == n : idx = a . index ( max ( a ) ) test = 0 for i in range ( 0 , idx ) : if i == 0 : continue else : if a [ i ] < a [ i - 1 ] : test = 1 break for i in range ( idx + 1 , n ) : if i == idx + 1 : continue else : if a [ i ] > a [ i - 1 ] : test = 1 break if test : print ( ' NO ' ) else : print ( ' YES ' )                                                                                else : print ( ' NO ' ) NEW_LINE


import java . util . * ; import java . io . * ; import java . math . BigInteger ; public class cf1 { static long mod = ( long ) 1e9 + 7 ; static long mod1 = 998244353 ; static FastScanner f ; static PrintWriter pw = new PrintWriter ( System . out ) ; static Scanner S = new Scanner ( System . in ) ; static long x0 ; static long y0 ; static int inf = ( int ) ( 1e9 ) + 5 ; static long oo = Long . MAX_VALUE ; static double eps = ( double ) 1e-4 ;   public static class Query { int l , r ; long d ; public Query ( int l , int r , long d ) { this . l = l ; this . r = r ; this . d = d ; } }   public static void solve ( ) { int n = f . ni ( ) ; int m = f . ni ( ) ; int k = f . ni ( ) ;   long arr [ ] = new long [ n ] ; long dp [ ] = new long [ n ] ; for ( int i = 0 ; i < n ; ++ i ) { arr [ i ] = f . nl ( ) ;

import java . io . * ; import java . util . * ;   import static java . lang . Math . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastReader in = new FastReader ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; int n = in . nextInt ( ) , m = in . nextInt ( ) , k = in . nextInt ( ) ; long [ ] arr = new long [ n + 5 ] ; tuple [ ] update = new tuple [ m + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { arr [ i ] = in . nextLong ( ) ; } for ( int i = 1 ; i <= m ; i ++ ) { update [ i ] = new tuple ( in . nextInt ( ) , in . nextInt ( ) , in . nextLong ( ) ) ; } int [ ] mark = new int [ m + 5 ] ; for ( int i = 1 ; i <= k ; i ++ ) { int x = in . nextInt ( ) , y = in . nextInt ( ) ; mark [ x ] ++ ; mark [ y + 1 ] -- ; } for ( int i = 1 ; i <= m ; i ++ ) mark [ i ] += mark [ i - 1 ] ; for ( int i = 1 ; i <= m ; i ++ ) { update [ i ] = new tuple ( update [ i ] . l , update [ i ] . r , update [ i ] . d * mark [ i ] ) ; } long [ ] res = solve ( arr , n , m , update ) ; for ( int i = 0 ; i < n ; i ++ ) pw . print ( res [ i ] + " ▁ " ) ; pw . println ( ) ;

import sys   n , m , k = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ] arr = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ]   delta = [ ] delta . append ( arr [ 0 ] ) for i in range ( 1 , n ) : delta . append ( arr [ i ] - arr [ i - 1 ] )   ops = [ ]   for i in range ( m ) : l , r , d = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ] op = ( l , r , d ) ops . append ( op )   num_calls = [ 0 ] * mfor i in range ( k ) : x , y = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ] num_calls [ x - 1 ] += 1 if y < len ( num_calls ) : num_calls [ y ] -= 1     calls = 0 for o in range ( m ) : calls += num_calls [ o ] op = ops [ o ] l = op [ 0 ] r = op [ 1 ] d = op [ 2 ] c = calls * d delta [ l - 1 ] += c if r < len ( delta ) : delta [ r ] -= c o += 1   arr [ 0 ] = delta [ 0 ] for i in range ( 1 , n ) : arr [ i ] = delta [ i ] + arr [ i - 1 ] print ( ' ▁ ' . join ( str ( x ) for x in arr ) ) NEW_LINE

maxn = 1e5 n , m , k = input ( ) . split ( ' ▁ ' ) ; n = int ( n ) ; m = int ( m ) ; k = int ( k ) NEW_LINE

// Motto : - Fail early , Fail Often , Fail Forward . // while ( true ) // { // if ( AC ) // { // break ; // } // else if ( Contest Over ) // { // Try . // Check out Editorial . // Understand . // Find out your Mistake . // Learn the topic ( if new ) . // Solve Problems on that topic ( if new ) . // Upsolve that problem . // break ; // } // else // { // Try . // Use Pen - Paper . // Find errors , edge cases , etc . // continue ; // } // } NEW_LINE

import sys   n , m , k = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ] arr = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ]   delta = [ ] delta . append ( arr [ 0 ] ) for i in range ( 1 , n ) : delta . append ( arr [ i ] - arr [ i - 1 ] )   ops = [ ]   for i in range ( m ) : l , r , d = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ] op = ( l , r , d ) ops . append ( op )   num_calls = [ 0 ] * mfor i in range ( k ) : x , y = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ] num_calls [ x - 1 ] += 1 if y < len ( num_calls ) : num_calls [ y ] -= 1     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 . util . Scanner ; import java . util . Arrays ; public class Codechef { public static void main ( String [ ] args ) throws java . lang . Exception { try { Scanner sc = new Scanner ( System . in ) ; int t , n ; t = sc . nextInt ( ) ; if ( t < 3 ) System . out . println ( t ) ; else System . out . println ( 1 ) ; } catch ( Exception e ) { } } }

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 DefiniteGame { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Task solver = new Task ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class Task { public void solve ( int testNumber , InputReader in , PrintWriter out ) { int n = in . nextInt ( ) ; if ( n != 2 ) n = 1 ; out . println ( n ) ; } }   static class InputReader { public BufferedReader reader ; public StringTokenizer tokenizer ;   public InputReader ( InputStream stream ) { reader = new BufferedReader ( new InputStreamReader ( stream ) , 32768 ) ; tokenizer = null ; }   public String next ( ) { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { 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 . 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 DefiniteGame { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Task solver = new Task ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class Task { public void solve ( int testNumber , InputReader in , PrintWriter out ) { int n = in . nextInt ( ) ; boolean pos = true ; while ( pos ) { pos = false ; for ( int i = n - 1 ; i >= 2 ; i -- ) { if ( n % i != 0 ) { n -= i ; pos = true ; break ; } } } out . println ( n ) ; } }   static class InputReader { public BufferedReader reader ; public StringTokenizer tokenizer ;   public InputReader ( InputStream stream ) { reader = new BufferedReader ( new InputStreamReader ( stream ) , 32768 ) ; tokenizer = null ; }   public String next ( ) { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { 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 . * ; import java . io . * ; import java . math . * ; public class Practice { static FastReader sc = new FastReader ( ) ; static int mod = ( int ) Math . pow ( 10 , 9 ) + 7 ; public static void main ( String [ ] args ) { int ttt = 1 ;

a , = map ( int , input ( ) . split ( ) ) if a == 2 : print ( 2 ) else : print ( 1 ) NEW_LINE

print ( 1 if int ( input ( ) ) != 2 else 2 ) NEW_LINE

v = int ( input ( ) ) if v == 2 : print ( "2" ) else : print ( "1" ) NEW_LINE

num = int ( input ( ) ) if num == 2 : print ( "2" ) else : print ( "1" ) NEW_LINE

T_ON = 0 DEBUG_ON = 1 MOD = 998244353     def solve ( ) : n = read_int ( ) if n <= 2 : print ( n ) else : print ( 1 )     def main ( ) : T = read_int ( ) if T_ON else 1 for i in range ( T ) : solve ( )     def debug ( * xargs ) : if DEBUG_ON : print ( * xargs )     from collections import * import math     NEW_LINE


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

import java . util . * ; import java . io . * ; import java . math . * ;   public class Main {   private static int MAX = Integer . MAX_VALUE ; private static int MIN = Integer . MIN_VALUE ; private static int MOD = 1000000007 ; static FastScanner sc = new FastScanner ( ) ;   public static void main ( String [ ] args ) throws IOException {

import java . util . * ;   public class CodeForces1201B { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; long sum = 0 ; int max = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int a = input . nextInt ( ) ; sum += a ; max = Math . max ( max , a ) ; } if ( sum % 2 == 0 && max * 2 <= sum ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } }

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) if sum ( a ) % 2 : print ( ' NO ' ) exit ( ) k = sum ( a ) for i in range ( n ) : if a [ i ] * 2 > k : print ( ' NO ' ) exit ( ) print ( ' YES ' ) NEW_LINE

import heapqn = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) arr . sort ( ) largest = arr [ - 1 ] total = sum ( arr ) others = total - arr [ - 1 ] if total % 2 == 0 and largest <= others : print ( " YES " ) else : print ( " NO " ) NEW_LINE

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) maxi = max ( a ) s = sum ( a ) if maxi * 2 > s or s % 2 == 1 : print ( " NO " ) else : print ( " YES " ) NEW_LINE

n = int ( input ( ) ) arr = [ int ( i ) for i in input ( ) . split ( ) ] s = sum ( arr ) if s % 2 or max ( arr ) > s - max ( arr ) : print ( " NO " ) else : print ( " YES " ) NEW_LINE

import sysinput = sys . stdin . readline   '''   '''   n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( ) pf_sum = [ a [ 0 ] ] for i in range ( 1 , n ) : pf_sum . append ( pf_sum [ - 1 ] + a [ i ] )   if pf_sum [ - 1 ] % 2 : print ( " NO " ) sys . exit ( ) elif pf_sum [ - 1 ] > 2 * pf_sum [ - 2 ] : print ( " NO " ) sys . exit ( ) else : print ( " YES " ) NEW_LINE


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

import java . util . Scanner ;   public class LinksPearls { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; String s = in . next ( ) ; int p = 0 , l = 0 , i ;   for ( i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == ' o ' ) { p ++ ; } else { l ++ ; } } in . close ( ) ; System . out . println ( p == 0 || l % p == 0 ? " YES " : " NO " ) ; } }

import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String s = in . next ( ) ; int cnt = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == ' - ' ) ++ cnt ; } if ( s . length ( ) - cnt == 0 || cnt % ( s . length ( ) - cnt ) == 0 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; }

def solve ( s ) : o = 0 l = 0 for i in s : if i == ' - ' : l += 1 else : o += 1 max_val = max ( l , o ) min_val = min ( l , o ) if o == 0 or l == 0 : return ' YES ' if l < o : return ' NO ' if max_val % min_val == 0 : return ' YES ' return ' NO '             def main ( ) : NEW_LINE

s = input ( ) a = 0 ; b = 0 for i in s : if i == ' - ' : a += 1 else : b += 1 if b == 0 : print ( " YES " ) else : print ( " YES " if a % b == 0 else " NO " ) NEW_LINE

import sys , os , iofrom sys import stdinfrom math import log , gcd , ceilfrom collections import defaultdict , deque , Counterfrom heapq import heappush , heappopfrom bisect import bisect_left , bisect_rightimport math       alphabets = list ( ' abcdefghijklmnopqrstuvwxyz ' )     def isPrime ( x ) : for i in range ( 2 , x ) : if i * i > x : break if ( x % i == 0 ) : return False return Truedef ncr ( n , r , p ) : num = den = 1 for i in range ( r ) : num = ( num * ( n - i ) ) % p den = ( den * ( i + 1 ) ) % p return ( num * pow ( den , p - 2 , p ) ) % pdef primeFactors ( n ) : l = [ ] while n % 2 == 0 : l . append ( 2 ) n = n / 2 for i in range ( 3 , int ( math . sqrt ( n ) ) + 1 , 2 ) : while n % i == 0 : l . append ( int ( i ) ) n = n / i if n > 2 : l . append ( n ) return list ( set ( l ) ) def power ( x , y , p ) : res = 1 x = x % p if ( x == 0 ) : return 0 while ( y > 0 ) : if ( ( y & 1 ) == 1 ) : res = ( res * x ) % p y = y >> 1 NEW_LINE

s = input ( ) a = 0 b = 0 for x in s : if ( x == " - " ) : a = a + 1 else : b = b + 1 if ( b == 0 ) : print ( " YES " ) else : if ( a % b == 0 ) : print ( " YES " ) else : print ( " NO " ) NEW_LINE

s = input ( ) a = s . count ( ' - ' ) b = len ( s ) - aif not a or not b : print ( ' YES ' ) elif a % b == 0 : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


import java . io . * ; import java . util . * ;   public class F {   public static void main ( String [ ] args ) { FastScanner in = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int t = 1 ;

import java . util . * ; import java . io . * ;   public class PetrPermutations { public static void main ( String [ ] args ) { FastScanner scanner = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int N = scanner . nextInt ( ) ; int [ ] perm = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) perm [ i ] = scanner . nextInt ( ) ; int swaps = 0 ; boolean [ ] vis = new boolean [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { int j = i , cycle = 0 ; while ( ! vis [ j ] ) { vis [ j ] = true ; j = perm [ j ] - 1 ; cycle ++ ; } if ( cycle > 0 ) swaps += cycle - 1 ; } if ( swaps % 2 != N % 2 ) out . println ( " Um _ nik " ) ; else out . println ( " Petr " ) ; out . flush ( ) ; } public static class FastScanner { BufferedReader br ; StringTokenizer st ; public FastScanner ( Reader in ) { br = new BufferedReader ( in ) ; } public FastScanner ( ) { this ( 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 readNextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } int [ ] readIntArray ( int n ) { int [ ] a = new int [ n ] ; for ( int idx = 0 ; idx < n ; idx ++ ) { a [ idx ] = nextInt ( ) ; } return a ; } } }

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

import sys   n = int ( sys . stdin . readline ( ) . rstrip ( ) ) nums = list ( map ( int , sys . stdin . readline ( ) . split ( ) ) )   swaps = 0 visited = set ( ) for index in range ( n ) : if index in visited : continue else : visited . add ( index ) length = 0 value = nums [ index ] while ( value != index + 1 ) : visited . add ( value - 1 ) value = nums [ value - 1 ] length += 1 swaps += length   if ( ( 3 * n - swaps ) % 2 ) : print ( " Um _ nik " ) else : print ( " Petr " )         NEW_LINE


import com . oracle . jrockit . jfr . DataType ; import java . io . * ; import java . util . * ; public class CF_325A {

import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n ; int x1 , y1 , x2 , y2 ; while ( in . hasNext ( ) ) { int maxx = - 1 , minx = 40000 , maxy = - 1 , miny = 40000 ; n = in . nextInt ( ) ; long ans1 , ans2 = 0 ; for ( int i = 0 ; i < n ; ++ i ) { x1 = in . nextInt ( ) ; y1 = in . nextInt ( ) ; x2 = in . nextInt ( ) ; y2 = in . nextInt ( ) ; maxx = Math . max ( x2 , maxx ) ; minx = Math . min ( x1 , minx ) ; maxy = Math . max ( y2 , maxy ) ; miny = Math . min ( y1 , miny ) ; ans2 += Math . abs ( x2 - x1 ) * Math . abs ( y2 - y1 ) ; } ans1 = Math . abs ( maxx - minx ) * Math . abs ( maxy - miny ) ; if ( maxx - minx != maxy - miny || ans1 != ans2 ) System . out . println ( " NO " ) ; else System . out . println ( " YES " ) ; } in . close ( ) ; } }

xmin , ymin , xmax , ymax , a = 31400 , 31400 , 0 , 0 , 0   for i in range ( int ( input ( ) ) ) :   x1 , y1 , x2 , y2 = map ( int , input ( ) . split ( ) )   xmin = min ( xmin , x1 )   ymin = min ( ymin , y1 )   xmax = max ( xmax , x2 )   ymax = max ( ymax , y2 )   a += ( x2 - x1 ) * ( y2 - y1 )   print ( ' YES ' if xmax - xmin == ymax - ymin and a == ( xmax - xmin ) ** 2 else ' NO ' ) NEW_LINE

n = int ( input ( ) ) a1 , b1 , a2 , b2 = map ( int , input ( ) . split ( ) ) s = ( a2 - a1 ) * ( b2 - b1 ) for i in range ( n - 1 ) : x1 , y1 , x2 , y2 = map ( int , input ( ) . split ( ) ) a1 , b1 , a2 , b2 = min ( a1 , x1 ) , min ( b1 , y1 ) , max ( a2 , x2 ) , max ( b2 , y2 ) s += ( x2 - x1 ) * ( y2 - y1 ) print ( ' YES ' if a2 - a1 == b2 - b1 and s == ( a2 - a1 ) * ( b2 - b1 ) else ' NO ' ) NEW_LINE

import sysimport math                           n = int ( input ( ) )   vmaxx = 0 vmaxy = 0 vminx = 31401 vminy = 31401   s = 0 for i in range ( n ) : x1 , y1 , x2 , y2 = [ int ( x ) for x in ( sys . stdin . readline ( ) ) . split ( ) ] vmaxx = max ( vmaxx , x2 ) vmaxy = max ( vmaxy , y2 ) vminx = min ( vminx , x1 ) vminy = min ( vminy , y1 ) s += ( x2 - x1 ) * ( y2 - y1 )   if ( s == ( vmaxx - vminx ) * ( vmaxy - vminy ) and ( vmaxx - vminx ) == ( vmaxy - vminy ) ) : print ( " YES " ) else : print ( " NO " ) NEW_LINE

n = int ( input ( ) ) area = 0 minx = miny = 999999 maxx = maxy = 0 for _ in range ( n ) : x1 , y1 , x2 , y2 = list ( map ( int , input ( ) . split ( ) ) ) minx = min ( minx , min ( x1 , x2 ) ) miny = min ( miny , min ( y1 , y2 ) ) maxx = max ( maxx , max ( x1 , x2 ) ) maxy = max ( maxy , max ( y1 , y2 ) ) a = abs ( x1 - x2 ) * abs ( y1 - y2 ) area += a   h = maxy - minyw = maxx - minx   if h != w or h * h != area : print ( ' NO ' ) else : print ( ' YES ' ) NEW_LINE


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

import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . io . OutputStreamWriter ; import java . io . PrintWriter ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . * ;   import static java . lang . System . out ; public class c693a {

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

import java . io . * ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . StringTokenizer ; import java . util . List ; import java . util . * ; import java . util . Collections ; import java . util . Stack ;   public class solution { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; long a , b , c ; a = in . nextLong ( ) ; b = in . nextLong ( ) ; c = in . nextLong ( ) ; long arr [ ] = new long [ 3 ] ; arr [ 0 ] = a ; arr [ 1 ] = b ; arr [ 2 ] = c ; Arrays . sort ( arr ) ; long x , y , z ; int count = 0 ; if ( ( a + b - c ) / 2 > 0 ) count ++ ; if ( ( b + c - a ) / 2 > 0 ) count ++ ; if ( ( a + c - b ) / 2 > 0 ) count ++ ; if ( count >= 2 && arr [ 0 ] + arr [ 1 ] >= arr [ 2 ] && ( a + b + c ) % 2 == 0 ) { x = ( a + b - c ) / 2 ; y = ( b + c - a ) / 2 ; z = ( c + a - b ) / 2 ; System . out . print ( x + " ▁ " + y + " ▁ " + z ) ; } else { System . out . print ( " Impossible " ) ; } } }

a , b , c = map ( int , input ( ) . split ( ) ) x , y , z = 0 , 0 , 0 sm = ( a + b + c ) if sm % 2 == 0 : x = ( a + b - c ) // 2 y = ( b + c - a ) // 2 z = ( a + c - b ) // 2 if x >= 0 and y >= 0 and z >= 0 : print ( x , y , z ) else : print ( " Impossible " ) else : print ( " Impossible " ) NEW_LINE

a , b , c = map ( int , input ( ) . split ( ) ) flag = 0 if b >= c : x = b - c a -= x if a >= 0 and a % 2 == 0 : z = a // 2 if c - z >= 0 : print ( x + z , c - z , z ) else : flag = 1 else : flag = 1 else : x = c - b a -= x if a >= 0 and a % 2 == 0 : z = a // 2 if b - z >= 0 : print ( z , b - z , x + z ) else : flag = 1 else : flag = 1 if flag : print ( " Impossible " ) NEW_LINE

a , b , c = input ( ) . split ( ) a = int ( a ) b = int ( b ) c = int ( c ) sum = a + b + cif sum % 2 == 0 : sum /= 2 x = int ( sum - c ) y = int ( sum - a ) z = int ( sum - b ) if x >= 0 and y >= 0 and z >= 0 : print ( x , y , z ) else : print ( ' Impossible \n ' ) else : print ( ' Impossible \n ' ) NEW_LINE

a , b , c = map ( int , input ( ) . split ( ) ) summ = ( a + b + c ) // 2 if a > b + c or b > a + c or c > a + b or ( a + b + c ) % 2 : print ( " Impossible " ) exit ( 0 ) print ( summ - c , summ - a , summ - b ) NEW_LINE

a , b , c = map ( int , input ( ) . split ( ) ) s = ( a + b + c ) // 2 if ( a + b + c ) % 2 or s - a < 0 or s - b < 0 or s - c < 0 : print ( " Impossible " ) else : print ( s - c , s - a , s - b ) NEW_LINE


import java . io . * ; import java . util . * ; public class Pairs { static int N , M , arr1 [ ] , arr2 [ ] ; public static void main ( String [ ] args ) throws IOException {

n , m = [ int ( x ) for x in input ( ) . split ( ) ] l = [ ] for i in range ( m ) : t = [ int ( x ) for x in input ( ) . split ( ) ] l . append ( t )   flag = 0 a , b = l [ 0 ] tempa = [ ] tempb = [ ] for i in range ( len ( l ) ) : if ( a not in l [ i ] ) : tempa . append ( l [ i ] ) if ( b not in l [ i ] ) : tempb . append ( l [ i ] )   flag = 0 if ( tempa == [ ] ) : print ( " YES " ) flag = 1 else : c , d = tempa [ 0 ] f = 0 for i in range ( len ( tempa ) ) : if ( c not in tempa [ i ] ) : f = 1 if ( f == 0 ) : print ( " YES " ) flag = 1 if ( flag == 0 ) : f = 0 for i in range ( len ( tempa ) ) : if ( d not in tempa [ i ] ) : f = 1 if ( f == 0 ) : print ( " YES " ) flag = 1   if ( tempb == [ ] and flag == 0 ) : print ( " YES " ) flag = 1 elif ( flag == 0 ) : c , d = tempb [ 0 ] f = 0 for i in range ( len ( tempb ) ) : if ( c not in tempb [ i ] ) : f = 1 if ( f == 0 ) : print ( " YES " ) flag = 1 if ( flag == 0 ) : f = 0 for i in range ( len ( tempb ) ) : if ( d not in tempb [ i ] ) : f = 1 if ( f == 0 ) : print ( " YES " ) flag = 1   if ( flag == 0 ) : print ( " NO " ) NEW_LINE

import sysinput = sys . stdin . buffer . readline         def check ( x ) : visited = [ 0 for i in range ( n + 1 ) ] count = 0 for i in range ( 1 , m ) : if ( a [ i ] [ 0 ] != x and a [ i ] [ 1 ] != x ) : count += 1 visited [ a [ i ] [ 0 ] ] += 1 visited [ a [ i ] [ 1 ] ] += 1 if ( max ( visited ) == count ) : return 1 else : return 0   n , m = map ( int , input ( ) . split ( ) ) a = [ ] for i in range ( m ) : k , l = map ( int , input ( ) . split ( ) ) a . append ( [ k , l ] ) if ( check ( a [ 0 ] [ 0 ] ) + check ( a [ 0 ] [ 1 ] ) > 0 ) : print ( " YES " ) else : print ( " NO " ) NEW_LINE

from __future__ import division , print_functiondef get_ints ( ) : return map ( int , input ( ) . strip ( ) . split ( ) ) def get_array ( ) : return list ( map ( int , input ( ) . strip ( ) . split ( ) ) ) mod = 1000000007 import collections , math , sys , bisectINF = sys . maxsizeMOD = 998244353     def main ( ) : def check ( a , b , arr ) : for i in arr : if i [ 0 ] != a and i [ 1 ] != b and i [ 0 ] != b and i [ 1 ] != a : return False return True   def solve ( ) : n , m = get_ints ( ) arr = [ ] for i in range ( m ) : a , b = get_ints ( ) arr . append ( ( a , b ) ) NEW_LINE

def solve ( pairs ) : for x in pairs [ 0 ] : i = 1 while i < len ( pairs ) and x in pairs [ i ] : i += 1 if i == len ( pairs ) : return True for y in pairs [ i ] : if all ( x in p or y in p for p in pairs ) : return True return False     _ , m = map ( int , input ( ) . split ( ) ) pairs = [ tuple ( map ( int , input ( ) . split ( ) ) ) for i in range ( m ) ] print ( " YES " if solve ( pairs ) else " NO " ) NEW_LINE


import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; long n = in . nextLong ( ) , k = in . nextLong ( ) ; for ( int i = 0 ; i < k ; i ++ ) { if ( n % 2 == 0 ) { n = n / 2 ; } if ( n % 5 == 0 ) { n = n / 5 ; } } String [ ] s = new String [ ( int ) k ] ; for ( int i = 0 ; i < k ; i ++ ) { s [ i ] = "0" ; } System . out . print ( n ) ; for ( String str : s ) { System . out . print ( str ) ; }   }   }

import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . Scanner ;   public class Main { public static long gcd ( long a , long b ) { if ( b == 0 ) { return a ; } else { return gcd ( b , a % b ) ; } } public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; long n = s . nextLong ( ) ; long k = s . nextLong ( ) ; long num = 1 ; for ( int j = 1 ; j <= k ; j ++ ) { num *= 10 ; } long ans = n * num / gcd ( n , num ) ; pw . print ( ans ) ; pw . close ( ) ;   }   }

import java . math . BigInteger ; import java . util . * ;    public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; long n = input . nextLong ( ) ; long k = input . nextLong ( ) ; k = ( long ) Math . pow ( 10 , k ) ; for ( int i = 1 ; i <= k ; i ++ ) { if ( k % i == 0 && n * i % k == 0 ) { System . out . println ( n * i ) ; break ; } } }   }

import java . util . Scanner ;     public class subStraction { static long gcd ( long a , long b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; long n = in . nextInt ( ) ; long k = in . nextInt ( ) ; long temp = 1 ; for ( int i = 1 ; i <= k ; i ++ ) { temp *= 10 ; } System . out . println ( temp * n / gcd ( temp , n ) ) ; } }

import math def gcd ( x , y ) : if y == 0 : return x return gcd ( y , x % y ) def lcm ( x , y ) : return int ( x / gcd ( x , y ) * y ) n , m = [ int ( x ) for x in input ( ) . split ( ) ] print ( lcm ( n , 10 ** m ) ) NEW_LINE

from math import gcd     def lcm ( a , b ) : return ( a / gcd ( a , b ) ) * b     num = "1"   n , k = map ( int , input ( ) . split ( ) ) for i in range ( k ) : num += "0" num = int ( num ) print ( int ( lcm ( num , n ) ) ) NEW_LINE

import mathdef lcm ( a , b ) : return ( a * b ) // math . gcd ( a , b ) n , k = map ( int , input ( ) . split ( ) ) print ( lcm ( n , ( 10 ** k ) ) ) NEW_LINE

import matha , b = input ( ) . split ( ) a = int ( a ) b = int ( b ) ab = 1 for i in range ( b ) : ab = ab * 10 print ( ( ab // math . gcd ( ab , a ) ) * a )   NEW_LINE


import java . io . FileInputStream ; import java . io . FileNotFoundException ; import java . io . IOException ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . List ; import java . util . Scanner ; import java . util . stream . Collectors ; public class _p001054A { static public void main ( final String [ ] args ) throws IOException { p001054A . _main ( args ) ; }

import java . util . Scanner ;   public class ElevatorOrStairs { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int z = sc . nextInt ( ) ; int t1 = sc . nextInt ( ) ; int t2 = sc . nextInt ( ) ; int t3 = sc . nextInt ( ) ; int diff = Math . abs ( x - y ) ; int sdiff = diff * t1 ; int ediff = Math . abs ( z - x ) ; int tediff = ediff + Math . abs ( x - y ) ; int tllift = tediff * t2 ; int tt = 3 * t3 + tllift ; if ( tt <= sdiff ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   public class Main { public static void main ( String [ ] args ) throws NumberFormatException , IOException { Scanner scan = new Scanner ( System . in ) ; int x = scan . nextInt ( ) ; int y = scan . nextInt ( ) ; int z = scan . nextInt ( ) ; int t1 = scan . nextInt ( ) ; int t2 = scan . nextInt ( ) ; int t3 = scan . nextInt ( ) ;

import java . util . Scanner ;   public class ElevatorOrStairs { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int z = sc . nextInt ( ) ; int t1 = sc . nextInt ( ) ; int t2 = sc . nextInt ( ) ; int t3 = sc . nextInt ( ) ; int elevTime = 0 , stairTime = 0 ; elevTime = Math . abs ( x - y ) * t2 + Math . abs ( x - z ) * t2 + t3 * 3 ; stairTime = Math . abs ( x - y ) * t1 ; System . out . println ( stairTime < elevTime ? " NO " : " YES " ) ; sc . close ( ) ; } }

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

x , y , z , t1 , t2 , t3 = map ( int , input ( ) . split ( ) ) ele = ( abs ( z - x ) * t2 ) + ( abs ( x - y ) * t2 ) + ( 3 * t3 ) sta = abs ( x - y ) * t1   if ele <= sta : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE

x , y , z , t1 , t2 , t3 = map ( int , input ( ) . split ( ) ) a = abs ( x - y ) * t1b = abs ( x - z ) * t2 + 2 * t3 + abs ( x - y ) * t2 + t3print ( " YES " if b <= a else " NO " ) NEW_LINE

x , y , z , t1 , t2 , t3 = map ( int , input ( ) . split ( ) ) st = abs ( y - x ) * t1 et = abs ( z - x ) * t2 + abs ( x - y ) * t2 + 3 * t3 print ( ' YES ' if et <= st else ' NO ' )   NEW_LINE


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

import java . util . * ; import java . io . * ;   / ** * Made by egor https : // github . com / chermehdi / egor . * * @ author Azuz * * / public class Main {   void solve ( Scanner in , PrintWriter out ) { long a = in . nextLong ( ) ; long b = in . nextLong ( ) ; long ans = 0 ; while ( true ) { if ( a == 1 ) { ans += b ; break ; } else if ( b == 1 ) { ans += a ; break ; } if ( a > b ) { long x = a / b ; ans += x ; a -= b * x ; } else if ( a + 1 == b ) { ans += a + 1 ; break ; } else { a = swap ( b , b = a ) ; } }     out . println ( ans ) ;   }     public long swap ( long a , long b ) { return a ; }     public static void main ( String [ ] args ) { try ( Scanner in = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ) { new Main ( ) . solve ( in , out ) ; } } } NEW_LINE

def resistors ( a , b ) : ans = 0 while b : ans += a // b a , b = b , a % b return ansa , b = map ( int , input ( ) . strip ( ) . split ( ) ) print ( resistors ( a , b ) ) NEW_LINE

import sysfrom functools import lru_cache , cmp_to_keyfrom heapq import merge , heapify , heappop , heappushfrom math import * from collections import defaultdict as dd , deque , Counter as Cfrom itertools import combinations as comb , permutations as permfrom bisect import bisect_left as bl , bisect_right as br , bisectfrom time import perf_counterfrom fractions import Fractionimport copyimport timestarttime = time . time ( ) mod = int ( pow ( 10 , 9 ) + 7 ) mod2 = 998244353 NEW_LINE

a , b = map ( int , input ( ) . split ( ) ) ans = 0 if ( a > b ) : ans += int ( a // b ) a = a % bwhile ( b != 0 ) : ans += int ( a // b ) a , b = b , a % bprint ( ans ) NEW_LINE


import java . util . * ;   public class Producing_Snow {   static Scanner in = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int n = in . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = in . nextInt ( ) ; }   PriorityQueue < Long > q = new PriorityQueue < > ( ) ; long sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int t = in . nextInt ( ) ; q . add ( arr [ i ] + sum ) ; sum += t ; long ans = 0 ; while ( ! q . isEmpty ( ) && q . peek ( ) <= sum ) { ans += q . remove ( ) - sum + t ; } System . out . print ( ans + ( long ) t * q . size ( ) + " ▁ " ) ; } } }

import java . io . File ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . TreeSet ;   public class p024 { public static void main ( String args [ ] ) throws Exception { StringTokenizer stok = new StringTokenizer ( new Scanner ( System . in ) . useDelimiter ( " \\ A " ) . next ( ) ) ; StringBuilder sb = new StringBuilder ( ) ; int n = Integer . parseInt ( stok . nextToken ( ) ) ; long [ ] t = new long [ n ] , v = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) v [ i ] = Long . parseLong ( stok . nextToken ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) t [ i ] = Long . parseLong ( stok . nextToken ( ) ) ; long pt = 0 ; TreeSet < long [ ] > st = new TreeSet < long [ ] > ( ( x , y ) -> x [ 0 ] == y [ 0 ] ? Long . compare ( x [ 1 ] , y [ 1 ] ) : Long . compare ( x [ 0 ] , y [ 0 ] ) ) ; for ( int i = 0 ; i < n ; i ++ ) { st . add ( new long [ ] { pt + v [ i ] , i } ) ; long [ ] ct = new long [ ] { pt + t [ i ] , n + 5 } ; long pv = 0 ; while ( st . floor ( ct ) != null ) { long [ ] vl = st . floor ( ct ) ; st . remove ( vl ) ; pv += vl [ 0 ] - pt ; } pv += st . size ( ) * t [ i ] ; pt = ct [ 0 ] ; sb . append ( pv + " ▁ " ) ; } System . out . println ( sb ) ; } }

import java . util . * ; import java . io . * ;   public class Producing_Snow {   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 ) {

# include < iostream > # include < vector > # include < algorithm > using namespace std ;      int main ( ) { int N ; cin >> N ; vector < long long > V ( 200000 , 0 ) ; vector < long long > T ( 200000 , 0 ) ; vector < long long > count ( 200000 , 0 ) ; vector < long long > M ( 200000 , 0 ) ; for ( int i = 1 ; i <= N ; ++ i ) cin >> V [ i ] ; for ( int i = 1 ; i <= N ; ++ i ) { cin >> T [ i ] ; T [ i ] += T [ i - 1 ] ; } long long ost = 0 ; for ( int i = 1 ; i <= N ; ++ i ) { long long j = lower_bound ( T . begin ( ) + i , T . begin ( ) + N + 1 , T [ i - 1 ] + V [ i ] ) - T . begin ( ) ; count [ j ] ++ ; M [ j ] += V [ i ] - T [ j - 1 ] + T [ i - 1 ] ; ost += count [ i ] ; cout << ( T [ i ] - T [ i - 1 ] ) * ( i - ost ) + M [ i ] << ' ▁ ' ; }   }

n = int ( input ( ) ) v = list ( map ( int , input ( ) . split ( ) ) ) t = list ( map ( int , input ( ) . split ( ) ) )   sumv = list ( ) sumv . append ( 0 ) for i in range ( n ) : sumv . append ( sumv [ i ] + v [ i ] ) sumt = list ( ) sumt . append ( 0 ) for i in range ( n ) : sumt . append ( sumt [ i ] + t [ i ] )   ans = [ 0 ] * ( n ) add = [ 0 ] * ( n + 1 ) for i in range ( n ) : if ( v [ i ] <= t [ i ] ) : ans [ i ] += v [ i ] elif ( v [ i ] >= sumt [ n ] - sumt [ i ] ) : add [ i ] += 1 else : l = i + 1 ; r = n ; mid = ( r + l ) // 2 while ( r > l ) : mid = ( r + l ) // 2 if ( sumt [ mid ] - sumt [ i ] == v [ i ] ) : r = mid break elif ( sumt [ mid ] - sumt [ i ] > v [ i ] ) : r = mid else : l = mid + 1 ans [ r - 1 ] += ( v [ i ] - sumt [ r - 1 ] + sumt [ i ] ) add [ i ] += 1 ; add [ r - 1 ] -= 1   tmpcnt = 0 for i in range ( n ) : tmpcnt += add [ i ] ans [ i ] += ( tmpcnt * t [ i ] )   print ( ' ▁ ' . join ( i for i in map ( str , ans ) ) ) NEW_LINE


import java . util . Scanner ;   public class Code549B {   public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = Integer . parseInt ( scanner . nextLine ( ) ) ; char [ ] [ ] s = new char [ n ] [ n ] ; int [ ] a = new int [ n ] ; int [ ] dp = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) s [ i ] = scanner . nextLine ( ) . toCharArray ( ) ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = scanner . nextInt ( ) ; StringBuilder sb = new StringBuilder ( ) ; int count = 0 ; while ( true ) { int zero = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] == dp [ i ] ) { zero = i ; break ; } } if ( zero < 0 ) break ; count ++ ; sb . append ( zero + 1 ) . append ( " ▁ " ) ; for ( int j = 0 ; j < n ; j ++ ) { if ( s [ zero ] [ j ] == '1' ) dp [ j ] ++ ; } } sb . append ( " \n " ) ; System . out . println ( count ) ; System . out . println ( sb ) ; scanner . close ( ) ; }   }

import java . util . Arrays ; import java . util . BitSet ; import java . util . Scanner ;   public class CF_549B {   public static void main ( String [ ] args ) { try ( Scanner s = new Scanner ( System . in ) ) { int n = s . nextInt ( ) ; BitSet [ ] contacts = new BitSet [ n ] ;   for ( int i = 0 ; i < n ; i ++ ) { contacts [ i ] = bitSetFromString ( s . next ( ) ) ; }   int [ ] guess = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { guess [ i ] = s . nextInt ( ) ; }   BitSet invitees = new BitSet ( n ) ;

n = int ( input ( ) . strip ( ) )   nums = [ ' ' ] + [ ' ▁ ' + input ( ) . strip ( ) for _ in range ( n ) ] a = [ 0 ] + list ( map ( int , input ( ) . split ( ) ) )     def send ( x ) : for i in range ( 1 , n + 1 ) : if nums [ x ] [ i ] == '1' : a [ i ] -= 1   vis = [ 0 ] * ( n + 1 ) while True : for i in range ( 1 , n + 1 ) : if not vis [ i ] and not a [ i ] : vis [ i ] = 1 send ( i ) break else : for i in range ( 1 , n + 1 ) : if not a [ i ] : print ( - 1 ) exit ( ) break     ans = [ ] for i in range ( 1 , n + 1 ) : if vis [ i ] : ans . append ( i )   if ans : print ( len ( ans ) ) print ( * ans ) else : print ( 0 ) NEW_LINE

def main ( ) : import sys tokens = sys . stdin . read ( ) . split ( ) tokens . reverse ( ) n = int ( tokens . pop ( ) ) mat = [ [ int ( j ) for j in tokens . pop ( ) ] for i in range ( n ) ] prediction = [ int ( tokens . pop ( ) ) for i in range ( n ) ] frequency = [ 0 ] * n result = [ ] for step in range ( n ) : for i in range ( n ) : if frequency [ i ] == prediction [ i ] : result . append ( i + 1 ) for j in range ( n ) : frequency [ j ] += mat [ i ] [ j ] break print ( len ( result ) ) print ( ' ▁ ' . join ( str ( i ) for i in result ) ) main ( ) NEW_LINE

n = int ( input ( ) . strip ( ) ) a = [ ] for i in range ( n ) : s = input ( ) . strip ( ) a . append ( s ) b = list ( map ( int , input ( ) . strip ( ) . split ( ) ) ) c = [ ] while ( True ) : k = - 1 for i in range ( n ) : if ( b [ i ] == 0 ) : k = i break if ( k == - 1 ) : break else : c . append ( k + 1 ) for i in range ( n ) : if ( a [ k ] [ i ] == '1' ) : b [ i ] -= 1 tot = len ( c ) print ( tot ) for x in c : tot = tot - 1 print ( x , end = ' ▁ ' ) if ( tot != 0 ) else print ( x , end = ' \n ' ) NEW_LINE


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

import java . util . * ; import java . util . Map . Entry ;    import java . io . * ; import java . math . * ; import static java . util . stream . Collectors . * ; import static java . util . Map . Entry . * ;   public class Hey { public static void main ( String [ ] args ) throws IOException { final long mod = ( long ) ( 1e9 + 7 ) ; Reader s = new Reader ( ) ; PrintWriter pt = new PrintWriter ( System . out ) ;

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

a = [ ' ' ] * 8 for i in range ( 8 ) : a [ i ] = input ( ) a = list ( map ( lambda a : a . count ( ' B ' ) , a ) ) b = set ( a ) c = 0 for i in b : if i == 8 : c += a . count ( 8 ) else : c += iprint ( c ) NEW_LINE

s , ans , met = " " , 0 , Falsefor i in range ( 8 ) : s = input ( ) if s == " BBBBBBBB " : ans += 1 elif not met : ans += s . count ( ' B ' ) met = True   print ( ans ) NEW_LINE

import sys   lines = list ( sys . stdin . read ( ) . strip ( ) . split ( ) )   print_lines = 0 columns = [ 0 for _ in range ( 8 ) ] for line in lines : if line == ' BBBBBBBB ' : print_lines += 1 for j , s in enumerate ( line ) : columns [ j ] += bool ( s == ' B ' )   print_col = sum ( j == 8 for j in columns )   if print_col == 8 : print_col = 0   NEW_LINE

count = 0 columns = [ " " , " " , " " , " " , " " , " " , " " , " " ] for _ in range ( 8 ) : line = input ( ) if " W " not in line : count += 1 for index , character in enumerate ( line ) : columns [ index ] += characterfor column in columns : if " W " not in column : count += 1 print ( 8 if count == 16 else count ) NEW_LINE


import java . io . BufferedReader ; import java . io . FileNotFoundException ; import java . io . FileReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . PriorityQueue ; import java . util . StringTokenizer ;   public class Planning {   static class Node implements Comparable < Node > {   int i ; int c ;   Node ( int i , int c ) { this . i = i ; this . c = c ; }   @ Override public int compareTo ( Node o ) { return o . c - this . c ; }   }   public static void main ( String [ ] args ) { FastScanner sc = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ;   int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ;   Node [ ] arr = new Node [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = new Node ( i , sc . nextInt ( ) ) ; }   PriorityQueue < Node > q = new PriorityQueue < Node > ( ) ; long cur = 0 ; long sum = 0 ;   for ( int i = 0 ; i < k ; i ++ ) { sum += cur ; cur += arr [ i ] . c ; q . add ( arr [ i ] ) ; } sum += cur ;   int [ ] ans = new int [ n ] ;   for ( int i = k ; i < n + k ; i ++ ) { if ( i < n ) { cur += arr [ i ] . c ; q . add ( arr [ i ] ) ; }   Node temp = q . poll ( ) ; cur -= temp . c ; ans [ temp . i ] = i ;   sum += cur ;   }   out . println ( sum ) ; for ( int e : ans ) out . print ( ( e + 1 ) + " ▁ " ) ; out . close ( ) ;   }   public static class FastScanner { BufferedReader br ; StringTokenizer st ;   public FastScanner ( String s ) { try { br = new BufferedReader ( new FileReader ( s ) ) ; } catch ( FileNotFoundException e ) {

import heapqn , k = map ( int , input ( ) . split ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) ans = [ 0 ] * nh = [ ] for i in range ( k ) : h . append ( ( - 1 * l [ i ] , i ) )   heapq . heapify ( h ) som = 0 for i in range ( k , n + k ) : if i < n : heapq . heappush ( h , ( - 1 * l [ i ] , i ) )   x = heapq . heappop ( h ) s = - 1 * x [ 0 ] * ( i - x [ 1 ] ) som += s ans [ x [ 1 ] ] = i + 1   print ( som ) print ( * ans ) NEW_LINE

import sysinput = sys . stdin . readlinefrom heapq import *   n , k = map ( int , input ( ) . split ( ) ) c = list ( map ( int , input ( ) . split ( ) ) ) ic = [ ( - c [ i ] , i + 1 ) for i in range ( n ) ] pq = [ ] idx = 0 ans_v = 0 ans_arr = [ - 1 ] * n   for t in range ( k + 1 , k + n + 1 ) : while idx < n : if ic [ idx ] [ 1 ] <= t : heappush ( pq , ic [ idx ] ) idx += 1 else : break   ci , i = heappop ( pq ) ci *= - 1 ans_v += ( t - i ) * ci ans_arr [ i - 1 ] = t print ( ans_v ) print ( * ans_arr ) NEW_LINE


import java . io . * ; import java . util . * ;   final public class A {   public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder sb = new StringBuilder ( ) ; char [ ] a = br . readLine ( ) . toCharArray ( ) ; char [ ] b = br . readLine ( ) . toCharArray ( ) ; int lenA = a . length , lenB = b . length ; int [ ] pref_1 = new int [ lenB + 1 ] ; int [ ] pref_0 = new int [ lenB + 1 ] ; pref_1 [ 0 ] = 0 ; pref_0 [ 0 ] = 0 ; for ( int i = 0 ; i < lenB ; i ++ ) { pref_1 [ i + 1 ] = pref_1 [ i ] + ( ( b [ i ] == '1' ) ? 1 : 0 ) ; pref_0 [ i + 1 ] = pref_0 [ i ] + ( ( b [ i ] == '0' ) ? 1 : 0 ) ; } long ans = 0 ; for ( int i = 0 ; i < lenA ; i ++ ) { if ( a [ i ] == '0' ) { ans += pref_1 [ lenB - lenA + 1 + i ] - pref_1 [ i ] ; } else { ans += pref_0 [ lenB - lenA + 1 + i ] - pref_0 [ i ] ; } } System . out . println ( ans ) ; } }

import java . io . * ; import java . util . * ;   import static java . lang . Math . max ; import static java . lang . Math . min ;    public class Solution implements Runnable { public static void main ( String [ ] args ) throws IOException , InterruptedException {

import java . util . * ; import java . io . * ;   public class Main {   public static void main ( String [ ] args ) throws IOException { Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; String str1 = in . next ( ) ; String str2 = in . next ( ) ; int n1 = str1 . length ( ) , n2 = str2 . length ( ) ; int count0 = 0 , count1 = 0 ; for ( int x = 0 ; x <= n2 - n1 ; x ++ ) { if ( str2 . charAt ( x ) == '0' ) count0 ++ ; else count1 ++ ; } long ans = 0 ; if ( str1 . charAt ( 0 ) == '0' ) ans += count1 ; else ans += count0 ; for ( int x = n2 - n1 + 1 ; x < n2 ; x ++ ) { char ch = str1 . charAt ( x - n2 + n1 ) ; char ch1 = str2 . charAt ( x ) , ch2 = str2 . charAt ( x - n2 + n1 - 1 ) ; if ( ch1 == '0' ) count0 ++ ; else count1 ++ ; if ( ch2 == '0' ) count0 -- ; else count1 -- ; if ( ch == '0' ) ans += count1 ; else ans += count0 ; } System . out . println ( ans ) ; }   }

""" https : / / codeforces . com / contest / 608 / problem / B0100111 ▁ should ▁ output ▁ 3 00110110 ▁ should ▁ output ▁ 2 """ first = [ int ( i ) for i in input ( ) ] second = [ int ( i ) for i in input ( ) ]   pref_dists = [ [ 0 ] + [ int ( 0 != c ) for c in second ] , [ 0 ] + [ int ( 1 != c ) for c in second ] ] for i in range ( 1 , len ( second ) + 1 ) : pref_dists [ 0 ] [ i ] += pref_dists [ 0 ] [ i - 1 ] pref_dists [ 1 ] [ i ] += pref_dists [ 1 ] [ i - 1 ]   total = 0 for i , c in enumerate ( first ) : end = len ( second ) - ( len ( first ) - i ) total += pref_dists [ c ] [ end + 1 ] - pref_dists [ c ] [ i ] print ( total ) NEW_LINE

cache = { }     def countOnes ( number ) : counter = 0 while number != 0 : counter += 1 number = number & ( number - 1 ) return counter     def populateCache ( string , aLen ) : ones = 0 zeroes = 0 index = len ( string ) - aLen + 1 for i in range ( len ( string ) - 1 , - 1 , - 1 ) : if string [ i ] == "1" : ones += 1 else : zeroes += 1 cache [ i ] = ( ones , zeroes ) for i in range ( 0 , aLen - 1 , 1 ) : ones , zeroes = cache [ i ] cache [ i ] = ( ones - cache [ index ] [ 0 ] , zeroes - cache [ index ] [ 1 ] ) index += 1     def matchingStrings ( a , b ) : return countOnes ( int ( a , 2 ) ^ int ( b , 2 ) )     total = 0 a = str ( input ( ) ) aLen = len ( a ) b = str ( input ( ) ) bLen = len ( b ) if aLen == bLen : print ( matchingStrings ( a , b ) ) else : populateCache ( b , aLen ) for index , ele in enumerate ( a ) : num = int ( ele ) if num == 0 : total += cache [ index ] [ 0 ] else : total += cache [ index ] [ 1 ] print ( total ) NEW_LINE

a , b = input ( ) , input ( ) ans = 0 ones = [ 0 for i in range ( len ( b ) + 1 ) ] zeros = [ 0 for i in range ( len ( b ) + 1 ) ] for i in range ( len ( b ) ) : ones [ i ] = ones [ i - 1 ] + int ( b [ i ] ) zeros [ i ] = i + 1 - ones [ i ] for i in range ( len ( a ) ) : if a [ i ] == '1' : ans += zeros [ len ( b ) - len ( a ) + i ] - zeros [ i - 1 ] else : ans += ones [ len ( b ) - len ( a ) + i ] - ones [ i - 1 ] print ( ans ) NEW_LINE


import java . io . * ; import java . util . * ; import java . lang . * ;   public class A { public static void solve ( FastReader in , PrintWriter out , int nTestCase ) { int n = in . nextInt ( ) , sum = in . nextInt ( ) ; if ( n == 1 ) out . println ( sum * ( long ) sum ) ; else if ( sum == 1 ) out . println ( 1 ) ; else { if ( sum % n == 0 ) out . println ( n * ( ( sum / n ) * ( sum / n ) ) ) ; else { long ans = 0 ; int mx = ( sum / n ) ; int rem = ( sum % n ) ; ans = rem * ( ( mx + 1 ) * ( long ) ( mx + 1 ) ) + ( ( n - rem ) * ( mx ) * ( long ) ( mx ) ) ; out . println ( ans ) ; } } } public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int T = in . nextInt ( ) ; for ( int tt = 1 ; tt <= T ; tt ++ ) { solve ( in , out , tt ) ; } out . close ( ) ; } public static int findSqRt ( int n ) { int i = 1 ; while ( i * i < n ) i ++ ; return i ; } static final Random random = new Random ( ) ;

import java . util . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class a { static int [ ] count ;

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringJoiner ; import java . util . StringTokenizer ;   public class A {   public static void main ( String [ ] args ) { FastScanner sc = new FastScanner ( ) ; int n = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int c = sc . nextInt ( ) , sum = sc . nextInt ( ) ; int div = sum / c ; int rem = sum % c ; long ans = rem * ( div + 1 ) * ( div + 1 ) + ( c - rem ) * div * div ; System . out . println ( ans ) ; }   }   static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; }   long [ ] readLongArray ( int n ) { long [ ] a = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextLong ( ) ; return a ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } }   }

import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int c = s . nextInt ( ) ; int sum = s . nextInt ( ) ; int a = sum / c ; int b = sum % c ; System . out . println ( b * ( a + 1 ) * ( a + 1 ) + ( c - b ) * a * a ) ; } } }

import math   def solve ( ) : c , sm = map ( int , input ( ) . split ( ) ) if sm <= c : print ( sm ) else : if sm % c == 0 : print ( c * ( sm // c ) ** 2 ) else : cnt2 = sm % c cnt1 = c - cnt2 print ( cnt1 * ( sm // c ) ** 2 + cnt2 * math . ceil ( sm / c ) ** 2 )   t = int ( input ( ) ) for _ in range ( t ) : solve ( ) NEW_LINE

for case in range ( int ( input ( ) ) ) : c , s = [ int ( x ) for x in input ( ) . split ( ) ] mn = s // c c2 = 0 if mn != 0 : c2 = s % c else : c2 = s   c -= c2 NEW_LINE

t = int ( input ( ) ) for _ in range ( t ) : c , summ = [ int ( x ) for x in input ( ) . split ( ) ] avg = summ // c cntsWithAvgPlusOne = summ % c cntsWithAvg = c - cntsWithAvgPlusOne ans = cntsWithAvg * ( avg ** 2 ) + cntsWithAvgPlusOne * ( ( avg + 1 ) ** 2 ) print ( ans ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : a , b = map ( int , input ( ) . split ( ) ) low = b // a hg = b % a res = ( a - hg ) * low ** 2 + hg * ( low + 1 ) ** 2 print ( res ) NEW_LINE


import java . util . * ; public class P2 {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; List < Integer > neg = new ArrayList < > ( ) ; List < Integer > pos = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; if ( x < 0 ) { neg . add ( x ) ; } else pos . add ( x ) ; } if ( neg . size ( ) == 1 || pos . size ( ) == 1 || neg . size ( ) == 0 || pos . size ( ) == 0 ) { System . out . println ( " YES " ) ; } else System . out . println ( " NO " ) ; } }

import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int i , positive = 0 , negative = 0 ; long x ; for ( i = 0 ; i < n ; i ++ ) { x = scan . nextLong ( ) ; if ( x > 0 ) positive ++ ; if ( x < 0 ) negative ++ ; scan . nextLong ( ) ; } if ( positive < 2 || negative < 2 ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

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

n = eval ( input ( ) ) x , y , z = 0 , 0 , 0 for i in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) if a > 0 : x += 1 else : y += 1 if x > 1 and y > 1 : print ( ' No ' ) z = 1 breakif z == 0 : print ( ' Yes ' ) NEW_LINE

i = input ; n = int ( i ( ) ) ; x = sum ( int ( i ( ) . split ( ) [ 0 ] ) > 0 for _ in [ 0 ] * n ) ; print ( ' YNEOS ' [ 1 < x < n - 1 : : 2 ] ) NEW_LINE

cases = int ( input ( ) )   one = 0 two = 0 while cases : cases -= 1 a , b = map ( int , input ( ) . split ( ) )   if a < 0 : one += 1 if a > 0 : two += 1   if min ( two , one ) < 2 : print ( " Yes " ) else : print ( " No " ) NEW_LINE

cases = int ( input ( ) )   one = 0 two = 0 broken = Falsewhile cases : cases -= 1 a , b = map ( int , input ( ) . split ( ) )   if a < 0 : one += 1 if a > 0 : two += 1 if min ( two , one ) > 1 : broken = True print ( " No " ) break   if not broken : print ( " Yes " ) NEW_LINE


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

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . * ;   public class Main {   public static void main ( String [ ] args ) throws IOException { FastScanner input = new FastScanner ( ) ; long l = input . nextLong ( ) ; long r = input . nextLong ( ) ; long store [ ] = new long [ 1025 ] ; for ( int i = 2 ; i <= 1024 ; i ++ ) { if ( i % 2 == 0 ) { store [ i ] = 10 * store [ i / 2 ] + 4 ; } else { store [ i ] = 10 * store [ i / 2 ] + 7 ; } }

import java . io . * ; import java . util . ArrayList ; import java . util . StringTokenizer ;   public class LuckySum { public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; PrintWriter out = new PrintWriter ( new BufferedOutputStream ( System . out ) ) ;   int l = in . nextInt ( ) ; int r = in . nextInt ( ) ;   ArrayList < Long > nums = new ArrayList < > ( 2 * 517 ) ;

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

l , r = map ( str , input ( ) . split ( ) ) l1 = len ( l ) l2 = len ( r ) graph = { "4" : [ "4" , "7" ] , "7" : [ "4" , "7" ] } ans = set ( ) def dfs ( s , n ) : s += n if len ( s ) >= l1 and len ( s ) <= l2 + 1 and int ( s ) >= int ( l ) : ans . add ( int ( s ) ) elif len ( s ) > l2 : return for i in graph [ n ] : dfs ( s [ : ] , i ) s = " " for i in graph : dfs ( s [ : ] , i ) ans = list ( ans ) ans . sort ( ) fin = 0 i = 0 l = int ( l ) ; r = int ( r ) for num in ans : if num >= l : fin += num * ( num - l + 1 ) l = num + 1 if num >= r : fin += num * ( r - l + 1 ) break ; NEW_LINE

lucky = [ ] MAX = 10000000000 def func ( s ) : s = s * 10 if s > MAX : return lucky . append ( s + 4 ) lucky . append ( s + 7 ) func ( s + 4 ) func ( s + 7 )   func ( 0 ) lucky . sort ( )   l , r = [ int ( x ) for x in input ( ) . split ( ' ▁ ' ) ]   i = 0j = 0 while ( l > lucky [ i ] ) : i += 1 while ( r > lucky [ j ] ) : j += 1 ans = 0 for x in range ( i + 1 , j + 1 ) : ans += ( lucky [ x ] - lucky [ x - 1 ] ) * lucky [ x ] ans -= ( lucky [ j ] - r ) * lucky [ j ] ans += ( lucky [ i ] - l + 1 ) * lucky [ i ] print ( ans ) NEW_LINE

import bisectx , y = map ( int , input ( ) . split ( ) )   i = 2 l = [ 4 , 7 ] while ( l [ - 1 ] <= 10 ** 11 ) : if ( i % 2 == 0 ) : l . append ( l [ ( i - 1 ) // 2 ] * 10 + 4 ) else : l . append ( l [ ( i - 1 ) // 2 - 1 ] * 10 + 7 ) i += 1   val1 = bisect . bisect_left ( l , x , 0 , len ( l ) ) val2 = bisect . bisect_right ( l , y , 0 , len ( l ) )   start = 0 for i in range ( len ( l ) ) : if ( l [ i ] == l [ val1 ] ) : start = i break NEW_LINE

lucky = [ 4 , 7 ] n = 1 length = 0 while n < 10 : check = lucky [ length : ( length + 2 ** ( n ) ) ] for x in check : lucky . append ( int ( "4" + str ( x ) ) ) for x in check : lucky . append ( int ( "7" + str ( x ) ) ) length += 2 ** n n += 1 l , r = map ( int , input ( ) . split ( ) ) ans = 0 i = 0 for num in lucky : if num >= r : ans += num * ( r - l + 1 ) break elif num >= l : ans += num * ( num - l + 1 ) l = num + 1 print ( ans )   NEW_LINE


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

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 ; import java . util . * ; public class A1374 { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int tc = sc . nextInt ( ) ; int t = 0 ; int arr [ ] = new int [ tc ] ; for ( int i = 0 ; i < tc ; i ++ ) { int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int r = n % x ; if ( r == y ) {

import java . util . * ;    public class Main {   public static void main ( String [ ] args ) { Scanner reader = new Scanner ( System . in ) ; int t = reader . nextInt ( ) ; while ( t -- != 0 ) { long x = reader . nextInt ( ) , y = reader . nextInt ( ) , n = reader . nextInt ( ) ; long ans = y ; long l = 1 , r = 1000000000 ; while ( l <= r ) { long mid = ( l + r ) / 2 ; if ( mid * x + y <= n ) { ans = mid * x + y ; l = mid + 1 ; } else r = mid - 1 ; } System . out . println ( ans ) ; } } }

import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int m = ( ( n / x ) * x ) + y ; if ( m > n ) { m -= ( x ) ; } System . out . println ( m ) ; } } } ;

import java . util . Scanner ;   public class RequiredRemainder { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int ans = - 1 ; int k = n - ( ( n - y ) % x ) ; System . out . println ( k ) ; } } }

a = int ( input ( ) ) for i in range ( a ) : m , n , o = map ( int , input ( ) . split ( ) ) print ( ( o - n ) // m * m + n ) NEW_LINE

def main ( ) : t = int ( input ( ) ) for _ in range ( t ) : x , y , n = map ( int , input ( ) . split ( ) ) ans = n + ( x - ( n % x ) ) - ( x - y ) if n % x < y : ans -= x print ( ans )     if __name__ == ' _ _ main _ _ ' : main ( )     ''' explaink ▁ % ▁ x ▁ = ▁ y 11 % ▁ 3 ▁ = = 1211 ▁ + ▁ ( ▁ 3 ▁ - ▁ 2 ' rem ' ▁ ) ▁ = > ▁ 12 ▁ - ▁ ( ▁ 3 ▁ - ▁ 1 ▁ ) ▁ = > ▁ 11 ▁ + ▁ ( ▁ 3 ▁ - ▁ 2 ' rem ' ▁ ) ▁ - ▁ ( ▁ 3 ▁ - ▁ 1 ' req ' ▁ ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ = > ▁ n ▁ + ▁ ( ▁ x ▁ - ▁ ( ▁ n ▁ % ▁ x ▁ ) ) ▁ - ▁ ( ▁ x ▁ - ▁ y ▁ )  12345 ▁ % ▁ 7 ▁ = ▁ 5    ''' NEW_LINE

for _ in range ( int ( input ( ) ) ) : x , y , n = map ( int , input ( ) . split ( ) ) if ( n - n % x + y ) <= n : res = n - n % x + y else : res = n - n % x - ( x - y ) print ( res ) NEW_LINE

num = int ( input ( ) )   for i in range ( num ) :   x , y , n = map ( int , input ( ) . split ( ) ) z = n % x if z == y : print ( n ) elif z > y : n = n - ( z - y ) print ( n ) else : n = ( n - z - ( x - y ) ) print ( n )         NEW_LINE

def requiredRemainder ( x , y , n ) : if ( n - n % x + y <= n ) : print ( n - n % x + y ) else : print ( n - n % x - ( x - y ) ) 	     tc = int ( input ( ) ) for _ in range ( 0 , tc ) : x , y , n = input ( ) . split ( ) x = int ( x ) y = int ( y ) n = int ( n ) requiredRemainder ( x , y , n ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class WaterTheGarden { private static final FastReader in = new FastReader ( ) ; private static final PrintWriter out = new PrintWriter ( System . out ) ;   public static void main ( String [ ] args ) { Solver sol = new Solver ( ) ; int tt = 1 ; for ( int qq = in . nextInt ( ) ; tt <= qq ; ++ tt ) sol . solve ( tt ) ; out . close ( ) ; }   private static final class Solver { public void solve ( int testCase ) { int n = in . nextInt ( ) , k = in . nextInt ( ) ; boolean [ ] gardenBeds = new boolean [ n ] ; for ( int i = 0 ; i < k ; ++ i ) { int index = in . nextInt ( ) - 1 ; gardenBeds [ index ] = true ; } if ( k == n ) { out . println ( 1 ) ; return ; } int ans = 0 ; while ( true ) { boolean [ ] filled = new boolean [ n ] ;

import java . util . * ; import java . lang . * ; import java . io . * ;   public class Main { PrintWriter out = new PrintWriter ( System . out ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer tok = new StringTokenizer ( " " ) ; String next ( ) throws IOException { if ( ! tok . hasMoreTokens ( ) ) { tok = new StringTokenizer ( in . readLine ( ) ) ; } return tok . nextToken ( ) ; } int ni ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; } long nl ( ) throws IOException { return Long . parseLong ( next ( ) ) ; } long mod = 1000000007 ; void solve ( ) throws IOException { for ( int tc = ni ( ) ; tc > 0 ; tc -- ) { int n = ni ( ) , k = ni ( ) ; int prev = ni ( ) ; int max = prev ; for ( int i = 1 ; i < k ; i ++ ) { int next = ni ( ) ; int na = ( next - prev + 2 ) / 2 ; max = Math . max ( max , na ) ; prev = next ; } max = Math . max ( max , n + 1 - prev ) ; out . println ( max ) ; } out . flush ( ) ; } int gcd ( int a , int b ) { return ( b == 0 ? a : gcd ( b , a % b ) ) ; } long gcd ( long a , long b ) { return ( b == 0 ? a : gcd ( b , a % b ) ) ; } long mp ( long a , long p ) { long r = 1 ; while ( p > 0 ) { if ( ( p & 1 ) == 1 ) r = ( r * a ) % mod ; p >>= 1 ; a = ( a * a ) % mod ; } return r ; } public static void main ( String [ ] args ) throws IOException { new Main ( ) . solve ( ) ; } }

import java . util . * ; import java . math . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class a { static int [ ] count , count1 , count2 ; static Node [ ] nodes ; static long [ ] arr ; static char [ ] ch , ch1 ; static long [ ] darr , farr ; static Character [ ] [ ] mat , mat1 ; static long x , h ; static long maxl ; static double dec ; static String s ; static long minl ; static int mx = ( int ) 1e9 + 5 ; static long mod = 998244353l ;

import java . beans . DesignMode ; import java . util . * ;   public class Main { private static int n , k , t , ans ; static Queue < Node > q = new LinkedList < > ( ) ; static boolean [ ] visit = new boolean [ 210 ] ; static Scanner in = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int total = in . nextInt ( ) ; while ( total -- > 0 ) { n = in . nextInt ( ) ; k = in . nextInt ( ) ; Arrays . fill ( visit , false ) ; ans = 0 ; for ( int i = 0 ; i < k ; i ++ ) { t = in . nextInt ( ) ; Node temp = new Node ( ) ; temp . s = t ; temp . dep = 1 ; q . add ( temp ) ; visit [ temp . s ] = true ;

r = lambda : list ( map ( int , input ( ) . split ( ) ) ) t = int ( input ( ) ) for _ in range ( t ) : n , k = map ( int , input ( ) . split ( ) )   arr = r ( )   bed = [ 1 ] + ( [ 0 ] * n ) i = 0 t = 0 while 0 in bed : NEW_LINE

import sys , math , itertoolsfrom collections import Counter , deque , defaultdictfrom bisect import bisect_left , bisect_right from heapq import heappop , heappush , heapify , nlargestfrom copy import deepcopymod = 10 ** 9 + 7 INF = float ( ' inf ' ) def inp ( ) : return int ( sys . stdin . readline ( ) ) def inpl ( ) : return list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) def inpl_1 ( ) : return list ( map ( lambda x : int ( x ) - 1 , sys . stdin . readline ( ) . split ( ) ) ) def inps ( ) : return sys . stdin . readline ( ) def inpsl ( x ) : tmp = sys . stdin . readline ( ) ; return list ( tmp [ : x ] ) def err ( x ) : print ( x ) ; exit ( )   for _ in range ( inp ( ) ) : n , k = inpl ( ) a = inpl_1 ( ) res = [ INF ] * n se = set ( a ) pr = - INF for i in range ( n ) : if i in se : pr = i res [ i ] = min ( res [ i ] , i - pr + 1 ) pr = INF for i in range ( n ) [ : : - 1 ] : if i in se : pr = i res [ i ] = min ( res [ i ] , pr - i + 1 ) print ( max ( res ) ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) ) k = [ int ( i ) for i in input ( ) . split ( ) ] lis = [ 1 ] * n for i in k : lis [ i - 1 ] = 0 t = 1 newlis = lis [ : ] while sum ( lis ) : for i in range ( n ) : if lis [ i ] == 0 : newlis [ max ( 0 , i - 1 ) ] = 0 newlis [ min ( n - 1 , i + 1 ) ] = 0 lis = newlis [ : ] t += 1 print ( t ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) ) k = [ int ( i ) for i in input ( ) . split ( ) ] lis = [ 1 ] * n for i in k : lis [ i - 1 ] = 0 t = 1 newlis = lis [ : ] while sum ( lis ) : for i in range ( n ) : if lis [ i ] == 0 : newlis [ max ( 0 , i - 1 ) ] = 0 newlis [ min ( n - 1 , i + 1 ) ] = 0 lis = newlis [ : ] t += 1 print ( t , ' \n ' ) NEW_LINE

import mathfor _ in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) ) k = [ int ( i ) for i in input ( ) . split ( ) ] start = k [ 0 ] maxcount = 0 for x in k [ 1 : ] : maxcount = max ( math . ceil ( ( x - start - 1 ) / 2 ) + 1 , maxcount ) start = x maxcount = max ( k [ 0 ] , maxcount ) maxcount = max ( n - k [ - 1 ] + 1 , maxcount ) print ( maxcount ) NEW_LINE


# include " vector " # include " set " # include " map " # include " unordered _ set " # include " unordered _ map " # include " string " # include " iostream " # include " algorithm " # include " queue "   using namespace std ;  # define ll long long # define INF 2e9

import javax . swing . text . html . HTMLDocument ; import java . util . * ; import java . io . * ;    public class TaskB { public static InputReader in ; public static PrintWriter out ;   public static void main ( String [ ] args ) { in = new InputReader ( System . in ) ; out = new PrintWriter ( System . out ) ; int n = in . nextInt ( ) ; long [ ] a = new long [ n ] ; long [ ] b = new long [ n ] ; long Gx = 0 , Gy = 0 ; HashMap < Point , Boolean > mp = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = in . nextLong ( ) ; a [ i ] *= 2 * n ; Gx += a [ i ] ; b [ i ] = in . nextLong ( ) ; b [ i ] *= 2 * n ; Gy += b [ i ] ; Point p = new Point ( a [ i ] , b [ i ] ) ; mp . put ( p , true ) ; } Gx /= n ; Gy /= n ; boolean flag = true ; for ( int i = 0 ; i < n ; i ++ ) { Point opposite = new Point ( 2 * Gx - a [ i ] , 2 * Gy - b [ i ] ) ;

from sys import exitn = int ( input ( ) ) arr = [ ] for _ in range ( n ) : arr . append ( tuple ( map ( int , input ( ) . split ( ) ) ) )   def no ( ) : print ( " no " ) exit ( 0 )   def yes ( ) : print ( " yes " ) exit ( 0 )   if len ( arr ) & 1 == 1 : no ( )   def center ( a , b ) : return ( ( a [ 0 ] + b [ 0 ] ) / 2 , ( a [ 1 ] + b [ 1 ] ) / 2 )   c = center ( arr [ 0 ] , arr [ len ( arr ) // 2 ] ) for i in range ( 1 , len ( arr ) // 2 ) : if c != center ( arr [ i ] , arr [ i + len ( arr ) // 2 ] ) : no ( )   yes ( ) NEW_LINE

''' import ▁ PIL . ImageDraw ▁ as ▁ ImageDrawimport ▁ PIL . Image ▁ as ▁ Image image ▁ = ▁ Image . new ( " RGB " , ▁ ( 1280 , ▁ 720 ) )  draw ▁ = ▁ ImageDraw . Draw ( image )   # ▁ points ▁ = ▁ ( (1,1 ) , ▁ ( 2,1 ) , ▁ ( 2,2 ) , ▁ ( 1,2 ) , ▁ ( 0.5,1.5 ) ) points ▁ = ▁ ( (0,0 ) , ▁ ( 100,0 ) , ▁ ( 200 , ▁ 100 ) , ▁ ( 300 , ▁ 300 ) , ▁ ( 400 , ▁ 600 ) , (300,600 ) , (200,500 ) , (100,300 ) ) draw . polygon ( ( points ) , ▁ fill = 200 )  image . show ( ) '''   import sysinput = sys . stdin . readlinepoints = [ ] n = int ( input ( ) ) if n % 2 : print ( " NO " ) else : for i in range ( n ) : x , y = map ( int , input ( ) . split ( ) ) points . append ( [ x , y ] ) points . append ( points [ 0 ] ) NEW_LINE

import math   n = int ( input ( ) ) kords = list ( )   for _ in range ( n ) : kords . append ( list ( map ( int , input ( ) . split ( ) ) ) )   if n % 2 == 0 : first_part = kords [ : len ( kords ) // 2 + 1 ] second_part = kords [ len ( kords ) // 2 : ] + [ kords [ 0 ] ]   for i in range ( n // 2 ) : if abs ( first_part [ i ] [ 0 ] - second_part [ i + 1 ] [ 0 ] ) == abs ( first_part [ i + 1 ] [ 0 ] - second_part [ i ] [ 0 ] ) and abs ( first_part [ i + 1 ] [ 1 ] - second_part [ i ] [ 1 ] ) == abs ( first_part [ i ] [ 1 ] - second_part [ i + 1 ] [ 1 ] ) : continue else : print ( ' NO ' ) break else : print ( ' YES ' ) else : print ( ' NO ' )   NEW_LINE

import sysinput = sys . stdin . readline   n = int ( input ( ) ) A = [ tuple ( map ( int , input ( ) . split ( ) ) ) for i in range ( n ) ] if n % 2 != 0 : print ( " NO " ) else : mid = ( A [ 0 ] [ 0 ] + A [ n // 2 ] [ 0 ] , A [ 0 ] [ 1 ] + A [ n // 2 ] [ 1 ] ) for i in range ( n // 2 ) : if mid != ( A [ i ] [ 0 ] + A [ i + n // 2 ] [ 0 ] , A [ i ] [ 1 ] + A [ i + n // 2 ] [ 1 ] ) : print ( " NO " ) sys . exit ( ) print ( " YES " ) NEW_LINE