import java . io . * ; import java . math . * ; import java . util . * ; public class Main { static final long MOD = 1000000007L ; static final int INF = 50000000 ; public static void main ( String [ ] args ) { FastScanner sc = new FastScanner ( ) ; PrintWriter pw = new PrintWriter ( System . out ) ; int N = sc . ni ( ) ; int M = sc . ni ( ) ; boolean [ ] [ ] adj = new boolean [ N ] [ N ] ; for ( int i = 0 ; i < M ; i ++ ) { int a = sc . ni ( ) - 1 ; int b = sc . ni ( ) - 1 ; adj [ a ] [ b ] = true ; adj [ b ] [ a ] = true ; } char [ ] vals = new char [ N ] ; Arrays . fill ( vals , ' b ' ) ; for ( int i = 0 ; i < N ; i ++ ) { for ( int j = i + 1 ; j < N ; j ++ ) { if ( ! adj [ i ] [ j ] ) { if ( vals [ i ] == ' a ' ) { vals [ j ] = ' c ' ; } else if ( vals [ i ] == ' c ' ) { vals [ j ] = ' a ' ; } else if ( vals [ j ] == ' a ' ) { vals [ i ] = ' c ' ; } else if ( vals [ j ] == ' c ' ) { vals [ i ] = ' a ' ; } else { vals [ i ] = ' a ' ; vals [ j ] = ' c ' ; } } } } for ( int i = 0 ; i < N ; i ++ ) { for ( int j = i + 1 ; j < N ; j ++ ) { int diff = Math . abs ( vals [ i ] - vals [ j ] ) ; if ( ( adj [ i ] [ j ] && diff == 2 ) || ( ! adj [ i ] [ j ] && diff <= 1 ) ) { pw . println ( " No " ) ; pw . close ( ) ; return ; } } } pw . println ( " Yes " ) ; for ( char c : vals ) pw . print ( c ) ; pw . close ( ) ; }

n , m = map ( int , input ( ) . split ( ) ) connectionList = [ ] for _ in range ( n ) : connectionList . append ( [ 0 ] * n ) for _ in range ( m ) : p , q = map ( int , input ( ) . split ( ) ) connectionList [ p - 1 ] [ q - 1 ] = 1 connectionList [ q - 1 ] [ p - 1 ] = 1 isDone = FalserefList = [ ] ans = [ " N " ] * nfor i in range ( n ) : for j in range ( n ) : if i == j : continue if connectionList [ i ] [ j ] == 0 : isDone = True refList = ( i , j ) ans [ i ] = " a " ans [ j ] = " c " break if isDone : breakif not isDone : print ( " Yes " ) print ( " a " * n ) else : isPossible = True for i in range ( n ) : if i in refList : continue else : if connectionList [ i ] [ refList [ 0 ] ] == 1 and connectionList [ i ] [ refList [ 1 ] ] == 1 : ans [ i ] = " b " elif connectionList [ i ] [ refList [ 0 ] ] == 0 and connectionList [ i ] [ refList [ 1 ] ] == 1 : ans [ i ] = " c " elif connectionList [ i ] [ refList [ 0 ] ] == 1 and connectionList [ i ] [ refList [ 1 ] ] == 0 : ans [ i ] = " a " else : isPossible = False break if not isPossible : print ( " No " ) else : isValid = True for i in range ( n ) : for j in range ( n ) : if i == j : continue if connectionList [ i ] [ j ] == 0 and ( ( ans [ i ] == " a " and ans [ j ] == " c " ) or ( ans [ j ] == " a " and ans [ i ] == " c " ) ) : pass elif ( not connectionList [ i ] [ j ] == 0 ) and ( not ( ( ans [ i ] == " a " and ans [ j ] == " c " ) or ( ans [ j ] == " a " and ans [ i ] == " c " ) ) ) : pass else : isValid = False if isValid : print ( " Yes " ) print ( ' ' . join ( ans ) ) else : print ( " No " )     NEW_LINE


def bfs ( k ) : fila = [ k ] flag = [ 0 ] * ( n + 1 ) flag [ k ] = 1 while len ( fila ) != 0 : v = fila [ 0 ] mark [ v ] = mark [ k ] fila . pop ( 0 ) for i in g [ v ] : if flag [ i ] == 0 and mark [ i ] != ' b ' : fila . append ( i ) flag [ i ] = 1 n , m = [ int ( x ) for x in input ( ) . split ( ) ] g = [ [ ] for i in range ( n + 1 ) ] res = 1 for i in range ( m ) : u , v = [ int ( x ) for x in input ( ) . split ( ) ] g [ u ] . append ( v ) g [ v ] . append ( u ) deg = [ 0 ] * ( n + 1 ) mark = [ 0 ] * ( n + 1 ) contb = 0 for i in range ( n + 1 ) : deg [ i ] = len ( g [ i ] ) if deg [ i ] == ( n - 1 ) : mark [ i ] = ' b ' contb += 1 for i in range ( 1 , n + 1 ) : if mark [ i ] == 0 : mark [ i ] = ' a ' bfs ( i ) breakfor i in range ( 1 , n + 1 ) : if mark [ i ] == 0 : mark [ i ] = ' c ' bfs ( i ) breakconta = 0 contc = 0 for i in mark : if i == ' a ' : conta += 1 for i in mark : if i == ' c ' : contc += 1 for i in range ( 1 , n + 1 ) : if mark [ i ] == ' a ' and deg [ i ] != ( conta - 1 + contb ) : res = 0 if mark [ i ] == ' c ' and deg [ i ] != ( contc - 1 + contb ) : res = 0 if mark [ i ] == 0 : res = 0 if res == 0 : print ( " No " ) else : mark . pop ( 0 ) r = ' ' . join ( mark ) print ( " Yes " ) print ( r ) NEW_LINE


from sys import stdin   n , m = [ int ( x ) for x in stdin . readline ( ) . split ( ) ]   graph = [ set ( [ y for y in range ( n ) ] ) for x in range ( n ) ] graph2 = [ set ( ) for x in range ( n ) ]   for x in range ( n ) : graph [ x ] . remove ( x )   for edge in range ( m ) : a , b = [ int ( x ) for x in stdin . readline ( ) . split ( ) ] a -= 1 b -= 1   graph [ a ] . remove ( b ) graph [ b ] . remove ( a ) graph2 [ a ] . add ( b ) graph2 [ b ] . add ( a )   notVisited = set ( [ x for x in range ( n ) ] )   val = [ - 1 for x in range ( n ) ]   for x in range ( n ) : if not graph [ x ] : val [ x ] = ' b ' notVisited . remove ( x )   valid = True   while notVisited : for x in notVisited : q = [ ( x , ' a ' ) ] break cur = 0 while q : nxt , char = q . pop ( )   if char == ' a ' : antC = ' c ' else : antC = ' a ' if nxt in notVisited : notVisited . remove ( nxt ) val [ nxt ] = char for x in graph [ nxt ] : if x in notVisited : q . append ( ( x , antC ) ) else : if val [ x ] == char : valid = False break for x in graph2 [ nxt ] : if val [ x ] == antC : valid = Falseif valid : print ( ' Yes ' ) print ( ' ' . join ( val ) ) else : print ( ' No ' ) NEW_LINE


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


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 ( ) , m = sc . nextInt ( ) ; ArrayList < HashSet < Integer > > graph = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) graph . add ( new HashSet < > ( ) ) ; while ( m -- > 0 ) { int u = sc . nextInt ( ) - 1 , v = sc . nextInt ( ) - 1 ; graph . get ( u ) . add ( v ) ; graph . get ( v ) . add ( u ) ; } int u = - 1 , v = - 1 ; outer : for ( int i = 0 ; i < n ; i ++ ) { if ( graph . get ( i ) . size ( ) < n - 1 ) { u = i ; for ( int j = 0 ; j < n ; j ++ ) { if ( i == j ) continue ; else if ( ! graph . get ( i ) . contains ( j ) ) { v = j ; break outer ; } } } }


import java . io . * ; import java . util . * ;   public class GraphAndString { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader inp = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Solver solver = new Solver ( ) ; solver . solve ( inp , out ) ; out . close ( ) ; }   static class Solver {   HashMap < Integer , ArrayList < Integer > > g ; int [ ] s ; boolean [ ] v ; boolean p = true ;   private void dfs ( int node , int val ) { if ( v [ node ] ) return ; v [ node ] = true ; int newVal = ( val == 3 ) ? 1 : 3 ; for ( int n : g . get ( node ) ) { if ( s [ n ] == val ) p = false ; else s [ n ] = newVal ; if ( ! v [ n ] ) dfs ( n , newVal ) ; } } private void solve ( InputReader inp , PrintWriter out ) { int n = inp . nextInt ( ) , m = inp . nextInt ( ) ; boolean [ ] [ ] adj = new boolean [ n ] [ n ] ; g = new HashMap < > ( ) ; for ( int i = 0 ; i < m ; i ++ ) { int a = inp . nextInt ( ) - 1 ; int b = inp . nextInt ( ) - 1 ; adj [ a ] [ b ] = true ; adj [ b ] [ a ] = true ; }   for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { if ( ! adj [ i ] [ j ] ) { if ( ! g . containsKey ( i ) ) g . put ( i , new ArrayList < > ( ) ) ; if ( ! g . containsKey ( j ) ) g . put ( j , new ArrayList < > ( ) ) ; g . get ( i ) . add ( j ) ; g . get ( j ) . add ( i ) ; } } }


import java . io . PrintWriter ; import java . util . Scanner ;    public class LightMatrix { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out , true ) ; int N = in . nextInt ( ) ; String [ ] board = new String [ N ] ; for ( int i = 0 ; i < N ; i ++ ) board [ i ] = in . next ( ) ; int res = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int count = 0 ; for ( int j = 0 ; j < N ; j ++ ) if ( board [ j ] . equals ( board [ i ] ) ) count ++ ; res = Math . max ( res , count ) ; } out . println ( res ) ; out . close ( ) ; System . exit ( 0 ) ; } }

n = int ( input ( ) )   columns = [ ] rows = [ ]   for r in range ( n ) : row = input ( ) rows . append ( row ) columnsneeded = [ i for i in range ( n ) if list ( row ) [ i ] == '0' ] columns . append ( columnsneeded )   res = [ ] for mvmt in columns : bigcnt = 0   for ro in rows : cnt = 0   for sweep in mvmt : if ro [ sweep ] == '0' : cnt += 1   elif ro [ sweep ] == '1' : continue   for nonsweep in [ bruh for bruh in range ( n ) if bruh not in mvmt ] : if ro [ nonsweep ] == '1' : cnt += 1   elif ro [ nonsweep ] == '0' : continue   if cnt == n : bigcnt += 1   res . append ( bigcnt )     print ( max ( res ) )     NEW_LINE


from collections import defaultdict n = int ( input ( ) ) a = [ ] k1 = [ ] c = 0 m = 0 for i in range ( n ) : a1 = list ( map ( str , input ( ) ) ) a . append ( a1 ) for i in range ( n ) : k = [ ] c = 0 for j in range ( n ) : if a [ i ] [ j ] == '0' : k . append ( j + 1 ) else : c += 1 if ( c == n ) : m += 1 if ( len ( k ) > 0 ) : r = int ( ' ' . join ( map ( str , k ) ) ) k1 . append ( r ) freq = defaultdict ( int ) ans = 0 for i in k1 : freq [ i ] += 1 ans = max ( ans , freq [ i ] ) if ( m > ans ) : print ( m ) else : print ( ans ) 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 NEW_LINE


n = int ( input ( ) )   a = [ ]   for i in range ( n ) : a . append ( input ( ) )   res = 0 for i in range ( n ) : count = 0 for j in range ( n ) : if a [ i ] == a [ j ] : count += 1 res = max ( res , count )   print ( res ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   public class Solution {    public static void main ( String [ ] args ) { FastReader fr = new FastReader ( ) ; int n = fr . nextInt ( ) ; int gmax = Integer . MIN_VALUE ; String [ ] s = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { s [ i ] = fr . next ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { int locamax = 0 ; for ( int j = i ; j < n ; j ++ ) { if ( s [ i ] . equals ( s [ j ] ) ) locamax ++ ; } if ( locamax > gmax ) gmax = locamax ; } System . out . println ( gmax ) ; } } class Pair { int val ; int idx ; Pair ( int val , int idx ) { this . val = val ; this . idx = idx ; } } class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } }


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


