import java . io . * ; import java . util . StringTokenizer ; public class Main { public void solve ( int testNumber , FastScanner in , PrintWriter out ) { out . printf ( " Case ▁ # % d : ▁ " , testNumber ) ; int r = in . nextInt ( ) ; int c = in . nextInt ( ) ; int w = in . nextInt ( ) ; int addRow = c / w * ( r - 1 ) ; int inRow = c / w + w ; if ( c % w == 0 ) inRow -- ; out . println ( addRow + inRow ) ; } public static void main ( String [ ] args ) throws IOException { FastScanner in = new FastScanner ( new FileInputStream ( " input . txt " ) ) ; PrintWriter out = new PrintWriter ( " output . txt " ) ; int t = in . nextInt ( ) ; for ( int test = 1 ; test <= t ; test ++ ) new Main ( ) . solve ( test , in , out ) ; in . close ( ) ; out . close ( ) ; } } class FastScanner { private StringTokenizer tokenizer ; private BufferedReader reader ; public FastScanner ( InputStream inputStream ) { reader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; } public String next ( ) { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { String line ; try { line = reader . readLine ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } if ( line == null ) return null ; tokenizer = new StringTokenizer ( line ) ; } return tokenizer . nextToken ( ) ; } public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } public long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } public double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } public String nextLine ( ) { String line ; try { line = reader . readLine ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } tokenizer = null ; return line ; } public void close ( ) { try { reader . close ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } }


def check ( R , C , W , B ) : NEW_LINE INDENT c = sum ( b . count ( 1 ) for b in B ) NEW_LINE for y in range ( R ) : NEW_LINE INDENT for x in range ( C - W + 1 ) : NEW_LINE INDENT if B [ y ] [ x : x + W ] . count ( 1 ) == c and B [ y ] [ x : x + W ] . count ( - 1 ) == 0 : NEW_LINE INDENT return True NEW_LINE DEDENT DEDENT DEDENT return False NEW_LINE DEDENT def BT ( R , C , W , B ) : NEW_LINE INDENT Bt = tuple ( tuple ( b ) for b in B ) NEW_LINE if Bt in memo : NEW_LINE INDENT return memo [ Bt ] NEW_LINE DEDENT ans = 9999 NEW_LINE for y in range ( R ) : NEW_LINE INDENT for x in range ( C ) : NEW_LINE INDENT if B [ y ] [ x ] == 0 : NEW_LINE INDENT ans2 = 0 NEW_LINE B [ y ] [ x ] = 1 NEW_LINE if check ( R , C , W , B ) : NEW_LINE INDENT if sum ( b . count ( 1 ) for b in B ) == W : NEW_LINE INDENT ans2 = max ( ans2 , 1 ) NEW_LINE DEDENT else : NEW_LINE INDENT ans2 = max ( ans2 , BT ( R , C , W , B ) + 1 ) NEW_LINE DEDENT DEDENT B [ y ] [ x ] = 0 NEW_LINE B [ y ] [ x ] = - 1 NEW_LINE if check ( R , C , W , B ) : NEW_LINE INDENT ans2 = max ( ans2 , BT ( R , C , W , B ) + 1 ) NEW_LINE DEDENT B [ y ] [ x ] = 0 NEW_LINE ans = min ( ans , ans2 ) NEW_LINE DEDENT DEDENT DEDENT memo [ Bt ] = ans NEW_LINE return ans NEW_LINE DEDENT def solve ( R , C , W ) : NEW_LINE INDENT global memo NEW_LINE B = [ [ 0 ] * C for _ in range ( R ) ] NEW_LINE memo = { } NEW_LINE return BT ( R , C , W , B ) NEW_LINE DEDENT for t in range ( input ( ) ) : NEW_LINE INDENT R , C , W = map ( int , raw_input ( ) . split ( ) ) NEW_LINE print " Case ▁ # % s : ▁ % s " % ( t + 1 , solve ( R , C , W ) ) NEW_LINE DEDENT