import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) {

from sys import stdin , stdout , setrecursionlimitsetrecursionlimit ( 10 ** 5 ) from collections import defaultdictnmbr = lambda : int ( stdin . readline ( ) ) lst = lambda : list ( map ( int , stdin . readline ( ) . split ( ) ) ) PI = float ( ' inf ' ) def dfs ( src ) : vis [ src ] = 1 for neigh in g [ src ] : if neigh < src : if not vis [ neigh ] : dfs ( neigh ) dp [ src ] = max ( dp [ src ] , 1 + dp [ neigh ] ) for _ in range ( 1 ) : NEW_LINE


from collections import defaultdict   graph = defaultdict ( list ) n , m = list ( map ( int , input ( ) . split ( ) ) ) for i in range ( m ) : v , u = list ( map ( int , input ( ) . split ( ) ) ) graph [ v ] . append ( u ) graph [ u ] . append ( v ) dp = [ 1 ] * ( n + 1 ) ans = len ( graph [ 1 ] ) for i in range ( 2 , n + 1 ) : for v in graph [ i ] : if v < i : dp [ i ] = max ( dp [ i ] , dp [ v ] + 1 ) ans = max ( ans , dp [ i ] * len ( graph [ i ] ) )   print ( ans ) NEW_LINE


from sys import stdin , setrecursionlimit   setrecursionlimit ( 100000 )     class Graph : def __init__ ( self , No_of_nodes ) : self . n = No_of_nodes self . adj = [ [ ] for i in range ( self . n ) ]   def addEdge ( self , a , b ) : self . adj [ a ] . append ( b ) self . adj [ b ] . append ( a ) count [ a ] [ 0 ] += 1 count [ b ] [ 0 ] += 1     def solve ( start ) : for i in g . adj [ start ] : if i < start : dp [ start ] = max ( dp [ start ] , dp [ i ] + 1 ) return dp [ start ]     n , m = map ( int , stdin . readline ( ) . split ( ) ) g = Graph ( n ) count = [ [ 0 , i ] for i in range ( n ) ] dp = [ 1 ] * nfor i in range ( m ) : a , b = map ( int , stdin . readline ( ) . split ( ) ) a -= 1 b -= 1 g . addEdge ( a , b ) for i in range ( n ) : solve ( i ) ans = - 1000 for i in range ( n ) : if dp [ i ] != - 1 : ans = max ( ans , ( dp [ i ] ) * len ( g . adj [ i ] ) ) print ( ans ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) )   G = [ [ ] for i in range ( n ) ] for i in range ( m ) : a , b = map ( int , input ( ) . split ( ) ) G [ a - 1 ] . append ( b - 1 ) G [ b - 1 ] . append ( a - 1 )   max_dist = 0 dist = [ 0 ] * nfor v in range ( n ) : dist [ v ] = 1 for u in G [ v ] : if ( u < v ) : dist [ v ] = max ( dist [ v ] , dist [ u ] + 1 ) ; max_dist = max ( max_dist , dist [ v ] * len ( G [ v ] ) ) ;   print ( max_dist ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) A = [ [ ] for _ in range ( n + 1 ) ] B = [ 0 for _ in range ( n + 1 ) ] for i in range ( m ) : u , v = map ( int , input ( ) . split ( ) ) if u > v : u , v = v , u A [ u ] . append ( v ) B [ u ] += 1 B [ v ] += 1 C = [ 0 for _ in range ( n + 1 ) ] X = B [ 1 ] for u in range ( 1 , n + 1 ) : for v in A [ u ] : C [ v ] = max ( C [ v ] , C [ u ] + 1 ) X = max ( X , ( C [ v ] + 1 ) * B [ v ] ) print ( X ) NEW_LINE


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


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . * ; import java . io . BufferedReader ; import java . io . InputStreamReader ;   public class First {   public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ;

def gcd ( a , b ) : if b == 0 : return a return gcd ( b , a % b ) n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) c = 0 f = 0 if 1 in l : print ( n - l . count ( 1 ) ) else : while True : c += 1 for i in range ( n - c ) : a = gcd ( l [ i ] , l [ i + 1 ] ) if a == 1 : f = 1 break l [ i ] = a if f == 1 : break if c == n : break if f == 0 : print ( - 1 ) else : print ( c + n - 1 ) NEW_LINE


def gcd ( a , b ) : while b : a %= b a , b = b , a return an = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) g = l [ 0 ] for i in range ( 1 , n ) : g = gcd ( g , l [ i ] ) if g != 1 : print ( - 1 ) else : a = l . count ( 1 ) if a > 0 : print ( n - a ) else : ans = float ( ' inf ' ) for i in range ( n ) : g = l [ i ] for j in range ( i + 1 , n ) : g = gcd ( g , l [ j ] ) if g == 1 : d = j - i + n - 1 NEW_LINE


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


import java . io . * ; import java . util . * ;     public class Main { public static int [ ] a = new int [ 2020 ] ; public static int gcd ( int a , int b ) { if ( a == 0 ) return b ; if ( b == 0 ) return a ; if ( a > b ) return gcd ( a % b , b ) ; return gcd ( b % a , a ) ; } public static void main ( String args [ ] ) { Scanner in ; PrintStream out ; try { in = new Scanner ( new FileInputStream ( " java . in " ) ) ; out = new PrintStream ( " java . out " ) ; } catch ( FileNotFoundException e ) { in = new Scanner ( new BufferedInputStream ( System . in ) ) ; out = System . out ; } int n = in . nextInt ( ) ; int cntOne = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { a [ i ] = in . nextInt ( ) ; if ( a [ i ] == 1 ) cntOne ++ ; } if ( cntOne > 0 ) { out . println ( n - cntOne ) ; return ; } int ans = - 1 ; for ( int i = 1 ; i <= n ; i ++ ) { int c = 0 ; for ( int j = i ; j <= n ; j ++ ) { if ( j == i ) c = a [ i ] ; else c = gcd ( c , a [ j ] ) ; if ( c == 1 ) { if ( ans == - 1 ) ans = j - i + n - 1 ; else ans = Math . min ( ans , j - i + n - 1 ) ; } } } out . println ( ans ) ; } }


import java . io . * ; import java . util . * ;   public class YaroslavPermutations_296A { public static void main ( String [ ] args ) throws IOException { FastReader fr = new FastReader ( ) ; PrintWriter pr = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ; int n = fr . nextInt ( ) ; PriorityQueue < Pair > pq = new PriorityQueue < > ( ( a , b ) -> b . y - a . y ) ; Map < Integer , Integer > map = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int add = fr . nextInt ( ) ; map . putIfAbsent ( add , 0 ) ; map . put ( add , map . get ( add ) + 1 ) ; }   for ( Map . Entry < Integer , Integer > a : map . entrySet ( ) ) { if ( a . getValue ( ) > ( n + 1 ) / 2 ) { pr . println ( " NO " ) ; pr . close ( ) ; return ; } }   pr . println ( " YES " ) ; pr . close ( ) ; }   static class Pair { int x , y ; public Pair ( int x , int y ) { this . x = x ; this . y = y ; } }   static int toInt ( String s ) { return Integer . parseInt ( s ) ; }   static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) throws FileNotFoundException { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }

def solution ( ) : n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) )   count = { } for i in arr : if i not in count : count [ i ] = 1 else : count [ i ] += 1   maxi = n / 2 if int ( maxi ) != maxi : maxi = int ( maxi ) + 1 mx = 0 for i in count : mx = max ( mx , count [ i ] ) if mx <= maxi : print ( ' YES ' ) else : print ( ' NO ' )     return 	 	       solution ( ) NEW_LINE


from collections import Countern = int ( input ( ) ) NEW_LINE


n = int ( input ( ) ) array = input ( ) . split ( ) c = ( n + 1 ) / 2 most_repeated = max ( set ( array ) , key = array . count ) counter = 0   for i in array : if ( i == most_repeated ) : counter += 1 else : continue   if ( c <= counter and n % 2 == 0 ) : print ( " NO " ) elif ( c < counter and n % 2 != 0 ) : print ( " NO " ) else : print ( " YES " ) NEW_LINE


from collections import Counter   n = int ( input ( ) ) x = list ( map ( int , input ( ) . split ( ) ) )   c = Counter ( x ) if 2 * max ( c . values ( ) ) > n + 1 : print ( " NO " ) else : print ( " YES " ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) flag = 0 dic = { } for i in a : if ( i not in dic ) : dic [ i ] = 1 else : dic [ i ] += 1 m = max ( dic . values ( ) )   if ( n == 1 ) : print ( " YES " ) elif ( n % 2 == 1 ) : if ( m > ( n // 2 ) + 1 ) : print ( ' NO ' ) else : print ( ' YES ' ) else : if ( m > ( n // 2 ) ) : print ( ' NO ' ) else : print ( ' YES ' ) NEW_LINE


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


import java . util . * ; import java . math . * ; public class YaroslavPermutation { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int size = sc . nextInt ( ) ; int temp = size ; int [ ] arr = new int [ 1001 ] ; while ( temp -- > 0 ) { arr [ sc . nextInt ( ) ] ++ ; } Arrays . sort ( arr ) ; if ( arr [ 1000 ] == 1 ) System . out . println ( " YES " ) ; else { for ( int i = 0 ; i < 1001 ; i ++ ) { if ( arr [ i ] > ( ( size + 1 ) / 2 ) ) { System . out . println ( " NO " ) ; return ; } } System . out . println ( " YES " ) ; } } }


import java . util . HashMap ; import java . util . Scanner ;   public class A296 { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; HashMap < Integer , Integer > amounts = new HashMap < > ( ) ; int n = s . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int a = s . nextInt ( ) ; amounts . put ( a , amounts . containsKey ( a ) ? amounts . get ( a ) + 1 : 1 ) ;   } boolean answer = true ; for ( int i : amounts . values ( ) ) { if ( i > ( n + 1 ) / 2f ) { answer = false ; break ; } } System . out . println ( answer ? " YES " : " NO " ) ; } }


import java . lang . * ; import java . util . * ; import java . io . * ;   public class CodeforcesB {   public void solve ( ) throws IOException { FastScanner fs = new FastScanner ( ) ; StringBuilder ans = new StringBuilder ( " " ) ; long n = fs . nextLong ( ) , d = fs . nextLong ( ) , m = fs . nextLong ( ) , l = fs . nextLong ( ) ; long x = 0 ; while ( x * d <= ( n - 1 ) * m + l ) { long h = x * d % m ; if ( h > l ) break ; x += ( l - h ) / d + 1 ; } ans . append ( x * d ) ; System . out . println ( ans ) ; } public static void main ( String [ ] args ) throws IOException { try { new CodeforcesB ( ) . solve ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ;   } } static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } } }

n , d , m , l = list ( map ( int , input ( ) . split ( ) ) ) a = 0 x = 0 for i in range ( n ) : x += ( ( l - a ) // d + 1 ) * d if x % m > l : break a = x % mprint ( x ) NEW_LINE


import systry : fin = open ( ' in ' ) except : fin = sys . stdininput = fin . readline   n , d , m , l = map ( int , input ( ) . split ( ) ) cur = 0 R = Nonefor i in range ( n ) : R = i * m + l NEW_LINE


import osimport sysfrom io import BytesIO , IOBasefrom typing import Textfrom collections import *     '''  2 ▁ 2 ▁ 5 ▁ 3 1 ▁ : ▁ 0,32 ▁ : ▁ 5 ,     ''' def main ( ) : n , d , m , l = map ( int , input ( ) . split ( ) ) Coordinate = 0 for i in range ( n ) : left = i * m right = i * m + l if ( Coordinate < left ) : print ( Coordinate ) exit ( 0 ) NumberOfMoves = ( ( right - Coordinate ) // d ) + 1 Coordinate += NumberOfMoves * d NEW_LINE


import java . util . * ;   public class CodeForces18B { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; long n = input . nextInt ( ) ; long d = input . nextInt ( ) ; long m = input . nextInt ( ) ; long l = input . nextInt ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { long s1 = ( i - 1 ) * m + l ; long s2 = i * m ; long s3 = ( s1 / d ) * d + d ; if ( i == n || s3 < s2 ) { System . out . println ( s3 ) ; return ; } } } }


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


import java . util . * ; import java . util . Scanner ; import java . io . * ; import javax . lang . model . util . ElementScanner6 ; import static java . lang . System . out ; import java . util . Stack ; import java . util . Queue ; import java . util . LinkedList ;   public class B18 {   static int mod = ( int ) ( 1e9 + 7 ) ; static long MOD = ( long ) ( 1e9 + 7 ) ; static FastReader in = new FastReader ( ) ; static PrintWriter pr = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; public static void main ( String args [ ] ) {   int tc = 1 ;


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

n , k = map ( int , input ( ) . split ( ) ) ah = 2 * nl = list ( map ( int , input ( ) . split ( ) ) ) i = 1 while i < ah : if k == 0 : break if l [ i ] - l [ i - 1 ] > 1 and l [ i ] - l [ i + 1 ] > 1 : l [ i ] -= 1 k -= 1   i += 1 for j in l : print ( j , end = ' ▁ ' ) NEW_LINE


nk = input ( ) . strip ( ) . split ( ' ▁ ' ) n = int ( nk [ 0 ] ) k = int ( nk [ 1 ] )   pks = input ( ) . strip ( ) . split ( ' ▁ ' ) pks = [ int ( p ) for p in pks ]     for i in range ( 1 , 2 * n , 2 ) : if pks [ i ] - 1 > pks [ i - 1 ] and pks [ i ] - 1 > pks [ i + 1 ] : pks [ i ] -= 1 k -= 1 if k == 0 : breakfor i in range ( 2 * n + 1 ) : print ( pks [ i ] , end = ' ▁ ' ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) arr = input ( ) . split ( ) original = [ ] count = 0 for i in range ( len ( arr ) ) : if ( i % 2 != 0 and count < k and int ( arr [ i ] ) - 1 > int ( arr [ i + 1 ] ) and int ( arr [ i ] ) - 1 > int ( arr [ i - 1 ] ) ) : original . append ( int ( arr [ i ] ) - 1 ) count += 1 else : original . append ( int ( arr [ i ] ) ) print ( " ▁ " . join ( map ( str , original ) ) ) NEW_LINE


inn = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) mnts = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) pks = inn [ 0 ] cngd = inn [ 1 ] k = [ ] for i in range ( 1 , len ( mnts ) - 1 ) : if mnts [ i ] > ( mnts [ i - 1 ] + 1 ) and mnts [ i ] > ( mnts [ i + 1 ] + 1 ) : k . append ( i ) for j in range ( cngd ) : mnts [ k [ j ] ] = mnts [ k [ j ] ] - 1 print ( " ▁ " . join ( map ( str , mnts ) ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) arr = [ int ( x ) for x in input ( ) . split ( ) ]   NEW_LINE


import java . util . * ; public class square { public static void main ( String ar [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , k = sc . nextInt ( ) ; int [ ] height = new int [ 2 * n + 1 ] ; for ( int i = 0 ; i <= 2 * n ; i ++ ) height [ i ] = sc . nextInt ( ) ; for ( int i = 1 ; i <= 2 * n ; i += 2 ) { if ( height [ i ] - Math . max ( height [ i - 1 ] , height [ i + 1 ] ) >= 2 ) { height [ i ] -- ; k -- ; } if ( k == 0 ) break ; } for ( int x : height ) System . out . print ( x + " ▁ " ) ; System . out . println ( ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class MountainScenery {   public static void main ( String [ ] args ) { FastReader reader = new FastReader ( ) ;   int n = reader . nextInt ( ) ; int k = reader . nextInt ( ) ; int size = 2 * n + 1 ; int [ ] segment = new int [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { segment [ i ] = reader . nextInt ( ) ; }   for ( int i = 1 ; i < size ; i += 2 ) { int current = segment [ i ] ; int previous = segment [ i - 1 ] ; int next = segment [ i + 1 ] ; if ( current - 1 > previous && current - 1 > next ) { segment [ i ] -= 1 ; k -- ; } if ( k == 0 ) break ; } for ( int i = 0 ; i < size ; i ++ ) { System . out . print ( segment [ i ] + " ▁ " ) ; } System . out . println ( ) ; }   static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }


# include < bits / stdc ++ . h > using namespace std ; int main ( ) {

from math import gcd NEW_LINE def lcm ( a , b ) : return ( a * b ) // gcd ( a , b ) NEW_LINE i = 0 NEW_LINE a , b = map ( int , input ( ) . split ( ) ) NEW_LINE first = Falsesecond = False NEW_LINE masha = 0 NEW_LINE dasha = 0 NEW_LINE while i < lcm ( a , b ) : if NEW_LINE first : masha += b - ( i % b ) NEW_LINE i += b - ( i % b ) elif second : dasha += a - ( i % a ) NEW_LINE i += a - ( i % a ) NEW_LINE if i % a == 0 and i % b == 0 : if NEW_LINE a > b : first = True NEW_LINE second = False else : first = False NEW_LINE second = True elif first : second = True NEW_LINE first = False else : first = True NEW_LINE second = False NEW_LINE if masha > dasha : NEW_LINE INDENT print ( " Dasha " ) elif dasha > masha : NEW_LINE print ( " Masha " ) else : NEW_LINE print ( " Equal " ) NEW_LINE DEDENT


def mcd ( a , b ) : while NEW_LINE b != 0 : a , b = b , a % b NEW_LINE return a   datos = input ( ) . split ( ) NEW_LINE d = int ( datos [ 0 ] ) NEW_LINE m = int ( datos [ 1 ] )   mcd = mcd ( d , m ) NEW_LINE if abs ( d - m ) == 1 or d - m == mcd or m - d == mcd : NEW_LINE INDENT print ( ' Equal ' ) elif d - m > 0 : NEW_LINE print ( ' Masha ' ) else : NEW_LINE print ( ' Dasha ' ) NEW_LINE DEDENT


import java . io . * ; import java . util . * ;   public class Trains { static long gcd ( long a , long b ) { if ( b == 0 ) return a ; else return gcd ( b , a % b ) ; }   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; long a = in . nextInt ( ) ; long b = in . nextInt ( ) ; long m = ( a * b ) ; long aa = m / a ; long bb = m / b ; if ( a < b ) { if ( gcd ( a , b ) > 1 ) aa -= gcd ( a , b ) ; else aa -- ; } else { if ( gcd ( a , b ) > 1 ) bb -= gcd ( a , b ) ; else bb -- ; } if ( aa == bb ) out . println ( " Equal " ) ; else if ( aa > bb ) out . println ( " Dasha " ) ; else out . println ( " Masha " ) ; out . close ( ) ; } }


# include < bits / stdc ++ . h > using namespace std ;  # define int long long # define ull unsigned long long # define ld long double # define mem ( a , b ) memset ( a , ( b ) , sizeof ( a ) ) # define rep ( i , j , k ) for ( int i = j ; i < k ; ++ i ) # define rrep ( i , j , k ) for ( int i = j ; i > k ; -- i ) # define all ( cont ) cont . begin ( ) , cont . end ( ) # define rall ( cont ) cont . end ( ) , cont . begin ( ) # define foreach ( i , a ) for ( auto i : a ) # define forEach ( it , l ) for ( auto it = l . begin ( ) ; it != l . end ( ) ; it ++ ) # define in ( A , B , C ) assert ( B <= A && A <= C ) # define debug ( a ) cout << # a << " : ▁ " << a << endl # define flag ( n ) cout << " here ▁ " << n << endl # define w ( x ) int x ; cin >> x ; while ( x -- ) # define mp make_pair # define pb push_back  # define endl ' \n ' ; # define io ios_base :: sync_with_stdio ( false ) ; cin . tie ( NULL ) ; cout . tie ( NULL ) ;    # define TRACE # ifdef TRACE # define see ( ... ) __f ( # __VA_ARGS__ , __VA_ARGS__ ) ; template < typename Arg1 > void __f ( const char * name , Arg1 && arg1 ) { cerr << name << " ▁ : ▁ " << arg1 << endl ; } template < typename Arg1 , typename ... Args > void __f ( const char * names , Arg1 && arg1 , Args && ... args ) { const char * comma = strchr ( names + 1 , ' , ' ) ; cerr . write ( names , comma - names ) << " ▁ : ▁ " << arg1 << " ▁ | ▁ " ; __f ( comma + 1 , args ... ) ; } # else # endif   const int POSITIVE_INFINITY = 9223372036854775807 ; const int NEGATIVE_INFINITY = - 9223372036854775807 ; const ld PI = acos ( - 1.0 ) ; const int MOD = 1000000007 ; const int INF = 1e18 ; const int N = 1e6 + 5 ;    int32_t main ( ) { io ;


import java . util . Scanner ; public class CodeForces { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = sc . nextInt ( ) ; String s = " " ; for ( int j = 0 ; j < n ; j ++ ) { s += sc . next ( ) ; } boolean isTrue = true ; while ( s . length ( ) > 0 ) { String s1 = s . substring ( 0 , 1 ) ; int count = 0 ; for ( int j = 0 ; j < s . length ( ) ; j ++ ) { if ( s1 . equals ( s . substring ( j , j + 1 ) ) ) count ++ ; } s = s . replace ( s1 , " " ) ; if ( count >= n ) { if ( n % 2 == 0 ) { if ( count % 2 != 0 ) isTrue = false ; } else { if ( count % n != 0 ) isTrue = false ; } } else { isTrue = false ; break ; } } if ( isTrue ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } } }

t = int ( input ( ) ) NEW_LINE while t : NEW_LINE INDENT n = int ( input ( ) ) NEW_LINE s = " " NEW_LINE for i in range ( 0 , n ) : NEW_LINE INDENT s += str ( input ( ) ) NEW_LINE DEDENT s = sorted ( s ) NEW_LINE c = True NEW_LINE for i in range ( ord ( s [ 0 ] ) , ord ( s [ len ( s ) - 1 ] ) + 1 ) : NEW_LINE INDENT if s . count ( chr ( i ) ) % n != 0 : NEW_LINE INDENT c = False NEW_LINE break NEW_LINE DEDENT DEDENT if c == True : NEW_LINE INDENT print ( " YES " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " NO " ) NEW_LINE DEDENT t -= 1 NEW_LINE DEDENT


from collections import Counter NEW_LINE for i in range ( int ( input ( ) ) ) : NEW_LINE INDENT s = ' ' NEW_LINE n = int ( input ( ) ) NEW_LINE for j in range ( n ) : NEW_LINE INDENT s += input ( ) NEW_LINE DEDENT s = list ( s ) NEW_LINE cun = Counter ( ) NEW_LINE cun . update ( s ) NEW_LINE res = 0 NEW_LINE for k in cun : NEW_LINE INDENT if ( cun [ k ] % n == 0 ) : NEW_LINE INDENT res += 1 NEW_LINE DEDENT DEDENT if ( res == len ( cun ) ) : NEW_LINE INDENT print ( ' YES ' ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " NO " ) NEW_LINE DEDENT DEDENT


t = int ( input ( ) ) NEW_LINE for i in range ( t ) : NEW_LINE INDENT d = { } NEW_LINE n = int ( input ( ) ) NEW_LINE for j in range ( n ) : NEW_LINE INDENT s = input ( ) NEW_LINE for letter in s : NEW_LINE INDENT if letter in d : NEW_LINE INDENT d [ letter ] += 1 NEW_LINE DEDENT else : NEW_LINE INDENT d [ letter ] = 1 NEW_LINE DEDENT DEDENT DEDENT all_count = True NEW_LINE for k in d . values ( ) : NEW_LINE INDENT if k % n != 0 : NEW_LINE INDENT all_count = False NEW_LINE DEDENT DEDENT if not all_count : NEW_LINE INDENT print ( " no " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " yes " ) NEW_LINE DEDENT DEDENT


from collections import Counter NEW_LINE t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : NEW_LINE INDENT n = int ( input ( ) ) NEW_LINE c = Counter ( ) NEW_LINE for i in range ( n ) : NEW_LINE INDENT s = input ( ) NEW_LINE for j in s : NEW_LINE INDENT c [ j ] += 1 NEW_LINE DEDENT DEDENT f = 0 NEW_LINE for i in c : NEW_LINE INDENT if ( c [ i ] % n != 0 ) : NEW_LINE INDENT f = 1 NEW_LINE break NEW_LINE DEDENT DEDENT if ( f == 0 ) : NEW_LINE INDENT print ( " YES " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " NO " ) NEW_LINE DEDENT DEDENT


import sys NEW_LINE input = sys . stdin . readline NEW_LINE import math NEW_LINE for _ in range ( int ( input ( ) ) ) : NEW_LINE INDENT n = int ( input ( ) ) NEW_LINE s = " " NEW_LINE for i in range ( n ) : NEW_LINE INDENT s += input ( ) NEW_LINE DEDENT b = [ 0 ] * 200 NEW_LINE for i in s : NEW_LINE INDENT b [ ord ( i ) ] += 1 NEW_LINE DEDENT ok = 1 NEW_LINE for i in range ( len ( b ) ) : NEW_LINE INDENT if b [ i ] % n != 0 : NEW_LINE INDENT ok = 0 NEW_LINE DEDENT DEDENT if ok == 0 : NEW_LINE INDENT print ( " NO " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " YES " ) NEW_LINE DEDENT DEDENT


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; for ( int i = 0 ; i < a ; i ++ ) { int n = sc . nextInt ( ) ; int [ ] arr = new int [ 26 ] ; for ( int j = 0 ; j < n ; j ++ ) { String s = sc . next ( ) ; for ( int k = 0 ; k < s . length ( ) ; k ++ ) { int as = s . charAt ( k ) - ' a ' ; arr [ as ] += 1 ; } } boolean c = false ; for ( int j = 0 ; j < 26 ; j ++ ) { if ( arr [ j ] % n != 0 ) { c = true ; break ; } else { c = false ; } } System . out . println ( ! c ? " YES " : " NO " ) ; } } }


import java . util . * ; public class question { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; for ( int l = 0 ; l < t ; l ++ ) { int n = sc . nextInt ( ) ; HashMap < Character , Integer > h = new HashMap < > ( ) ; int count = 0 , e = 0 ; for ( int k = 0 ; k < n ; k ++ ) { String s = sc . next ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char ch = s . charAt ( i ) ; if ( ! h . containsKey ( ch ) ) h . put ( ch , 1 ) ; else { int v = h . get ( ch ) + 1 ; h . put ( ch , v ) ; } } } for ( char ch : h . keySet ( ) ) { if ( h . get ( ch ) % n == 0 ) count ++ ; else { e ++ ; System . out . println ( " NO " ) ; break ; } } if ( e == 0 ) System . out . println ( " YES " ) ; } } }


# include < bits / stdc ++ . h > using namespace std ;  # define fastio ios_base :: sync_with_stdio ( false ) ; cin . tie ( NULL ) ; cout . tie ( NULL ) ; # define fr ( i , k ) for ( i = 0 ; i < k ; i ++ ) # define deb ( x ) cerr << # x << " ▁ ▁ = ▁ " << x << endl ; # define deb2 ( x , y ) cerr << # x << " ▁ = ▁ " << x << " ▁ ▁ " << # y << " ▁ = ▁ " << y << endl ; # define print ( x ) for ( auto k : x ) cout << k << " ▁ " ; cout << endl ; # define SZ ( x ) ( x ) . size ( ) ; # define ll long long # define mod 1000000007 # define ff first # define ss second # define pb push_back # define em emplace_back # define ulli unsigned long long int # define inf 1e18 # define endl " \n " typedef vector < vector < ll >> vvll ; typedef vector < ll > vll ; typedef vector < pair < ll , ll >> vpll ; typedef pair < ll , ll > pll ; typedef vector < bool > vb ; void solve ( ) ; void pre ( ) ;    int main ( ) { fastio ; # ifndef ONLINE_JUDGE freopen ( " input . txt " , " r " , stdin ) ; freopen ( " output . txt " , " w " , stdout ) ; # endif   ll t ; t = 1 ;   cin >> t ; for ( ll test = 1 ; test <= t ; test ++ ) {

import bisectimport collectionsimport copyimport functoolsimport heapqimport itertoolsimport mathimport randomimport reimport sysimport timeimport stringfrom typing import Listsys . setrecursionlimit ( 99999 )   for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) if n < 5 : print ( "0 ▁ 0 ▁ 0" ) continue g , s , b = 0 , 0 , 0 score = [ [ arr [ 0 ] , 1 ] ] for c in arr [ 1 : ] : if c == score [ - 1 ] [ 0 ] : score [ - 1 ] [ 1 ] += 1 else : score . append ( [ c , 1 ] )   g = score [ 0 ] [ 1 ] j = 1 while s <= g and j < len ( score ) : s += score [ j ] [ 1 ] j += 1 while j < len ( score ) and ( g + s + b + score [ j ] [ 1 ] ) <= n // 2 : b += score [ j ] [ 1 ] j += 1 if g > 0 and s > 0 and b > 0 and g < s and g < b : print ( g , s , b ) continue else : print ( "0 ▁ 0 ▁ 0" ) continue NEW_LINE