import math NEW_LINE import itertools NEW_LINE import numpy as NP NEW_LINE def read_case ( f ) : NEW_LINE INDENT return read_ints ( f ) NEW_LINE DEDENT def solve_small ( case ) : NEW_LINE INDENT R , C , W = case NEW_LINE return ( C // W ) * R + W - ( 1 if C % W == 0 else 0 ) NEW_LINE DEDENT def solve_large ( case ) : NEW_LINE INDENT return solve_small ( case ) NEW_LINE DEDENT def write_case ( f , i , res ) : NEW_LINE INDENT f . write ( ' Case ▁ # % d : ▁ ' % i ) NEW_LINE f . write ( ' % s ' % res ) NEW_LINE f . write ( ' \n ' ) NEW_LINE DEDENT def read_word ( f ) : NEW_LINE INDENT return next ( f ) . strip ( ) NEW_LINE DEDENT def read_int ( f , b = 10 ) : NEW_LINE INDENT return int ( read_word ( f ) , b ) NEW_LINE DEDENT def read_letters ( f ) : NEW_LINE INDENT return list ( read_word ( f ) ) NEW_LINE DEDENT def read_digits ( f , b = 10 ) : NEW_LINE INDENT return [ int ( x , b ) for x in read_letters ( f ) ] NEW_LINE DEDENT def read_words ( f , d = ' ▁ ' ) : NEW_LINE INDENT return read_word ( f ) . split ( d ) NEW_LINE DEDENT def read_ints ( f , b = 10 , d = ' ▁ ' ) : NEW_LINE INDENT return [ int ( x , b ) for x in read_words ( f , d ) ] NEW_LINE DEDENT def read_floats ( f , d = ' ▁ ' ) : NEW_LINE INDENT return [ float ( x ) for x in read_words ( f , d ) ] NEW_LINE DEDENT def read_arr ( f , R , reader = read_ints , * args , ** kwargs ) : NEW_LINE INDENT return [ reader ( f , * args , ** kwargs ) for i in range ( R ) ] NEW_LINE DEDENT def solve ( solver , fn , out_fn = None ) : NEW_LINE INDENT in_fn = fn + ' . in ' NEW_LINE if out_fn is None : NEW_LINE INDENT out_fn = fn + ' . out ' NEW_LINE DEDENT with open ( in_fn , ' r ' ) as fi : NEW_LINE INDENT with open ( out_fn , ' w ' ) as fo : NEW_LINE INDENT T = read_int ( fi ) NEW_LINE for i in range ( T ) : NEW_LINE INDENT case = read_case ( fi ) NEW_LINE res = solver ( case ) NEW_LINE write_case ( fo , i , res ) NEW_LINE DEDENT DEDENT DEDENT DEDENT DEBUG = ' i ' NEW_LINE from run import * NEW_LINE


import os NEW_LINE import sys NEW_LINE from collections import defaultdict NEW_LINE problem_id = ' A ' NEW_LINE sys . setrecursionlimit ( 10 ** 9 ) NEW_LINE input_path = ' % s . in ' % problem_id NEW_LINE output_path = ' % s . out ' % problem_id NEW_LINE def read_line ( ) : NEW_LINE INDENT line = ' ' NEW_LINE while len ( line ) == 0 : NEW_LINE INDENT line = input_file . readline ( ) . strip ( ) NEW_LINE DEDENT return line NEW_LINE DEDENT def write_line ( line ) : NEW_LINE INDENT print line NEW_LINE return output_file . write ( line + os . linesep ) NEW_LINE DEDENT def solve ( ) : NEW_LINE INDENT r , c , w = map ( int , read_line ( ) . split ( ' ▁ ' ) ) NEW_LINE nc = ( c / w ) * r + ( w - 1 ) NEW_LINE if c % w : NEW_LINE INDENT nc += 1 NEW_LINE DEDENT return ' % s ' % nc NEW_LINE DEDENT input_file = open ( input_path , " r " ) NEW_LINE output_file = open ( output_path , " w + " ) NEW_LINE T = int ( read_line ( ) ) NEW_LINE for case_id in xrange ( 1 , T + 1 ) : NEW_LINE INDENT write_line ( " Case ▁ # % d : ▁ % s " % ( case_id , solve ( ) ) ) NEW_LINE DEDENT input_file . close ( ) NEW_LINE output_file . close ( ) NEW_LINE


FILE_NAME_BASE = ' A - large ' NEW_LINE NUM_PROCESSES = 0 NEW_LINE MEM_LIMIT_GB = 1.5 NEW_LINE RECURSION_LIMIT = 1000 NEW_LINE def parse ( inp ) : NEW_LINE INDENT rows , cols , size = ( int ( x ) for x in inp . readline ( ) . split ( ) ) NEW_LINE return rows , cols , size NEW_LINE DEDENT def solve ( rows , cols , size ) : NEW_LINE INDENT toHit = cols / size NEW_LINE hitFlex = cols % size NEW_LINE toSink = size - 1 if hitFlex == 0 else size NEW_LINE return rows * toHit + toSink NEW_LINE DEDENT def main ( ) : NEW_LINE INDENT import sys NEW_LINE sys . setrecursionlimit ( RECURSION_LIMIT ) NEW_LINE import resource NEW_LINE soft , hard = resource . getrlimit ( resource . RLIMIT_AS ) NEW_LINE resource . setrlimit ( resource . RLIMIT_AS , ( MEM_LIMIT_GB * 1024 ** 3 , hard ) ) NEW_LINE with open ( FILE_NAME_BASE + ' . in ' , ' r ' ) as inp : NEW_LINE INDENT numCases = int ( inp . readline ( ) ) NEW_LINE inputs = [ parse ( inp ) for _ in xrange ( numCases ) ] NEW_LINE DEDENT if NUM_PROCESSES == 0 : NEW_LINE INDENT runners = [ lambda inp = inp : apply ( solve , inp ) for inp in inputs ] NEW_LINE DEDENT else : NEW_LINE INDENT from multiprocessing import Pool NEW_LINE from signal import SIGINT , SIG_IGN , signal NEW_LINE pool = Pool ( NUM_PROCESSES , signal , ( SIGINT , SIG_IGN ) ) NEW_LINE runners = [ pool . apply_async ( solve , inp ) . get for inp in inputs ] NEW_LINE pool . close ( ) NEW_LINE DEDENT caseFmt = ' % ' + str ( len ( str ( numCases ) ) ) + ' d ' NEW_LINE progressFmt = ' [ % s / % s ] ▁ % % s \n ' % ( caseFmt , caseFmt ) NEW_LINE with open ( FILE_NAME_BASE + ' . out ' , ' w ' ) as out : NEW_LINE INDENT for case , runner in enumerate ( runners , 1 ) : NEW_LINE INDENT result = runner ( ) NEW_LINE out . write ( ' Case ▁ # % d : ▁ % s \n ' % ( case , result ) ) NEW_LINE out . flush ( ) NEW_LINE sys . stderr . write ( progressFmt % ( case , numCases , result ) ) NEW_LINE DEDENT DEDENT DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT main ( ) NEW_LINE DEDENT


import gcj . GCJ ; import java . util . Scanner ; public class FallingDiamonds { public static void main ( String [ ] args ) { Scanner s = GCJ . createScanner ( ' B ' , true ) ; int T = s . nextInt ( ) ; for ( int i = 1 ; i <= T ; i ++ ) { int n = s . nextInt ( ) ; int x = s . nextInt ( ) ; int y = s . nextInt ( ) ; double p = 0 ; int nn = 1 ; int total = 1 ; while ( total + nn + 1 + nn + 2 <= n ) { total += nn + 1 + nn + 2 ; nn += 2 ; } int xy = Math . abs ( x ) + y ; if ( xy < nn ) { p = 1 ; } else if ( xy >= nn + 2 ) { p = 0 ; } else { int left = n - total ; if ( left < y + 1 ) { p = 0 ; } else { nn ++ ; double [ ] [ ] cand = new double [ nn + 1 ] [ nn + 1 ] ; cand [ 0 ] [ 0 ] = 1 ; for ( int w = 1 ; w <= left ; w ++ ) { for ( int u = 0 ; u < w && u <= nn ; u ++ ) { int v = w - u - 1 ; if ( v > nn ) { continue ; } if ( u == nn ) { cand [ u ] [ v + 1 ] += cand [ u ] [ v ] ; } else if ( v == nn ) { cand [ u + 1 ] [ v ] += cand [ u ] [ v ] ; } else { cand [ u + 1 ] [ v ] += cand [ u ] [ v ] / 2 ; cand [ u ] [ v + 1 ] += cand [ u ] [ v ] / 2 ; } } } p = 0 ; for ( int u = y + 1 ; u <= left && u <= nn ; u ++ ) { int v = left - u ; if ( v > nn ) { continue ; } p += cand [ u ] [ v ] ; } } } GCJ . out ( i , Double . toString ( p ) ) ; } } }

import math NEW_LINE def C ( k , a ) : NEW_LINE INDENT if a == 0 : NEW_LINE INDENT return 1 NEW_LINE DEDENT return math . factorial ( k ) / ( math . factorial ( a ) * math . factorial ( k - a ) ) NEW_LINE DEDENT def Cal ( k , a ) : NEW_LINE INDENT sum = 0 NEW_LINE for i in range ( a , k + 1 ) : NEW_LINE INDENT sum += C ( k , i ) NEW_LINE DEDENT return sum * 1.0 / 2 ** k NEW_LINE DEDENT T = int ( raw_input ( ) ) NEW_LINE for i in range ( 1 , T + 1 ) : NEW_LINE INDENT input = raw_input ( ) NEW_LINE b = input . split ( " ▁ " ) NEW_LINE c = [ int ( e ) for e in b ] NEW_LINE N = c [ 0 ] NEW_LINE X = c [ 1 ] NEW_LINE Y = c [ 2 ] NEW_LINE if X < 0 : NEW_LINE INDENT X = - X NEW_LINE DEDENT if ( X + Y ) % 2 == 1 : NEW_LINE INDENT p = 0 NEW_LINE DEDENT elif X + Y == 0 : NEW_LINE INDENT p = 1 NEW_LINE DEDENT elif X == 0 : NEW_LINE INDENT level = Y / 2 + 2 NEW_LINE btm = ( 2 * level - 3 ) * ( level - 1 ) NEW_LINE if N >= btm : NEW_LINE INDENT p = 1 NEW_LINE DEDENT else : NEW_LINE INDENT p = 0 NEW_LINE DEDENT DEDENT else : NEW_LINE INDENT level = ( X + Y ) / 2 + 1 NEW_LINE btm = ( 2 * level - 3 ) * ( level - 1 ) + Y + 1 NEW_LINE level2 = level + 1 NEW_LINE upper = ( 2 * level2 - 3 ) * ( level2 - 1 ) - X NEW_LINE if N < btm : NEW_LINE INDENT p = 0 NEW_LINE DEDENT elif N >= upper : NEW_LINE INDENT p = 1 NEW_LINE DEDENT else : NEW_LINE INDENT left = N - ( 2 * level - 3 ) * ( level - 1 ) ; NEW_LINE a = Y + 1 NEW_LINE p = Cal ( left , a ) NEW_LINE DEDENT DEDENT print ( " Case ▁ # " + str ( i ) + " : ▁ " + str ( p ) ) NEW_LINE DEDENT


import numpy as np NEW_LINE def pyramid_size ( n ) : NEW_LINE INDENT return 2 * n ** 2 - n NEW_LINE DEDENT def pyramid_coordinates ( x , y ) : NEW_LINE INDENT if x == 0 : NEW_LINE INDENT return y / 2 + 1 , 0 NEW_LINE DEDENT return ( y + abs ( x ) ) / 2 , y + 1 NEW_LINE DEDENT def prob ( level , rem , h ) : NEW_LINE INDENT p = np . zeros ( ( 2 * level + 1 , 2 * level + 1 ) ) NEW_LINE p [ 0 , 0 ] = 1.0 NEW_LINE s = 0.0 NEW_LINE for l in xrange ( 0 , 4 * level + 1 ) : NEW_LINE INDENT for x in xrange ( 0 , 2 * level + 1 ) : NEW_LINE INDENT y = l - x NEW_LINE if y < 0 or y > 2 * level : NEW_LINE INDENT continue NEW_LINE DEDENT if x + y == rem and x >= h : NEW_LINE INDENT s += p [ x , y ] NEW_LINE DEDENT if x < 2 * level and y < 2 * level : NEW_LINE INDENT p [ x + 1 , y ] += 0.5 * p [ x , y ] NEW_LINE p [ x , y + 1 ] += 0.5 * p [ x , y ] NEW_LINE DEDENT elif x < 2 * level and y == 2 * level : NEW_LINE INDENT p [ x + 1 , y ] += p [ x , y ] NEW_LINE DEDENT elif x == 2 * level and y < 2 * level : NEW_LINE INDENT p [ x , y + 1 ] += p [ x , y ] NEW_LINE DEDENT DEDENT DEDENT return s NEW_LINE DEDENT def solve ( n , x , y ) : NEW_LINE INDENT level , h = pyramid_coordinates ( x , y ) NEW_LINE if pyramid_size ( level ) + h > n : NEW_LINE INDENT return 0.0 NEW_LINE DEDENT if pyramid_size ( level + 1 ) <= n : NEW_LINE INDENT return 1.0 NEW_LINE DEDENT return prob ( level , n - pyramid_size ( level ) , h ) NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT ncases = int ( raw_input ( ) ) NEW_LINE for ncase in xrange ( 1 , ncases + 1 ) : NEW_LINE INDENT n , x , y = map ( int , raw_input ( ) . split ( ) ) NEW_LINE print " Case ▁ # % d : ▁ % .8lf " % ( ncase , solve ( n , x , y ) ) NEW_LINE DEDENT DEDENT


tcs = int ( input ( ) ) NEW_LINE binom = [ [ 1 ] ] NEW_LINE for i in range ( 1 , 5001 ) : NEW_LINE INDENT binom . append ( [ ] ) NEW_LINE binom [ - 1 ] . append ( binom [ - 2 ] [ 0 ] / 2 ) NEW_LINE for j in range ( 1 , i ) : NEW_LINE INDENT binom [ - 1 ] . append ( ( binom [ - 2 ] [ j - 1 ] + binom [ - 2 ] [ j ] ) / 2 ) NEW_LINE DEDENT binom [ - 1 ] . append ( binom [ - 2 ] [ - 1 ] / 2 ) NEW_LINE DEDENT for i in range ( len ( binom ) ) : NEW_LINE INDENT assert ( len ( binom [ i ] ) == i + 1 ) NEW_LINE for j in range ( 1 , len ( binom [ i ] ) ) : NEW_LINE INDENT binom [ i ] [ j ] += binom [ i ] [ j - 1 ] ; NEW_LINE DEDENT DEDENT for tc in range ( 1 , tcs + 1 ) : NEW_LINE INDENT n , x , y = ( int ( i ) for i in input ( ) . split ( ' ▁ ' ) ) NEW_LINE level = ( abs ( x ) + y ) // 2 NEW_LINE l = 0 NEW_LINE while n > 0 : NEW_LINE INDENT k = 4 * l + 1 NEW_LINE if n >= k : NEW_LINE INDENT if level == l : NEW_LINE INDENT print ( " Case ▁ # % d : ▁ 1.0" % tc ) NEW_LINE break NEW_LINE DEDENT n -= k NEW_LINE DEDENT else : NEW_LINE INDENT if level == l : NEW_LINE INDENT if y <= n - 1 - 2 * l : NEW_LINE INDENT print ( " Case ▁ # % d : ▁ 1.0" % tc ) NEW_LINE DEDENT elif y >= min ( 2 * l , n ) : NEW_LINE INDENT print ( " Case ▁ # % d : ▁ 0.0" % tc ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Case ▁ # % d : ▁ % .15f " % ( tc , 1 - binom [ n ] [ y ] ) ) NEW_LINE DEDENT break NEW_LINE DEDENT n = 0 NEW_LINE DEDENT l += 1 NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Case ▁ # % d : ▁ 0.0" % tc ) NEW_LINE DEDENT DEDENT


def parse ( inFile ) : NEW_LINE INDENT return tuple ( inFile . getInts ( ) ) NEW_LINE DEDENT import sys NEW_LINE sys . setrecursionlimit ( 2000 ) NEW_LINE a_cache = { } NEW_LINE def ans ( r , num ) : NEW_LINE INDENT if not a_cache . has_key ( ( r , num ) ) : NEW_LINE INDENT if ( num == 0 ) : NEW_LINE INDENT return 1.0 NEW_LINE DEDENT if ( num == r ) : NEW_LINE INDENT return 1.0 / ( 1 << r ) NEW_LINE DEDENT a_cache [ ( r , num ) ] = ( ans ( r - 1 , num - 1 ) + ans ( r - 1 , num ) ) / 2 NEW_LINE DEDENT return a_cache [ ( r , num ) ] NEW_LINE DEDENT def solve ( ( N , X , Y ) ) : NEW_LINE INDENT if ( X <= 0 ) : NEW_LINE INDENT X = - X NEW_LINE DEDENT lvl = ( X + Y ) / 2 NEW_LINE if ( N >= 2 * lvl * lvl + 3 * lvl + 1 ) : NEW_LINE INDENT return "1" NEW_LINE DEDENT if ( N <= 2 * ( lvl - 1 ) * ( lvl - 1 ) + 3 * ( lvl - 1 ) + 1 ) : NEW_LINE INDENT return "0" NEW_LINE DEDENT if ( X == 0 ) : NEW_LINE INDENT return "0" NEW_LINE DEDENT r = N - ( 2 * ( lvl - 1 ) * ( lvl - 1 ) + 3 * ( lvl - 1 ) + 1 ) NEW_LINE if ( r <= Y ) : NEW_LINE INDENT return "0" NEW_LINE DEDENT if ( r >= Y + 2 * lvl + 1 ) : NEW_LINE INDENT return "1" NEW_LINE DEDENT return str ( ans ( r , Y + 1 ) ) NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT from GCJ import GCJ NEW_LINE GCJ ( parse , solve , " / Users / lpebody / gcj / 2013_1b / b " , " B " ) . run ( ) NEW_LINE DEDENT


from __future__ import division NEW_LINE import sys NEW_LINE vstup = map ( int , sys . stdin . read ( ) . split ( ) ) NEW_LINE t = vstup . pop ( 0 ) NEW_LINE def level ( x , y ) : NEW_LINE INDENT return ( y + abs ( x ) ) // 2 + 1 NEW_LINE DEDENT def findout ( n , x , y ) : NEW_LINE INDENT x = abs ( x ) NEW_LINE numfull = 0 NEW_LINE fullsize = 1 NEW_LINE while fullsize <= n : NEW_LINE INDENT numfull += 1 NEW_LINE n -= fullsize NEW_LINE fullsize += 4 NEW_LINE DEDENT if level ( x , y ) <= numfull : NEW_LINE INDENT return 1.0 NEW_LINE DEDENT if n == 0 : NEW_LINE INDENT return 0.0 NEW_LINE DEDENT if level ( x , y ) != numfull + 1 or x == 0 : NEW_LINE INDENT return 0.0 NEW_LINE DEDENT fullsize -= 1 NEW_LINE half = fullsize // 2 NEW_LINE want = y + 1 NEW_LINE dp = [ [ 0.0 ] * ( half + 1 ) , None ] NEW_LINE dp [ 0 ] [ 0 ] = 1.0 NEW_LINE for i in xrange ( n ) : NEW_LINE INDENT oi = i % 2 NEW_LINE ni = 1 - oi NEW_LINE dp [ ni ] = [ 0.0 ] * ( half + 1 ) NEW_LINE for on in xrange ( half + 1 ) : NEW_LINE INDENT off = i - on NEW_LINE if on == half : dp [ ni ] [ on ] += dp [ oi ] [ on ] NEW_LINE elif off == half : dp [ ni ] [ on + 1 ] += dp [ oi ] [ on ] NEW_LINE else : NEW_LINE INDENT dp [ ni ] [ on ] += dp [ oi ] [ on ] / 2 NEW_LINE dp [ ni ] [ on + 1 ] += dp [ oi ] [ on ] / 2 NEW_LINE DEDENT DEDENT DEDENT res = 0.0 NEW_LINE for on in xrange ( half + 1 ) : NEW_LINE INDENT if on >= want : res += dp [ n % 2 ] [ on ] NEW_LINE DEDENT return res NEW_LINE DEDENT for tc in xrange ( t ) : NEW_LINE INDENT n = vstup . pop ( 0 ) NEW_LINE x = vstup . pop ( 0 ) NEW_LINE y = vstup . pop ( 0 ) NEW_LINE print " Case ▁ # { } : ▁ { : . 9f } " . format ( tc + 1 , findout ( n , x , y ) ) NEW_LINE DEDENT


import java . io . * ; import java . util . * ; public class Main { static PrintWriter out ; static StreamTokenizer in ; static int next ( ) throws Exception { in . nextToken ( ) ; return ( int ) in . nval ; } public static void main ( String [ ] args ) throws Exception { out = new PrintWriter ( System . out ) ; in = new StreamTokenizer ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; int tests = next ( ) ; int m = 11000 ; double [ ] [ ] c = new double [ m ] [ m ] ; c [ 0 ] [ 0 ] = 1 ; for ( int i = 1 ; i < m ; i ++ ) { c [ i ] [ 0 ] = c [ i ] [ i ] = c [ i - 1 ] [ 0 ] / 2 ; for ( int j = 1 ; j < i ; j ++ ) c [ i ] [ j ] = ( c [ i - 1 ] [ j ] + c [ i - 1 ] [ j - 1 ] ) / 2 ; } for ( int test = 1 ; test <= tests ; test ++ ) { int n = next ( ) ; int x = Math . abs ( next ( ) ) ; int y = Math . abs ( next ( ) ) ; int level = ( x + y ) / 2 ; int sum = 0 ; int lev = 0 ; for ( ; ; lev ++ ) { sum += 4 * lev + 1 ; if ( sum >= n ) break ; } int kol = n - sum + 4 * lev + 1 ; double answ = 0 ; if ( level == lev ) { if ( x == 0 ) { if ( kol == 4 * lev + 1 ) answ = 1 ; } else { for ( int i = 0 ; i <= kol ; i ++ ) if ( i + Math . max ( 0 , kol - i - 2 * lev ) > y ) { answ += c [ kol ] [ i ] ; } } } else if ( level < lev ) answ = 1 ; out . print ( " Case ▁ # " + test + " : ▁ " ) ; out . println ( answ ) ; } out . close ( ) ; } }


import java . io . * ; import java . util . * ;   public class RoadConstruction { public static void main ( String [ ] args ) { try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; BufferedWriter writer = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) { Set < Integer > notAllowed = new HashSet < > ( ) ; int [ ] nm = Arrays . stream ( reader . readLine ( ) . split ( " ▁ " ) ) . mapToInt ( Integer :: parseInt ) . toArray ( ) ; for ( int i = 0 ; i < nm [ 1 ] ; i ++ ) { int [ ] uv = Arrays . stream ( reader . readLine ( ) . split ( " ▁ " ) ) . mapToInt ( Integer :: parseInt ) . toArray ( ) ; notAllowed . add ( uv [ 0 ] ) ; notAllowed . add ( uv [ 1 ] ) ; } for ( int i = 1 ; i <= nm [ 0 ] ; i ++ ) { if ( ! notAllowed . contains ( i ) ) { writer . write ( ( nm [ 0 ] - 1 ) + " \n " ) ; for ( int j = 1 ; j <= nm [ 0 ] ; j ++ ) { if ( j != i ) { writer . write ( i + " ▁ " + j + " \n " ) ; } } break ; }   }   } catch ( IOException e ) { } }   }