from sys import stdininput = stdin . readline for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) p = list ( map ( int , input ( ) . split ( ) ) ) l , cou , x = p [ 0 ] , 1 , [ ] for i in range ( 1 , n // 2 + 1 ) : if l != p [ i ] : l = p [ i ] x . append ( cou ) cou = 0 cou += 1 if len ( x ) < 3 : print ( 0 , 0 , 0 ) else : a , b , c , fl = x [ 0 ] , 0 , 0 , 0 for j in range ( 1 , len ( x ) ) : if not fl : b += x [ j ] else : c += x [ j ] if b > a : fl = 1 if a < b and a < c : print ( a , b , c ) else : print ( 0 , 0 , 0 ) NEW_LINE


import java . util . * ; public class BoboniuLikestoColorBalls { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { long r = sc . nextLong ( ) , g = sc . nextLong ( ) , b = sc . nextLong ( ) , w = sc . nextLong ( ) , c = 0 , c1 = 0 ; if ( r % 2 == 0 && r > 0 ) c ++ ; if ( g % 2 == 0 && g > 0 ) c ++ ; if ( b % 2 == 0 && b > 0 ) c ++ ; if ( r == 0 ) c1 ++ ; if ( g == 0 ) c1 ++ ; if ( b == 0 ) c1 ++ ; if ( c1 == 3 || ( c1 == 1 && c == 2 ) || ( c1 == 1 && c == 1 && w % 2 == 0 ) || ( c1 == 2 && c == 1 ) || ( c1 == 2 && c == 0 && w % 2 == 0 ) ) System . out . println ( " YES " ) ; else if ( w == 0 && c == 2 ) System . out . println ( " YES " ) ; else if ( r > 0 && b > 0 && g > 0 ) { if ( c == 3 || c == 0 || ( c == 1 && w % 2 != 0 ) || ( c == 2 && w % 2 == 0 ) ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } else System . out . println ( " NO " ) ; } } }

t = int ( input ( ) ) NEW_LINE for a in range ( t ) : NEW_LINE INDENT r , g , b , w = map ( int , input ( ) . split ( ) ) NEW_LINE flag = False NEW_LINE if ( r + g + b + w ) % 2 == 0 : NEW_LINE INDENT if r % 2 == 0 and g % 2 == 0 and b % 2 == 0 and w % 2 == 0 : NEW_LINE INDENT flag = True NEW_LINE DEDENT else : NEW_LINE INDENT while ( r > 0 and g > 0 and b > 0 ) : NEW_LINE INDENT r -= 1 NEW_LINE g -= 1 NEW_LINE b -= 1 NEW_LINE w += 3 NEW_LINE if r % 2 == 0 and g % 2 == 0 and b % 2 == 0 and w % 2 == 0 : NEW_LINE INDENT flag = True NEW_LINE DEDENT break NEW_LINE DEDENT DEDENT DEDENT else : NEW_LINE INDENT if ( r % 2 == 0 and g % 2 == 0 and b % 2 == 0 and w % 2 == 1 ) or ( r % 2 == 0 and g % 2 == 0 and b % 2 == 1 and w % 2 == 0 ) or ( r % 2 == 0 and g % 2 == 1 and b % 2 == 0 and w % 2 == 0 ) or ( r % 2 == 1 and g % 2 == 0 and b % 2 == 0 and w % 2 == 0 ) : NEW_LINE INDENT flag = True NEW_LINE DEDENT else : NEW_LINE INDENT while ( r > 0 and g > 0 and b > 0 ) : NEW_LINE INDENT r -= 1 NEW_LINE g -= 1 NEW_LINE b -= 1 NEW_LINE w += 3 NEW_LINE if ( r % 2 == 0 and g % 2 == 0 and b % 2 == 0 and w % 2 == 1 ) or ( r % 2 == 0 and g % 2 == 0 and b % 2 == 1 and w % 2 == 0 ) or ( r % 2 == 0 and g % 2 == 1 and b % 2 == 0 and w % 2 == 0 ) or ( r % 2 == 1 and g % 2 == 0 and b % 2 == 0 and w % 2 == 0 ) : NEW_LINE INDENT flag = True NEW_LINE DEDENT break NEW_LINE DEDENT DEDENT DEDENT if ( flag ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT DEDENT


def check ( r , g , b , w ) : NEW_LINE INDENT if r < 0 or g < 0 or b < 0 or w < 0 : NEW_LINE INDENT return - 1 NEW_LINE DEDENT else : NEW_LINE INDENT count = 0 NEW_LINE count1 = 0 NEW_LINE if r % 2 == 0 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT else : NEW_LINE INDENT count1 += 1 NEW_LINE DEDENT if g % 2 == 0 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT else : NEW_LINE INDENT count1 += 1 NEW_LINE DEDENT if b % 2 == 0 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT else : NEW_LINE INDENT count1 += 1 NEW_LINE DEDENT if w % 2 == 0 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT else : NEW_LINE INDENT count1 += 1 NEW_LINE DEDENT if count == 4 and count1 == 0 : NEW_LINE INDENT return 1 NEW_LINE DEDENT elif count == 3 and count1 == 1 : NEW_LINE INDENT return 1 NEW_LINE DEDENT else : NEW_LINE INDENT return - 1 NEW_LINE DEDENT DEDENT DEDENT t = int ( input ( ) ) NEW_LINE for i in range ( t ) : NEW_LINE INDENT r , g , b , w = map ( int , input ( ) . split ( ) ) NEW_LINE if check ( r , g , b , w ) == 1 : NEW_LINE INDENT print ( " YES " ) NEW_LINE DEDENT else : NEW_LINE INDENT w += 3 NEW_LINE r -= 1 NEW_LINE g -= 1 NEW_LINE b -= 1 NEW_LINE if check ( r , g , b , w ) == 1 : NEW_LINE INDENT print ( " YES " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT DEDENT DEDENT


t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : NEW_LINE INDENT r , g , b , w = map ( int , input ( ) . split ( ) ) NEW_LINE max_op = min ( r , g , b ) NEW_LINE even_count = 0 NEW_LINE if r % 2 == 0 : NEW_LINE INDENT even_count += 1 NEW_LINE DEDENT if g % 2 == 0 : NEW_LINE INDENT even_count += 1 NEW_LINE DEDENT if b % 2 == 0 : NEW_LINE INDENT even_count += 1 NEW_LINE DEDENT if even_count == 3 or even_count == 0 : NEW_LINE INDENT print ( ' Yes ' ) NEW_LINE DEDENT elif even_count == 2 : NEW_LINE INDENT if w % 2 == 1 : NEW_LINE INDENT print ( ' No ' ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ' Yes ' ) NEW_LINE DEDENT DEDENT else : NEW_LINE INDENT if w % 2 == 0 : NEW_LINE INDENT print ( ' No ' ) NEW_LINE DEDENT else : NEW_LINE INDENT if max_op >= 1 : NEW_LINE INDENT print ( ' Yes ' ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ' No ' ) NEW_LINE DEDENT DEDENT DEDENT DEDENT


import math NEW_LINE import sys NEW_LINE import collections NEW_LINE import bisect NEW_LINE import time NEW_LINE def get_ints ( ) : return map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) NEW_LINE def get_list ( ) : return list ( map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) ) NEW_LINE def get_string ( ) : return sys . stdin . readline ( ) . strip ( ) NEW_LINE for t in range ( int ( input ( ) ) ) : NEW_LINE INDENT r , g , b , w = get_ints ( ) NEW_LINE ans = [ r , g , b , w ] NEW_LINE odd = 0 NEW_LINE for i in ans : NEW_LINE INDENT if i % 2 == 1 : NEW_LINE INDENT odd += 1 NEW_LINE DEDENT DEDENT if odd <= 1 : NEW_LINE INDENT print ( " Yes " ) NEW_LINE continue NEW_LINE DEDENT change = min ( r , g , b , 1 ) NEW_LINE r -= change NEW_LINE g -= change NEW_LINE b -= change NEW_LINE w += change NEW_LINE ans = [ r , g , b , w ] NEW_LINE odd = 0 NEW_LINE for i in ans : NEW_LINE INDENT if i % 2 == 1 : NEW_LINE INDENT odd += 1 NEW_LINE DEDENT DEDENT if odd <= 1 : NEW_LINE INDENT print ( " Yes " ) NEW_LINE continue NEW_LINE DEDENT print ( " No " ) NEW_LINE DEDENT


def numOfOdd ( * args ) : NEW_LINE INDENT num = 0 NEW_LINE for col in args : NEW_LINE INDENT if col % 2 != 0 : NEW_LINE INDENT num += 1 NEW_LINE DEDENT DEDENT return num NEW_LINE DEDENT for _ in range ( int ( input ( ) ) ) : NEW_LINE INDENT r , g , b , w = map ( int , input ( ) . split ( ) ) NEW_LINE nOdd = numOfOdd ( r , g , b , w ) NEW_LINE if r == 0 or g == 0 or b == 0 : NEW_LINE INDENT if numOfOdd ( r , g , b , w ) == 1 or numOfOdd ( r , g , b , w ) == 0 : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT DEDENT else : NEW_LINE INDENT if nOdd == 2 : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT DEDENT DEDENT


import java . util . Scanner ; public class _0621BoboniuLikestoColorBalls { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int cases = sc . nextInt ( ) ; while ( cases > 0 ) { int r = sc . nextInt ( ) ; int g = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int w = sc . nextInt ( ) ; int min = Math . min ( r , Math . min ( b , g ) ) ; if ( r % 2 == 0 && g % 2 == 0 && b % 2 == 0 ) { System . out . println ( " YES " ) ; } else if ( r % 2 != 0 && g % 2 != 0 && b % 2 != 0 && min >= 1 ) { System . out . println ( " YES " ) ; } else { int count = 0 ; if ( r % 2 != 0 ) { count ++ ; } if ( g % 2 != 0 ) { count ++ ; } if ( b % 2 != 0 ) { count ++ ; } if ( count == 2 && min >= 1 && w % 2 != 0 ) { System . out . println ( " YES " ) ; } else if ( count == 1 && w % 2 == 0 ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } cases -- ; } } }


import java . util . Scanner ; public class Div2A { private static boolean areValid ( int a , int b , int c , int d ) { int paritySum = ( a % 2 ) + ( b % 2 ) + ( c % 2 ) + ( d % 2 ) ; return a >= 0 && b >= 0 && c >= 0 && d >= 0 && paritySum <= 1 ; } public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = Integer . parseInt ( scanner . nextLine ( ) ) ; int r ; int g ; int b ; int w ; for ( int i = 0 ; i < t ; i ++ ) { r = scanner . nextInt ( ) ; g = scanner . nextInt ( ) ; b = scanner . nextInt ( ) ; w = scanner . nextInt ( ) ; scanner . nextLine ( ) ; if ( areValid ( r , g , b , w ) || areValid ( r - 1 , g - 1 , b - 1 , w + 1 ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } scanner . close ( ) ; } }


import java . io . * ; import java . util . StringTokenizer ; public class BoboniuLikesToColorBalls { public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; PrintWriter out = new PrintWriter ( new BufferedOutputStream ( System . out ) ) ; int t = in . nextInt ( ) ; while ( t -- > 0 ) { int odds = 0 ; int zero = 0 ; int [ ] arr = new int [ 4 ] ; for ( int i = 0 ; i < 4 ; i ++ ) { arr [ i ] = in . nextInt ( ) ; if ( arr [ i ] % 2 != 0 ) odds ++ ; if ( arr [ i ] == 0 && i != 3 ) zero ++ ; } if ( odds <= 1 ) out . println ( " Yes " ) ; else if ( zero != 0 ) out . println ( " No " ) ; else { odds = 0 ; zero = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) arr [ i ] -= 1 ; arr [ 3 ] += 3 ; for ( int i = 0 ; i < 4 ; i ++ ) { if ( arr [ i ] % 2 != 0 ) odds ++ ; if ( arr [ i ] == 0 && i != 3 ) zero ++ ; } if ( odds <= 1 ) out . println ( " Yes " ) ; else out . println ( " No " ) ; } } out . close ( ) ; } private static class FastReader { BufferedReader br ; StringTokenizer st ; 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 ( ) ) ; } } }


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