n , m = map ( int , input ( ) . split ( ) ) L = [ 0 ] * nfor i in range ( m ) : a , b = map ( int , input ( ) . split ( ) ) L [ a - 1 ] = - 1 L [ b - 1 ] = - 1 central = 0 for i in range ( n ) : if L [ i ] == 0 : central = i + 1 breakprint ( n - 1 ) for i in range ( 1 , n + 1 ) : if i != central : print ( central , i ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) g = [ set ( ) for i in range ( n ) ] for i in range ( m ) : a , b = map ( int , input ( ) . split ( ) ) a -= 1 b -= 1 g [ a ] . add ( b ) g [ b ] . add ( a ) for i in range ( n ) : ok = True for j in range ( n ) : if i == j : continue if i in g [ j ] : ok = False break if ok : print ( n - 1 ) for j in range ( n ) : if i != j : print ( i + 1 , j + 1 ) quit ( ) NEW_LINE


R = lambda : map ( int , input ( ) . split ( ) ) n , m = R ( ) a = set ( range ( 1 , n + 1 ) ) for i in range ( m ) : a = a - set ( R ( ) ) a = list ( a ) [ 0 ] print ( n - 1 ) for i in range ( 1 , n + 1 ) : if i != a : print ( a , i ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) g = [ 0 ] * ( n + 1 ) for k in range ( m ) : a , b = map ( int , input ( ) . split ( ) ) g [ a ] = 1 g [ b ] = 1   c = 0 for k in range ( 1 , len ( g ) ) : if g [ k ] == 0 : c = k break   print ( n - 1 ) for k in range ( 1 , len ( g ) ) : if k == c : continue print ( c , k ) NEW_LINE


import sys   input = sys . stdin . readline   n , m = map ( int , input ( ) . split ( ) )     f = [ - 1 ] * ( n + 1 )     u = { }   for j in range ( m ) : a , b = map ( int , input ( ) . split ( ) )   u [ a ] = 1 u [ b ] = 1   f [ a ] = b f [ b ] = a   x = - 1 for j in range ( 1 , n + 1 ) :   if j not in u : x = j break   d = [ ]   for j in range ( 1 , n + 1 ) : if j != x : d . append ( [ x , j ] )   print ( len ( d ) )   for j in d : print ( * j ) NEW_LINE


import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; import java . lang . Math ; public class Account { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] [ ] path = new int [ n + 1 ] [ n + 1 ] ;


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


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


import java . io . * ; import java . util . StringTokenizer ;   public class _140B implements Runnable { private BufferedReader in ; private StringTokenizer tok ;   private Object solve ( ) throws IOException { int n = nextInt ( ) ; int [ ] [ ] rs = new int [ n ] [ n ] ; int [ ] p = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { rs [ i ] [ j ] = nextInt ( ) ; } } for ( int i = 0 ; i < n ; i ++ ) { p [ i ] = nextInt ( ) ; } int [ ] z = new int [ n + 1 ] ; for ( int i = 1 ; i < n ; i ++ ) { for ( int j = 0 ; j < i ; j ++ ) { if ( p [ j ] < p [ i ] ) { if ( z [ p [ i ] ] == 0 ) { z [ p [ i ] ] = p [ j ] ; } else { z [ p [ i ] ] = - 1 ; break ; } } } } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( rs [ i ] [ j ] != i + 1 && ( z [ rs [ i ] [ j ] ] == 0 || z [ rs [ i ] [ j ] ] == i + 1 ) ) { sb . append ( rs [ i ] [ j ] ) ; if ( i < n - 1 ) { sb . append ( ' ▁ ' ) ; } break ; } } } return sb ; }

n = int ( input ( ) )   frnd = [ list ( map ( int , input ( ) . split ( ) ) ) for _ in range ( n ) ] ara = list ( map ( int , input ( ) . split ( ) ) )   pref = [ 0 ] * ( n + 1 ) ans = [ 0 ] * n   for i in range ( n ) : pref [ ara [ i ] ] = i     def ok ( val , row ) : for x in ara : if x - 1 == row : continue if x < val : return 0 if x == val : return 1     for ro in range ( n ) : for x in frnd [ ro ] : if x - 1 == ro : continue if ok ( x , ro ) : ans [ ro ] = x break   for i in range ( n ) : print ( ans [ i ] , end = ' ▁ ' ) print ( )     NEW_LINE


import sysfrom itertools import * from math import * def solve ( ) : n = int ( input ( ) ) tab = [ list ( map ( int , input ( ) . split ( ) ) ) for _ in range ( n ) ] alex = list ( map ( int , input ( ) . split ( ) ) ) willget = [ [ 0 ] * n for _ in range ( n ) ] has = list ( ) for row in range ( n ) : hasrow = list ( ) for val in alex : if val <= row + 1 : hasrow . append ( val ) has . append ( hasrow ) NEW_LINE


import sysfrom itertools import * from math import * def solve ( ) : n = int ( input ( ) ) tab = [ list ( map ( int , input ( ) . split ( ) ) ) for _ in range ( n ) ] alex = list ( map ( int , input ( ) . split ( ) ) ) has = list ( ) for row in range ( n ) : hasrow = list ( ) for val in alex : if val <= row + 1 : hasrow . append ( val ) has . append ( hasrow ) for friend in range ( 1 , n + 1 ) : NEW_LINE


def f ( ) : t = [ 0 ] * n for i , j in enumerate ( input ( ) . split ( ) ) : t [ int ( j ) - 1 ] = i return tn = int ( input ( ) ) p = [ f ( ) for i in range ( n ) ] s = f ( ) for x , t in enumerate ( p ) : i = j = x < 1 for y in range ( n ) : if x != y and s [ y ] < s [ i ] : i = y if t [ i ] < t [ j ] : j = i print ( j + 1 ) NEW_LINE


n = int ( input ( ) ) arr = [ list ( map ( int , input ( ) . split ( ) ) ) for _ in range ( n + 1 ) ] res = [ 0 ] * nfor i in range ( n ) : p = [ 0 ] * ( n + 1 ) for j in range ( n ) : p [ arr [ i ] [ j ] ] = j u , t , b = 0 , int ( 1e5 ) , int ( 1e5 ) for x in arr [ n ] : if x != i + 1 and x < b : if p [ x ] < t : u , t = x , p [ x ] b = x res [ i ] = uprint ( * res ) NEW_LINE


import java . util . Scanner ;   public class Palindromic_Twist { public static void main ( String [ ] args ) { Scanner obj = new Scanner ( System . in ) ; int T ; String t = " " ; t = obj . nextLine ( ) ; T = Integer . parseInt ( t ) ; while ( T > 0 ) { String z = obj . nextLine ( ) ; int n = Integer . parseInt ( z ) ; String s = obj . nextLine ( ) ; int i = 0 ; int j = s . length ( ) - 1 ; while ( i < j && i < s . length ( ) && j < s . length ( ) ) { if ( s . charAt ( i ) == s . charAt ( j ) ) { i ++ ; j -- ; } else { if ( s . charAt ( i ) + 1 == s . charAt ( j ) + 1 || s . charAt ( i ) - 1 == s . charAt ( j ) - 1 || s . charAt ( i ) + 1 == s . charAt ( j ) - 1 || s . charAt ( i ) - 1 == s . charAt ( j ) + 1 ) { i ++ ; j -- ; } else i = j + 5 ;   } } if ( n % 2 != 0 ) if ( i == j ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; else if ( i == j + 1 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; T -- ; } } }

t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) s = str ( input ( ) ) flag = True for i in range ( n ) : c1 = ord ( s [ i ] ) - ord ( ' a ' ) c2 = ord ( s [ n - 1 - i ] ) - ord ( ' a ' ) if c1 == c2 or abs ( c1 - c2 ) == 2 : pass else : flag = False break if flag : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) s = input ( ) if n == 0 : print ( " YES " ) else : count = 0 for i in range ( n // 2 ) : if ord ( s [ i ] ) - ord ( s [ n - 1 - i ] ) == 2 or s [ i ] == s [ n - 1 - i ] or ord ( s [ i ] ) - ord ( s [ n - 1 - i ] ) == - 2 : count += 1 if ( count == ( n // 2 ) ) : print ( " YES " ) else : print ( " NO " ) NEW_LINE


t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) s = input ( ) i , j = 0 , n - 1 ans = ' YES ' while i < j : if abs ( ord ( s [ i ] ) - ord ( s [ j ] ) ) not in [ 0 , 2 ] : ans = ' NO ' break i += 1 j -= 1 print ( ans ) NEW_LINE


from __future__ import division , print_functionfrom collections import * from math import * from itertools import * from time import timeimport osimport sysfrom io import BytesIO , IOBase   if sys . version_info [ 0 ] < 3 : from __builtin__ import xrange as range from future_builtins import ascii , filter , hex , map , oct , zip   ''' Notes : n ▁ = ▁ number ▁ of ▁ ballsk ▁ = ▁ attract ▁ powerni ▁ = ▁ ball ' s ▁ coords '''   def main ( ) : n = int ( input ( ) ) s = input ( ) if s == s [ : : - 1 ] : print ( ' YES ' ) return opposite = s [ : : - 1 ] for i in range ( n // 2 ) : first = ord ( s [ i ] ) second = ord ( opposite [ i ] ) if first == second : continue if first - 1 == second + 1 : continue if first + 1 == second - 1 : continue else : print ( ' NO ' ) return print ( ' YES ' )             NEW_LINE


import java . util . * ;   public class Test { public static void main ( String [ ] args ) {   Scanner input = new Scanner ( System . in ) ; int t = input . nextInt ( ) ;   while ( t -- > 0 ) { int n = input . nextInt ( ) ; char [ ] s = input . next ( ) . toCharArray ( ) ;   int l = ( ( n & 1 ) == 1 ) ? n / 2 : n / 2 - 1 ; int r = n / 2 ; boolean res = true ;   while ( l >= 0 ) { int temp = Math . abs ( ( int ) s [ l ] - ( int ) s [ r ] ) ; if ( temp != 2 && temp != 0 ) { res = false ; break ; } l -- ; r ++ ; } System . out . println ( res ? " YES " : " NO " ) ; } } }


import java . util . * ; import java . lang . Math . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . nextLine ( ) ; int t = Integer . parseInt ( a ) ; while ( t > 0 ) { String b = sc . nextLine ( ) ; int n = Integer . parseInt ( b ) ; String s = sc . nextLine ( ) ; int c = 0 ; for ( int i = 0 ; i < s . length ( ) / 2 ; i ++ ) { if ( ( Math . abs ( s . charAt ( i ) - s . charAt ( s . length ( ) - 1 - i ) ) != 0 ) && ( Math . abs ( s . charAt ( i ) - s . charAt ( s . length ( ) - 1 - i ) ) != 2 ) ) { c = 1 ; break ; } } if ( c == 1 ) { System . out . println ( " NO " ) ; } else { System . out . println ( " YES " ) ; } t -- ; } } }