from math import * name = input ( ) n = len ( name )   if n <= 20 : print ( 1 , n ) print ( name ) exit ( 0 )   rows = [ ]   rows_amount = 2 while n / rows_amount > 20 : rows_amount += 1     cutted = ceil ( n / rows_amount ) print ( rows_amount , cutted )   i = 0 start = 0 ostatok = n % rows_amount if n % rows_amount != 0 else rows_amountwhile i < rows_amount - ( rows_amount - ostatok ) : start = i * cutted rows . append ( name [ start : ( start + cutted ) ] ) i += 1   start += cuttedcutted -= 1 while i < rows_amount : rows . append ( name [ start : ( start + cutted ) ] ) rows [ - 1 ] += " * " i += 1 start += cutted     for j in rows : print ( j ) NEW_LINE


from math import * name = input ( ) n = len ( name )   if n <= 20 : print ( 1 , n ) print ( name ) exit ( 0 )   rows = [ ]   rows_amount = 2 while n / rows_amount > 20 : rows_amount += 1     cutted = ceil ( n / rows_amount ) print ( rows_amount , cutted )   i = 0 start = 0 ostatok = n % rows_amount if n % rows_amount != 0 else rows_amountwhile i < rows_amount - ( rows_amount - ostatok ) : rows . append ( name [ start : ( start + cutted ) ] ) i += 1 start += cutted   cutted -= 1 while i < rows_amount : rows . append ( name [ start : ( start + cutted ) ] ) rows [ - 1 ] += " * " i += 1 start += cutted     for j in rows : print ( j ) NEW_LINE


import java . util . Scanner ;   public class B1032 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; char [ ] S = in . next ( ) . toCharArray ( ) ; int length = S . length ; int rows = ( length + 19 ) / 20 ; int inRow = length / rows ; int remainder = length % rows ; int colums = inRow + ( ( remainder == 0 ) ? 0 : 1 ) ; StringBuilder sb = new StringBuilder ( ) ; int pos = 0 ; for ( int row = 0 ; row < rows ; row ++ ) { for ( int i = 0 ; i < inRow ; i ++ ) { sb . append ( S [ pos ++ ] ) ; } if ( remainder != 0 ) { sb . append ( ( row < remainder ) ? S [ pos ++ ] : ' * ' ) ; } sb . append ( ' \n ' ) ; } System . out . println ( rows + " ▁ " + colums ) ; System . out . print ( sb ) ; }   }


# include < cstdio >   char s [ 110 ] ;   int main ( ) { scanf ( " % s " , s ) ; int len = 0 ; while ( ( s [ len ] >= ' a ' && s [ len ] <= ' z ' ) || ( s [ len ] >= ' A ' && s [ len ] <= ' Z ' ) ) ++ len ; int n = len / 20 , m = 20 , r = len % 20 ; if ( r == 0 ) { printf ( " % d ▁ % d \n " , n , 20 ) ; for ( int i = 0 ; i < n ; ++ i ) { for ( int j = 0 ; j < m ; ++ j ) putchar ( s [ i * m + j ] ) ; putchar ( ' \n ' ) ; } } else if ( n == 0 ) { printf ( " % d ▁ % d \n " , 1 , r ) ; for ( int i = 0 ; i < len ; ++ i ) putchar ( s [ i ] ) ; } else { m -= ( 20 - r ) / ( n + 1 ) ; r = ( 20 - r ) % ( n + 1 ) ; ++ n ; printf ( " % d ▁ % d \n " , n , m ) ; int index = 0 ; for ( int i = 0 ; i < n ; ++ i ) { for ( int j = 0 ; j < m ; ++ j ) { if ( j == m - 1 && i > ( n - r ) - 1 ) putchar ( ' * ' ) ; else { putchar ( s [ index ] ) ; ++ index ; } } putchar ( ' \n ' ) ; } } }


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

import sys , mathfrom collections import defaultdict , dequeinput = sys . stdin . readline       n = int ( input ( ) ) s = input ( ) . strip ( ) moves = n - 11 NEW_LINE


n = int ( input ( ) ) nn = neight = [ ] rest = [ ] s = list ( input ( ) ) for i in range ( n ) : if s [ i ] == "8" : eight . append ( i ) else : rest . append ( i ) lst = eight + rest [ : : - 1 ] i = 0 left = 1 right = 0 while n > 11 : n -= 1 if i == 0 : s [ lst [ - left ] ] = " " left += 1 i = 1 else : s [ lst [ right ] ] = " " right += 1 i = 0 ans = " " for i in range ( nn ) : ans += s [ i ] if ans [ 0 ] == "8" : print ( " YES " ) else : print ( " NO " ) NEW_LINE


n = int ( input ( ) ) s = input ( ) ; flag = True ; cnt = 0 for i in range ( 0 , n - 10 , 2 ) : NEW_LINE


import java . util . Scanner ;   public class Problem1155B { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; sc . nextLine ( ) ; String s = sc . nextLine ( ) ; int count = 0 ; int toRemove = n - 11 ; int vasya = toRemove / 2 ; int petya = toRemove / 2 ; for ( int i = 0 ; i < n - 10 ; i ++ ) { if ( s . charAt ( i ) == '8' ) { count ++ ; } } if ( count - ( petya ) > 0 ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } }


import java . util . Scanner ;   public class GamewithelephoneNumbers {   public static void main ( String args [ ] ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; String s = scan . next ( ) ; int k = n - 11 ; k /= 2 ; int p = 0 ; for ( int i = 0 ; i <= n - 11 ; i ++ ) { if ( s . charAt ( i ) == '8' ) { ++ p ; } } if ( p > k ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } }   }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Game_Tele { 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 ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } } public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; int n = in . nextInt ( ) ; String s = in . nextLine ( ) ; int c = 0 ; for ( int i = 0 ; i <= ( n - 11 ) ; i ++ ) { if ( s . charAt ( i ) == '8' ) { c ++ ; } }