import java . util . * ; import java . io . * ; public class Main { public static int mod = 1000000007 ; public static void solve ( InputReader in ) { int n = in . readInt ( ) ; char s [ ] = in . readString ( ) . toCharArray ( ) ; int left = 0 ; int right = n - 1 ; for ( ; left + 1 <= right ; left ++ , right -- ) { if ( s [ left ] == s [ right ] ) continue ; if ( s [ left ] == ' a ' ) { if ( s [ left ] + 1 != s [ right ] - 1 ) { System . out . println ( " NO " ) ; return ; } } if ( s [ left ] == ' z ' ) { if ( s [ left ] - 1 != s [ right ] + 1 ) { System . out . println ( " NO " ) ; return ; } } if ( s [ left ] > s [ right ] ) { if ( s [ left ] - 1 != s [ right ] + 1 ) { System . out . println ( " NO " ) ; return ; } } else if ( s [ left ] < s [ right ] ) { if ( s [ left ] + 1 != s [ right ] - 1 ) { System . out . println ( " NO " ) ; return ; } } } System . out . println ( " YES " ) ; } public static void main ( String [ ] args ) {


import java . util . Scanner ;   public class _0689PalindromicTwist {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int cases = sc . nextInt ( ) ; while ( cases > 0 ) { int n = sc . nextInt ( ) ; sc . nextLine ( ) ; String input = sc . nextLine ( ) ; boolean flag = true ; for ( int i = 0 ; i < n / 2 ; i ++ ) { int first = input . charAt ( i ) ; int last = input . charAt ( n - 1 - i ) ; if ( first == last ) { continue ; } else if ( Math . abs ( first - last ) == 1 ) { flag = false ; break ; } else if ( Math . abs ( first - last ) == 2 ) { continue ; } else { flag = false ; break ; } } if ( flag ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } cases -- ; } }   }


import java . util . * ; import java . io . * ; public class MainClass { public static void main ( String [ ] args ) throws IOException { Reader in = new Reader ( ) ; int n = in . nextInt ( ) ; Game [ ] A = new Game [ n ] ; for ( int i = 0 ; i < n ; i ++ ) A [ i ] = new Game ( in . nextInt ( ) , i ) ; Arrays . sort ( A ) ; int [ ] ans = new int [ n ] ; for ( int i = 1 ; i < n ; i ++ ) ans [ A [ i ] . idx ] = A [ i - 1 ] . val ; ans [ A [ 0 ] . idx ] = A [ n - 1 ] . val ; for ( int i = 0 ; i < n ; i ++ ) System . out . print ( ans [ i ] + " ▁ " ) ; } } class Game implements Comparable < Game > { int val ; int idx ;   public Game ( int val , int idx ) { this . val = val ; this . idx = idx ; }   @ Override public int compareTo ( Game game ) { return this . val - game . val ; } } class Reader { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din ; private byte [ ] buffer ; private int bufferPointer , bytesRead ;   public Reader ( ) { din = new DataInputStream ( System . in ) ; buffer = new byte [ BUFFER_SIZE ] ; bufferPointer = bytesRead = 0 ; }   public Reader ( String file_name ) throws IOException { din = new DataInputStream ( new FileInputStream ( file_name ) ) ; buffer = new byte [ BUFFER_SIZE ] ; bufferPointer = bytesRead = 0 ; }   public String readLine ( ) throws IOException { byte [ ] buf = new byte [ 64 ] ;

input ( ) t = list ( map ( int , input ( ) . split ( ) ) ) s = sorted ( t ) for q in t : print ( s [ s . index ( q ) - 1 ] ) NEW_LINE


from collections import defaultdict , dequeimport sysimport bisectinput = sys . stdin . readline     n = int ( input ( ) ) a = [ int ( i ) for i in input ( ) . split ( ) if i != ' \n ' ] ind = defaultdict ( int ) for i in range ( n ) : ind [ a [ i ] ] = ia . sort ( ) ans = [ 0 ] * ( n ) for i in range ( n ) : index = ind [ a [ ( i + 1 ) % n ] ] ans [ index ] = a [ i ] print ( * ans ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) arr = sorted ( a , reverse = True ) ans = [ None for x in range ( n ) ] for i in range ( n - 1 ) : pos = a . index ( arr [ i ] ) ans [ pos ] = arr [ i + 1 ] for i in range ( n ) : if ans [ i ] == None : ans [ i ] = arr [ 0 ] print ( * ans ) NEW_LINE


import java . io . BufferedOutputStream ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . io . Reader ; import java . util . Arrays ; import java . util . Comparator ; import java . util . StringTokenizer ;   public class B {   static final long MODULO = ( long ) ( 1e9 + 7 ) ;   public static void main ( String [ ] args ) { BufferedScanner scanner = new BufferedScanner ( ) ; PrintWriter writer = new PrintWriter ( new BufferedOutputStream ( System . out ) ) ;   int t = 1 ;


import java . io . * ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . StringTokenizer ; import java . util . List ; import java . util . * ; public class realfast implements Runnable { private static final int INF = ( int ) 1e9 ; long in = ( long ) Math . pow ( 10 , 9 ) + 7 ; long fac [ ] = new long [ 3000 ] ; public void solve ( ) throws IOException { int n = readInt ( ) ; int a [ ] = new int [ n ] ; int b [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = readInt ( ) ; b [ i ] = a [ i ] ; } Arrays . sort ( b ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] == b [ n - 1 ] ) { out . print ( b [ 0 ] + " ▁ " ) ; } else {   for ( int j = 0 ; j < n ; j ++ ) { if ( b [ j ] > a [ i ] ) { out . print ( b [ j ] + " ▁ " ) ; break ; } }   } } } public int gcd ( int a , int b ) { if ( a < b ) { int t = a ; a = b ; b = t ; } if ( a % b == 0 ) return b ; return gcd ( b , a % b ) ; } public long pow ( long n , long p , long m ) { if ( p == 0 ) return 1 ; long val = pow ( n , p / 2 , m ) ; ; val = ( val * val ) % m ; if ( p % 2 == 0 ) return val ; else return ( val * n ) % m ; }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . ArrayDeque ; import java . util . Arrays ; import java . util . HashMap ; import java . util . Random ; import java . util . StringTokenizer ; import java . util . TreeSet ;   public class Solution { public static void main ( String [ ] args ) throws IOException { FastScanner fs = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int tt = 1 ; while ( tt -- > 0 ) { int n = fs . nextInt ( ) ; int [ ] [ ] a = new int [ n ] [ 2 ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] [ 0 ] = fs . nextInt ( ) ; a [ i ] [ 1 ] = i ; } Arrays . sort ( a , ( x , y ) -> x [ 0 ] - y [ 0 ] ) ; int [ ] ans = new int [ n ] ; for ( int i = 1 ; i < n ; i ++ ) { ans [ a [ i - 1 ] [ 1 ] ] = a [ i ] [ 0 ] ; } ans [ a [ n - 1 ] [ 1 ] ] = a [ 0 ] [ 0 ] ; for ( int i = 0 ; i < n ; i ++ ) { out . print ( ans [ i ] + " ▁ " ) ; } out . println ( ) ; } out . close ( ) ; } static final Random random = new Random ( ) ; static < T > void shuffle ( T [ ] arr ) { int n = arr . length ; for ( int i = 0 ; i < n ; i ++ ) { int k = random . nextInt ( n ) ; T temp = arr [ k ] ; arr [ k ] = arr [ i ] ; arr [ i ] = temp ; } } static void ruffleSort ( int [ ] a ) { int n = a . length ;


import java . util . Scanner ;   public class B821 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; long M = in . nextInt ( ) ; long B = in . nextInt ( ) ; long max = 0 ; for ( long y = B ; y >= 0 ; y -- ) { long x = ( B - y ) * M ; long current = y * ( y + 1 ) / 2 * ( x + 1 ) + x * ( x + 1 ) / 2 * ( y + 1 ) ; max = Math . max ( max , current ) ; } System . out . println ( max ) ; }   }

ans = [ ] m , b = map ( int , input ( ) . split ( ) ) for x in range ( m * b + 1 ) : y = - x / m + b if y . is_integer ( ) : y = - x // m + b start = ( 0 + x ) * ( x + 1 ) // 2 end = ( start + y * ( x + 1 ) ) ans . append ( int ( ( start + end ) * ( y + 1 ) // 2 ) ) print ( max ( ans ) ) NEW_LINE


m , b = list ( map ( int , input ( ) . split ( ) ) )             u = 0 for j in range ( b - 1 , - 1 , - 1 ) : y = j x = m * ( b - j )   s = x * ( x + 1 ) // 2 t = y * ( y + 1 ) // 2 p = t + s + ( s ) * y + t * x if p > u : u = p   print ( u ) NEW_LINE


def get ( i , j ) : return ( i + 1 ) * ( j + 1 ) * ( i + j ) // 2   m , b = map ( int , input ( ) . split ( ) ) res = - 1 for y in range ( b ) : x = ( b - y ) * m res = max ( get ( x , y ) , res ) print ( res ) NEW_LINE


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


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . StringTokenizer ; import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . InputStream ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; BOkabeIBananovieDerevya solver = new BOkabeIBananovieDerevya ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class BOkabeIBananovieDerevya { public void solve ( int testNumber , InputReader in , PrintWriter out ) { int m , b ; m = in . nextInt ( ) ; b = in . nextInt ( ) ; long best = 0 ; for ( int y = b ; y >= 0 ; -- y ) { long x = m * ( b - y ) ; long t = 0 ; t += ( x + 1 ) * sum ( y ) + ( y + 1 ) * sum ( x ) ; best = Math . max ( best , t ) ; } out . println ( best ) ; }   long sum ( long k ) { return k * ( k + 1 ) / 2 ; }   }   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 . * ; import java . util . * ;   public class Codeforces {   public static void main ( String ... args ) { InputReader sc = new InputReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; Thread th = new Thread ( null , new Runnable ( ) { public void run ( ) { new Solver ( ) . solve ( sc , out ) ; } } , " Solver " , 1 << 24 ) ; try { th . start ( ) ; th . join ( ) ; } catch ( InterruptedException e ) { } out . close ( ) ; } }   class Solver {   public long getSum ( long x ) { if ( x == - 1 ) return 0 ; return x * ( x + 1 ) / 2 ; }   public void solve ( InputReader sc , PrintWriter out ) { long m = sc . nextInt ( ) ; long b = sc . nextInt ( ) ; long ans = 0 ; for ( long i = 0 ; i < b ; i ++ ) { long j = m * ( b - i ) ; long sum = 0 ; for ( long k = i ; k >= 0 ; k -- ) { sum += ( getSum ( k + j ) - getSum ( k - 1 ) ) ; } ans = Math . max ( ans , sum ) ; } ans = Math . max ( ans , getSum ( b - 1 ) ) ; out . println ( ans ) ; } }


import java . util . * ; import java . io . * ;   public class tr0 { static PrintWriter out ; static StringBuilder sb ; static int mod = 998244353 ; static int inf = ( int ) 1e18 ; static int [ ] col ; static int n , m ; static ArrayList < Integer > [ ] ad ; static long [ ] memo , cnt [ ] ; static ArrayList < Integer > h ; static int [ ] pos , ones ; static char [ ] [ ] g ; static boolean [ ] [ ] vis ; static boolean f ;   public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; out = new PrintWriter ( System . out ) ; int m = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; long ans = 0 ; for ( int i = 0 ; i <= b ; i ++ ) { int y = ( b - i ) * m ; long tem = y * 1l * ( i + 1 ) * ( y + 1 ) / 2 ; tem += ( y + 1 ) * 1l * i * ( i + 1 ) / 2 ; ans = Math . max ( ans , tem ) ;


import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . * ;     public class Planets {   public static void main ( String [ ] args ) {   InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader sc = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Solver solver = new Solver ( ) ;

from sys import stdin , stdoutfrom collections import defaultdictfrom heapq import heapify , heappop , heappushnmbr = lambda : int ( stdin . readline ( ) ) lst = lambda : list ( map ( int , stdin . readline ( ) . split ( ) ) ) PI = float ( ' inf ' ) def dijsktra ( ) : dist = [ PI ] * ( 1 + n ) dist [ 1 ] = 0 NEW_LINE


from heapq import * from sys import stdin , stdoutinput = stdin . readlinedef BinSearch ( li , x , len ) : i = 1 j = len while i < j : m = int ( ( i + j ) / 2 ) if x > li [ m ] : i = m + 1 else : j = m if li [ j ] == x : return j else : return None n , m = map ( int , input ( ) . split ( ) )   dist = [ 10 ** 20 for i in range ( n + 1 ) ] G = [ [ ] for i in range ( n + 1 ) ] T = [ [ None ] ]   for i in range ( m ) : u , v , w = map ( int , input ( ) . split ( ) ) G [ u ] . append ( ( v , w ) ) G [ v ] . append ( ( u , w ) ) for i in range ( n ) : x = list ( map ( int , input ( ) . split ( ) ) ) T . append ( x ) unused = [ ( 0 , 1 ) ] parent = [ - 1 for i in range ( n + 1 ) ] dist [ 1 ] = 0 min_dist = 0 nex = 1   while unused : t , nex = heappop ( unused ) if T [ nex ] [ 0 ] != 0 : j = BinSearch ( T [ nex ] , t , T [ nex ] [ 0 ] ) if j != None : while j <= T [ nex ] [ 0 ] and t == T [ nex ] [ j ] : t += 1 j += 1 for edge in G [ nex ] : to = edge [ 0 ] wt = edge [ 1 ] if t + wt < dist [ to ] : dist [ to ] = t + wt NEW_LINE


from sys import stdin , stdoutfrom collections import defaultdictfrom heapq import heapify , heappop , heappushnmbr = lambda : int ( stdin . readline ( ) ) lst = lambda : list ( map ( int , stdin . readline ( ) . split ( ) ) ) PI = float ( ' inf ' ) def dijsktra ( ) : dist = [ PI ] * ( 1 + n ) dist [ 1 ] = 0 vis = [ 0 ] * ( 1 + n ) hp = [ ] heapify ( hp ) heappush ( hp , ( 0 , 1 ) ) while hp : curDis , curNode = heappop ( hp ) if vis [ curNode ] : continue vis [ curNode ] = 1 for neigh , wt in g [ curNode ] : if vis [ neigh ] : continue eff_wt = wt if curDis in t [ curNode ] : eff_wt += t [ curNode ] [ curDis ] - curDis if curDis + eff_wt < dist [ neigh ] : dist [ neigh ] = curDis + eff_wt heappush ( hp , ( curDis + eff_wt , neigh ) ) NEW_LINE


from sys import stdin , stdoutfrom collections import defaultdictfrom heapq import heapify , heappop , heappushnmbr = lambda : int ( stdin . readline ( ) ) lst = lambda : list ( map ( int , stdin . readline ( ) . split ( ) ) ) PI = float ( ' inf ' ) def dijsktra ( ) : dist = [ PI ] * ( 1 + n ) dist [ 1 ] = 0 vis = [ 0 ] * ( 1 + n ) hp = [ ] heappush ( hp , ( 0 , 1 ) ) while hp : curDis , curNode = heappop ( hp ) if vis [ curNode ] : continue vis [ curNode ] = 1 for neigh , wt in g [ curNode ] : if vis [ neigh ] : continue eff_wt = wt if curDis in t [ curNode ] : eff_wt += t [ curNode ] [ curDis ] - curDis if curDis + eff_wt < dist [ neigh ] : dist [ neigh ] = curDis + eff_wt heappush ( hp , ( curDis + eff_wt , neigh ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . FileReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . * ; import java . io . * ; public class codeforces { static class Student { int x ; long y ;


import java . util . Scanner ;   public class P849A { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } System . out . println ( a [ 0 ] % 2 != 0 && a [ n - 1 ] % 2 != 0 && n % 2 != 0 ? " Yes " : " No " ) ; } }

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) if n % 2 == 0 or a [ 0 ] % 2 == 0 or a [ - 1 ] % 2 == 0 : print ( ' No ' ) else : print ( ' Yes ' ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) if n % 2 == 0 or a [ 0 ] % 2 == 0 or a [ - 1 ] % 2 == 0 : print ( " NO " ) else : print ( " YES " ) NEW_LINE


n = int ( input ( ) ) g = list ( map ( int , input ( ) . split ( ) ) )   if len ( g ) % 2 == 1 and g [ 0 ] % 2 == 1 and g [ - 1 ] % 2 == 1 : print ( " YES " ) else : print ( " NO " ) NEW_LINE


n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) if n % 2 == 1 and l [ 0 ] % 2 == 1 and l [ n - 1 ] % 2 == 1 : print ( ' Yes ' ) else : print ( ' No ' ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) if n % 2 == 0 : print ( ' No ' ) else : if a [ 0 ] % 2 == 0 or a [ - 1 ] % 2 == 0 : print ( ' No ' ) else : print ( ' Yes ' ) NEW_LINE


import java . io . * ; import java . util . * ;   public class Composite { static final Random random = new Random ( ) ; static PrintWriter out = new PrintWriter ( ( System . out ) ) ; static Reader sc = new Reader ( ) ;   public static void main ( String args [ ] ) throws IOException { int n = sc . nextInt ( ) ; int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; boolean f = false ; int c = 0 ; if ( n % 2 == 0 ) { System . out . println ( " no " ) ; f = true ; }   else if ( a [ 0 ] % 2 != 0 && a [ n - 1 ] % 2 != 0 ) { f = true ; System . out . println ( " yes " ) ; }   else { for ( int i = 0 ; i < n ; i ++ ) { if ( a [ 0 ] % 2 == 0 ) { f = true ; System . out . println ( " no " ) ; break ; } else if ( a [ i ] % 2 == 0 ) { c ++ ;   if ( c >= 1 ) { f = true ; System . out . println ( " No " ) ; break ; }   } else continue ; }   } if ( f == false ) System . out . println ( " yes " ) ; }


import java . io . * ; import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int arr [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } if ( arr [ 0 ] % 2 != 0 && arr [ n - 1 ] % 2 != 0 && arr . length % 2 != 0 ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }


import java . io . * ; import java . util . * ;   public class C {   public static void main ( String [ ] args ) throws IOException { BufferedReader ob = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( ob . readLine ( ) ) ; n = ( int ) Math . pow ( 2 , n + 1 ) ;

import math   def add ( n , arr ) : sumlis = [ i for i in arr ] def sumdou ( i ) : if 2 * i + 2 >= len ( arr ) : return arr [ i ] else : return sumlis [ 2 * i + 2 ] + arr [ i ] tot = 0 p2 = len ( arr ) for j in reversed ( range ( n ) ) : p1 = p2 - int ( math . pow ( 2 , j + 1 ) ) for i in range ( p1 , p2 , 2 ) : s1 = sumdou ( i ) s2 = sumdou ( i + 1 ) tot += abs ( s2 - s1 ) sumlis [ i ] = max ( s1 , s2 ) sumlis [ i + 1 ] = max ( s1 , s2 ) p2 = p1 print ( tot )   n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) add ( n , arr ) NEW_LINE


n = 2 ** ( int ( input ( ) ) + 1 ) - 1 ; a = [ 0 , 0 ] + list ( map ( int , input ( ) . split ( ) ) ) r = 0 while n > 1 : a [ n // 2 ] += max ( a [ n ] , a [ n - 1 ] ) r += abs ( a [ n ] - a [ n - 1 ] ) n -= 2 print ( r )         NEW_LINE


n = int ( input ( ) ) lst = { i + 1 : int ( x ) for i , x in enumerate ( input ( ) . split ( ) ) } lst [ 0 ] = 0 x = 2 ** ( n + 1 ) - 1 res = 0 for i in range ( n , 0 , - 1 ) : for j in range ( x - 1 , x - 2 ** i - 1 , - 2 ) : ma = max ( lst [ j ] , lst [ j - 1 ] ) mi = min ( lst [ j ] , lst [ j - 1 ] ) res += ma - mi lst [ ( j + 1 ) // 2 - 1 ] += ma x -= 2 ** iprint ( res ) NEW_LINE


n = int ( input ( ) ) lis = [ 0 ] * 2 + list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE


ans = [ ] def DFS ( x , n ) :   count = 0   stack = [ ( x , count ) ] leaf = 0 ans = 0 max1 = 0 back_stack = [ ] NEW_LINE


import java . util . * ;   public class Main {   public static void main ( String [ ] args ) {   Scanner scn = new Scanner ( System . in ) ;   int n = scn . nextInt ( ) ;   int t = ( int ) ( Math . pow ( 2 , n + 1 ) ) - 1 ;   int arr [ ] = new int [ t + 1 ] ;   for ( int i = 2 ; i <= t ; i ++ ) { arr [ i ] = scn . nextInt ( ) ; }   int ans = 0 ;   for ( int i = ( int ) Math . pow ( 2 , n ) - 1 ; i > 0 ; i -- ) {   arr [ i ] += Math . max ( arr [ 2 * i ] , arr [ 2 * i + 1 ] ) ;   ans += Math . abs ( arr [ 2 * i ] - arr [ 2 * i + 1 ] ) ; } System . out . println ( ans ) ;   }   }


import java . util . * ;   public class a {   static Scanner in = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int n = in . nextInt ( ) ; int [ ] a = new int [ ( int ) Math . pow ( 2 , n + 1 ) ] ; int [ ] c = new int [ ( int ) Math . pow ( 2 , n + 1 ) ] ; for ( int i = 2 ; i < Math . pow ( 2 , n + 1 ) ; i ++ ) { a [ i ] = in . nextInt ( ) ; } for ( int i = 2 ; i < Math . pow ( 2 , n + 1 ) ; i ++ ) { c [ i ] = a [ i ] + c [ Math . floorDiv ( i , 2 ) ] ; } long ans = 0 ; for ( int i = n ; i > 0 ; i -- ) { for ( int j = ( int ) Math . pow ( 2 , i ) ; j < Math . pow ( 2 , i + 1 ) ; j += 2 ) { c [ Math . floorDiv ( j , 2 ) ] = Math . max ( c [ j ] , c [ j + 1 ] ) ; ans += Math . abs ( c [ j ] - c [ j + 1 ] ) ; } } System . out . println ( ans ) ; } }


import java . util . * ; public class Practice { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ;   int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = sc . nextInt ( ) ;   int k = 0 ; for ( int i = 0 ; i < arr . length - 1 ; i ++ ) { if ( arr [ i ] <= arr [ i + 1 ] ) k ++ ; else break ; }   if ( k == arr . length - 1 ) System . out . println ( 0 ) ; else { boolean sorted = true ; for ( int i = k + 1 ; i < arr . length - 1 ; i ++ ) { if ( arr [ i ] <= arr [ i + 1 ] ) continue ; else { sorted = false ; break ; } }   if ( ! sorted ) System . out . println ( - 1 ) ; else if ( arr [ 0 ] >= arr [ n - 1 ] ) System . out . println ( n - k - 1 ) ; else System . out . println ( - 1 ) ; } } }

n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) if ( arr == sorted ( arr ) ) : print ( 0 ) else : f = 0 for i in range ( n - 1 ) : if ( arr [ i ] > arr [ i + 1 ] ) : f = i break k = arr [ f + 1 : ] p = k + arr [ : f + 1 ] if ( p == sorted ( arr ) ) : print ( len ( k ) ) else : print ( - 1 ) NEW_LINE


n = int ( input ( ) )   A = list ( map ( int , input ( ) . split ( ) ) ) for i in range ( n - 1 ) : if A [ i ] > A [ i + 1 ] : NEW_LINE


n = int ( input ( ' ' ) ) x = list ( map ( int , input ( ) . split ( ) ) ) if ( x == sorted ( x ) ) : print ( '0' ) else : for i in range ( 0 , len ( x ) ) : if ( x [ i ] > x [ i + 1 ] ) : c = i break b = x [ c + 1 : ] c = b + x [ : c + 1 ] if ( c == sorted ( x ) ) : print ( len ( b ) ) else : print ( ' - 1' ) NEW_LINE


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


n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) )   m = l [ 0 ] mx = l [ 0 ] k = 0j = 0 for i in range ( 1 , n ) : if l [ i ] > mx : mx = l [ i ] k = i if m < 0 or l [ i ] < m or ( l [ i ] <= m and k > j ) : m = l [ i ] j = i     flag = 0   for i in range ( j , n - 1 ) : if flag == 1 : break if l [ i + 1 ] < l [ i ] : flag = 1 break   for i in range ( j - 1 ) : if flag == 1 : break if l [ i + 1 ] < l [ i ] : flag = 1 break   if l [ 0 ] < l [ n - 1 ] and l [ 0 ] > m : flag = 1   if flag == 1 : print ( - 1 ) elif j == 0 : print ( j ) else : print ( n - j ) NEW_LINE


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


import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ;   public class Main { static int lastBefore = 0 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; List < Integer > list = new ArrayList < > ( ) ; int first_min_index = 0 ; int last_min_index = 0 ; int min = Integer . MAX_VALUE ;   for ( int i = 0 ; i < t ; i ++ ) { int toAdd = sc . nextInt ( ) ; if ( toAdd == min ) { min = toAdd ; if ( list . get ( i - 1 ) > min ) { lastBefore = i - 1 ; } last_min_index = i ; } else if ( toAdd < min ) { min = toAdd ; lastBefore = i - 1 ; first_min_index = i ; last_min_index = i ; } list . add ( toAdd ) ; } if ( canBeSorted ( list , first_min_index , last_min_index ) ) { if ( last_min_index != 0 ) { if ( last_min_index == list . size ( ) - 1 ) { if ( same ( list ) ) System . out . println ( 0 ) ; else System . out . println ( list . size ( ) - lastBefore - 1 ) ; } else { System . out . println ( list . size ( ) - first_min_index ) ; } } else { System . out . println ( 0 ) ; } } else { System . out . println ( - 1 ) ; } }   private static boolean same ( List < Integer > list ) { for ( int i = 0 ; i < list . size ( ) - 1 ; i ++ ) { int a = list . get ( i ) ; int b = list . get ( i + 1 ) ; if ( a != b ) { return false ; } } return true ; }   private static boolean canBeSorted ( List < Integer > list , int first_min_index , int last_min_index ) {   if ( list . size ( ) <= 2 ) return true ;


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

n , k = map ( int , input ( ) . split ( ) ) a = [ 0 ] + list ( map ( int , input ( ) . split ( ) ) ) freq = [ 0 ] * ( 100001 ) dist = 0 for i in range ( 1 , n + 1 ) : if freq [ a [ i ] ] == 0 : dist += 1 freq [ a [ i ] ] += 1 l = 1 r = n   if dist < k : print ( - 1 , - 1 ) else : while dist >= k and r >= l : freq [ a [ r ] ] -= 1 if freq [ a [ r ] ] == 0 : dist -= 1 r -= 1 r += 1 dist += 1   while dist >= k and l <= r : freq [ a [ l ] ] -= 1 if freq [ a [ l ] ] == 0 : dist -= 1 l += 1 l -= 1 print ( l , r ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) A = list ( map ( int , input ( ) . split ( ) ) ) C = [ 0 ] * 100001   l = 0 r = 0 p = 0   while r < n and p < k : C [ A [ r ] ] += 1 if C [ A [ r ] ] == 1 : p += 1 r += 1 if p != k : print ( ' - 1' , ' - 1' ) else : while p == k : C [ A [ l ] ] -= 1 if C [ A [ l ] ] == 0 : p -= 1 l += 1 l -= 1 print ( l + 1 , r ) NEW_LINE


n , k = list ( map ( int , input ( ) . split ( ) ) ) arr = list ( map ( int , input ( ) . split ( ) ) )   count = [ 0 ] * ( int ( 1e5 + 1 ) )   for i in arr : count [ i ] += 1   s = sum ( [ 1 if i > 0 else 0 for i in count ] ) if s < k : print ( ' - 1 ▁ - 1' ) exit ( )   r = n - 1 while True : if count [ arr [ r ] ] == 1 : s -= 1 if s < k : s += 1 break count [ arr [ r ] ] -= 1 r -= 1   l = 0 while True : if count [ arr [ l ] ] == 1 : s -= 1 if s < k : s += 1 break count [ arr [ l ] ] -= 1 l += 1   print ( l + 1 , r + 1 )   NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) q = { 0 } e = 0 l = [ ] for i in range ( n ) : if a [ i ] not in q : e += 1 q . add ( a [ i ] ) if e == k : e = 0 q = { 0 } l += [ i ] w = 10 ** 5 t = 0 for i in l : e = 0 q = { 0 } for j in range ( i , - 1 , - 1 ) : if a [ j ] not in q : e += 1 q . add ( a [ j ] ) if e == k : if w > len ( q ) : w = j + 1 t = i + 1 breakif len ( set ( a ) ) >= k : print ( w , t ) else : print ( - 1 , - 1 ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) d = { } i = 1 for x in arr : if len ( d ) == m : break d [ x ] = i i += 1 if len ( d ) == m : print ( min ( d . values ( ) ) , max ( d . values ( ) ) ) else : print ( - 1 , - 1 ) NEW_LINE


import java . io . IOException ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Scanner ;   public class Main {


import java . util . * ; import java . io . * ; import java . math . * ;   public class Practice   { static FastReader sc = new FastReader ( ) ; static int mod = ( int ) Math . pow ( 10 , 9 ) + 7 ; static long dp [ ] [ ] ;


import java . util . * ;   public class Main {   public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int k = input . nextInt ( ) ; int a [ ] = new int [ n + 1 ] ; HashMap < Integer , Integer > map = new HashMap < > ( ) ; TreeSet < Integer > set = new TreeSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = input . nextInt ( ) ; set . add ( a [ i ] ) ; } int count = 0 ; if ( set . size ( ) < k ) { System . out . println ( " - 1 ▁ - 1" ) ; return ; } int first = 1 ; int last = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ! map . containsKey ( a [ i ] ) ) { count ++ ; } map . put ( a [ i ] , map . getOrDefault ( a [ i ] , 0 ) + 1 ) ; if ( count == k ) { last = i + 1 ; break ; } } int i = 0 ; while ( i < n && map . get ( a [ i ] ) > 1 && count == k ) { map . put ( a [ i ] , map . get ( a [ i ] ) - 1 ) ; i ++ ; } System . out . println ( ( i + 1 ) + " ▁ " + last ) ; }   }


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { new Main ( ) . run ( ) ; } void run ( ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; HashSet < Integer > set = new HashSet < > ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { int num = sc . nextInt ( ) ; set . add ( num ) ; a [ i ] = num ; } if ( set . size ( ) < k ) { System . out . println ( " - 1 ▁ - 1" ) ; return ; } if ( k == 1 ) { System . out . println ( "1 ▁ 1" ) ; return ; } int add = 0 , remove = 0 ; HashMap < Integer , Integer > map = new HashMap < > ( ) ; int left = 0 , right = n ; while ( add < n ) { map . put ( a [ add ] , map . getOrDefault ( a [ add ] , 0 ) + 1 ) ; add ++ ; while ( map . size ( ) >= k ) { int tl = remove , tr = add - 1 ; if ( right - left > tr - tl ) { left = tl ; right = tr ; } map . put ( a [ remove ] , map . get ( a [ remove ] ) - 1 ) ; if ( map . get ( a [ remove ] ) == 0 ) { map . remove ( a [ remove ] ) ; } remove ++ ; } } left ++ ; right ++ ; System . out . println ( left + " ▁ " + right ) ; } }


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

n = int ( input ( ) ) ans = 0 for a in range ( 1 , n ) : ans += ( n - a ) * aprint ( ans + n ) NEW_LINE


n = int ( input ( ) ) P = 0   for i in range ( n - 1 ) : P += ( n - i - 1 ) * ( i + 1 )     print ( P + n ) NEW_LINE


n = int ( input ( ) ) suma = ( 2 * n ) - 1 las = n - 2 fir = 2 for item in range ( 1 , n - 1 ) : suma += ( fir * las ) fir += 1 las -= 1 print ( suma ) NEW_LINE


n = int ( input ( ) )   result = n   for i in range ( 1 , n ) : result += ( n - i ) * i     print ( result ) NEW_LINE


import java . util . Scanner ;   public class _0609Buttons {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int x = n ; int y = 1 ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sum += x * y ; x -- ; y ++ ; } n -- ; sum -= ( n * ( n + 1 ) ) / 2 ; System . out . println ( sum ) ; }   }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int recibido = scanner . nextInt ( ) ; int suma = 0 ; int i ; for ( i = 1 ; i <= recibido ; i ++ ) { suma += 1 + ( recibido - i ) * i ; } System . out . printf ( " % d \n " , suma ) ; } }


import java . util . * ;   public class StackBracket { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   int n = sc . nextInt ( ) ; long sum = n ; for ( int j = 1 ; j <= ( n - 1 ) ; j ++ ) { sum = sum + j * ( n - j ) ; } System . out . println ( sum ) ;             }    public static int getAns ( String s , int k , int start1 , int end1 ) {


import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int T = sc . nextInt ( ) ; while ( T -- != 0 ) { String x = sc . next ( ) ; String y = sc . next ( ) ; StringBuilder s1 = new StringBuilder ( x ) ; StringBuilder s2 = new StringBuilder ( y ) ; s1 = s1 . reverse ( ) ; s2 = s2 . reverse ( ) ; int f = s2 . indexOf ( "1" ) ; int l = s1 . indexOf ( "1" , f ) ; int k = l - f ; System . out . println ( k ) ; }   }   }

for t in range ( int ( input ( ) ) ) : x = input ( ) [ : : - 1 ] y = input ( ) [ : : - 1 ] posy = 0 while y [ posy ] != "1" : posy += 1 posx = posy while x [ posx ] != "1" : posx += 1 ans = posx - posy print ( ans ) NEW_LINE


import sys   def main ( ) : for _ in range ( int ( sys . stdin . readline ( ) . strip ( ) ) ) : x = sys . stdin . readline ( ) . strip ( ) y = sys . stdin . readline ( ) . strip ( ) pos = 0 for i in range ( len ( y ) - 1 , - 1 , - 1 ) : if y [ i ] == '1' : pos += 1 break else : pos += 1 count = 0 for i in range ( len ( x ) - pos , - 1 , - 1 ) : if x [ i ] == '1' : break else : count += 1 print ( count )                                   main ( ) NEW_LINE