import java . util . * ; public class telephone { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; int chancePetya = ( n - 11 ) / 2 ; int count8 = 0 ; int b = 0 ; for ( int i = 0 ; i <= n - 1 ; i ++ ) { if ( s . charAt ( i ) == '8' ) count8 ++ ; else b ++ ; if ( count8 > chancePetya ) break ; } if ( count8 <= chancePetya ) System . out . println ( " NO " ) ; else if ( b <= chancePetya ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }


import java . util . * ; import java . lang . * ; import java . io . * ;   public class Ideone { public static void main ( String [ ] args ) throws java . lang . Exception { long M = 1000000007 ; long res = 1 ; Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; for ( int i = 0 ; i < k - 1 ; i ++ ) res = ( res * k ) % M ; for ( int i = 0 ; i < n - k ; i ++ ) res = ( res * ( n - k ) ) % M ; System . out . println ( res ) ; } }

n , k = map ( int , input ( ) . split ( ' ▁ ' ) ) print ( k ** ( k - 1 ) * ( n - k ) ** ( n - k ) % int ( 1e9 + 7 ) ) NEW_LINE


mod = 10 ** 9 + 7 def power ( x , a ) : if ( a == 0 ) : return ( 1 ) z = power ( x , a // 2 ) z = ( z * z ) % mod if ( a % 2 ) : z = ( z * x ) % mod return ( z ) [ n , k ] = list ( map ( int , input ( ) . split ( ) ) ) print ( ( power ( n - k , n - k ) * power ( k , k - 1 ) ) % mod ) NEW_LINE


import sys , math , heapq , copyfrom collections import defaultdict , dequefrom bisect import bisect_left , bisect_rightfrom functools import cmp_to_keyfrom itertools import permutations , combinations , combinations_with_replacement NEW_LINE


import sysread = lambda : sys . stdin . readline ( ) . strip ( ) readi = lambda : map ( int , read ( ) . split ( ) ) from collections import *   n , k = readi ( ) mod = 10 ** 9 + 7 ans = 1   for i in range ( 1 , k ) : ans = ( ans * k ) % mod   for _ in range ( n - k ) : ans = ( ans * ( n - k ) ) % mod   print ( ans ) NEW_LINE


n , k = [ int ( x ) for x in input ( ) . split ( ) ] ans = ( ( n - k ) ** ( n - k ) ) * ( ( k ) ** ( k - 1 ) ) % ( 10 ** 9 + 7 ) print ( ans ) NEW_LINE


import java . io . DataInputStream ; import java . io . FileInputStream ; import java . io . IOException ;   public class EpicGame { public static void main ( String [ ] args ) throws IOException { FastReader reader = new FastReader ( ) ; int a = reader . nextInt ( ) ; int b = reader . nextInt ( ) ; int heap = reader . nextInt ( ) ;   int turn = 0 ; while ( true ) { int itemsToRemove ; if ( turn % 2 == 0 ) { itemsToRemove = gcd ( a , heap ) ; } else { itemsToRemove = gcd ( b , heap ) ; }   if ( heap > 0 ) { heap -= itemsToRemove ; turn ++ ; } else { System . out . println ( ( turn + 1 ) % 2 ) ; break ; } } }   private static int gcd ( int a , int b ) { if ( a == 0 ) { return b ; }   return gcd ( b % a , a ) ; }    static class FastReader { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din ; private byte [ ] buffer ; private int bufferPointer , bytesRead ;   public FastReader ( ) { din = new DataInputStream ( System . in ) ; buffer = new byte [ BUFFER_SIZE ] ; bufferPointer = bytesRead = 0 ; }   public FastReader ( 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 ] ;

a , b , n = map ( int , input ( ) . split ( ) )   def gcd ( a , b ) : if b == 0 : return a else : return gcd ( b , a % b )   temp2 = True   while n > 0 : n -= gcd ( a , n ) if n <= 0 : temp2 = False break n -= gcd ( b , n ) 	   if temp2 != True : print ( 0 ) else : print ( 1 ) 	   NEW_LINE


import matha , b , n = map ( int , input ( ) . split ( ) ) i = 0 while math . gcd ( a , n ) <= n or math . gcd ( b , n ) <= n : if i % 2 == 0 : g = math . gcd ( a , n ) n = n - g else : g = math . gcd ( b , n ) n = n - g i = i + 1 if i % 2 == 1 : print ( 0 ) else : print ( 1 ) NEW_LINE


import matha , b , n = list ( map ( int , input ( ) . split ( ) ) ) c = 0 while n >= 0 :   if ( n != 0 ) : x = math . gcd ( a , n ) n = n - x c = 1 if ( n != 0 ) : y = math . gcd ( b , n ) n = n - y c = 2 if ( n == 0 ) : break   if ( c == 1 ) : print ( "0" ) else : print ( "1" )   NEW_LINE


import math * a , n = map ( int , input ( ) . split ( ) ) i = 0 while n >= 0 : n -= math . gcd ( a [ i ] , n ) i = 1 - iprint ( i ) NEW_LINE


import java . util . Scanner ;   public class CodeForces { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; while ( n >= 0 ) { n = n - gcd ( a , n ) ; if ( n < 0 ) { System . out . println ( 1 ) ; break ; } n = n - gcd ( b , n ) ; if ( n < 0 ) { System . out . println ( 0 ) ; }   }   } private static int gcd ( int a , int b ) { if ( b == 0 ) return a ; else return gcd ( b , a % b ) ; } }


import java . util . Scanner ; public class question { static int gcd ( int a , int b ) { int dividend = a > b ? a : b ; int divisor = a < b ? a : b ; int rem = 1 ; if ( a == 0 || b == 0 ) return dividend ; while ( rem != 0 ) { rem = dividend % divisor ; dividend = divisor ; if ( rem == 0 ) break ; divisor = rem ; } return divisor ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; while ( true ) { if ( n == 0 ) { System . out . println ( 1 ) ; break ; } n = n - gcd ( a , n ) ;   if ( n == 0 ) { System . out . println ( 0 ) ; break ; } n = n - gcd ( b , n ) ; } } }


import java . util . * ; public class FriendsPresents275B {   public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int cnt1 = s . nextInt ( ) ; int cnt2 = s . nextInt ( ) ; int x = s . nextInt ( ) ; int y = s . nextInt ( ) ; long l = 0 ; long r = ( long ) 1e10 ; long mid = 0l ; long ans = 0l ; while ( l <= r ) { mid = l + ( r - l ) / 2 ; long forone = mid - mid / x ; long fortwo = mid - mid / y ; long onlyone = mid / x + mid / y - mid / ( x * y ) ; long sub = mid - onlyone ; if ( forone >= cnt1 && fortwo >= cnt2 && forone + fortwo - sub >= cnt1 + cnt2 ) { ans = mid ; r = mid - 1 ; } else l = mid + 1 ; } System . out . println ( ans ) ; }   }

import mathu , v , x , y = map ( int , input ( ) . split ( ) ) z = x * y // math . gcd ( x , y ) def check ( ans ) : inter = ans - ans // x - ans // y + ans // z fx = ans // y - ans // z fy = ans // x - ans // z if fx + inter < u : return False if fy + inter < v : return False if fx + fy + inter < u + v : return False return Trueans = 0 for i in range ( 31 , - 1 , - 1 ) : if not check ( ans + 2 ** i ) : ans += 2 ** iprint ( ans + 1 ) NEW_LINE


def Solve ( n , m , sum ) : cnt = int ( sum / x / y ) if x == y : cnt = int ( sum / x ) n = max ( 0 , n - int ( sum / y ) + cnt ) m = max ( 0 , m - int ( sum / x ) + cnt ) if ( sum - int ( sum / x ) - int ( sum / y ) + cnt >= n + m ) : tmp = 0 else : tmp = m + n - ( sum - int ( sum / x ) - int ( sum / y ) + cnt ) NEW_LINE


c1 , c2 , x , y = map ( int , input ( ) . split ( ) )   def valid ( m ) : a = m - m // x b = m - m // y - max ( 0 , c1 - m // y + m // x // y ) return a >= c1 and b >= c2     l , r = 0 , ( 1 << 62 ) while l + 1 < r : m = l + r >> 1 if valid ( m ) : r = m else : l = mprint ( r ) NEW_LINE


c1 , c2 , x , y = map ( int , input ( ) . split ( ) ) def poss ( v ) : global c1 , c2 , x , y divbyx = v // x divbyy = v // y divbyxy = v // ( x * y ) cc1 = c2 - divbyx + divbyxy cc2 = c1 - divbyy + divbyxy cc1 = max ( cc1 , 0 ) cc2 = max ( cc2 , 0 ) remaining = v - divbyx - divbyy + divbyxy NEW_LINE


c1 , c2 , x , y = map ( int , input ( ) . split ( ) ) l = c1 + c2temp = lh = pow ( 10 , 10 ) while ( l < h ) : ans = ( l + h ) // 2 if ( c1 > ans - ans // x ) or ( c2 > ans - ans // y ) or ( temp > ans - ans // ( x * y ) ) : l = ans + 1 else : h = ansprint ( l ) NEW_LINE


import java . util . * ; public class ProB { static long a , b , x , y , ans , l , r , mid ;   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; a = in . nextInt ( ) ; b = in . nextInt ( ) ; x = in . nextInt ( ) ; y = in . nextInt ( ) ; l = 1 ; r = 10000000000l ; while ( l <= r ) { mid = ( l + r ) / 2 ; if ( mid - mid / x >= a && mid - mid / y >= b && mid - mid / x / y >= a + b ) { ans = mid ; r = mid - 1 ; } else l = mid + 1 ; } System . out . println ( ans ) ; } }


import java . awt . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   public class Main {   public static void main ( String agr [ ] ) throws Exception { FastReader sc = new FastReader ( ) ; long cnt1 = sc . nextInt ( ) , cnt2 = sc . nextInt ( ) , x = sc . nextInt ( ) , y = sc . nextInt ( ) ; long l = 1 , hi = ( long ) 1e12 ; long ans1 = - 1 ; while ( l <= hi ) { long mid = l + ( hi - l ) / 2 ; if ( cnt1 > ( mid - ( mid / x ) ) || cnt2 > ( mid - ( mid / y ) ) || ( mid - ( mid / ( x * y ) ) < cnt1 + cnt2 ) ) { l = mid + 1 ; } else { ans1 = mid ; hi = mid - 1 ; }


import java . util . Scanner ;   public class A599 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int d1 = scanner . nextInt ( ) , d2 = scanner . nextInt ( ) , d3 = scanner . nextInt ( ) ;   int a [ ] = { ( 2 * d1 + 2 * d2 ) , ( 2 * d1 + 2 * d3 ) , ( 2 * d2 + 2 * d3 ) , ( d1 + d2 + d3 ) } ; int min = Integer . MAX_VALUE ; for ( int i = 0 ; i < a . length ; i ++ ) {   if ( a [ i ] < min ) min = a [ i ] ;

a , b , c = map ( int , input ( ) . split ( ) ) x = a + b + cy = 2 * a + 2 * bz = 2 * a + 2 * cw = 2 * b + 2 * cprint ( min ( x , y , z , w ) ) NEW_LINE


a , b , c = map ( int , input ( ) . split ( ) ) print ( min ( 2 * ( a + b ) , 2 * ( a + c ) , 2 * ( b + c ) , a + b + c ) ) NEW_LINE


import java . util . * ; import static java . lang . Math . min ; import static java . lang . Math . max ;   public class Test { public static void main ( String [ ] args ) throws Exception {   Scanner input = new Scanner ( System . in ) ; int d1 = input . nextInt ( ) ; int d2 = input . nextInt ( ) ; int d3 = input . nextInt ( ) ;   System . out . println ( min ( d1 , d2 ) + min ( d1 + d2 , d3 ) + min ( max ( d1 , d2 ) , d3 + min ( d1 , d2 ) ) ) ; } }


import java . util . * ;   public class Main {   public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; long d1 = scanner . nextLong ( ) , d2 = scanner . nextLong ( ) , d3 = scanner . nextLong ( ) ; long path1 = 2 * d1 + 2 * d2 , path2 = 2 * d1 + 2 * d3 , path3 = 2 * d2 + 2 * d3 , path4 = d1 + d2 + d3 ; System . out . println ( Math . min ( Math . min ( path1 , path2 ) , Math . min ( path3 , path4 ) ) ) ; } }


import java . util . Scanner ;   public class Patrick { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ;   int d1 = scanner . nextInt ( ) ; int d2 = scanner . nextInt ( ) ; int d3 = scanner . nextInt ( ) ;   int max = Math . max ( Math . max ( d1 , d2 ) , d3 ) ;   int i = d1 + d2 + d3 - max ;   if ( d1 + d2 + d3 < i * 2 ) { System . out . println ( d1 + d2 + d3 ) ; } else { System . out . println ( i * 2 ) ; } } }


import com . sun . org . apache . bcel . internal . generic . AALOAD ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; import java . util . stream . IntStream ; import javafx . util . Pair ;   public class Main {   static void sort ( int a [ ] ) { Random ran = new Random ( ) ; for ( int i = 0 ; i < a . length ; i ++ ) { int r = ran . nextInt ( a . length ) ; int temp = a [ r ] ; a [ r ] = a [ i ] ; a [ i ] = temp ; }   Arrays . sort ( a ) ; }   public static void main ( String [ ] args ) throws IOException { Scanner input = new Scanner ( System . in ) ; StringBuilder s = new StringBuilder ( input . next ( ) + " ▁ " ) ; int i = 0 ; while ( i < s . length ( ) ) { StringBuilder newS = new StringBuilder ( s ) ; for ( char j = ' a ' ; j <= ' z ' ; j ++ ) { newS . insert ( i , j ) ; String send = newS . toString ( ) . trim ( ) ; boolean ch = check ( send ) ;

s = input ( ) n = len ( s ) f = Falsefor i in range ( len ( s ) // 2 ) : if s [ i ] != s [ n - 1 - i ] : o = s [ : n - i ] + s [ i ] + s [ n - i : ] p = s [ : i ] + s [ n - i - 1 ] + s [ i : ] f = True   if o == o [ : : - 1 ] : print ( o ) elif p == p [ : : - 1 ] : print ( p ) else : print ( " NA " ) break     if not f : if n % 2 == 0 : print ( s [ : n // 2 ] + ' y ' + s [ n // 2 : ] ) else : x = s [ n // 2 ] print ( s [ : n // 2 ] + x + s [ n // 2 : ] ) NEW_LINE


def STR ( ) : return list ( input ( ) ) def INT ( ) : return int ( input ( ) ) def MAP ( ) : return map ( int , input ( ) . split ( ) ) def MAP2 ( ) : return map ( float , input ( ) . split ( ) ) def LIST ( ) : return list ( map ( int , input ( ) . split ( ) ) ) def STRING ( ) : return input ( ) import stringfrom heapq import heappop , heappushfrom bisect import * from collections import deque , Counterfrom math import * from itertools import permutations , accumulatedx = [ - 1 , 1 , 0 , 0 ] dy = [ 0 , 0 , 1 , - 1 ] NEW_LINE


s = input ( ) l = len ( s ) a = ' abcdefghijklmnopqrstuvwxyz ' for i in range ( len ( a ) ) : for j in range ( l + 1 ) : x = s [ : j ] + a [ i ] + s [ j : ] if x == x [ : : - 1 ] : print ( x ) exit ( ) else : print ( " NA " ) NEW_LINE


import java . util . Scanner ;   public class test02 { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String s = in . nextLine ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String temp = s . substring ( 0 , i ) ; String temp2 = s . substring ( i ) ; String la = " abcdefghijklmnopqrstuvwxyz " ;


import java . util . * ; import java . math . * ; import java . io . * ;   public class MakePalindrom {   public static void main ( String [ ] args ) throws Exception { Scanner pm = new Scanner ( System . in ) ; int [ ] hash = new int [ 26 ] ; String s = pm . next ( ) ; int k = s . length ( ) ; StringBuffer sb = new StringBuffer ( s ) ; if ( k == 1 ) { System . out . println ( sb . append ( sb ) ) ; return ; } for ( int i = 0 ; i < k ; i ++ ) { int po = ( int ) s . charAt ( i ) - 97 ; hash [ po ] ++ ;


import java . util . Scanner ;   public class _0856ExercisingWalk {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t > 0 ) { int left = sc . nextInt ( ) ; int right = sc . nextInt ( ) ; int down = sc . nextInt ( ) ; int up = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int x1 = sc . nextInt ( ) ; int y1 = sc . nextInt ( ) ; int x2 = sc . nextInt ( ) ; int y2 = sc . nextInt ( ) ; x += right - left ; y += up - down ; if ( left + right > 0 && x1 == x2 ) { System . out . println ( " NO " ) ; } else if ( up + down > 0 && y1 == y2 ) { System . out . println ( " NO " ) ; } else if ( x <= x2 && x >= x1 && y <= y2 && y >= y1 ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } t -- ; } }   }

def q1332a ( ) : num_cases = int ( input ( ) ) for _ in range ( num_cases ) : a , b , c , d = tuple ( [ int ( num ) for num in input ( ) . split ( ) ] ) x , y , x1 , y1 , x2 , y2 = tuple ( [ int ( num ) for num in input ( ) . split ( ) ] ) subproblem ( a , b , c , d , x , y , x1 , y1 , x2 , y2 )   def subproblem ( a , b , c , d , x , y , x1 , y1 , x2 , y2 ) : move_x = b - a NEW_LINE


for iii in range ( int ( input ( ) ) ) : a , b , c , d = map ( int , input ( ) . split ( ) ) x , y , x1 , y1 , x2 , y2 = map ( int , input ( ) . split ( ) ) if ( x1 <= x - a + b <= x2 ) and ( y1 <= y - c + d <= y2 ) and ( x2 > x1 or a + b == 0 ) and ( y2 > y1 or c + d == 0 ) : print ( " YES " ) else : print ( " NO " ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : l , r , d , u = map ( int , input ( ) . split ( ) ) x , y , x1 , y1 , x2 , y2 = map ( int , input ( ) . split ( ) ) x += r - l y += u - d   if l + r > 0 and x1 == x2 : print ( ' No ' ) elif u + d > 0 and y1 == y2 : print ( ' No ' ) elif x1 <= x <= x2 and y1 <= y <= y2 : print ( ' Yes ' ) else : print ( ' No ' ) NEW_LINE


import sysinput = sys . stdin . readlinefrom collections import defaultdict as dcfrom collections import Counterfrom bisect import bisect_right , bisect_leftimport mathfrom operator import itemgetterfrom heapq import heapify , heappop , heappushfrom queue import PriorityQueue as pqfor _ in range ( int ( input ( ) ) ) : a , b , c , d = map ( int , input ( ) . split ( ) ) x , y , x1 , y1 , x2 , y2 = map ( int , input ( ) . split ( ) ) p , q = x , y if a >= b : p = p - ( a - b ) else : p = p + b - a if c >= d : q = q - ( c - d ) else : q = q + d - c f = 0 if ( b == 0 or ( b > 0 and x + 1 >= x1 and x + 1 <= x2 ) ) or ( a == 0 or ( a > 0 and x - 1 >= x1 and x - 1 <= x2 ) ) : if ( d == 0 or ( d > 0 and y + 1 >= y1 and y + 1 <= y2 ) ) or ( c == 0 or ( c > 0 and y - 1 >= y1 and y - 1 <= y2 ) ) : f = 1 if f == 1 and p >= x1 and p <= x2 and q >= y1 and q <= y2 : print ( " Yes " ) else : print ( " No " ) NEW_LINE


t = int ( input ( ) ) while t > 0 : a , b , c , d = map ( int , input ( ) . split ( ) ) x , y , x1 , y1 , x2 , y2 = map ( int , input ( ) . split ( ) ) x = x + ( b - a ) y = y + ( d - c ) if abs ( a + b ) > 0 and x1 == x2 : print ( " NO " ) elif abs ( c + d ) > 0 and y1 == y2 : print ( " NO " ) elif x1 <= x <= x2 and y1 <= y <= y2 : print ( " Yes " ) else : print ( " NO " ) NEW_LINE


import java . awt . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; public class Main { static int countSubstrings ( String s ) { int n = s . length ( ) ; int dp [ ] [ ] = new int [ 1001 ] [ 1001 ] ; for ( int i = 0 ; i < n ; i ++ ) { dp [ i ] [ i ] = 1 ; } for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( s . charAt ( i ) == s . charAt ( i + 1 ) ) { dp [ i ] [ i + 1 ] = 1 ; } } for ( int d = 2 ; d < n ; d ++ ) { int i = 0 , j = d ; while ( j < n ) { if ( s . charAt ( i ) == s . charAt ( j ) && dp [ i + 1 ] [ j - 1 ] == 1 ) { dp [ i ] [ j ] = 1 ; } else dp [ i ] [ j ] = 0 ; i ++ ; j ++ ; } } int count = 0 ; for ( int i = 0 ; i < 1001 ; i ++ ) { for ( int j = 0 ; j < 1001 ; j ++ ) { if ( dp [ i ] [ j ] == 1 ) count ++ ; } } return count ; } public static void main ( String [ ] args ) { FastScanner sc = new FastScanner ( ) ;


import java . util . * ;    public class ExercisingWalk { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ;   int test = input . nextInt ( ) ;    int a = 0 ; int b = 0 ; int c = 0 ; int d = 0 ; int x = 0 ; int y = 0 ; int x1 = 0 ; int y1 = 0 ; int x2 = 0 ; int y2 = 0 ; int sumV = 0 ; int sumH = 0 ; for ( int t = 0 ; t < test ; t ++ ) { a = input . nextInt ( ) ; b = input . nextInt ( ) ; c = input . nextInt ( ) ; d = input . nextInt ( ) ; x = input . nextInt ( ) ; y = input . nextInt ( ) ; x1 = input . nextInt ( ) ; y1 = input . nextInt ( ) ; x2 = input . nextInt ( ) ; y2 = input . nextInt ( ) ; String answer = " Yes " ;   sumV = d - c ; sumH = b - a ;   if ( x1 == x2 && a + b > 0 ) { answer = " No " ; } if ( y1 == y2 && c + d > 0 ) { answer = " No " ; } if ( sumV != 0 ) { if ( sumV > 0 ) { if ( y + sumV > y2 ) { answer = " No " ; } } else if ( sumV < 0 ) { if ( y + sumV < y1 ) { answer = " No " ; } } } if ( sumH != 0 ) { if ( sumH > 0 ) { if ( x + sumH > x2 ) { answer = " No " ; } } else if ( sumH < 0 ) { if ( x + sumH < x1 ) { answer = " No " ; } } }    System . out . println ( answer ) ;     } } }


import java . util . * ; import java . io . * ; import java . lang . Math ;    public class A { static int INF = - 2_000_000_000 ; static long MOD = 1_000_000_007 ; public static void main ( String args [ ] ) { FastScanner fs = new FastScanner ( ) ; int t = fs . nextInt ( ) ; for ( int test_case = 1 ; test_case <= t ; ++ test_case ) { long n = fs . nextInt ( ) , k = fs . nextInt ( ) ; if ( n % 2 != k % 2 || k > n || k * k > n ) { System . out . println ( " NO " ) ; } else {

import sysdef get_ints ( ) : return map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) for i in range ( int ( input ( ) ) ) : n , k = get_ints ( ) if ( k ** 2 > n ) or ( k % 2 != n % 2 ) : print ( " NO " ) else : print ( " yes " )   NEW_LINE


for i in range ( int ( input ( ) ) ) : n , k = map ( int , input ( ) . split ( ) ) if k % 2 == n % 2 and n >= k * k : print ( " YES " ) else : print ( " NO " ) NEW_LINE


t = int ( input ( ) ) for _ in range ( t ) : n , k = map ( int , input ( ) . split ( ) ) s = ( 1 + ( 1 + 2 * ( k - 1 ) ) ) * k / 2 if s <= n : if k % 2 == 1 and n % 2 == 1 : print ( ' YES ' ) elif k % 2 == 0 and n % 2 == 0 : print ( ' YES ' ) else : print ( ' NO ' ) else : print ( " NO " ) NEW_LINE


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


import java . util . Scanner ;   public class _0838SumofOddIntegers {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t > 0 ) { int n = sc . nextInt ( ) ; long k = sc . nextLong ( ) ; if ( k % 2 == 0 && n % 2 == 0 || k % 2 != 0 && n % 2 != 0 ) { if ( k * k <= n ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } else { System . out . println ( " NO " ) ; } t -- ; } }   }


import java . util . * ; import java . io . * ; import java . lang . Math ;    public class A { static int INF = - 2_000_000_000 ; static long MOD = 1_000_000_007 ; public static void main ( String args [ ] ) { FastScanner fs = new FastScanner ( ) ; int t = fs . nextInt ( ) ; for ( int test_case = 1 ; test_case <= t ; ++ test_case ) { long n = fs . nextInt ( ) , k = fs . nextInt ( ) ; if ( ! ( ( n & ( long ) 1 ) == ( k & ( long ) 1 ) ) || k > n || k * k > n ) { System . out . println ( " NO " ) ; } else {


import java . util . * ; public class B_Array_Walk { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int q = sc . nextInt ( ) ; while ( q -- > 0 ) { int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int z = sc . nextInt ( ) ; int ar [ ] = new int [ n ] ; int i = 0 ; for ( i = 0 ; i < n ; i ++ ) { ar [ i ] = sc . nextInt ( ) ; } long ans = 0 ; for ( int t = 0 ; t <= z ; t ++ ) { int pos = k - 2 * t ; if ( pos < 0 ) continue ; long s = 0 ; long max = 0 ; for ( i = 0 ; i <= pos ; i ++ ) { if ( i != n - 1 ) { max = Math . max ( max , ( long ) ( ar [ i ] + ar [ i + 1 ] ) ) ; } s += ar [ i ] ; } s += ( t ) * max ; ans = Math . max ( ans , s ) ; } System . out . println ( ans ) ; } } }

import math , sys , bisect , heapq , os NEW_LINE from collections import defaultdict , Counter , deque NEW_LINE from itertools import groupby , accumulate NEW_LINE from functools import lru_cache NEW_LINE int1 = lambda x : int ( x ) - 1 NEW_LINE def input ( ) : return sys . stdin . readline ( ) . rstrip ( ' \n ' ) NEW_LINE aj = lambda : list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE def list3d ( a , b , c , d ) : return [ [ [ d ] * c for j in range ( b ) ] for i in range ( a ) ] NEW_LINE def Y ( c ) : print ( [ " NO " , " YES " ] [ c ] ) NEW_LINE def y ( c ) : print ( [ " no " , " yes " ] [ c ] ) NEW_LINE def Yy ( c ) : print ( [ " No " , " Yes " ] [ c ] ) NEW_LINE def solve ( ) : NEW_LINE INDENT for _ in range ( int ( input ( ) ) ) : NEW_LINE INDENT n , k , z = aj ( ) NEW_LINE A = aj ( ) NEW_LINE B = list ( accumulate ( A ) ) NEW_LINE ans = 0 NEW_LINE for i in range ( 1 , n ) : NEW_LINE INDENT if i <= k : NEW_LINE INDENT temp = B [ i ] NEW_LINE back = min ( z , math . ceil ( ( k - i ) / 2 ) ) NEW_LINE temp += back * A [ i - 1 ] NEW_LINE forw = max ( 0 , back - 1 ) NEW_LINE temp += forw * A [ i ] NEW_LINE rem = max ( 0 , k - i - forw - back ) NEW_LINE if back : NEW_LINE INDENT temp += B [ i + rem - 1 ] - B [ i - 1 ] NEW_LINE DEDENT else : NEW_LINE INDENT temp += B [ i + rem ] - B [ i ] NEW_LINE DEDENT ans = max ( ans , temp ) NEW_LINE DEDENT DEDENT print ( ans ) NEW_LINE DEDENT DEDENT try : NEW_LINE INDENT sys . stdin = open ( ' input . txt ' , ' r ' ) NEW_LINE sys . stdout = open ( ' output . txt ' , ' w ' ) NEW_LINE DEDENT except : NEW_LINE INDENT pass NEW_LINE DEDENT solve ( ) NEW_LINE


import sys NEW_LINE for _ in range ( int ( sys . stdin . readline ( ) ) ) : NEW_LINE INDENT n , k , z = map ( int , sys . stdin . readline ( ) . split ( ) ) NEW_LINE a = [ int ( i ) for i in sys . stdin . readline ( ) . split ( ) ] NEW_LINE prefix_sums = [ a [ 0 ] ] NEW_LINE for a_i in a [ 1 : ] : NEW_LINE INDENT prefix_sums . append ( prefix_sums [ - 1 ] + a_i ) NEW_LINE DEDENT if z == 0 : NEW_LINE INDENT print ( sum ( a [ : k + 1 ] ) ) NEW_LINE DEDENT else : NEW_LINE INDENT max_score = a [ 0 ] NEW_LINE for ind in range ( 1 , n ) : NEW_LINE INDENT if k == 0 : NEW_LINE INDENT break NEW_LINE DEDENT local_max_score = prefix_sums [ ind ] NEW_LINE local_k = k - 1 NEW_LINE local_z = z NEW_LINE flag = 0 NEW_LINE while local_k != 0 and local_z != 0 : NEW_LINE INDENT if flag == 0 : NEW_LINE INDENT local_max_score += a [ ind - 1 ] NEW_LINE flag = 1 NEW_LINE local_z -= 1 NEW_LINE DEDENT else : NEW_LINE INDENT local_max_score += a [ ind ] NEW_LINE flag = 0 NEW_LINE DEDENT local_k -= 1 NEW_LINE DEDENT if local_k == local_z == 0 : NEW_LINE INDENT max_score = max ( max_score , local_max_score ) NEW_LINE DEDENT elif local_k == 0 : NEW_LINE INDENT max_score = max ( max_score , local_max_score ) NEW_LINE DEDENT elif local_z == 0 : NEW_LINE INDENT local_max_score += ( prefix_sums [ ind - 1 + local_k ] - prefix_sums [ ind - 1 ] ) NEW_LINE max_score = max ( max_score , local_max_score ) NEW_LINE DEDENT k -= 1 NEW_LINE DEDENT print ( max_score ) NEW_LINE DEDENT DEDENT


for _ in range ( int ( input ( ) ) ) : NEW_LINE INDENT n , k , z = map ( int , input ( ) . split ( ) ) NEW_LINE arr = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE pref = [ 0 ] * n NEW_LINE pref [ 0 ] = arr [ 0 ] NEW_LINE for i in range ( 1 , n ) : NEW_LINE INDENT pref [ i ] = pref [ i - 1 ] + arr [ i ] NEW_LINE DEDENT ans = pref [ k ] NEW_LINE for i in range ( 1 , k ) : NEW_LINE INDENT curr = 0 NEW_LINE neg = z NEW_LINE x = k - i NEW_LINE curr = pref [ i ] NEW_LINE j = i NEW_LINE f = - 1 NEW_LINE while neg and x : NEW_LINE INDENT if f == - 1 : NEW_LINE INDENT j -= 1 NEW_LINE curr += arr [ j ] NEW_LINE neg -= 1 NEW_LINE x -= 1 NEW_LINE f = 1 NEW_LINE DEDENT elif f == 1 : NEW_LINE INDENT j += 1 NEW_LINE curr += arr [ j ] NEW_LINE x -= 1 NEW_LINE f = - 1 NEW_LINE DEDENT DEDENT if x : NEW_LINE INDENT curr += ( pref [ j + x ] - pref [ j ] ) NEW_LINE DEDENT ans = max ( ans , curr ) NEW_LINE DEDENT print ( ans ) NEW_LINE DEDENT


t = int ( input ( ) ) NEW_LINE for test in range ( t ) : NEW_LINE INDENT n , k , z = map ( int , input ( ) . split ( ) ) NEW_LINE arr = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE dp = [ [ [ 0 , 0 ] for i in range ( z + 1 ) ] for j in range ( n ) ] NEW_LINE dp [ 0 ] [ 0 ] [ 0 ] = arr [ 0 ] NEW_LINE m = 0 NEW_LINE for j in range ( z + 1 ) : NEW_LINE INDENT for i in range ( n ) : NEW_LINE INDENT if i > 0 : NEW_LINE INDENT dp [ i ] [ j ] = [ arr [ i ] + dp [ i - 1 ] [ j ] [ 0 ] , dp [ i - 1 ] [ j ] [ 1 ] + 1 ] NEW_LINE DEDENT if i < n - 1 and j > 0 and dp [ i ] [ j - 1 ] [ 0 ] + arr [ i + 1 ] + arr [ i ] > dp [ i ] [ j ] [ 0 ] : NEW_LINE INDENT dp [ i ] [ j ] = [ dp [ i ] [ j - 1 ] [ 0 ] + arr [ i + 1 ] + arr [ i ] , dp [ i + 1 ] [ j - 1 ] [ 1 ] + 1 ] NEW_LINE DEDENT if dp [ i ] [ j ] [ 1 ] == k : NEW_LINE INDENT m = max ( m , dp [ i ] [ j ] [ 0 ] ) NEW_LINE DEDENT DEDENT DEDENT print ( m ) NEW_LINE DEDENT


for _ in range ( int ( input ( ) ) ) : NEW_LINE INDENT n , k , z = map ( int , input ( ) . split ( ) ) NEW_LINE arr = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE pairSum = [ [ i , i + 1 ] for i in range ( n - 1 ) ] NEW_LINE pairSum . sort ( key = lambda x : arr [ x [ 0 ] ] + arr [ x [ 1 ] ] ) NEW_LINE sumUptoK = sum ( arr [ : k + 1 ] ) NEW_LINE ans = sumUptoK NEW_LINE for leftMoves in range ( 1 , z + 1 ) : NEW_LINE INDENT if k < 2 : NEW_LINE INDENT break NEW_LINE DEDENT sumUptoK -= arr [ k ] + arr [ k - 1 ] NEW_LINE k -= 2 NEW_LINE temp = sumUptoK NEW_LINE while True : NEW_LINE INDENT if not pairSum : NEW_LINE INDENT break NEW_LINE DEDENT if pairSum [ - 1 ] [ 1 ] <= k + 1 : NEW_LINE INDENT ans = max ( ans , sumUptoK + ( arr [ pairSum [ - 1 ] [ 0 ] ] + arr [ pairSum [ - 1 ] [ 1 ] ] ) * leftMoves ) NEW_LINE break NEW_LINE DEDENT else : NEW_LINE INDENT pairSum . pop ( ) NEW_LINE DEDENT DEDENT DEDENT print ( ans ) NEW_LINE DEDENT


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

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) + [ 0 ] ans , i = [ ' First ' , ' Second ' ] , 0 while ( a [ i ] == 1 ) : i += 1 if i == n : i += 1 print ( ans [ i % 2 ] ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) s = sum ( l ) if s == n and n % 2 : print ( " First " ) elif s == n and n % 2 == 0 : print ( " Second " ) else : w = 0 for i in l : if i == 1 : w = 1 - w else : break if w == 0 : print ( " First " ) else : print ( " Second " ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) c = 0 for i in range ( n ) : if ( l [ i ] == 1 ) : c += 1 else : break if ( c == n ) : if ( c % 2 == 0 ) : print ( " Second " ) else : print ( " First " ) elif ( c % 2 != 0 ) : print ( " Second " ) else : print ( " First " )                           NEW_LINE


for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) arr = [ int ( x ) for x in input ( ) . split ( ) ] k = 0 while k < n and arr [ k ] == 1 : k += 1 if ( k % 2 == 1 ) : if n == k : print ( " First " ) else : print ( " Second " ) else : if n == k : print ( " Second " ) else : print ( " First " ) NEW_LINE


import java . util . Scanner ;   public class _0849SequentialNim {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t > 0 ) { int n = sc . nextInt ( ) ; int k = 0 ; int hype = 0 ; boolean allone = true ; int [ ] arr = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } for ( int i = 1 ; i <= n ; i ++ ) { int temp = arr [ i ] ; if ( temp == 1 ) { k ++ ; } else { break ; } } System . out . println ( ( k == n ) ^ ! ( k % 2 == 0 ) ? " Second " : " First " ) ; t -- ; } }   }


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 ; FastI in = new FastI ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; BSequentialNim solver = new BSequentialNim ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class BSequentialNim { public void solve ( int testNumber , FastI sc , PrintWriter out ) { int t = sc . nextInt ( ) ; while ( t > 0 ) { t -- ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } int cnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] == 1 ) { cnt ++ ; } else { break ; } } if ( cnt == n ) { if ( cnt % 2 == 0 ) { out . println ( " Second " ) ; } else { out . println ( " First " ) ; } } else { if ( cnt % 2 == 0 ) { out . println ( " First " ) ; } else { out . println ( " Second " ) ; } } } }   }   static class FastI { BufferedReader br ; StringTokenizer st ;   public FastI ( InputStream inputStream ) { br = new BufferedReader ( new InputStreamReader ( inputStream ) ) ;   }   public String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   } }


import java . math . * ; import java . util . * ; import java . io . * ; public class gr13b {


import java . io . * ; import java . util . * ; import java . math . * ;   public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { Reader pm = new Reader ( ) ;

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) print ( ( ' Yes ' , ' No ' ) [ any ( [ ( a [ i ] - ( - 1 ) ** i * a [ 0 ] ) % n != i for i in range ( n ) ] ) ] ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) x = ( 0 - a [ 0 ] ) % nfor i in range ( 1 , n ) : if ( a [ i ] + x * ( - 1 ) ** i ) % n != i : print ( ' No ' ) exit ( 0 ) print ( ' Yes ' ) NEW_LINE


from sys import stdin     def real_puzzle ( n , active_teeth ) : while active_teeth [ 0 ] != 0 : for i in range ( n ) : if i % 2 == 0 : active_teeth [ i ] = ( active_teeth [ i ] + 1 ) % n else : active_teeth [ i ] = active_teeth [ i ] - 1 if active_teeth [ i ] != 0 else n - 1 for i in range ( n ) : if active_teeth [ i ] != i : return " No " return " Yes "     if __name__ == " _ _ main _ _ " : n = int ( stdin . readline ( ) ) active_teeth = [ int ( c ) for c in stdin . readline ( ) . split ( " ▁ " ) ] print ( real_puzzle ( n , active_teeth ) ) NEW_LINE


import java . util . * ; import java . io . * ;   public class Div2_310B { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] array = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) array [ i ] = sc . nextInt ( ) ; boolean flag = true ; for ( int i = 1 ; i < n ; i ++ ) if ( array [ i ] != array [ i - 1 ] + 1 ) { flag = false ; break ; } for ( int k = 0 ; k < n - 1 ; k ++ ) { array [ 0 ] = ( array [ 0 ] + 1 ) % n ; boolean f = true ; for ( int i = 1 ; i < n ; i ++ ) { if ( i % 2 == 1 ) { array [ i ] += n - 1 ; array [ i ] %= n ; } else { array [ i ] ++ ; array [ i ] %= n ; } } for ( int i = 1 ; i < n ; i ++ ) { if ( array [ i ] != array [ i - 1 ] + 1 ) { f = false ; break ; } } if ( f ) { flag = true ; break ; } } System . out . println ( flag ? " YES " : " NO " ) ; } }


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Scanner ;   public class Main {   static Scanner sc = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; public static void main ( String [ ] args ) { int [ ] atto = new int [ 1000 ] ; int cas = sc . nextInt ( ) ; int b = 0 ; int c = 0 ; for ( b = 0 ; b < cas ; b ++ ) { atto [ b ] = sc . nextInt ( ) ; } while ( atto [ 0 ] != 0 ) { for ( b = 0 ; b < cas ; b ++ ) { if ( b % 2 == 1 && atto [ b ] == 0 ) { atto [ b ] = cas - 1 ; } else if ( b % 2 == 1 ) { atto [ b ] -- ; } else if ( atto [ b ] == cas - 1 ) { atto [ b ] = 0 ; } else { atto [ b ] ++ ; } } } for ( b = 0 ; b < cas ; b ++ ) { if ( atto [ b ] == b ) { c = 1 ; } else { c = 0 ; break ; } } if ( c == 1 ) { System . out . println ( " YES " ) ; } else { System . out . println ( " No " ) ; } } }


import java . io . * ; import java . lang . Math ; import java . util . * ;   public class Main {   public BufferedReader in ; public PrintStream out ;   public boolean log_enabled = false ; public boolean multiply_tests = true ;   public static boolean do_gen_test = false ; public void gen_test ( ) { } private class TestCase {   public Object solve ( ) { int n = readInt ( ) ; int [ ] a = readIntArray ( n ) ; int min = 1000000001 ; int max = - 1 ; int t , mp = 0 ; int i ; for ( i = 0 ; i < n - 1 ; i ++ ) { if ( ( a [ i ] > - 1 ) && ( a [ i + 1 ] == - 1 ) ) { if ( a [ i ] > max ) { max = a [ i ] ; } if ( a [ i ] < min ) { min = a [ i ] ; } } if ( ( a [ i ] > - 1 ) && ( a [ i + 1 ] > - 1 ) ) { t = Math . abs ( a [ i ] - a [ i + 1 ] ) ; if ( t > mp ) { mp = t ; } } } for ( i = 1 ; i < n ; i ++ ) { if ( ( a [ i ] > - 1 ) && ( a [ i - 1 ] == - 1 ) ) { if ( a [ i ] > max ) { max = a [ i ] ; } if ( a [ i ] < min ) { min = a [ i ] ; } } } if ( max == - 1 ) { return "0 ▁ 42" ; } int k = ( min + max ) / 2 ; int m = Math . max ( max - k , k - min ) ; if ( m < mp ) { m = mp ; } return strf ( " % d ▁ % d " , m , k ) ;

def ceil ( a , b ) : return ( ( a + b - 1 ) // b ) def maximum_diff ( arr ) : ans = 0 for i in range ( 1 , len ( arr ) ) : ans = max ( ans , abs ( arr [ i ] - arr [ i - 1 ] ) ) return ansfor _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) arr = [ ] for i in range ( n ) : if a [ i ] != - 1 : left = max ( 0 , i - 1 ) right = min ( n - 1 , i + 1 ) if a [ left ] == - 1 or a [ right ] == - 1 : arr . append ( a [ i ] ) if len ( arr ) == 0 : print ( 0 , 0 ) else : k = ceil ( max ( arr ) + min ( arr ) , 2 ) for i in range ( n ) : if a [ i ] == - 1 : a [ i ] = k m = maximum_diff ( a ) print ( m , k ) NEW_LINE


def calc ( a , mx ) : l = 0 r = 10 ** 9 for i in range ( 1 , len ( a ) ) : if a [ i ] != - 1 and a [ i - 1 ] != - 1 : if abs ( a [ i ] - a [ i - 1 ] ) > mx : return None elif a [ i ] != - 1 : l = max ( l , a [ i ] - mx ) r = min ( r , a [ i ] + mx ) elif a [ i - 1 ] != - 1 : l = max ( l , a [ i - 1 ] - mx ) r = min ( r , a [ i - 1 ] + mx ) return l if l <= r else None     def solve ( a ) : if calc ( a , 0 ) is not None : return 0 , calc ( a , 0 ) low = 0 high = 1 while calc ( a , high ) is None : high *= 2 while low + 1 < high : mid = ( low + high ) // 2 if calc ( a , mid ) is None : low = mid else : high = mid return high , calc ( a , high )     tc = int ( input ( ) ) for _ in range ( tc ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) print ( * solve ( a ) ) NEW_LINE


import mathimport sys   t = int ( input ( ) )   for _ in range ( t ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) e = 0 ; c = 0 ; r = [ ] mx = - 10 ; mn = 10 ** 10 for i in range ( n ) : if a [ i ] != - 1 : if i != 0 : if a [ i - 1 ] == - 1 : mn = min ( mn , a [ i ] ) mx = max ( mx , a [ i ] ) if i != n - 1 : if a [ i + 1 ] == - 1 : mn = min ( mn , a [ i ] ) mx = max ( mx , a [ i ] ) else : r . append ( i ) if len ( r ) == n : k = 0 else : k = ( mx + mn ) // 2 for i in range ( len ( r ) ) : a [ r [ i ] ] = k mx = - 2 for i in range ( n - 1 ) : mx = max ( mx , abs ( a [ i ] - a [ i + 1 ] ) ) print ( mx , k ) NEW_LINE


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


import java . 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 ) ; AFunctionHeight solver = new AFunctionHeight ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class AFunctionHeight { public void solve ( int testNumber , InputReader in , PrintWriter out ) { long n = in . nextLong ( ) , k = in . nextLong ( ) ; out . println ( k / n + ( k % n == 0 ? 0 : 1 ) ) ; }   }   static class InputReader { private BufferedReader reader ; private StringTokenizer tokenizer ;   public InputReader ( InputStream inputStream ) { reader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; }   public String next ( ) { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { try { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return tokenizer . nextToken ( ) ; }   public long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   } }

n , k = map ( int , input ( ) . split ( ) ) print ( ( k + n - 1 ) // n ) NEW_LINE


import mathn , k = map ( int , input ( ) . split ( ) ) print ( ( k + n - 1 ) // n ) NEW_LINE


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


n , k = map ( int , input ( ) . split ( ) ) if k % n != 0 : print ( k // n + 1 ) else : print ( k // n ) NEW_LINE


from decimal import *   import math   n , k = map ( int , input ( ) . split ( ) ) print ( math . ceil ( Decimal ( k ) / Decimal ( n ) ) ) NEW_LINE


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


import java . util . * ; import java . io . * ; import java . math . * ; public class Main {


import java . util . Scanner ;   public class _0721NastyaIsPlayingComputerGames {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; System . out . println ( 3 * n + Math . min ( n - k , k - 1 ) ) ; }   }

n , k = map ( int , input ( ) . split ( ) ) ans = min ( k - 1 , n - k ) + 3 * n print ( ans ) NEW_LINE