import sys   T = int ( sys . stdin . readline ( ) ) for _ in range ( T ) : x = sys . stdin . readline ( ) . rstrip ( ) y = sys . stdin . readline ( ) . rstrip ( ) x , y = x [ : : - 1 ] , y [ : : - 1 ] pos_y = y . find ( "1" ) pos_x = x . find ( "1" , pos_y ) print ( pos_x - pos_y ) NEW_LINE


from sys import stdininput = stdin . readline   t = int ( input ( ) ) for _ in range ( t ) : x = input ( ) . rstrip ( ) y = input ( ) . rstrip ( ) for i in range ( len ( y ) - 1 , - 1 , - 1 ) : if y [ i ] == "1" : a = i break c = 0 for i in range ( len ( x ) - ( len ( y ) - a ) , - 1 , - 1 ) : if x [ i ] == "1" : break c += 1 print ( c ) NEW_LINE


import java . util . * ; import java . io . * ; import java . math . * ;   public class x1202A { public static void main ( String hi [ ] ) throws Exception { BufferedReader infile = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( infile . readLine ( ) ) ; int T = Integer . parseInt ( st . nextToken ( ) ) ; while ( T -- > 0 ) { char [ ] arr = infile . readLine ( ) . toCharArray ( ) ; char [ ] brr = infile . readLine ( ) . toCharArray ( ) ; int N = arr . length ; int M = brr . length ; int dist2 = 0 ; for ( int i = M - 1 ; i >= 0 ; i -- ) { if ( brr [ i ] == '1' ) break ; dist2 ++ ; } int dist = 0 ; for ( int i = N - 1 ; i >= 0 ; i -- ) { if ( arr [ i ] == '1' && dist >= dist2 ) break ; dist ++ ; } int res = dist - dist2 ; System . out . println ( res ) ; } } }


import java . util . * ; import java . lang . * ; import java . io . * ;   public class Codechef { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; int T = sc . nextInt ( ) ; sc . nextLine ( ) ; for ( int t = 0 ; t < T ; t ++ ) { StringBuilder a = new StringBuilder ( sc . nextLine ( ) ) ; a . reverse ( ) ; StringBuilder b = new StringBuilder ( sc . nextLine ( ) ) ; b . reverse ( ) ; int y = b . indexOf ( "1" ) ; int x = a . indexOf ( "1" , y ) ; out . println ( x - y ) ; } out . flush ( ) ; } }


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 ( ) ; static StringBuilder sb = new StringBuilder ( ) ;   public static void main ( String [ ] args ) throws IOException { int T = sc . nextInt ( ) ; while ( T -- > 0 ) { solve ( ) ; } System . out . print ( sb ) ; }   static void solve ( ) throws IOException {   String X = sc . next ( ) ; String Y = sc . next ( ) ;   int offset = 0 ;   while ( Y . charAt ( Y . length ( ) - 1 - offset ) == '0' ) offset ++ ; int K = 0 ; while ( X . charAt ( X . length ( ) - 1 - offset - K ) == '0' ) K ++ ;   sb . append ( K + " \n " ) ; }   static class FastScanner { public BufferedReader reader ; public StringTokenizer tokenizer ; public FastScanner ( ) { reader = new BufferedReader ( new InputStreamReader ( System . in ) , 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 ( ) ) ; } public long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } public double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } public String nextLine ( ) { try { return reader . readLine ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } }   }


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

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) n = len ( a ) a . sort ( ) ans1 = ans2 = 0 for i in range ( n ) : ans1 += abs ( a [ i ] - ( i + 1 ) * 2 ) ans2 += abs ( a [ i ] - ( 1 + i * 2 ) ) print ( min ( ans1 , ans2 ) ) NEW_LINE


n = int ( input ( ) ) * p , = map ( int , input ( ) . split ( ) ) p . sort ( ) black = sum ( abs ( i * 2 + 1 - x ) for i , x in enumerate ( p ) ) white = sum ( abs ( i * 2 + 2 - x ) for i , x in enumerate ( p ) ) print ( min ( black , white ) ) NEW_LINE


n = int ( input ( ) ) chess = list ( map ( int , input ( ) . split ( ) ) )   move1 = 0 move2 = 0   chess . sort ( )   for i in range ( len ( chess ) ) : move1 += abs ( chess [ i ] - ( i * 2 + 1 ) ) move2 += abs ( chess [ i ] - ( i * 2 + 2 ) )   print ( min ( move1 , move2 ) ) 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 ( )   n = inp ( ) p = inpl ( ) ; p . sort ( ) res = 0 for i in range ( n // 2 ) : res += abs ( p [ i ] - ( i * 2 + 2 ) ) res2 = 0 for i in range ( n // 2 ) : res2 += abs ( p [ i ] - ( i * 2 + 1 ) ) print ( min ( res , res2 ) ) NEW_LINE


n = int ( input ( ) ) p = list ( map ( int , input ( ) . split ( ) ) ) ans = 0 k = 0 p . sort ( ) for i in range ( 1 , n , 2 ) : ans += abs ( p [ i // 2 ] - i ) for i in range ( 2 , n + 1 , 2 ) : k += abs ( p [ i // 2 - 1 ] - i ) print ( min ( ans , k ) ) NEW_LINE


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


import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . * ;     public class Ecr44A {   public static void main ( String [ ] args ) {   InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader sc = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Solver solver = new Solver ( ) ;


import java . io . * ; import java . math . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws IOException { FastReader scan = new FastReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; Task solver = new Task ( ) ; ans = new StringBuilder ( ) ; int T = scan . nextInt ( ) ; for ( int tt = 0 ; tt < T ; tt ++ ) solver . solve ( tt , scan , out ) ; out . close ( ) ; } static StringBuilder ans ; static class Task { public void solve ( int testNumber , FastReader scan , PrintWriter out ) { int n = scan . nextInt ( ) ; if ( n <= 30 ) out . println ( " NO " ) ; else { out . println ( " YES " ) ; int x = n - 30 ; if ( x != 10 && x != 6 && x != 14 ) { out . println ( 6 + " ▁ " + 10 + " ▁ " + 14 + " ▁ " + x ) ; } else { out . println ( 6 + " ▁ " + 10 + " ▁ " + 15 + " ▁ " + ( x - 1 ) ) ; } } } } static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } public FastReader ( String s ) throws FileNotFoundException { br = new BufferedReader ( new FileReader ( new File ( s ) ) ) ; } 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 ; } } }

t = int ( input ( ) ) NEW_LINE for i in range ( t ) : NEW_LINE INDENT n = int ( input ( ) ) NEW_LINE if n < 31 : NEW_LINE INDENT print ( ' NO ' ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ' YES ' ) NEW_LINE a = n - 30 NEW_LINE if a != 6 and a != 10 and a != 14 : NEW_LINE INDENT print ( 6 , 10 , 14 , a ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( 6 , 10 , 15 , n - 31 ) NEW_LINE DEDENT DEDENT DEDENT


import math NEW_LINE for _ in range ( int ( input ( ) ) ) : NEW_LINE INDENT x = int ( input ( ) ) NEW_LINE if x <= 30 : NEW_LINE INDENT print ( " NO " ) NEW_LINE DEDENT elif x == 36 or x == 44 or x == 40 : NEW_LINE INDENT print ( " YES " ) NEW_LINE print ( 6 , 10 , 15 , x - 31 ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ' YES ' ) NEW_LINE print ( 6 , 10 , 14 , x - 30 ) NEW_LINE DEDENT DEDENT


for i in range ( int ( input ( ) ) ) : NEW_LINE INDENT n = int ( input ( ) ) NEW_LINE if n <= 30 : NEW_LINE INDENT print ( ' NO ' ) NEW_LINE DEDENT else : NEW_LINE INDENT if n == 36 or n == 40 or n == 44 : NEW_LINE INDENT print ( ' YES ' ) NEW_LINE print ( 6 , 10 , 15 , n - 31 ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ' YES ' ) NEW_LINE print ( 6 , 10 , 14 , n - 30 ) NEW_LINE DEDENT DEDENT DEDENT


t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : NEW_LINE INDENT n = int ( input ( ) ) NEW_LINE if ( n <= 30 ) : NEW_LINE INDENT print ( " NO " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " YES " ) NEW_LINE q = n - 30 NEW_LINE if ( q == 6 or q == 10 or q == 14 ) : NEW_LINE INDENT print ( 6 , 10 , 15 , q - 1 ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( 6 , 10 , 14 , q ) NEW_LINE DEDENT DEDENT DEDENT


n = int ( input ( ) ) NEW_LINE for _ in range ( n ) : NEW_LINE INDENT a = int ( input ( ) ) NEW_LINE if ( a < 31 ) : NEW_LINE INDENT print ( " NO " ) NEW_LINE DEDENT else : NEW_LINE INDENT k = a - 30 NEW_LINE if k != 6 and k != 14 and k != 10 : NEW_LINE INDENT print ( " YES " ) NEW_LINE print ( "6 ▁ 10 ▁ 14" , a - 30 ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " YES " ) NEW_LINE print ( "6 ▁ 10 ▁ 15" , a - 31 ) NEW_LINE DEDENT DEDENT DEDENT


import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int t = s . nextInt ( ) ; int n ; for ( int i = 0 ; i < t ; i ++ ) { n = s . nextInt ( ) ; if ( n <= 30 ) { System . out . println ( " NO " ) ; } else { System . out . println ( " YES " ) ; if ( n == 36 || n == 40 || n == 44 ) { System . out . println ( "6 ▁ " + "10 ▁ " + "15 ▁ " + Integer . toString ( n - 31 ) ) ; } else { System . out . println ( "6 ▁ " + "10 ▁ " + "14 ▁ " + Integer . toString ( n - 30 ) ) ; } } } } }


import java . io . * ; import java . math . BigInteger ; import java . util . * ; import java . util . StringTokenizer ;   public class Main {   static int MOD = ( int ) Math . pow ( 10 , 9 ) + 7 ;   public static void main ( String [ ] args ) throws IOException { FastReader fr = new FastReader ( ) ; PrintWriter pw = new PrintWriter ( System . out ) ;   double X = fr . nextDouble ( ) / fr . nextDouble ( ) ; double Y = fr . nextDouble ( ) / fr . nextDouble ( ) ;   double multiplier = ( 1 - X ) * ( 1 - Y ) ;   double sum = X * ( 1 ) / ( 1 - multiplier ) ;   pw . println ( sum ) ;   pw . close ( ) ; }   static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } st = null ; return str ; } }   }

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


def common_common ( arr ) : commonstring = ' ' if len ( arr ) > 1 and len ( arr [ 0 ] ) > 0 : for i in range ( len ( arr [ 0 ] ) ) : for j in range ( len ( arr [ 0 ] ) - i + 1 ) : if j > len ( commonstring ) and is_commonstring ( arr [ 0 ] [ i : i + j ] , arr ) : commonstring = arr [ 0 ] [ i : i + j ] return commonstring   def is_commonstring ( stringg , arr ) : if len ( arr ) < 1 and len ( stringg ) < 1 : return False for i in range ( len ( arr ) ) : if stringg not in arr [ i ] : return False return Truedef common_common ( arr ) : commonstring = ' ' if len ( arr ) > 1 and len ( arr [ 0 ] ) > 0 : for i in range ( len ( arr [ 0 ] ) ) : for j in range ( len ( arr [ 0 ] ) - i + 1 ) : if j > len ( commonstring ) and is_commonstring ( arr [ 0 ] [ i : i + j ] , arr ) : commonstring = arr [ 0 ] [ i : i + j ] return commonstring   def is_commonstring ( stringg , arr ) : if len ( arr ) < 1 and len ( stringg ) < 1 : return False for i in range ( len ( arr ) ) : if stringg not in arr [ i ] : return False return Truet = ( input ( ) . split ( maxsplit = 4 ) ) ar = [ ] for i in t : i = float ( i ) ar . append ( i ) a = ar [ 0 ] b = ar [ 1 ] c = ar [ 2 ] d = ar [ 3 ] aa = c / daaa = ( a * c ) / ( b * d ) a1 = a / ba2 = 1 - aa - a1 + aaares = 0 ret = 0 for i in range ( 10000 ) : ret = ( a2 ** i ) res = res + ret * a1 NEW_LINE


a , b , c , d = map ( int , input ( ) . split ( ) ) result = ( a * d ) / ( b * c + a * d - a * c ) print ( result ) NEW_LINE


a , b , c , d = map ( int , input ( ) . split ( ) ) print ( ( a * d ) / ( b * c + a * d - a * c ) ) NEW_LINE


a , b , c , d = map ( int , input ( ) . split ( ) ) x = a / by = c / dxx = 1 - xyy = 1 - yf = x / ( 1 - ( xx * yy ) ) print ( f ) NEW_LINE


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


import java . util . Scanner ;   public class Archer { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   double a = sc . nextInt ( ) ; double b = sc . nextInt ( ) ; double c = sc . nextInt ( ) ; double d = sc . nextInt ( ) ; double r = ( 1 - c / d ) * ( 1 - a / b ) ; System . out . println ( ( a / b ) / ( 1 - r ) ) ; } }


import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; import java . lang . Math ; public class Account { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ;


import java . util . * ; import java . io . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastScanner in = new FastScanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; new Main ( ) . run ( in , out ) ; out . close ( ) ; }   void run ( FastScanner in , PrintWriter out ) {

from collections import defaultdictn = int ( input ( ) ) u , v = defaultdict ( int ) , defaultdict ( int ) for k in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) u [ a ] += 1 if b != a : v [ b ] += 1 k = ( n - 1 ) // 2 s = any ( v [ b ] > k for b in v ) t = [ u [ a ] for a in u if u [ a ] + v [ a ] > k ] if t : print ( max ( 0 , k + 1 - max ( t ) ) ) else : print ( k + 1 if s else - 1 ) NEW_LINE


from collections import defaultdictimport mathn = int ( input ( ) ) d = defaultdict ( int ) o = defaultdict ( int ) for i in range ( n ) : x , y = map ( int , input ( ) . split ( ) ) o [ x ] += 1 d [ x ] += 1 if y != x : d [ y ] += 1 mi = 10 ** 5 + 1 for i in d : NEW_LINE


import java . io . * ; import java . util . * ; import java . lang . * ;   public class Main {   public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = in . nextInt ( ) ; HashSet < Integer > set = new HashSet < Integer > ( ) ; HashMap < Integer , Integer > fTotal = new HashMap < > ( ) ; HashMap < Integer , Integer > fUp = new HashMap < > ( ) ; HashMap < Integer , Integer > same = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int up = in . nextInt ( ) , down = in . nextInt ( ) ; set . add ( up ) ; set . add ( down ) ; add ( fUp , up ) ; add ( fTotal , up ) ; add ( fTotal , down ) ; if ( up == down ) add ( same , up ) ; } int ans = n ; for ( int ele : set ) { int cnt = fUp . getOrDefault ( ele , 0 ) ; if ( cnt >= ( n + 1 ) / 2 ) { ans = 0 ; break ; } int cntTot = fTotal . get ( ele ) ; int cntSame = same . getOrDefault ( ele , 0 ) ; if ( cntTot - cntSame >= ( n + 1 ) / 2 ) ans = Math . min ( ( ( n + 1 ) / 2 ) - cnt , ans ) ; } out . println ( ans == n ? - 1 : ans ) ; out . close ( ) ; } public static void add ( HashMap < Integer , Integer > map , int ele ) { int cnt = map . getOrDefault ( ele , 0 ) ; cnt ++ ; map . put ( ele , cnt ) ; return ; } static final Random random = new Random ( ) ;


import java . io . * ; import java . util . * ;   public class Main {   static long len [ ] = new long [ ( int ) ( 1e5 + 1 ) ] ; static String stem = " What ▁ are ▁ you ▁ doing ▁ at ▁ the ▁ end ▁ of ▁ the ▁ world ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ save ▁ us ? " ; static String string = " What ▁ are ▁ you ▁ doing ▁ while ▁ sending ▁ \" \" ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ send ▁ \" \" ? " ; static String p1 = " What ▁ are ▁ you ▁ doing ▁ while ▁ sending ▁ \" " ; static String p2 = " \" ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ send ▁ \" " ; static String p3 = " \" ? " ;   public static void main ( String [ ] args ) throws Exception { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; len [ 0 ] = stem . length ( ) ; for ( int i = 1 ; i < 55 ; i ++ ) { len [ i ] = len [ i - 1 ] * 2 + string . length ( ) ;

from functools import lru_cacheimport sys   f0 = " What ▁ are ▁ you ▁ doing ▁ at ▁ the ▁ end ▁ of ▁ the ▁ world ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ save ▁ us ? " fnext = [ ' What ▁ are ▁ you ▁ doing ▁ while ▁ sending ▁ " ' , ' " ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ send ▁ " ' , ' " ? ' ] BIG = 10 ** 20   @ lru_cache ( maxsize = None ) def flength ( n ) : if n == 0 : return len ( f0 ) else : sublen = flength ( n - 1 ) return min ( BIG , sum ( [ len ( part ) for part in fnext ] ) + 2 * sublen )   def get_char ( n , k ) : while True : if k >= flength ( n ) : return ' . ' if n == 0 : return f0 [ k ]   for part in fnext : if k < len ( part ) : return part [ k ] else : k -= len ( part )   if k < flength ( n - 1 ) : n -= 1 break else : k -= flength ( n - 1 ) q = int ( input ( ) )   for i in range ( 2 * 10 ** 5 ) : flength ( i )   for _ in range ( q ) : n , k = map ( int , input ( ) . split ( ) ) print ( get_char ( n , k - 1 ) , end = " " ) print ( " " )   NEW_LINE


s0 = ' What ▁ are ▁ you ▁ doing ▁ at ▁ the ▁ end ▁ of ▁ the ▁ world ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ save ▁ us ? ' s1 = ' What ▁ are ▁ you ▁ doing ▁ while ▁ sending ▁ " ' s2 = ' " ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ send ▁ " ' def get ( h ) : if h > 55 : return 1 << 99 return ( 143 << h ) - 68 def solve ( n , k ) : if get ( n ) <= k : return ' . ' while True : if n == 0 : return s0 [ k ] if k < 34 : return s1 [ k ] k -= 34 if k < get ( n - 1 ) : n -= 1 continue k -= get ( n - 1 ) if k < 32 : return s2 [ k ] k -= 32 if k < get ( n - 1 ) : n -= 1 else : return ' " ? ' [ k - get ( n - 1 ) ] for i in range ( int ( input ( ) ) ) : n , k = list ( map ( int , input ( ) . split ( ) ) ) print ( solve ( n , k - 1 ) , end = ' ' ) NEW_LINE


q = int ( input ( ) ) q1 = ' What ▁ are ▁ you ▁ doing ▁ at ▁ the ▁ end ▁ of ▁ the ▁ world ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ save ▁ us ? ' q2 = ' What ▁ are ▁ you ▁ doing ▁ while ▁ sending ▁ " " ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ send ▁ " " ? ' q3 = ' What ▁ are ▁ you ▁ doing ▁ while ▁ sending ▁ " ' q4 = ' " ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ send ▁ " ' q5 = ' " ? ' lq1 = len ( q1 ) lq2 = len ( q2 ) lq3 = len ( q3 ) lq4 = len ( q4 ) lq5 = len ( q5 ) lengths = [ 75 ] for i in range ( 100 ) : lengths . append ( lengths [ - 1 ] * 2 + 68 ) NEW_LINE


import syssys . setrecursionlimit ( 1500 )   s1 = " What ▁ are ▁ you ▁ doing ▁ at ▁ the ▁ end ▁ of ▁ the ▁ world ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ save ▁ us ? " a = " What ▁ are ▁ you ▁ doing ▁ while ▁ sending ▁ \ " " b = " \ " ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ send ▁ \ " " c = " \ " ? " ans = " "     def solve ( n , k ) : if n == 0 : if k >= len ( s1 ) : return " . " else : return s1 [ k ] if k < len ( a ) : return a [ k ] k -= len ( a ) prev_len = ( 2 ** ( n - 1 ) - 1 ) * ( len ( a ) + len ( b ) + len ( c ) ) + ( 2 ** ( n - 1 ) ) * len ( s1 ) if k < prev_len : return solve ( n - 1 , k ) k -= prev_len if k < len ( b ) : return b [ k ] k -= len ( b ) if k < prev_len : return solve ( n - 1 , k ) k -= prev_len if k < len ( c ) : return c [ k ] else : return " . "     for _ in range ( int ( input ( ) ) ) : n , k = list ( map ( int , input ( ) . split ( ) ) ) k -= 1 if n > 65 : m = n - 65 if k < len ( a ) * m : ans += a [ k % len ( a ) ] continue k -= len ( a ) * m n = n - m ans += solve ( n , k )   print ( ans ) NEW_LINE


s0 = ' What ▁ are ▁ you ▁ doing ▁ at ▁ the ▁ end ▁ of ▁ the ▁ world ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ save ▁ us ? ' s1 = ' What ▁ are ▁ you ▁ doing ▁ while ▁ sending ▁ " ' s2 = ' " ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ send ▁ " ' l0 = len ( s0 ) l1 = len ( s1 ) l2 = len ( s2 )   def get ( h ) : if h > 55 : return int ( 1e20 ) return ( l0 + l1 + l2 + 2 << h ) - l1 - l2 - 2 def solve ( n , k ) : if get ( n ) <= k : return ' . ' while True : if n == 0 : return s0 [ k ] if k < l1 : return s1 [ k ] k -= l1 if k < get ( n - 1 ) : n -= 1 continue k -= get ( n - 1 ) if k < l2 : return s2 [ k ] k -= l2 if k < get ( n - 1 ) : n -= 1 else : return ' " ? ' [ k - get ( n - 1 ) ]   q = int ( input ( ) ) for i in range ( q ) : n , k = list ( map ( int , input ( ) . split ( ) ) ) print ( solve ( n , k - 1 ) , end = ' ' ) NEW_LINE


import java . util . * ;   public class CF597D { static String s1 = " ▁ What ▁ are ▁ you ▁ doing ▁ at ▁ the ▁ end ▁ of ▁ the ▁ world ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ save ▁ us ? " ; static String s2 = " ▁ What ▁ are ▁ you ▁ doing ▁ while ▁ sending ▁ \" \" ? ▁ Are ▁ you ▁ busy ? ▁ Will ▁ you ▁ send ▁ \" \" ? " ; static long lmit = ( long ) 1e18 ; static long [ ] f = new long [ 100005 ] ; public static void main ( String [ ] args ) { Scanner cin = new Scanner ( System . in ) ; int T = cin . nextInt ( ) ; long x , y ; f [ 0 ] = 75 ; for ( int i = 1 ; i <= 100000 ; i ++ ) f [ i ] = min ( 68 + f [ i - 1 ] * 2 , lmit ) ; while ( T -- > 0 ) { x = cin . nextLong ( ) ; y = cin . nextLong ( ) ; if ( y > f [ ( int ) x ] ) { System . out . print ( ' . ' ) ; } else { System . out . print ( get ( x , y ) ) ; } } } private static char get ( long x , long y ) { if ( x == 0 ) return s1 . charAt ( ( int ) y ) ; if ( y <= 34 ) return s2 . charAt ( ( int ) y ) ; if ( y <= 34 + f [ ( int ) ( x - 1 ) ] || ( f [ ( int ) x ] >= lmit && f [ ( int ) ( x - 1 ) ] >= lmit ) ) return get ( x - 1 , y - 34 ) ; if ( y <= 34 + f [ ( int ) ( x - 1 ) ] + 32 ) return s2 . charAt ( ( int ) ( y - f [ ( int ) ( x - 1 ) ] ) ) ; if ( y <= 34 + 2 * f [ ( int ) ( x - 1 ) ] + 32 ) return get ( x - 1 , y - 34 - f [ ( int ) ( x - 1 ) ] - 32 ) ; return s2 . charAt ( ( int ) ( y - f [ ( int ) ( x - 1 ) ] - f [ ( int ) ( x - 1 ) ] ) ) ; } private static long min ( long a , long b ) { if ( a < b ) return a ; return b ; } }


import java . io . * ; import java . util . * ;   public class Main2 { static void main ( ) throws Exception { int n = sc . nextInt ( ) , k = sc . nextInt ( ) ; HashSet < Integer > all = new HashSet < Integer > ( ) ; while ( n -- > 0 ) { all . add ( sc . nextInt ( ) ) ; } for ( int i = k ; i <= 1000000 ; i += k ) { if ( all . contains ( i ) ) { pw . println ( " Yes " ) ; return ; } } for ( int i = 2 ; i <= k ; i ++ ) { if ( k % i == 0 ) { int cur = 1 ; while ( k % i == 0 ) { k /= i ; cur *= i ; } boolean f = false ; for ( int j = cur ; j <= 1000000 ; j += cur ) { if ( all . contains ( j ) ) { f = true ; break ; } } if ( ! f ) { pw . println ( " No " ) ; return ; } } } pw . println ( " Yes " ) ; } public static void main ( String [ ] args ) throws Exception { sc = new MScanner ( System . in ) ; pw = new PrintWriter ( System . out ) ; int tc = 1 ;

import sysfrom math import gcd , sqrt , ceil , log2from collections import defaultdict , Counter , dequefrom bisect import bisect_left , bisect_rightimport mathsys . setrecursionlimit ( 2 * 10 ** 5 + 10 ) import heapqfrom itertools import permutations   NEW_LINE


import math   def main ( ) : n , k = map ( int , input ( ) . split ( ) ) C = list ( map ( int , input ( ) . split ( ) ) ) l = C [ 0 ] for c in C : l = l * c // math . gcd ( l , c ) % k if ( l == 0 ) : print ( " Yes " ) return print ( " No " )   main ( ) NEW_LINE


import sys , mathinput = sys . stdin . readline   def getInts ( ) : return [ int ( s ) for s in input ( ) . split ( ) ]   def getInt ( ) : return int ( input ( ) )   def getStrs ( ) : return [ s for s in input ( ) . split ( ) ]   def getStr ( ) : return input ( ) . strip ( )   def listStr ( ) : return list ( input ( ) . strip ( ) )   import collections as colimport math   def solve ( ) : NEW_LINE


import sys , mathinput = sys . stdin . readline   def getInts ( ) : return [ int ( s ) for s in input ( ) . split ( ) ]   def getInt ( ) : return int ( input ( ) )   def getStrs ( ) : return [ s for s in input ( ) . split ( ) ]   def getStr ( ) : return input ( ) . strip ( )   def listStr ( ) : return list ( input ( ) . strip ( ) )   import collections as colimport math   def prime_factors ( n ) : factors = [ ] num = 0 while n % 2 == 0 : num += 1 n //= 2 if num : factors . append ( ( 2 , num ) ) i = 3 while n > 1 and i * i <= n : num = 0 while n % i == 0 : num += 1 n //= i if num : factors . append ( ( i , num ) ) i += 2 if n > 2 : factors . append ( ( n , 1 ) ) return factors   def fails ( num , C ) : for c in C : if c % num == 0 : return False return True   def solve ( ) : NEW_LINE


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

n = int ( input ( ) ) arr = tuple ( map ( int , input ( ) . split ( ) ) ) d = { } for i in arr : if i in d : d [ i ] += 1 else : d [ i ] = 1 big = 0 for i in d : if d [ i ] > big : big = d [ i ] s = { i } elif d [ i ] == big : s . add ( i ) small = { } large = { } for i in range ( n ) : if arr [ i ] not in small : small [ arr [ i ] ] = ifor i in range ( n - 1 , - 1 , - 1 ) : if arr [ i ] not in large : large [ arr [ i ] ] = ibest = n + 1 for i in s : j = small [ i ] k = large [ i ] if k - j + 1 < best : best = k - j + 1 ans = ( j + 1 , k + 1 ) print ( * ans ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) d = { }   for i in range ( n ) : if str ( a [ i ] ) not in d : d [ str ( a [ i ] ) ] = [ 1 , i , i ] else : d [ str ( a [ i ] ) ] [ 0 ] += 1 d [ str ( a [ i ] ) ] [ 2 ] = max ( d [ str ( a [ i ] ) ] [ 2 ] , i )   res = sorted ( d , key = lambda x : d [ x ] [ 0 ] , reverse = True ) maxx = d [ res [ 0 ] ] [ 0 ] ans = float ( ' inf ' ) for i in range ( len ( res ) ) : if d [ res [ i ] ] [ 0 ] < maxx : break if ans > d [ res [ i ] ] [ 2 ] - d [ res [ i ] ] [ 1 ] : ans = d [ res [ i ] ] [ 2 ] - d [ res [ i ] ] [ 1 ] ind = [ d [ res [ i ] ] [ 1 ] + 1 , d [ res [ i ] ] [ 2 ] + 1 ] print ( * ind ) NEW_LINE


from collections import Countern = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) start = dict ( [ ] ) end = dict ( [ ] ) all = [ ] count = Counter ( a ) maxx = max ( list ( count . values ( ) ) ) for j in count : if count [ j ] == maxx : all . append ( j ) for i in range ( n ) : if a [ i ] not in start : start [ a [ i ] ] = i + 1 end [ a [ i ] ] = i + 1 else : end [ a [ i ] ] = i + 1 minn = 100000000 ele = 0 for k in all : if ( end [ k ] - start [ k ] ) < minn : minn = end [ k ] - start [ k ] ele = kprint ( start [ ele ] , end [ ele ] )   NEW_LINE


n = int ( input ( ) ) arr = [ int ( x ) for x in input ( ) . split ( ) ] b = [ [ ] for x in range ( 1 , 10 ** 6 + 10 ) ] for i , j in enumerate ( arr ) : b [ j ] . append ( i ) maxi = 0 for i in b : maxi = max ( maxi , len ( i ) ) best = 10 ** 10 l , r = 1 , 1 for i in b : if len ( i ) == maxi : if i [ - 1 ] - i [ 0 ] < best : best = i [ - 1 ] - i [ 0 ] l , r = i [ 0 ] , i [ - 1 ] print ( l + 1 , r + 1 ) NEW_LINE


from collections import Countern = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) start = dict ( [ ] ) end = dict ( [ ] ) all = [ ] count = Counter ( a ) maxx = max ( list ( count . values ( ) ) ) for j in count : if count [ j ] == maxx : all . append ( j ) for i in range ( n ) : if a [ i ] not in start : start [ a [ i ] ] = i + 1 end [ a [ i ] ] = i + 1 else : end [ a [ i ] ] = i + 1 minn = 100000000 ele = 0 for k in all : if ( end [ k ] - start [ k ] ) < minn : minn = end [ k ] - start [ k ] ele = kprint ( start [ ele ] , end [ ele ] ) NEW_LINE


import java . io . * ; import java . util . * ;   public class ez { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int size = Integer . parseInt ( st . nextToken ( ) ) ; st = new StringTokenizer ( br . readLine ( ) ) ; int max = 1000000 ; int [ ] a = new int [ max ] ; int [ ] star = new int [ max ] ; int [ ] end = new int [ max ] ; for ( int i = 0 ; i < size ; i ++ ) { int num = Integer . parseInt ( st . nextToken ( ) ) ; a [ num - 1 ] ++ ; if ( star [ num - 1 ] == 0 ) star [ num - 1 ] = i + 1 ; end [ num - 1 ] = i + 1 ; } int mod = 0 ; for ( int i = 0 ; i < max ; i ++ ) { if ( a [ i ] > mod ) mod = a [ i ] ; } int s = 1 ; int e = Integer . MAX_VALUE ; for ( int i = 0 ; i < max ; i ++ ) { if ( a [ i ] == mod && end [ i ] - star [ i ] < e - s ) { s = star [ i ] ; e = end [ i ] ; } } System . out . println ( s + " ▁ " + e ) ; } }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; if ( ( a + b ) * n < c - d || ( a - b ) * n > c + d ) { System . out . println ( " NO " ) ; } else { System . out . println ( " YES " ) ; } } } }

for t in range ( int ( input ( ) ) ) : n , a , b , c , d = map ( int , input ( ) . split ( ) ) if n * ( a - b ) > ( c + d ) or n * ( a + b ) < ( c - d ) : print ( ' No ' ) else : print ( ' Yes ' ) NEW_LINE


for i in range ( int ( input ( ) ) ) : n , a , b , c , d = map ( int , input ( ) . split ( ) ) if c - d <= n * ( a + b ) and c + d >= n * ( a - b ) : print ( " Yes " ) else : print ( " No " ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n , a , b , c , d = map ( int , input ( ) . split ( ) ) u1 = a + b d1 = abs ( a - b ) u2 = c + d d2 = abs ( c - d ) z = 0 if ( n * u1 < d2 ) : z = 1 elif ( n * d1 > u2 ) : z = 1 if ( z == 1 ) : print ( " NO " ) else : print ( " YES " ) NEW_LINE


from sys import stdin , stdout   def main ( ) : for _ in range ( int ( stdin . readline ( ) ) ) : n , a , b , c , d = map ( int , stdin . readline ( ) . split ( ' ▁ ' ) ) min_mass = ( a - b ) * n max_mass = ( a + b ) * n if min_mass > c + d or max_mass < c - d : stdout . write ( ' No \n ' ) else : stdout . write ( ' Yes \n ' )   if __name__ == " _ _ main _ _ " : main ( ) NEW_LINE


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


import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int T = s . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int n = s . nextInt ( ) ; int a = s . nextInt ( ) ; int b = s . nextInt ( ) ; int c = s . nextInt ( ) ; int d = s . nextInt ( ) ; if ( Math . abs ( a - b ) * n <= c + d && ( a + b ) * n >= Math . abs ( c - d ) ) { System . out . println ( " YES " ) ; } else System . out . println ( " NO " ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ;   import javafx . util . Pair ;   public class Main { public static void main ( String [ ] args ) { FastScanner input = new FastScanner ( ) ; int a [ ] [ ] = new int [ 3 ] [ 2 ] ; a [ 0 ] [ 0 ] = input . nextInt ( ) ; a [ 0 ] [ 1 ] = input . nextInt ( ) ; a [ 1 ] [ 0 ] = input . nextInt ( ) ; a [ 1 ] [ 1 ] = input . nextInt ( ) ; a [ 2 ] [ 0 ] = input . nextInt ( ) ; a [ 2 ] [ 1 ] = input . nextInt ( ) ; Arrays . sort ( a , new Comparator < int [ ] > ( ) { @ Override public int compare ( int [ ] t , int [ ] t1 ) { if ( t [ 0 ] - t1 [ 0 ] == 0 ) { return t1 [ 1 ] - t [ 1 ] ; } return t [ 0 ] - t1 [ 0 ] ; } } ) ;


x = [ ] y = [ ]   for i in range ( 3 ) : a , b = input ( ) . split ( ) x . append ( int ( a ) ) y . append ( int ( b ) ) print ( 3 ) for i in range ( 3 ) : print ( str ( sum ( x ) - 2 * x [ i ] ) + ' ▁ ' + str ( sum ( y ) - 2 * y [ i ] ) ) NEW_LINE


x1 , y1 = map ( int , input ( ) . split ( ) ) x2 , y2 = map ( int , input ( ) . split ( ) ) x3 , y3 = map ( int , input ( ) . split ( ) ) points = [ ] points . append ( [ x1 + x2 - x3 , y1 + y2 - y3 ] ) if [ x2 + x3 - x1 , y2 + y3 - y1 ] not in points : points . append ( [ x2 + x3 - x1 , y2 + y3 - y1 ] ) if [ x3 + x1 - x2 , y3 + y1 - y2 ] not in points : points . append ( [ x3 + x1 - x2 , y3 + y1 - y2 ] ) print ( len ( points ) ) for m in points : print ( m [ 0 ] , m [ 1 ] ) NEW_LINE


import java . io . * ; import java . util . * ;   public class Solution { public static void main ( String [ ] args ) throws Exception { int [ ] a = in . readA ( ) ; int [ ] b = in . readA ( ) ; int [ ] c = in . readA ( ) ;   System . out . println ( 3 ) ; System . out . println ( getCoord ( a , b , c ) ) ; System . out . println ( getCoord ( c , a , b ) ) ; System . out . println ( getCoord ( b , c , a ) ) ; } public static String getCoord ( int [ ] a , int [ ] b , int [ ] c ) {


import java . util . * ; import java . io . * ; import java . io . * ; import java . util . * ; public class MainClass { public static void main ( String args [ ] ) throws IOException { Reader in = new Reader ( ) ; long [ ] X = new long [ 3 ] ; long [ ] Y = new long [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { X [ i ] = in . nextLong ( ) ; Y [ i ] = in . nextLong ( ) ; } int ans = 0 ; StringBuilder stringBuilder = new StringBuilder ( ) ; for ( int i = 0 ; i < 3 ; i ++ ) { for ( int j = i + 1 ; j < 3 ; j ++ ) { long xx = X [ i ] + X [ j ] - X [ 3 - i - j ] ; long yy = Y [ i ] + Y [ j ] - Y [ 3 - i - j ] ; if ( ! ( ( xx == X [ i ] && yy == Y [ i ] ) || ( yy == Y [ j ] && xx == X [ j ] ) ) ) { ans ++ ; stringBuilder . append ( xx ) . append ( " ▁ " ) . append ( yy ) . append ( " \n " ) ; } } } System . out . println ( ans ) ; System . out . println ( stringBuilder ) ; } } class Reader { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din ; private byte [ ] buffer ; private int bufferPointer , bytesRead ;   public Reader ( ) { din = new DataInputStream ( System . in ) ; buffer = new byte [ BUFFER_SIZE ] ; bufferPointer = bytesRead = 0 ; }   public Reader ( String file_name ) throws IOException { din = new DataInputStream ( new FileInputStream ( file_name ) ) ; buffer = new byte [ BUFFER_SIZE ] ; bufferPointer = bytesRead = 0 ; }   public String readLine ( ) throws IOException { byte [ ] buf = new byte [ 64 ] ;


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