import java . util . ArrayList ; import java . util . HashSet ; import java . util . List ; import java . util . Scanner ; import java . util . Set ; class Main { static boolean canSet ( int x , List < Integer > list ) { Set < Integer > set = new HashSet < > ( ) ; set . add ( 0 ) ; for ( int i : list ) { Set < Integer > newSet = new HashSet < > ( ) ; for ( int j : set ) { newSet . add ( j + i ) ; newSet . add ( j - i ) ; } set = newSet ; } return set . contains ( x ) ; } public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s = scan . next ( ) + ' T ' ; int x = scan . nextInt ( ) ; int y = scan . nextInt ( ) ; List < Integer > hol = new ArrayList < > ( ) ; List < Integer > ver = new ArrayList < > ( ) ; int index = 0 ; while ( s . charAt ( index ) != ' T ' ) ++ index ; x -= index ; int cnt = 0 ; int vec = 0 ; for ( int i = index ; i < s . length ( ) ; ++ i ) { if ( s . charAt ( i ) == ' F ' ) ++ cnt ; else { ++ vec ; if ( cnt > 0 ) { if ( vec % 2 == 1 ) hol . add ( cnt ) ; else ver . add ( cnt ) ; cnt = 0 ; } } } if ( canSet ( x , hol ) && canSet ( y , ver ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }

import java . io . * ; import java . util . * ; import static java . lang . System . in ; class Main { int [ ] [ ] rec = new int [ 1001 ] [ 1001 ] ; public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; char [ ] s = sc . next ( ) . toCharArray ( ) ; int x = sc . nextInt ( ) , y = sc . nextInt ( ) ; int start = 0 , n = s . length ; while ( start < n && s [ start ] == ' F ' ) start ++ ; ArrayList < Integer > hori = new ArrayList < > ( ) , vert = new ArrayList < > ( ) ; int parity = 0 ; int i = start ; while ( i < n ) { if ( s [ i ] == ' T ' ) { parity = 1 - parity ; i ++ ; } else { int j = i + 1 ; while ( j < n && s [ j ] == ' F ' ) j ++ ; if ( parity == 0 ) hori . add ( j - i ) ; else vert . add ( j - i ) ; i = j ; } } String ans = help ( x - start , hori ) && help ( y , vert ) ? " Yes " : " No " ; System . out . println ( ans ) ; } static boolean help ( int target , ArrayList < Integer > step ) { int sum = 0 ; for ( int w : step ) sum += w ; if ( sum < Math . abs ( target ) ) return false ; if ( sum == Math . abs ( target ) ) return true ; boolean [ ] cur = new boolean [ 2 * sum + 1 ] , next = new boolean [ 2 * sum + 1 ] ; cur [ sum ] = true ; for ( int w : step ) { for ( int j = 0 ; j <= 2 * sum ; j ++ ) { if ( cur [ j ] ) { next [ j - w ] = true ; next [ j + w ] = true ; } } cur = next ; next = new boolean [ 2 * sum + 1 ] ; } return cur [ target + sum ] ; } }

import java . util . * ; public class Main { static Scanner s = new Scanner ( System . in ) ; static int gInt ( ) { return Integer . parseInt ( s . next ( ) ) ; } public static void main ( String [ ] $ ) { String v = s . next ( ) ; int x = gInt ( ) , y = gInt ( ) ; ArrayList < Integer > dx = new ArrayList < > ( ) , dy = new ArrayList < > ( ) ; boolean dir = true ; int d = 0 ; for ( int i = 0 ; i < v . length ( ) ; i ++ ) { if ( v . charAt ( i ) == ' T ' ) { ( dir ? dx : dy ) . add ( d ) ; d = 0 ; dir ^= true ; } else { d ++ ; } } ( dir ? dx : dy ) . add ( d ) ; x -= dx . remove ( 0 ) ; System . out . println ( dp ( dx , x ) && dp ( dy , y ) ? " Yes " : " No " ) ; } static boolean dp ( List < Integer > list , int goal ) { Set < Integer > set = new HashSet < > ( ) , buf = new HashSet < > ( ) ; set . add ( 0 ) ; for ( int v : list ) { buf . clear ( ) ; for ( int base : set ) { buf . add ( base + v ) ; buf . add ( base - v ) ; } set . clear ( ) ; set . addAll ( buf ) ; } return set . contains ( goal ) ; } }

import java . util . ArrayList ; import java . util . Arrays ; import java . util . List ; import java . util . Scanner ; public class Main { static int PLUS = 10000 ; static boolean check ( int start , int x , List < Integer > a ) { boolean [ ] dp = new boolean [ 20002 ] ; dp [ start ] = true ; for ( int i = 0 ; i < a . size ( ) ; i ++ ) { boolean [ ] next_dp = new boolean [ 20002 ] ; for ( int j = 0 ; j < 20002 ; j ++ ) { if ( ! dp [ j ] ) { continue ; } next_dp [ j + a . get ( i ) ] = true ; next_dp [ j - a . get ( i ) ] = true ; } dp = Arrays . copyOf ( next_dp , 20002 ) ; } return dp [ x ] ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; while ( sc . hasNext ( ) ) { String s = sc . next ( ) ; int x = sc . nextInt ( ) + PLUS ; int y = sc . nextInt ( ) + PLUS ; List < Integer > ax = new ArrayList < > ( ) ; List < Integer > ay = new ArrayList < > ( ) ; boolean isOdd = false ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { int cnt = 0 ; while ( i < s . length ( ) && s . charAt ( i ) == ' F ' ) { cnt ++ ; i ++ ; } if ( isOdd ) { ay . add ( cnt ) ; } else { ax . add ( cnt ) ; } isOdd = ! isOdd ; } int nowX = PLUS + ax . get ( 0 ) ; int nowY = PLUS ; if ( check ( nowX , x , ax . subList ( 1 , ax . size ( ) ) ) && check ( nowY , y , ay ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } } }

def c ( p , g , lis ) : NEW_LINE INDENT for e in lis : NEW_LINE INDENT if p <= g : NEW_LINE INDENT p += e NEW_LINE DEDENT else : NEW_LINE INDENT p -= e NEW_LINE DEDENT DEDENT return p == g NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT s = input ( ) NEW_LINE gx , gy = map ( int , input ( ) . split ( ) ) NEW_LINE s = s . split ( " T " ) NEW_LINE s = [ len ( _ ) for _ in s ] NEW_LINE x_move = s [ : : 2 ] NEW_LINE y_move = s [ 1 : : 2 ] NEW_LINE x = x_move . pop ( 0 ) NEW_LINE y = 0 NEW_LINE x_move . sort ( reverse = True ) NEW_LINE y_move . sort ( reverse = True ) NEW_LINE if c ( x , gx , x_move ) and c ( y , gy , y_move ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT DEDENT

ai = lambda : list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE ai_ = lambda : [ int ( x ) - 1 for x in input ( ) . split ( ) ] NEW_LINE s = input ( ) . split ( ' T ' ) NEW_LINE x , y = ai ( ) NEW_LINE xx , yy = [ ] , [ ] NEW_LINE c = 0 NEW_LINE for i in range ( len ( s ) ) : NEW_LINE INDENT if i % 2 : NEW_LINE INDENT yy . append ( len ( s [ i ] ) ) NEW_LINE DEDENT else : NEW_LINE INDENT xx . append ( len ( s [ i ] ) ) NEW_LINE DEDENT DEDENT anx = set ( ) NEW_LINE for i in range ( len ( xx ) ) : NEW_LINE INDENT if i == 0 : NEW_LINE INDENT anx = { xx [ i ] } NEW_LINE DEDENT else : NEW_LINE INDENT aanx = set ( ) NEW_LINE for j in anx : NEW_LINE INDENT aanx . add ( j + xx [ i ] ) NEW_LINE aanx . add ( j - xx [ i ] ) NEW_LINE DEDENT anx = aanx NEW_LINE DEDENT DEDENT any = { 0 } NEW_LINE for i in range ( len ( yy ) ) : NEW_LINE INDENT aany = set ( ) NEW_LINE for j in any : NEW_LINE INDENT aany . add ( j + yy [ i ] ) NEW_LINE aany . add ( j - yy [ i ] ) NEW_LINE DEDENT any = aany NEW_LINE DEDENT if x in anx and y in any : NEW_LINE INDENT print ( ' Yes ' ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ' No ' ) NEW_LINE DEDENT

import sys NEW_LINE sys . setrecursionlimit ( 10000 ) NEW_LINE inp = list ( map ( len , input ( ) . split ( " T " ) ) ) NEW_LINE inx , iny = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE memo = { } NEW_LINE def tg ( g , n , t ) : NEW_LINE INDENT g . sort ( ) NEW_LINE g . reverse ( ) NEW_LINE def tn ( g , n , t ) : NEW_LINE INDENT if ( tuple ( g ) , n , t ) in memo : NEW_LINE INDENT return memo [ ( tuple ( g ) , n , t ) ] NEW_LINE DEDENT if g == [ ] : NEW_LINE INDENT if n == t : NEW_LINE INDENT return True NEW_LINE DEDENT else : NEW_LINE INDENT return False NEW_LINE DEDENT DEDENT if n < t : NEW_LINE INDENT z = tn ( g [ 1 : ] , n + g [ 0 ] , t ) NEW_LINE memo [ ( tuple ( g ) , n , t ) ] = z NEW_LINE return z NEW_LINE DEDENT else : NEW_LINE INDENT z = tn ( g [ 1 : ] , n - g [ 0 ] , t ) NEW_LINE memo [ ( tuple ( g ) , n , t ) ] = z NEW_LINE return z NEW_LINE DEDENT DEDENT return tn ( g , n , t ) NEW_LINE DEDENT if tg ( inp [ 1 : : 2 ] , 0 , iny ) and tg ( inp [ 2 : : 2 ] , inp [ 0 ] , inx ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT

def solve ( s , x , y ) : NEW_LINE INDENT def update ( move ) : NEW_LINE INDENT ncx = set ( ) NEW_LINE cx = cxy [ is_x ] NEW_LINE for x in cx : NEW_LINE INDENT ncx . add ( x + move ) NEW_LINE ncx . add ( x - move ) NEW_LINE DEDENT cxy [ is_x ] = ncx NEW_LINE DEDENT spl = map ( len , s . split ( ' T ' ) ) NEW_LINE is_x = 1 NEW_LINE cxy = [ { next ( spl ) } , { 0 } ] NEW_LINE for l in spl : NEW_LINE INDENT update ( l ) NEW_LINE is_x ^= 1 NEW_LINE DEDENT return x in cxy [ 0 ] and y in cxy [ 1 ] NEW_LINE DEDENT s = input ( ) NEW_LINE x , y = map ( int , input ( ) . split ( ) ) NEW_LINE print ( ' Yes ' if solve ( s , x , y ) else ' No ' ) NEW_LINE

s = input ( ) + " T " NEW_LINE goal_x , goal_y = map ( int , input ( ) . split ( ) ) NEW_LINE length = len ( s ) NEW_LINE dp_x , dp_y = [ 0 ] * ( length * 2 + 1 ) , [ 0 ] * ( length * 2 + 1 ) NEW_LINE start = x_steps = s . index ( " T " ) NEW_LINE dp_x [ length + start ] = dp_y [ length ] = 1 NEW_LINE steps = y_steps = 0 NEW_LINE direction = 0 NEW_LINE for i , c in enumerate ( s [ start : ] , start = start ) : NEW_LINE INDENT if c == " F " : NEW_LINE INDENT steps += 1 NEW_LINE DEDENT else : NEW_LINE INDENT if steps : NEW_LINE INDENT _dp = [ 0 ] * ( length * 2 + 1 ) NEW_LINE if direction == 0 : NEW_LINE INDENT for x , v in enumerate ( dp_x [ length - x_steps : length + x_steps + 1 ] , start = length - x_steps ) : NEW_LINE INDENT if v : NEW_LINE INDENT _dp [ x - steps ] = _dp [ x + steps ] = 1 NEW_LINE DEDENT DEDENT x_steps += steps NEW_LINE dp_x = _dp NEW_LINE DEDENT else : NEW_LINE INDENT for y , v in enumerate ( dp_y [ length - y_steps : length + y_steps + 1 ] , start = length - y_steps ) : NEW_LINE INDENT if v : NEW_LINE INDENT _dp [ y - steps ] = _dp [ y + steps ] = 1 NEW_LINE DEDENT DEDENT y_steps += steps NEW_LINE dp_y = _dp NEW_LINE DEDENT DEDENT steps = 0 NEW_LINE direction ^= 1 NEW_LINE DEDENT DEDENT print ( " Yes " if dp_x [ length + goal_x ] and dp_y [ length + goal_y ] else " No " ) NEW_LINE


import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner scan = new Scanner ( System . in ) ; int N = scan . nextInt ( ) ; if ( N % 2 == 0 ) { System . out . println ( " Blue " ) ; } else { System . out . println ( " Red " ) ; } } }

import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . InputMismatchException ; import java . io . IOException ; import java . io . InputStream ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; FastScanner in = new FastScanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class TaskA { public void solve ( int testNumber , FastScanner in , PrintWriter out ) { out . println ( ( in . nextInt ( ) & 1 ) == 1 ? " Red " : " Blue " ) ; } } static class FastScanner { private InputStream in ; private byte [ ] buffer = new byte [ 1024 ] ; private int bufPointer ; private int bufLength ; public FastScanner ( InputStream in ) { this . in = in ; this . bufPointer = 0 ; this . bufLength = 0 ; } private int readByte ( ) { if ( bufPointer >= bufLength ) { if ( bufLength == - 1 ) throw new InputMismatchException ( ) ; bufPointer = 0 ; try { bufLength = in . read ( buffer ) ; } catch ( IOException e ) { throw new InputMismatchException ( ) ; } if ( bufLength <= 0 ) return - 1 ; } return buffer [ bufPointer ++ ] ; } private static boolean isSpaceChar ( int c ) { return c == ' ▁ ' || c == ' \n ' || c == ' \r ' || c == ' \t ' || c == - 1 ; } public int nextInt ( ) { int n = 0 ; int b = readByte ( ) ; while ( isSpaceChar ( b ) ) b = readByte ( ) ; boolean minus = ( b == ' - ' ) ; if ( minus ) b = readByte ( ) ; while ( b >= '0' && b <= '9' ) { n *= 10 ; n += b - '0' ; b = readByte ( ) ; } if ( ! isSpaceChar ( b ) ) throw new NumberFormatException ( ) ; return minus ? - n : n ; } } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . UncheckedIOException ; import java . util . StringTokenizer ; class Main { public static void main ( String [ ] args ) { SC sc = new SC ( System . in ) ; int N = sc . nextInt ( ) ; if ( N % 2 == 0 ) { pl ( " Blue " ) ; } else if ( N % 2 == 1 ) { pl ( " Red " ) ; } } static class SC { private BufferedReader reader = null ; private StringTokenizer tokenizer = null ; public SC ( InputStream in ) { reader = new BufferedReader ( new InputStreamReader ( in ) ) ; } public String next ( ) { if ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { try { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { throw new UncheckedIOException ( e ) ; } } return tokenizer . nextToken ( ) ; } public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } public long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } public double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } public String nextLine ( ) { try { return reader . readLine ( ) ; } catch ( IOException e ) { throw new UncheckedIOException ( e ) ; } } } public static void pl ( Object o ) { System . out . println ( o ) ; } public static void p ( Object o ) { System . out . print ( o ) ; } public static boolean isPrime ( int a ) { if ( a < 4 ) { if ( a == 2 || a == 3 ) { return true ; } else { return false ; } } else { for ( int j = 2 ; j * j <= a ; j ++ ) { if ( a % j == 0 ) { return false ; } if ( a % j != 0 && ( j + 1 ) * ( j + 1 ) > a ) { return true ; } } return true ; } } }

import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int N = scanner . nextInt ( ) ; System . out . println ( ( N % 2 == 0 ) ? " Blue " : " Red " ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Main { static int N ; public static void main ( String [ ] args ) { FastScanner fc = new FastScanner ( System . in ) ; N = fc . nextInt ( ) ; System . out . println ( solve ( ) ) ; } static String solve ( ) { return N % 2 == 1 ? " Red " : " Blue " ; } @ SuppressWarnings ( " unused " ) static class FastScanner { private BufferedReader reader ; private StringTokenizer tokenizer ; FastScanner ( InputStream in ) { reader = new BufferedReader ( new InputStreamReader ( in ) ) ; tokenizer = null ; } String next ( ) { if ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { try { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } return tokenizer . nextToken ( ) ; } String nextLine ( ) { if ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { try { return reader . readLine ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } return tokenizer . nextToken ( " \n " ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } int [ ] nextIntArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } long [ ] nextLongArray ( int n ) { long [ ] a = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextLong ( ) ; return a ; } } }

n = int ( input ( ) ) NEW_LINE if n % 2 == 1 : NEW_LINE INDENT print ( " Red " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Blue " ) NEW_LINE DEDENT

print ( ' Red ' if int ( input ( ) ) % 2 else ' Blue ' ) NEW_LINE

import sys NEW_LINE sys . setrecursionlimit ( 10 ** 9 ) NEW_LINE input = sys . stdin . readline NEW_LINE N = int ( input ( ) ) NEW_LINE ans = " Blue " NEW_LINE if N % 2 == 1 : NEW_LINE INDENT ans = " Red " NEW_LINE DEDENT print ( ans ) NEW_LINE

def main ( ) : NEW_LINE INDENT n = int ( input ( ) ) NEW_LINE if n % 2 == 0 : NEW_LINE INDENT print ( " Blue " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Red " ) NEW_LINE DEDENT DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT main ( ) NEW_LINE DEDENT

print ( " BRleude " [ int ( input ( ) ) % 2 : : 2 ] ) NEW_LINE


public class Main { public static void main ( String [ ] args ) { java . util . Scanner s = new java . util . Scanner ( System . in ) ; int n = s . nextInt ( ) , a [ ] = new int [ n ] ; java . util . List < Integer > list = new java . util . ArrayList < > ( java . util . stream . IntStream . range ( 0 , n ) . map ( i -> a [ i ] = s . nextInt ( ) ) . boxed ( ) . collect ( java . util . stream . Collectors . toCollection ( java . util . TreeSet :: new ) ) ) ; for ( int i : a ) System . out . println ( java . util . Collections . binarySearch ( list , i ) ) ; } }

import java . math . BigDecimal ; import java . util . * ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int N = sc . nextInt ( ) ; long [ ] values = new long [ N ] ; SortedSet < Long > distincts = new TreeSet < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { values [ i ] = sc . nextLong ( ) ; distincts . add ( values [ i ] ) ; } HashMap < Long , Integer > rank = new HashMap < > ( ) ; int index = 0 ; for ( Long v : distincts ) { rank . put ( v , index ) ; index ++ ; } for ( int i = 0 ; i < N ; i ++ ) { System . out . println ( rank . get ( values [ i ] ) ) ; } } }

import java . util . Arrays ; import java . util . HashMap ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int [ ] a2 = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; a2 [ i ] = a [ i ] ; } Arrays . sort ( a2 ) ; int cnt = 1 ; int tmp = a2 [ 0 ] ; HashMap < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; map . put ( a2 [ 0 ] , 0 ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( tmp != a2 [ i ] ) { cnt ++ ; tmp = a2 [ i ] ; map . put ( a2 [ i ] , cnt - 1 ) ; } } for ( int i = 0 ; i < n ; i ++ ) { System . out . println ( map . get ( a [ i ] ) ) ; } sc . close ( ) ; } }

import java . util . * ; public class Main { public static class Pair { int index ; int value ; public Pair ( int index , int value ) { this . index = index ; this . value = value ; } } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; ArrayList < Pair > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { int index = i ; int value = sc . nextInt ( ) ; Pair p = new Pair ( index , value ) ; list . add ( p ) ; } Collections . sort ( list , ( a , b ) -> a . value - b . value ) ; int before = Integer . MAX_VALUE ; int nValue = - 1 ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { int tmp = list . get ( i ) . value ; if ( tmp != before ) { before = tmp ; nValue ++ ; } list . get ( i ) . value = nValue ; } Collections . sort ( list , ( a , b ) -> a . index - b . index ) ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { System . out . println ( list . get ( i ) . value ) ; } } }

import java . util . Arrays ; import java . util . Comparator ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Zaatu [ ] array = new Zaatu [ n ] ; Zaatu [ ] array2 = new Zaatu [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { Zaatu z = new Zaatu ( ) ; z . a = sc . nextInt ( ) ; array [ i ] = z ; array2 [ i ] = z ; } sc . close ( ) ; Arrays . sort ( array , new Comparator < Zaatu > ( ) { public int compare ( Zaatu o1 , Zaatu o2 ) { return o1 . a - o2 . a ; } } ) ; array [ 0 ] . b = 0 ; for ( int i = 1 ; i < n ; i ++ ) { if ( array [ i ] . a == array [ i - 1 ] . a ) { array [ i ] . b = array [ i - 1 ] . b ; } else { array [ i ] . b = array [ i - 1 ] . b + 1 ; } } for ( int i = 0 ; i < n ; i ++ ) { System . out . println ( array2 [ i ] . b ) ; } } static class Zaatu { int a , b ; } }

n = int ( input ( ) ) NEW_LINE A = list ( int ( input ( ) ) for i in range ( n ) ) NEW_LINE B = sorted ( list ( set ( A ) ) ) NEW_LINE C = { } NEW_LINE for i in range ( len ( B ) ) : NEW_LINE INDENT C [ B [ i ] ] = i NEW_LINE DEDENT for i in range ( len ( A ) ) : NEW_LINE INDENT print ( C [ A [ i ] ] ) NEW_LINE DEDENT

def seat_pressure ( N : int , A : list ) -> list : NEW_LINE INDENT m = { a : i for i , a in enumerate ( sorted ( set ( A ) ) ) } NEW_LINE return [ m [ a ] for a in A ] NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT N = int ( input ( ) ) NEW_LINE A = [ int ( input ( ) ) for _ in range ( N ) ] NEW_LINE ans = seat_pressure ( N , A ) NEW_LINE for a in ans : NEW_LINE INDENT print ( a ) NEW_LINE DEDENT DEDENT

def getInt ( ) : return int ( input ( ) ) NEW_LINE def getIntList ( ) : return [ int ( x ) for x in input ( ) . split ( ) ] NEW_LINE def zeros ( n ) : return [ 0 ] * n NEW_LINE INF = 10 ** 18 NEW_LINE class Debug ( ) : NEW_LINE INDENT def __init__ ( self ) : NEW_LINE INDENT self . debug = True NEW_LINE DEDENT def off ( self ) : NEW_LINE INDENT self . debug = False NEW_LINE DEDENT def dmp ( self , x , cmt = ' ' ) : NEW_LINE INDENT if self . debug : NEW_LINE INDENT if cmt != ' ' : NEW_LINE INDENT w = cmt + ' : ▁ ' + str ( x ) NEW_LINE DEDENT else : NEW_LINE INDENT w = str ( x ) NEW_LINE DEDENT print ( w ) NEW_LINE DEDENT return x NEW_LINE DEDENT DEDENT def prob ( ) : NEW_LINE INDENT d = Debug ( ) NEW_LINE d . off ( ) NEW_LINE N = getInt ( ) NEW_LINE d . dmp ( ( N ) , ' N ' ) NEW_LINE A = zeros ( N ) NEW_LINE adic = { } NEW_LINE for i in range ( N ) : NEW_LINE INDENT A [ i ] = getInt ( ) NEW_LINE adic [ A [ i ] ] = 0 NEW_LINE DEDENT ordered = sorted ( list ( adic . keys ( ) ) ) NEW_LINE for i in range ( len ( ordered ) ) : NEW_LINE INDENT adic [ ordered [ i ] ] = i NEW_LINE DEDENT for x in A : NEW_LINE INDENT print ( adic [ x ] ) NEW_LINE DEDENT return NEW_LINE DEDENT ans = prob ( ) NEW_LINE

import sys NEW_LINE input = sys . stdin . readline NEW_LINE N = int ( input ( ) ) NEW_LINE a = [ int ( input ( ) ) for _ in range ( N ) ] NEW_LINE anslist = [ 0 ] * N NEW_LINE for i , j in enumerate ( a ) : NEW_LINE INDENT anslist [ i ] = [ i , j , 0 ] NEW_LINE DEDENT anslist = sorted ( anslist , key = lambda x : x [ 1 ] ) NEW_LINE tmp = anslist [ 0 ] [ 1 ] NEW_LINE cnt = 0 NEW_LINE for i in range ( 1 , N ) : NEW_LINE INDENT if anslist [ i ] [ 1 ] == tmp : NEW_LINE INDENT anslist [ i ] [ 2 ] = cnt NEW_LINE DEDENT else : NEW_LINE INDENT tmp = anslist [ i ] [ 1 ] NEW_LINE cnt += 1 NEW_LINE anslist [ i ] [ 2 ] = cnt NEW_LINE DEDENT DEDENT anslist = sorted ( anslist , key = lambda x : x [ 0 ] ) NEW_LINE for i in anslist : NEW_LINE INDENT print ( i [ 2 ] ) NEW_LINE DEDENT

from collections import * ; n , * a = map ( int , open ( 0 ) . read ( ) . split ( ) ) ; b = { v : k for ( k , v ) in enumerate ( sorted ( set ( a ) ) ) } NEW_LINE for i in a : NEW_LINE INDENT print ( b [ i ] ) NEW_LINE DEDENT


import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; long ans = 1 ; for ( int i = 1 ; i <= N ; i ++ ) { ans *= i ; if ( ans > Math . pow ( 10 , 9 ) + 7 ) ans %= Math . pow ( 10 , 9 ) + 7 ; } System . out . println ( ( long ) ans % ( ( long ) Math . pow ( 10 , 9 ) + 7 ) ) ; } }

import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; BufferedWriter out = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ; int n = Integer . parseInt ( input . readLine ( ) ) ; int m = 1000000007 ; long sum = 1 ; for ( int i = 1 ; i <= n ; i ++ ) { sum *= i ; sum %= m ; } out . write ( String . valueOf ( sum ) ) ; out . write ( " \n " ) ; out . close ( ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . MathContext ; import java . math . RoundingMode ; public class Main { private static final long DIVIDER = ( long ) Math . pow ( 10 , 9 ) + 7 ; private static final MathContext MC = new MathContext ( 0 , RoundingMode . HALF_DOWN ) ; public static void main ( String [ ] args ) { int n = 0 ; try ( BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { n = Integer . parseInt ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; System . exit ( 1 ) ; } long quotient = 1 ; for ( int i = 1 ; i <= n ; i ++ ) { quotient = ( quotient * i ) % DIVIDER ; } System . out . print ( quotient ) ; } }

import java . util . * ; import java . util . stream . IntStream ; public class Main { public static boolean found = false ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long ret = 1 ; for ( int i = 0 ; i < n ; i ++ ) { ret = ( ret * ( i + 1 ) ) ; ret = ret % 1000000007 ; } System . out . println ( ret ) ; } }

import java . math . BigDecimal ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; BigDecimal x = BigDecimal . valueOf ( 1 ) ; for ( int i = 1 ; i <= N ; i ++ ) { x = x . multiply ( BigDecimal . valueOf ( i ) ) . remainder ( BigDecimal . valueOf ( 1000000007 ) ) ; } System . out . println ( x ) ; } }

N = int ( input ( ) ) NEW_LINE def fact ( n ) : NEW_LINE INDENT val = 1 NEW_LINE for i in range ( 2 , n + 1 ) : NEW_LINE INDENT val *= i NEW_LINE val %= 1000000007 NEW_LINE DEDENT return val NEW_LINE DEDENT print ( fact ( N ) ) NEW_LINE

from functools import reduce NEW_LINE import math NEW_LINE def main ( ) : NEW_LINE INDENT N = int ( input ( ) . rstrip ( ) ) NEW_LINE f = math . factorial ( N ) NEW_LINE print ( f % ( 10 ** 9 + 7 ) ) NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT main ( ) NEW_LINE DEDENT

import sys NEW_LINE def main ( ) : NEW_LINE INDENT input = sys . stdin . readline NEW_LINE N = int ( input ( ) ) NEW_LINE MOD = 10 ** 9 + 7 NEW_LINE ans = 1 NEW_LINE for i in range ( 1 , N + 1 ) : NEW_LINE INDENT ans *= i NEW_LINE ans = ans % MOD NEW_LINE DEDENT return ans NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT print ( main ( ) ) NEW_LINE DEDENT

import math NEW_LINE N = int ( input ( ) ) NEW_LINE print ( math . factorial ( N ) % 1000000007 ) NEW_LINE

n = int ( input ( ) ) NEW_LINE power = 1 NEW_LINE for i in range ( n ) : NEW_LINE INDENT power = power * ( i + 1 ) % 1000000007 NEW_LINE power %= 1000000007 NEW_LINE DEDENT print ( power ) NEW_LINE


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; System . out . println ( sc . nextInt ( ) < 1000 ? " ABC " : " ABD " ) ; } }

import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; if ( n >= 1 && n <= 999 ) System . out . println ( " ABC " ) ; else if ( n > 999 ) System . out . println ( " ABD " ) ; } }

import java . util . ArrayList ; import java . util . Collections ; import java . util . HashSet ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; System . out . println ( n > 999 ? " ABD " : " ABC " ) ; } }

import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; System . out . println ( N < 1000 ? " ABC " : " ABD " ) ; } }

import java . util . * ; class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int n = sc . nextInt ( ) ; System . out . println ( n < 1000 ? " ABC " : " ABD " ) ; } }

a = int ( input ( ) ) NEW_LINE if a <= 999 : NEW_LINE INDENT print ( " ABC " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " ABD " ) NEW_LINE DEDENT

import sys NEW_LINE import re NEW_LINE from collections import deque , defaultdict , Counter NEW_LINE from math import ceil , sqrt , hypot , factorial , pi , sin , cos , radians NEW_LINE from itertools import permutations , combinations , product NEW_LINE from operator import itemgetter , mul NEW_LINE from copy import deepcopy NEW_LINE from string import ascii_lowercase , ascii_uppercase , digits NEW_LINE def input ( ) : return sys . stdin . readline ( ) . strip ( ) NEW_LINE def INT ( ) : return int ( input ( ) ) NEW_LINE def MAP ( ) : return map ( int , input ( ) . split ( ) ) NEW_LINE def LIST ( ) : return list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE sys . setrecursionlimit ( 10 ** 9 ) NEW_LINE INF = float ( ' inf ' ) NEW_LINE MOD = 10 ** 9 + 7 NEW_LINE n = INT ( ) NEW_LINE if n < 1000 : NEW_LINE INDENT print ( ' ABC ' ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ' ABD ' ) NEW_LINE DEDENT

print ( ' ABC ' if int ( input ( ) ) < 1000 else ' ABD ' ) NEW_LINE

N = int ( input ( ) ) NEW_LINE print ( " ABC " if N <= 999 else " ABD " ) NEW_LINE

N = int ( input ( ) ) NEW_LINE if ( N < 1000 ) : NEW_LINE INDENT ans = ' ABC ' NEW_LINE DEDENT else : NEW_LINE INDENT ans = ' ABD ' NEW_LINE DEDENT print ( ans ) NEW_LINE


import java . util . * ; import static java . lang . System . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long N = sc . nextLong ( ) ; long A = sc . nextLong ( ) ; long B = sc . nextLong ( ) ; long min = A * ( N - 1 ) + B ; long max = A + ( N - 1 ) * B ; out . println ( Math . max ( 0 , max - min + 1 ) ) ; } }

import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . io . UncheckedIOException ; 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 ; LightScanner in = new LightScanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; AABProblem solver = new AABProblem ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class AABProblem { public void solve ( int testNumber , LightScanner in , PrintWriter out ) { int n = in . ints ( ) , a = in . ints ( ) , b = in . ints ( ) ; long max = ( n - 1L ) * b + a ; long min = ( n - 1L ) * a + b ; out . println ( Math . max ( 0 , max - min + 1 ) ) ; } } static class LightScanner { private BufferedReader reader = null ; private StringTokenizer tokenizer = null ; public LightScanner ( InputStream in ) { reader = new BufferedReader ( new InputStreamReader ( in ) ) ; } public String string ( ) { if ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { try { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { throw new UncheckedIOException ( e ) ; } } return tokenizer . nextToken ( ) ; } public int ints ( ) { return Integer . parseInt ( string ( ) ) ; } } }

import java . io . InputStream ; import java . io . IOException ; class MyScanner { InputStream stream ; public MyScanner ( ) { stream = System . in ; } public long nextLong ( ) { long ret = 0 ; try { while ( true ) { char readed = ( char ) stream . read ( ) ; if ( readed < '0' || readed > '9' ) { break ; } ret = ret * 10 + ( readed - '0' ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } finally { return ret ; } } } class Main { public static void main ( String args [ ] ) { MyScanner sc = new MyScanner ( ) ; long n = sc . nextLong ( ) , a = sc . nextLong ( ) , b = sc . nextLong ( ) ; long min = b + a * ( n - 1 ) ; long max = a + b * ( n - 1 ) ; if ( max < min ) { System . out . println ( 0 ) ; } else { System . out . println ( max - min + 1 ) ; } } }

import java . util . Scanner ; import java . util . Collections ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Queue ; import java . util . ArrayDeque ; import java . util . Deque ; import java . util . PriorityQueue ; import java . util . Set ; import java . util . HashSet ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; long n = scanner . nextLong ( ) ; long a = scanner . nextLong ( ) ; long b = scanner . nextLong ( ) ; long ans = ( b - a ) * ( n - 2 ) + 1 ; if ( a > b ) { System . out . println ( 0 ) ; } else if ( a == b ) { System . out . println ( 1 ) ; } else if ( a < b ) { if ( n >= 2 ) { System . out . println ( ans ) ; } else if ( n == 1 ) { System . out . println ( 0 ) ; } } } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextInt ( ) ; long a = sc . nextInt ( ) ; long b = sc . nextInt ( ) ; if ( a > b ) { System . out . println ( 0 ) ; return ; } if ( n == 1 ) { System . out . println ( a == b ? 1 : 0 ) ; return ; } else { System . out . println ( ( long ) ( ( b - a ) * ( n - 2 ) + 1 ) ) ; } } }

N , A , B = map ( int , input ( ) . split ( ) ) NEW_LINE if A > B : NEW_LINE INDENT print ( 0 ) NEW_LINE DEDENT elif N == 1 and A != B : NEW_LINE INDENT print ( 0 ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ( B - A ) * ( N - 2 ) + 1 ) NEW_LINE DEDENT

import sys NEW_LINE import math NEW_LINE INF = float ( ' inf ' ) NEW_LINE MOD = 10 ** 9 + 7 NEW_LINE def LI ( ) : return [ int ( x ) for x in sys . stdin . readline ( ) . split ( ) ] NEW_LINE def LI_ ( ) : return [ int ( x ) - 1 for x in sys . stdin . readline ( ) . split ( ) ] NEW_LINE def LS ( ) : return sys . stdin . readline ( ) . split ( ) NEW_LINE def II ( ) : return int ( sys . stdin . readline ( ) ) NEW_LINE def SI ( ) : return input ( ) NEW_LINE def main ( ) : NEW_LINE INDENT n , a , b = LI ( ) NEW_LINE return max ( 0 , ( n - 2 ) * ( b - a ) + 1 ) NEW_LINE DEDENT print ( main ( ) ) NEW_LINE

n , a , b = map ( int , input ( ) . split ( ) ) NEW_LINE print ( max ( ( ( n - 1 ) * b + a ) - ( ( n - 1 ) * a + b ) + 1 , 0 ) ) NEW_LINE

N , A , B = map ( int , input ( ) . split ( ) ) NEW_LINE if N == 1 : NEW_LINE INDENT if A == B : NEW_LINE INDENT print ( 1 ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( 0 ) NEW_LINE DEDENT DEDENT else : NEW_LINE INDENT if A > B : NEW_LINE INDENT print ( 0 ) NEW_LINE DEDENT elif A == B or N == 2 : NEW_LINE INDENT print ( 1 ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ( B - A ) * ( N - 2 ) + 1 ) NEW_LINE DEDENT DEDENT

N , A , B = map ( int , input ( ) . split ( ) ) NEW_LINE if A > B : NEW_LINE INDENT print ( 0 ) NEW_LINE exit ( ) NEW_LINE DEDENT if N == 1 and A != B : NEW_LINE INDENT print ( 0 ) NEW_LINE exit ( ) NEW_LINE DEDENT elif N == 1 and A == B : NEW_LINE INDENT print ( 1 ) NEW_LINE exit ( ) NEW_LINE DEDENT print ( ( B * ( N - 1 ) + A ) - ( A * ( N - 1 ) + B ) + 1 ) NEW_LINE


import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int s = sc . nextInt ( ) ; int m = 1 ; for ( int i = 0 ; i < 10000 ; i ++ ) { if ( s == 4 || s == 2 || s == 1 ) { break ; } if ( s % 2 == 0 ) { s = s / 2 ; m = m + 1 ; } else { s = ( s * 3 ) + 1 ; m = m + 1 ; } } m = m + 3 ; System . out . println ( m ) ; } }

import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader bf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int s = Integer . valueOf ( bf . readLine ( ) ) , m = 1 ; Set < Integer > number = new HashSet < > ( ) ; while ( true ) { if ( ! number . add ( s ) ) { break ; } if ( s % 2 > 0 ) { s = 3 * s + 1 ; } else { s /= 2 ; } m ++ ; } System . out . println ( m ) ; } }

import java . io . InputStream ; import java . io . PrintStream ; import java . util . Scanner ; public class Main { InputStream in = System . in ; PrintStream out = System . out ; int f ( int n ) { if ( n % 2 == 0 ) { return n / 2 ; } else { return 3 * n + 1 ; } } public void _main ( String [ ] args ) { Scanner sc = new Scanner ( in ) ; int s = sc . nextInt ( ) ; int [ ] a = new int [ 1000000 ] ; a [ s ] = 1 ; int i , i_1 = s ; int n = 1 ; for ( ; ; ) { i = f ( i_1 ) ; n ++ ; if ( a [ i ] == 1 ) { out . println ( n ) ; break ; } a [ i ] = 1 ; i_1 = i ; } sc . close ( ) ; } public static void main ( String [ ] args ) { new Main ( ) . _main ( args ) ; } }

import java . util . ArrayList ; import java . util . Scanner ; public class Main { public static int f ( int a ) { if ( a % 2 == 0 ) { return a / 2 ; } else { return 3 * a + 1 ; } } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int s = sc . nextInt ( ) ; int index ; sc . close ( ) ; ArrayList < Integer > data = new ArrayList < Integer > ( ) ; while ( true ) { index = data . indexOf ( s ) ; data . add ( s ) ; if ( index == - 1 ) { s = f ( s ) ; } else { break ; } } System . out . println ( data . size ( ) ) ; } }

import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; Integer s = scan . nextInt ( ) ; List < Integer > numList = new ArrayList ( ) ; OUT : for ( int i = 1 ; ; i ++ ) { if ( i == 1 ) { numList . add ( s ) ; } Integer currentValue = null ; if ( i > 1 ) { Integer prevValue = numList . get ( i - 2 ) ; if ( prevValue % 2 == 0 ) { currentValue = prevValue / 2 ; } else { currentValue = 3 * prevValue + 1 ; } for ( Integer num : numList ) { if ( currentValue == num ) { System . out . println ( i ) ; break OUT ; } } numList . add ( currentValue ) ; } } } } Note : . / Main . java uses unchecked or unsafe operations . Note : Recompile with - Xlint : unchecked for details .

s = int ( input ( ) ) NEW_LINE count = 2 NEW_LINE num = s NEW_LINE collatz_list = [ s ] NEW_LINE while True : NEW_LINE INDENT if num % 2 == 0 : NEW_LINE INDENT num = num // 2 NEW_LINE DEDENT else : NEW_LINE INDENT num = 3 * num + 1 NEW_LINE DEDENT if num in collatz_list : NEW_LINE INDENT print ( count ) NEW_LINE exit ( ) NEW_LINE DEDENT else : NEW_LINE INDENT collatz_list . append ( num ) NEW_LINE count += 1 NEW_LINE DEDENT DEDENT

s = int ( input ( ) ) NEW_LINE a = s NEW_LINE already = set ( ) NEW_LINE already . add ( a ) NEW_LINE for i in range ( 10000000 ) : NEW_LINE INDENT if a % 2 : NEW_LINE INDENT a = 3 * a + 1 NEW_LINE if { a } <= already : NEW_LINE INDENT print ( i + 2 ) NEW_LINE exit ( 0 ) NEW_LINE DEDENT already . add ( a ) NEW_LINE DEDENT else : NEW_LINE INDENT a //= 2 NEW_LINE if { a } <= already : NEW_LINE INDENT print ( i + 2 ) NEW_LINE exit ( 0 ) NEW_LINE DEDENT already . add ( a ) NEW_LINE DEDENT DEDENT

s = int ( input ( ) ) NEW_LINE progression = [ s ] NEW_LINE n = s NEW_LINE count = 1 NEW_LINE while True : NEW_LINE INDENT count += 1 NEW_LINE if n % 2 == 0 : NEW_LINE INDENT n = n / 2 NEW_LINE DEDENT else : NEW_LINE INDENT n = 3 * n + 1 NEW_LINE DEDENT if n in progression : NEW_LINE INDENT break NEW_LINE DEDENT else : NEW_LINE INDENT progression . append ( n ) NEW_LINE DEDENT DEDENT print ( count ) NEW_LINE

def COL ( n ) : NEW_LINE INDENT if n % 2 == 0 : NEW_LINE INDENT return int ( n / 2 ) NEW_LINE DEDENT else : NEW_LINE INDENT return 3 * n + 1 NEW_LINE DEDENT DEDENT s = int ( input ( ) ) NEW_LINE List = [ s ] NEW_LINE s = COL ( s ) NEW_LINE while s not in List : NEW_LINE INDENT List . append ( s ) NEW_LINE s = COL ( s ) NEW_LINE DEDENT print ( len ( List ) + 1 ) NEW_LINE

n = int ( input ( ) ) NEW_LINE li = [ n ] NEW_LINE x = 0 NEW_LINE i = 0 NEW_LINE while i <= 1000000 and x == 0 : NEW_LINE INDENT if li [ i ] % 2 == 0 : NEW_LINE INDENT li . append ( li [ i ] / 2 ) NEW_LINE for j in range ( i ) : NEW_LINE INDENT if li [ i + 1 ] == li [ j ] : NEW_LINE INDENT x = i + 2 NEW_LINE DEDENT else : pass NEW_LINE DEDENT i += 1 NEW_LINE DEDENT else : NEW_LINE INDENT li . append ( 3 * li [ i ] + 1 ) NEW_LINE for j in range ( i ) : NEW_LINE INDENT if li [ i + 1 ] == li [ j ] : NEW_LINE INDENT x = i + 2 NEW_LINE DEDENT else : pass NEW_LINE DEDENT i += 1 NEW_LINE DEDENT DEDENT print ( x ) NEW_LINE


import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; int [ ] [ ] kankeigraph = new int [ N + 1 ] [ N + 1 ] ; int [ ] friend = new int [ 10 ] ; boolean [ ] friend_of_friend = new boolean [ 11 ] ; int friend_cnt = 0 ; for ( int i = 0 ; i <= N ; i ++ ) { for ( int j = 0 ; j <= N ; j ++ ) { kankeigraph [ i ] [ j ] = 0 ; } } for ( int i = 0 ; i < 10 ; i ++ ) { friend [ i ] = 0 ; } for ( int i = 0 ; i < M ; i ++ ) { int from = sc . nextInt ( ) ; int to = sc . nextInt ( ) ; kankeigraph [ from ] [ to ] = 1 ; kankeigraph [ to ] [ from ] = 1 ; } for ( int i = 1 ; i <= N ; i ++ ) { for ( int j = 0 ; j < 10 ; j ++ ) { friend [ j ] = 0 ; } for ( int j = 1 ; j <= 10 ; j ++ ) { friend_of_friend [ j ] = false ; } friend_cnt = 0 ; for ( int j = 1 ; j <= N ; j ++ ) { if ( kankeigraph [ i ] [ j ] == 1 ) { friend [ friend_cnt ] = j ; friend_cnt ++ ; } } for ( int j = 0 ; j < friend_cnt ; j ++ ) { for ( int k = 1 ; k <= N ; k ++ ) { if ( kankeigraph [ friend [ j ] ] [ k ] == 1 && kankeigraph [ i ] [ k ] == 0 && i != k ) { friend_of_friend [ k ] = true ; } } } int kazu = 0 ; for ( int j = 1 ; j <= N ; j ++ ) { if ( friend_of_friend [ j ] ) { kazu ++ ; } } System . out . println ( kazu ) ; } } }

import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . HashSet ; import java . util . List ; import java . util . Scanner ; import java . util . Set ; import java . util . ArrayList ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; C solver = new C ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class C { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; List < Set < Integer > > friends = new ArrayList < > ( n ) ; for ( int i = 0 ; i < n ; i ++ ) { friends . add ( new HashSet < > ( ) ) ; } for ( int i = 0 ; i < m ; i ++ ) { int a = in . nextInt ( ) - 1 , b = in . nextInt ( ) - 1 ; friends . get ( a ) . add ( b ) ; friends . get ( b ) . add ( a ) ; } for ( int i = 0 ; i < n ; i ++ ) { Set < Integer > friend = friends . get ( i ) ; Set < Integer > ff = new HashSet < > ( ) ; for ( int f : friend ) { ff . addAll ( friends . get ( f ) ) ; } ff . removeAll ( friend ) ; ff . remove ( i ) ; out . println ( ff . size ( ) ) ; } } } }

import java . util . ArrayList ; import java . util . List ; import java . util . Map ; import java . util . function . Function ; import java . util . stream . Collectors ; import java . util . stream . IntStream ; public class Main { private static java . util . Scanner scanner = new java . util . Scanner ( System . in ) ; public static void main ( String [ ] $ ) { int n = scanner . nextInt ( ) , m = scanner . nextInt ( ) ; Map < Integer , List < Integer > > friendMap = IntStream . rangeClosed ( 1 , n ) . boxed ( ) . collect ( Collectors . toMap ( Function . identity ( ) , i -> new ArrayList < > ( ) ) ) ; for ( int i = 0 , l , r ; i < m ; i ++ ) { friendMap . get ( l = scanner . nextInt ( ) ) . add ( r = scanner . nextInt ( ) ) ; friendMap . get ( r ) . add ( l ) ; } IntStream . rangeClosed ( 1 , n ) . mapToLong ( i -> friendMap . get ( i ) . stream ( ) . flatMap ( friend -> friendMap . get ( friend ) . stream ( ) . filter ( f -> ! friendMap . get ( i ) . contains ( f ) && f != i ) ) . distinct ( ) . count ( ) ) . forEach ( System . out :: println ) ; } }

import java . util . * ; import static java . lang . System . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; HashMap < Integer , List < Integer > > relations = new HashMap < Integer , List < Integer > > ( ) ; for ( int i = 0 ; i < M ; i ++ ) { int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; addRelations ( A , B , relations ) ; addRelations ( B , A , relations ) ; } for ( int i = 1 ; i <= N ; i ++ ) { Set < Integer > friendOfFriend = new HashSet < Integer > ( ) ; if ( relations . containsKey ( i ) ) { for ( int f : relations . get ( i ) ) { if ( relations . containsKey ( f ) ) { for ( int ff : relations . get ( f ) ) { if ( i == ff || relations . get ( i ) . contains ( ff ) ) { continue ; } friendOfFriend . add ( ff ) ; } } } } out . println ( friendOfFriend . size ( ) ) ; } } public static void addRelations ( int A , int B , HashMap < Integer , List < Integer > > relations ) { List < Integer > list = new ArrayList < Integer > ( ) ; if ( relations . containsKey ( A ) ) { list = relations . get ( A ) ; } list . add ( B ) ; relations . put ( A , list ) ; } }

import java . util . * ; import java . awt . * ; import java . awt . geom . * ; import static java . lang . System . * ; import static java . lang . Math . * ; public class Main { public static void main ( String [ ] $ ) { Scanner sc = new Scanner ( in ) ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; int [ ] [ ] d = new int [ n + 1 ] [ n + 1 ] ; int inf = 100 ; for ( int i = 0 ; i <= n ; i ++ ) { for ( int j = 0 ; j <= n ; j ++ ) { d [ i ] [ j ] = inf ; } } for ( int i = 0 ; i < m ; i ++ ) { int a = sc . nextInt ( ) , b = sc . nextInt ( ) ; d [ a ] [ b ] = d [ b ] [ a ] = 1 ; } for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= n ; j ++ ) { for ( int k = 1 ; k <= n ; k ++ ) { if ( d [ j ] [ k ] > d [ j ] [ i ] + d [ i ] [ k ] ) { d [ j ] [ k ] = d [ j ] [ i ] + d [ i ] [ k ] ; } } } } for ( int i = 1 ; i <= n ; i ++ ) { int ans = 0 ; for ( int j = 1 ; j <= n ; j ++ ) { if ( j != i && d [ i ] [ j ] == 2 ) { ans ++ ; } } out . println ( ans ) ; } } }

n , m = map ( int , input ( ) . split ( ) ) NEW_LINE d = [ [ ] for i in range ( n ) ] NEW_LINE for i in range ( m ) : NEW_LINE INDENT a , b = map ( int , input ( ) . split ( ) ) NEW_LINE d [ a - 1 ] . append ( b - 1 ) NEW_LINE d [ b - 1 ] . append ( a - 1 ) NEW_LINE DEDENT c = 0 NEW_LINE for i in range ( n ) : NEW_LINE INDENT for j in range ( n ) : NEW_LINE INDENT for h in range ( n ) : NEW_LINE INDENT if i != j : NEW_LINE INDENT if j not in d [ i ] : NEW_LINE INDENT if h in d [ i ] : NEW_LINE INDENT if j in d [ h ] : NEW_LINE INDENT c += 1 NEW_LINE break NEW_LINE DEDENT DEDENT DEDENT DEDENT DEDENT DEDENT else : NEW_LINE INDENT print ( c ) NEW_LINE c = 0 NEW_LINE DEDENT DEDENT

from collections import defaultdict NEW_LINE class Graph ( object ) : NEW_LINE INDENT def __init__ ( self ) : NEW_LINE INDENT self . graph = defaultdict ( list ) NEW_LINE DEDENT def __len__ ( self ) : NEW_LINE INDENT return len ( self . graph ) NEW_LINE DEDENT def add_edge ( self , src , dst ) : NEW_LINE INDENT self . graph [ src ] . append ( dst ) NEW_LINE self . graph [ dst ] . append ( src ) NEW_LINE DEDENT DEDENT N , M = map ( int , input ( ) . split ( ) ) NEW_LINE friends = Graph ( ) NEW_LINE for m in range ( M ) : NEW_LINE INDENT a , b = map ( int , input ( ) . split ( ) ) NEW_LINE friends . add_edge ( a , b ) NEW_LINE DEDENT for i in range ( N ) : NEW_LINE INDENT nums = [ ] NEW_LINE for j in friends . graph [ i + 1 ] : NEW_LINE INDENT for k in friends . graph [ j ] : NEW_LINE INDENT if k not in friends . graph [ i + 1 ] : NEW_LINE INDENT nums . append ( k ) NEW_LINE DEDENT DEDENT DEDENT nums = set ( nums ) NEW_LINE if i + 1 in nums : NEW_LINE INDENT nums . remove ( i + 1 ) NEW_LINE DEDENT print ( len ( nums ) ) NEW_LINE DEDENT

import sys NEW_LINE input = sys . stdin . readline NEW_LINE inf = 10 ** 18 NEW_LINE N , M = map ( int , input ( ) . split ( ) ) NEW_LINE AB = [ list ( map ( int , input ( ) . split ( ) ) ) for _ in range ( M ) ] NEW_LINE net = [ [ False ] * N for _ in range ( N ) ] NEW_LINE for Ai , Bi in AB : NEW_LINE INDENT net [ Ai - 1 ] [ Bi - 1 ] = True NEW_LINE net [ Bi - 1 ] [ Ai - 1 ] = True NEW_LINE DEDENT for p in range ( N ) : NEW_LINE INDENT net2 = [ False ] * N NEW_LINE for q in filter ( lambda x : net [ p ] [ x ] , range ( N ) ) : NEW_LINE INDENT if q == p : continue NEW_LINE for r in filter ( lambda x : net [ q ] [ x ] , range ( N ) ) : NEW_LINE INDENT if r == p : continue NEW_LINE if net [ p ] [ r ] : continue NEW_LINE net2 [ r ] = True NEW_LINE DEDENT DEDENT print ( sum ( net2 ) ) NEW_LINE DEDENT

n , m = map ( int , input ( ) . split ( ) ) NEW_LINE d = [ [ float ( " inf " ) ] * n for i in range ( n ) ] NEW_LINE for i in range ( m ) : NEW_LINE INDENT a , b = map ( int , input ( ) . split ( ) ) NEW_LINE a -= 1 NEW_LINE b -= 1 NEW_LINE d [ a ] [ b ] = 1 NEW_LINE d [ b ] [ a ] = 1 NEW_LINE DEDENT for i in range ( n ) : NEW_LINE INDENT for j in range ( n ) : NEW_LINE INDENT for k in range ( n ) : NEW_LINE INDENT d [ i ] [ j ] = min ( d [ i ] [ j ] , d [ i ] [ k ] + d [ k ] [ j ] ) NEW_LINE DEDENT DEDENT DEDENT for i in d : NEW_LINE INDENT print ( max ( 0 , i . count ( 2 ) - 1 ) ) NEW_LINE DEDENT

N , M = map ( int , input ( ) . split ( ) ) NEW_LINE A = [ list ( map ( int , input ( ) . split ( ) ) ) for _ in range ( M ) ] NEW_LINE dist = [ [ 10 ** 5 for _ in range ( N ) ] for _ in range ( N ) ] NEW_LINE res = [ 0 for _ in range ( N ) ] NEW_LINE def warshall_floyd ( d , V ) : NEW_LINE INDENT for k in range ( V ) : NEW_LINE INDENT for i in range ( V ) : NEW_LINE INDENT for j in range ( V ) : NEW_LINE INDENT d [ i ] [ j ] = min ( d [ i ] [ j ] , d [ i ] [ k ] + d [ k ] [ j ] ) NEW_LINE DEDENT DEDENT DEDENT return d NEW_LINE DEDENT for i in range ( M ) : NEW_LINE INDENT A [ i ] [ 0 ] -= 1 NEW_LINE A [ i ] [ 1 ] -= 1 NEW_LINE DEDENT for i in range ( N ) : NEW_LINE INDENT for j in range ( N ) : NEW_LINE INDENT if i == j : NEW_LINE INDENT dist [ i ] [ j ] = 0 NEW_LINE DEDENT DEDENT DEDENT for i in range ( M ) : NEW_LINE INDENT dist [ A [ i ] [ 0 ] ] [ A [ i ] [ 1 ] ] = 1 NEW_LINE dist [ A [ i ] [ 1 ] ] [ A [ i ] [ 0 ] ] = 1 NEW_LINE DEDENT distance = warshall_floyd ( dist , N ) NEW_LINE for i in range ( N ) : NEW_LINE INDENT for j in range ( N ) : NEW_LINE INDENT if distance [ i ] [ j ] == 2 : NEW_LINE INDENT res [ i ] += 1 NEW_LINE DEDENT DEDENT DEDENT for i in range ( N ) : NEW_LINE INDENT print ( res [ i ] ) NEW_LINE DEDENT


import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double a = sc . nextInt ( ) ; double b = sc . nextInt ( ) ; double c = sc . nextInt ( ) ; double d = sc . nextInt ( ) ; if ( a / b > c / d ) { System . out . println ( " AOKI " ) ; } else if ( a / b == c / d ) { System . out . println ( " DRAW " ) ; } else { System . out . println ( " TAKAHASHI " ) ; } } }

import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . InputMismatchException ; import java . io . IOException ; import java . io . InputStream ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; FastScanner in = new FastScanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class TaskA { public void solve ( int testNumber , FastScanner in , PrintWriter out ) { double t = in . nextDouble ( ) / in . nextDouble ( ) ; double a = in . nextDouble ( ) / in . nextDouble ( ) ; if ( a == t ) out . println ( " DRAW " ) ; else out . println ( t < a ? " TAKAHASHI " : " AOKI " ) ; } } static class FastScanner { private InputStream in ; private byte [ ] buffer = new byte [ 1024 ] ; private int bufPointer ; private int bufLength ; public FastScanner ( InputStream in ) { this . in = in ; this . bufPointer = 0 ; this . bufLength = 0 ; } private int readByte ( ) { if ( bufPointer >= bufLength ) { if ( bufLength == - 1 ) throw new InputMismatchException ( ) ; bufPointer = 0 ; try { bufLength = in . read ( buffer ) ; } catch ( IOException e ) { throw new InputMismatchException ( ) ; } if ( bufLength <= 0 ) return - 1 ; } return buffer [ bufPointer ++ ] ; } private static boolean isPrintableChar ( int c ) { return c >= 33 && c <= 126 ; } public String next ( ) { StringBuilder sb = new StringBuilder ( ) ; int b = readByte ( ) ; while ( ! isPrintableChar ( b ) ) b = readByte ( ) ; while ( isPrintableChar ( b ) ) { sb . appendCodePoint ( b ) ; b = readByte ( ) ; } return sb . toString ( ) ; } public double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } } }

import java . util . * ; import java . util . stream . * ; import static java . lang . System . * ; class Main { static Scanner sc = new Scanner ( System . in ) ; static int nextInt ( ) { return Integer . parseInt ( sc . next ( ) ) ; } static int [ ] nextIntArray ( int n ) { return IntStream . range ( 0 , n ) . map ( i -> nextInt ( ) ) . toArray ( ) ; } static int max ( int ... ar ) { Arrays . sort ( ar ) ; return ar [ ar . length - 1 ] ; } static int min ( int ... ar ) { Arrays . sort ( ar ) ; return ar [ 0 ] ; } static int maxInt = Integer . MAX_VALUE ; static int minInt = Integer . MIN_VALUE ; public static void main ( String [ ] args ) { double a = sc . nextDouble ( ) , b = sc . nextDouble ( ) , c = sc . nextDouble ( ) , d = sc . nextDouble ( ) ; out . println ( b / a > d / c ? " TAKAHASHI " : b / a == d / c ? " DRAW " : " AOKI " ) ; } }

import java . util . Scanner ; public class Main { private static final String TEAM_A = " TAKAHASHI " ; private static final String TEAM_B = " AOKI " ; private static final String DRAW = " DRAW " ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double a = sc . nextDouble ( ) ; double b = sc . nextDouble ( ) ; double c = sc . nextDouble ( ) ; double d = sc . nextDouble ( ) ; sc . close ( ) ; double perVicA = b / a ; double perVicB = d / c ; if ( perVicA == perVicB ) { System . out . println ( DRAW ) ; } else if ( perVicA > perVicB ) { System . out . println ( TEAM_A ) ; } else { System . out . println ( TEAM_B ) ; } } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Task solver = new Task ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class Task { public void solve ( int testNumber , InputReader in , PrintWriter out ) { double A = in . nextInt ( ) ; double B = in . nextInt ( ) ; double C = in . nextInt ( ) ; double D = in . nextInt ( ) ; if ( B / A > D / C ) { out . println ( " TAKAHASHI " ) ; } else if ( B / A < D / C ) { out . println ( " AOKI " ) ; } else { out . println ( " DRAW " ) ; } } } static class InputReader { public BufferedReader reader ; public StringTokenizer tokenizer ; public InputReader ( InputStream stream ) { reader = new BufferedReader ( new InputStreamReader ( stream ) , 32768 ) ; tokenizer = null ; } public String next ( ) { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { try { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } return tokenizer . nextToken ( ) ; } public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } } }

a , b , c , d = map ( int , input ( ) . split ( ) ) NEW_LINE if c * b == a * d : NEW_LINE INDENT print ( ' DRAW ' ) NEW_LINE DEDENT elif c * b > a * d : NEW_LINE INDENT print ( ' TAKAHASHI ' ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ' AOKI ' ) NEW_LINE DEDENT

def win_rate ( A : int , B : int , C : int , D : int ) -> str : NEW_LINE INDENT if B * C < A * D : NEW_LINE INDENT return ' AOKI ' NEW_LINE DEDENT if B * C > A * D : NEW_LINE INDENT return ' TAKAHASHI ' NEW_LINE DEDENT return ' DRAW ' NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT A , B , C , D = map ( int , input ( ) . split ( ) ) NEW_LINE ans = win_rate ( A , B , C , D ) NEW_LINE print ( ans ) NEW_LINE DEDENT

ia , ib , ic , id = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE if ib / ia == id / ic : NEW_LINE INDENT print ( " DRAW " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " TAKAHASHI " if ib / ia > id / ic else " AOKI " ) NEW_LINE DEDENT

x = input ( ) NEW_LINE takahashi = float ( x . split ( ' ▁ ' ) [ 1 ] ) / float ( x . split ( ' ▁ ' ) [ 0 ] ) NEW_LINE aoki = float ( x . split ( ' ▁ ' ) [ 3 ] ) / float ( x . split ( ' ▁ ' ) [ 2 ] ) NEW_LINE if takahashi == aoki : NEW_LINE INDENT print ( ' DRAW ' ) NEW_LINE DEDENT elif takahashi > aoki : NEW_LINE INDENT print ( ' TAKAHASHI ' ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ' AOKI ' ) NEW_LINE DEDENT

a , b , c , d = map ( int , input ( ) . split ( ) ) NEW_LINE x = b / a NEW_LINE y = d / c NEW_LINE print ( " TAKAHASHI " if x > y else " DRAW " if x == y else " AOKI " ) NEW_LINE


import java . util . ArrayList ; import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; ArrayList < DJSet > ds = new ArrayList < DJSet > ( ) ; for ( int i = 0 ; i < m ; i ++ ) ds . add ( new DJSet ( n ) ) ; for ( int i = 0 ; i < m ; i ++ ) { int a = sc . nextInt ( ) - 1 ; int b = sc . nextInt ( ) - 1 ; for ( int j = 0 ; j < m ; j ++ ) { if ( i != j ) ds . get ( j ) . union ( a , b ) ; } } int ans = 0 ; for ( int i = 0 ; i < m ; i ++ ) { if ( ds . get ( i ) . countSet ( ) != 1 ) ans ++ ; } System . out . println ( ans ) ; sc . close ( ) ; } } class DJSet { public int [ ] upper ; public DJSet ( int n ) { upper = new int [ n ] ; Arrays . fill ( upper , - 1 ) ; } public int root ( int x ) { return upper [ x ] < 0 ? x : ( upper [ x ] = root ( upper [ x ] ) ) ; } public boolean same ( int x , int y ) { return root ( x ) == root ( y ) ; } public boolean union ( int x , int y ) { x = root ( x ) ; y = root ( y ) ; if ( x != y ) { if ( upper [ y ] < upper [ x ] ) { int t = x ; x = y ; y = t ; } upper [ x ] += upper [ y ] ; upper [ y ] = x ; } return x != y ; } public int countSet ( ) { int c = 0 ; for ( int u : upper ) { if ( u < 0 ) c ++ ; } return c ; } public int countElement ( int x ) { return upper [ root ( x ) ] * - 1 ; } }

import java . util . * ; import static java . lang . System . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; boolean [ ] [ ] edges = new boolean [ N ] [ N ] ; for ( int m = 0 ; m < M ; m ++ ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; edges [ a - 1 ] [ b - 1 ] = true ; edges [ b - 1 ] [ a - 1 ] = true ; } solver ( N , edges ) ; } public static void solver ( int N , boolean [ ] [ ] edges ) { Set < Integer > left_nodes = new HashSet < Integer > ( ) ; for ( int n = 0 ; n < N ; n ++ ) { left_nodes . add ( n ) ; } int ans = 0 ; int before_ans = ans + 1 ; while ( ans != before_ans ) { before_ans = ans ; HashMap < Integer , Integer > bridgeable_nodes = new HashMap < Integer , Integer > ( ) ; for ( Integer from : left_nodes ) { ArrayList < Integer > bridge_nodes = new ArrayList < Integer > ( ) ; for ( int to = 0 ; to < N ; to ++ ) { if ( edges [ from ] [ to ] == true ) { bridge_nodes . add ( to ) ; } } if ( bridge_nodes . size ( ) == 1 ) { bridgeable_nodes . put ( from , bridge_nodes . get ( 0 ) ) ; } } for ( Integer from : bridgeable_nodes . keySet ( ) ) { int to = bridgeable_nodes . get ( from ) ; left_nodes . remove ( from ) ; if ( edges [ from ] [ to ] == false ) { continue ; } edges [ from ] [ to ] = false ; edges [ to ] [ from ] = false ; ans ++ ; } } out . println ( ans ) ; } }

import java . util . * ; public class Main { static ArrayList < Integer > [ ] lists ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; lists = new ArrayList [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { lists [ i ] = new ArrayList < Integer > ( ) ; } int [ ] a = new int [ m ] ; int [ ] b = new int [ m ] ; for ( int i = 0 ; i < m ; i ++ ) { a [ i ] = sc . nextInt ( ) ; b [ i ] = sc . nextInt ( ) ; lists [ a [ i ] ] . add ( b [ i ] ) ; lists [ b [ i ] ] . add ( a [ i ] ) ; } int count = 0 ; for ( int i = 0 ; i < m ; i ++ ) { boolean [ ] test = new boolean [ n + 1 ] ; Arrays . fill ( test , false ) ; search ( 1 , a [ i ] , b [ i ] , test ) ; if ( ! isAllTrue ( test ) ) { count ++ ; } } System . out . print ( count ) ; } static void search ( int idx , int a , int b , boolean [ ] test ) { for ( int i : lists [ idx ] ) { if ( ! test [ i ] && ! ( ( a == i && b == idx ) || ( a == idx && b == i ) ) ) { test [ i ] = true ; search ( i , a , b , test ) ; } } } static boolean isAllTrue ( boolean [ ] bs ) { for ( int i = 1 ; i < bs . length ; i ++ ) { if ( ! bs [ i ] ) { return false ; } } return true ; } } Note : . / Main . java uses unchecked or unsafe operations . Note : Recompile with - Xlint : unchecked for details .

import java . util . Arrays ; import java . util . stream . IntStream ; public class Main { private static java . util . Scanner scanner = new java . util . Scanner ( System . in ) ; private static int n ; private static boolean [ ] visited ; private static boolean [ ] [ ] graph ; public static void main ( String [ ] args ) { n = scanner . nextInt ( ) ; int m = scanner . nextInt ( ) ; int [ ] a = new int [ m ] , b = new int [ m ] ; graph = new boolean [ n ] [ n ] ; visited = new boolean [ n ] ; for ( int i = 0 ; i < m ; i ++ ) graph [ a [ i ] = scanner . nextInt ( ) - 1 ] [ b [ i ] = scanner . nextInt ( ) - 1 ] = graph [ b [ i ] ] [ a [ i ] ] = true ; int ans = 0 ; for ( int i = 0 ; i < m ; i ++ ) { graph [ a [ i ] ] [ b [ i ] ] = graph [ b [ i ] ] [ a [ i ] ] = false ; Arrays . fill ( visited , false ) ; dfs ( 0 ) ; if ( IntStream . range ( 0 , n ) . anyMatch ( j -> ! visited [ j ] ) ) ans ++ ; graph [ a [ i ] ] [ b [ i ] ] = graph [ b [ i ] ] [ a [ i ] ] = true ; } System . out . println ( ans ) ; } private static void dfs ( int v ) { visited [ v ] = true ; for ( int v2 = 0 ; v2 < n ; v2 ++ ) if ( graph [ v ] [ v2 ] && ! visited [ v2 ] ) dfs ( v2 ) ; } }

import java . util . * ; import java . lang . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] a = new int [ m ] ; int [ ] b = new int [ m ] ; int [ ] count = new int [ n + 1 ] ; for ( int i = 0 ; i < m ; i ++ ) { a [ i ] = sc . nextInt ( ) ; b [ i ] = sc . nextInt ( ) ; count [ a [ i ] ] ++ ; count [ b [ i ] ] ++ ; } int ans = 0 ; boolean bre = true ; while ( bre ) { bre = false ; out : for ( int i = 0 ; i <= n ; i ++ ) { if ( count [ i ] == 1 ) { count [ i ] -- ; ans ++ ; for ( int j = 0 ; j < m ; j ++ ) { if ( a [ j ] == i ) { count [ b [ j ] ] -- ; a [ j ] = 0 ; b [ j ] = 0 ; bre = true ; break out ; } else if ( b [ j ] == i ) { count [ a [ j ] ] -- ; a [ j ] = 0 ; b [ j ] = 0 ; bre = true ; break out ; } } } } } System . out . println ( ans ) ; } }

n , m = [ int ( item ) for item in input ( ) . split ( ) ] NEW_LINE edge = [ [ 0 ] * n for _ in range ( n ) ] NEW_LINE for i in range ( m ) : NEW_LINE INDENT a , b = [ int ( item ) for item in input ( ) . split ( ) ] NEW_LINE edge [ a - 1 ] [ b - 1 ] = 1 NEW_LINE edge [ b - 1 ] [ a - 1 ] = 1 NEW_LINE DEDENT ans = 0 NEW_LINE order = 0 NEW_LINE pre = [ - 1 ] * n NEW_LINE low = [ - 1 ] * n NEW_LINE def dfs ( node , prev ) : NEW_LINE INDENT global order , ans NEW_LINE pre [ node ] = order NEW_LINE low [ node ] = order NEW_LINE order += 1 NEW_LINE for to in range ( n ) : NEW_LINE INDENT if to == prev or edge [ node ] [ to ] == 0 : NEW_LINE INDENT continue NEW_LINE DEDENT if pre [ to ] == - 1 : NEW_LINE INDENT ret = dfs ( to , node ) NEW_LINE low [ node ] = min ( low [ node ] , ret ) NEW_LINE DEDENT else : NEW_LINE INDENT low [ node ] = min ( low [ node ] , pre [ to ] ) NEW_LINE DEDENT if pre [ node ] < low [ to ] : NEW_LINE INDENT ans += 1 NEW_LINE DEDENT DEDENT return low [ node ] NEW_LINE DEDENT dfs ( 0 , - 1 ) NEW_LINE print ( ans ) NEW_LINE

class UnionFind ( object ) : NEW_LINE INDENT def __init__ ( self , num ) : NEW_LINE INDENT self . parent = [ - 1 for i in range ( num + 1 ) ] NEW_LINE DEDENT def find ( self , x ) : NEW_LINE INDENT if self . parent [ x ] < 0 : NEW_LINE INDENT return x NEW_LINE DEDENT else : NEW_LINE INDENT self . parent [ x ] = self . find ( self . parent [ x ] ) NEW_LINE return self . parent [ x ] NEW_LINE DEDENT DEDENT def unite ( self , x , y ) : NEW_LINE INDENT x = self . find ( x ) NEW_LINE y = self . find ( y ) NEW_LINE if x == y : NEW_LINE INDENT return NEW_LINE DEDENT if self . size ( x ) > self . size ( y ) : NEW_LINE INDENT self . parent [ x ] += self . parent [ y ] NEW_LINE self . parent [ y ] = x NEW_LINE DEDENT else : NEW_LINE INDENT self . parent [ y ] += self . parent [ x ] NEW_LINE self . parent [ x ] = y NEW_LINE DEDENT DEDENT def size ( self , x ) : NEW_LINE INDENT return - self . parent [ self . find ( x ) ] NEW_LINE DEDENT def same ( self , x , y ) : NEW_LINE INDENT return self . find ( x ) == self . find ( y ) NEW_LINE DEDENT DEDENT n , m = map ( int , input ( ) . split ( ) ) NEW_LINE lis = [ ] NEW_LINE count = 0 NEW_LINE for i in range ( m ) : NEW_LINE INDENT lis . append ( list ( map ( int , input ( ) . split ( ) ) ) ) NEW_LINE DEDENT for i in range ( m ) : NEW_LINE INDENT u = UnionFind ( n ) NEW_LINE for j in range ( m ) : NEW_LINE INDENT if i == j : NEW_LINE INDENT continue NEW_LINE DEDENT u . unite ( lis [ j ] [ 0 ] , lis [ j ] [ 1 ] ) NEW_LINE DEDENT if not u . same ( lis [ i ] [ 0 ] , lis [ i ] [ 1 ] ) : NEW_LINE INDENT count += 1 NEW_LINE DEDENT DEDENT print ( count ) NEW_LINE

import numpy as np NEW_LINE import queue NEW_LINE n , m = map ( int , input ( ) . split ( ) ) NEW_LINE V = np . zeros ( ( n + 1 , n + 1 ) , dtype = bool ) NEW_LINE E = [ ] NEW_LINE for i in range ( m ) : NEW_LINE INDENT a , b = map ( int , input ( ) . split ( ) ) NEW_LINE V [ a ] [ b ] = True NEW_LINE V [ b ] [ a ] = True NEW_LINE E . append ( ( a , b ) ) NEW_LINE DEDENT def BFS ( x , y ) : NEW_LINE INDENT mark = [ False ] * ( n + 1 ) NEW_LINE q = queue . Queue ( ) NEW_LINE q . put ( x ) NEW_LINE while not q . empty ( ) : NEW_LINE INDENT p = q . get ( ) NEW_LINE if p == y : NEW_LINE INDENT return True NEW_LINE DEDENT mark [ p ] = True NEW_LINE for i in range ( 1 , n + 1 ) : NEW_LINE INDENT if V [ p ] [ i ] and not mark [ i ] : NEW_LINE INDENT q . put ( i ) NEW_LINE DEDENT DEDENT DEDENT return False NEW_LINE DEDENT res = 0 NEW_LINE for a , b in E : NEW_LINE INDENT V [ a ] [ b ] = False NEW_LINE V [ b ] [ a ] = False NEW_LINE if not BFS ( a , b ) : NEW_LINE INDENT res += 1 NEW_LINE DEDENT V [ a ] [ b ] = True NEW_LINE V [ b ] [ a ] = True NEW_LINE DEDENT print ( res ) NEW_LINE

n , m = [ int ( val ) for val in input ( ) . split ( ) ] NEW_LINE matrix = [ [ int ( val ) for val in input ( ) . split ( ) ] for val in range ( m ) ] NEW_LINE ee = [ [ val [ 0 ] - 1 , val [ 1 ] - 1 ] for val in matrix ] NEW_LINE cnt = 0 NEW_LINE k = 0 NEW_LINE for L in range ( m ) : NEW_LINE INDENT xx = [ i for i in range ( n ) ] NEW_LINE for j in range ( m ) : NEW_LINE INDENT if j != k : NEW_LINE INDENT val1 = xx [ ee [ j ] [ 1 ] ] NEW_LINE val2 = xx [ ee [ j ] [ 0 ] ] NEW_LINE for i in range ( len ( xx ) ) : NEW_LINE INDENT if xx [ i ] == val1 : NEW_LINE INDENT xx [ i ] = val2 NEW_LINE DEDENT DEDENT DEDENT DEDENT if len ( set ( xx ) ) > 1 : NEW_LINE INDENT cnt += 1 NEW_LINE DEDENT k += 1 NEW_LINE DEDENT print ( cnt ) NEW_LINE

import sys NEW_LINE n , m = map ( int , input ( ) . split ( ) ) NEW_LINE vertex = [ [ int ( i ) for i in l . split ( ) ] for l in sys . stdin ] NEW_LINE def find ( x ) : NEW_LINE INDENT if root [ x ] == x : NEW_LINE INDENT return x NEW_LINE DEDENT root [ x ] = find ( root [ x ] ) NEW_LINE return root [ x ] NEW_LINE DEDENT def check ( x , y ) : NEW_LINE INDENT return find ( x ) == find ( y ) NEW_LINE DEDENT def union ( x , y ) : NEW_LINE INDENT x = find ( x ) NEW_LINE y = find ( y ) NEW_LINE if size [ x ] >= size [ y ] : NEW_LINE INDENT root [ y ] = x NEW_LINE DEDENT else : NEW_LINE INDENT root [ x ] = y NEW_LINE DEDENT if size [ x ] == size [ y ] : NEW_LINE INDENT size [ x ] += 1 NEW_LINE DEDENT DEDENT ans = 0 NEW_LINE for i in range ( m ) : NEW_LINE INDENT root = [ i for i in range ( n + 1 ) ] NEW_LINE size = [ 0 ] * ( n + 1 ) NEW_LINE for j in range ( m ) : NEW_LINE INDENT if j != i : NEW_LINE INDENT if check ( vertex [ j ] [ 0 ] , vertex [ j ] [ 1 ] ) : NEW_LINE INDENT pass NEW_LINE DEDENT else : NEW_LINE INDENT union ( vertex [ j ] [ 0 ] , vertex [ j ] [ 1 ] ) NEW_LINE DEDENT DEDENT DEDENT for j in range ( 1 , n ) : NEW_LINE INDENT if check ( j , j + 1 ) == True : NEW_LINE INDENT pass NEW_LINE DEDENT else : NEW_LINE INDENT ans += 1 NEW_LINE break NEW_LINE DEDENT DEDENT DEDENT print ( ans ) NEW_LINE


import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int vv ; int input1 = scanner . nextInt ( ) ; if ( input1 < 100 ) { vv = 0 ; } else if ( input1 >= 100 && input1 <= 5000 ) { vv = input1 * 10 / 1000 ; } else if ( input1 >= 6000 && input1 <= 30000 ) { vv = ( input1 / 1000 ) + 50 ; } else if ( input1 >= 35000 && input1 <= 70000 ) { vv = ( ( ( input1 / 1000 ) - 30 ) / 5 ) + 80 ; } else if ( input1 > 70000 ) { vv = 89 ; } else { throw new RuntimeException ( " Unnexpected ▁ input : ▁ " + input1 ) ; } System . out . printf ( " % 02d \n " , vv ) ; } }

import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { try ( Scanner sc = new Scanner ( System . in ) ) { while ( sc . hasNextInt ( ) ) { int a = Integer . parseInt ( sc . nextLine ( ) ) ; int VV = 0 ; if ( a >= 100 && a <= 5000 ) { VV = a * 10 ; } else if ( a >= 6000 && a <= 30000 ) { VV = a + 50000 ; } else if ( a >= 35000 && a <= 70000 ) { VV = ( a - 30000 ) / 5 + 80000 ; } else if ( a > 70000 ) { VV = 89000 ; } System . out . println ( String . format ( " % 02d " , VV / 1000 ) ) ; } } } }

import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { new Main ( ) . solveB ( ) ; } private void solveA ( ) { Scanner scanner = null ; int numH1 = 0 ; int numH2 = 0 ; try { scanner = new Scanner ( System . in ) ; numH1 = scanner . nextInt ( ) ; numH2 = scanner . nextInt ( ) ; System . out . println ( numH1 - numH2 ) ; } finally { if ( scanner != null ) { scanner . close ( ) ; } } } private void solveB ( ) { Scanner scanner = null ; int numM = 0 ; try { scanner = new Scanner ( System . in ) ; numM = scanner . nextInt ( ) ; int vv = 0 ; if ( numM < 100 ) { vv = 0 ; } else if ( numM <= 5000 ) { vv = numM / 100 ; } else if ( numM <= 30000 ) { vv = numM / 1000 + 50 ; } else if ( numM <= 70000 ) { vv = ( numM / 1000 - 30 ) / 5 + 80 ; } else { vv = 89 ; } System . out . printf ( " % 02d % n " , vv ) ; ; } finally { if ( scanner != null ) { scanner . close ( ) ; } } } private void solveC ( ) { Scanner scanner = null ; int numN = 0 ; int numK = 0 ; int numS = 0 ; try { scanner = new Scanner ( System . in ) ; numN = scanner . nextInt ( ) ; System . out . println ( " " ) ; } finally { if ( scanner != null ) { scanner . close ( ) ; } } } private void solveD ( ) { Scanner scanner = null ; int numN = 0 ; int numK = 0 ; int numS = 0 ; try { scanner = new Scanner ( System . in ) ; numN = scanner . nextInt ( ) ; System . out . println ( " " ) ; } finally { if ( scanner != null ) { scanner . close ( ) ; } } } }

import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; double m = sc . nextDouble ( ) ; double M = m / 1000.0 ; if ( M < 0.1 ) { System . out . println ( "00" ) ; } else if ( 0.1 <= M && M <= 5 ) { int ans = ( int ) ( M * 10 ) ; if ( ans <= 9 ) System . out . println ( "0" + ans ) ; else System . out . println ( ans ) ; } else if ( 6 <= M && M <= 30 ) { System . out . println ( ( int ) M + 50 ) ; } else if ( 35 <= M && M <= 70 ) { System . out . println ( ( ( int ) M - 30 ) / 5 + 80 ) ; } else if ( 70 < M ) { System . out . println ( 89 ) ; } } }

import java . util . * ; import java . util . List ; import java . util . ArrayList ; import java . math . * ; class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int H1 = scanner . nextInt ( ) ; int H2 = scanner . nextInt ( ) ; System . out . println ( H1 - H2 ) ; } }

m = int ( input ( ) ) NEW_LINE if m < 100 : NEW_LINE INDENT ans = "00" NEW_LINE DEDENT elif m <= 5000 : NEW_LINE INDENT if m < 1000 : NEW_LINE INDENT ans = "0" + str ( m // 100 ) NEW_LINE DEDENT else : NEW_LINE INDENT ans = int ( m / 100 ) NEW_LINE DEDENT DEDENT elif m <= 30000 : NEW_LINE INDENT ans = int ( m / 1000 ) + 50 NEW_LINE DEDENT elif m <= 70000 : NEW_LINE INDENT ans = ( ( int ( m / 1000 ) - 30 ) // 5 ) + 80 NEW_LINE DEDENT else : NEW_LINE INDENT ans = 89 NEW_LINE DEDENT print ( ans ) NEW_LINE

import math NEW_LINE m = int ( input ( ) ) / 1000 NEW_LINE if m < 0.1 : NEW_LINE INDENT print ( "00" ) NEW_LINE DEDENT elif m >= 0.1 and m <= 5 : NEW_LINE INDENT if m >= 1.0 : NEW_LINE INDENT print ( math . floor ( m * 10 ) ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( "0" + str ( math . floor ( m * 10 ) ) ) NEW_LINE DEDENT DEDENT elif m >= 6 and m <= 30 : NEW_LINE INDENT print ( math . floor ( m + 50 ) ) NEW_LINE DEDENT elif m >= 35 and m <= 70 : NEW_LINE INDENT print ( math . floor ( ( m - 30 ) / 5 + 80 ) ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( 89 ) NEW_LINE DEDENT

hi = int ( input ( ) ) NEW_LINE if ( hi < 100 ) : NEW_LINE INDENT print ( " { 0:02d } " . format ( 0 ) ) NEW_LINE DEDENT elif ( hi >= 100 and hi <= 5000 ) : NEW_LINE INDENT print ( " { 0:02d } " . format ( int ( hi / 100 ) ) ) NEW_LINE DEDENT elif ( hi >= 6000 and hi <= 30000 ) : NEW_LINE INDENT print ( " { 0:02d } " . format ( int ( hi / 1000 + 50 ) ) ) NEW_LINE DEDENT elif ( hi >= 35000 and hi <= 70000 ) : NEW_LINE INDENT print ( " { 0:02d } " . format ( int ( ( hi / 1000 - 30 ) / 5 + 80 ) ) ) NEW_LINE DEDENT elif ( hi > 70000 ) : NEW_LINE INDENT print ( " { 0:02d } " . format ( 89 ) ) NEW_LINE DEDENT

import sys NEW_LINE m = int ( sys . stdin . readline ( ) ) NEW_LINE ans = 0 NEW_LINE if 100 <= m <= 5000 : NEW_LINE INDENT ans = m / 100 NEW_LINE DEDENT elif 6000 <= m <= 30000 : NEW_LINE INDENT ans = m / 1000 + 50 NEW_LINE DEDENT elif 35000 <= m <= 70000 : NEW_LINE INDENT ans = ( m / 1000 - 30 ) / 5 + 80 NEW_LINE DEDENT elif 70000 <= m : NEW_LINE INDENT ans = 89 NEW_LINE DEDENT ans = int ( ans ) NEW_LINE print ( " { :02 } " . format ( ans ) ) NEW_LINE

m = float ( input ( ) ) NEW_LINE km = m / 1000 NEW_LINE VV = 0 NEW_LINE if 0.1 <= km <= 5 : NEW_LINE INDENT VV = str ( int ( km * 10 ) ) NEW_LINE if len ( VV ) == 1 : NEW_LINE INDENT print ( 0 , int ( VV ) , sep = " " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( int ( km * 10 ) ) NEW_LINE DEDENT DEDENT if 6 <= km <= 30 : NEW_LINE INDENT print ( int ( km + 50 ) ) NEW_LINE DEDENT if 35 <= km <= 70 : NEW_LINE INDENT print ( int ( ( ( km - 30 ) / 5 ) + 80 ) ) NEW_LINE DEDENT if km > 70 : NEW_LINE INDENT print ( 89 ) NEW_LINE DEDENT if km < 0.1 : NEW_LINE INDENT print ( 0 , 0 , sep = " " ) NEW_LINE DEDENT


import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String S = scanner . next ( ) ; boolean flag1 = false ; boolean flag2 = false ; boolean flag3 = false ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { if ( S . charAt ( i ) == ' i ' || S . charAt ( i ) == ' I ' ) { flag1 = true ; } if ( flag1 == true && ( S . charAt ( i ) == ' c ' || S . charAt ( i ) == ' C ' ) ) { flag2 = true ; } if ( flag2 == true && ( S . charAt ( i ) == ' t ' || S . charAt ( i ) == ' T ' ) ) { flag3 = true ; } } if ( flag3 ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } }

import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . InputMismatchException ; import java . io . IOException ; import java . io . InputStream ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; FastScanner in = new FastScanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class TaskA { public void solve ( int testNumber , FastScanner in , PrintWriter out ) { String s = in . next ( ) ; char [ ] ICT = { ' I ' , ' C ' , ' T ' } ; int p = 0 ; for ( int i = 0 ; i < s . length ( ) && p < 3 ; i ++ ) { if ( Character . toUpperCase ( s . charAt ( i ) ) == ICT [ p ] ) p ++ ; } out . println ( p == 3 ? " YES " : " NO " ) ; } } static class FastScanner { private InputStream in ; private byte [ ] buffer = new byte [ 1024 ] ; private int bufPointer ; private int bufLength ; public FastScanner ( InputStream in ) { this . in = in ; this . bufPointer = 0 ; this . bufLength = 0 ; } private int readByte ( ) { if ( bufPointer >= bufLength ) { if ( bufLength == - 1 ) throw new InputMismatchException ( ) ; bufPointer = 0 ; try { bufLength = in . read ( buffer ) ; } catch ( IOException e ) { throw new InputMismatchException ( ) ; } if ( bufLength <= 0 ) return - 1 ; } return buffer [ bufPointer ++ ] ; } private static boolean isPrintableChar ( int c ) { return c >= 33 && c <= 126 ; } public String next ( ) { StringBuilder sb = new StringBuilder ( ) ; int b = readByte ( ) ; while ( ! isPrintableChar ( b ) ) b = readByte ( ) ; while ( isPrintableChar ( b ) ) { sb . appendCodePoint ( b ) ; b = readByte ( ) ; } return sb . toString ( ) ; } } }

import java . util . Scanner ; public class Main { static Scanner s = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { System . out . println ( s . next ( ) . toLowerCase ( ) . matches ( " ^ . * i . * c . * t . * $ " ) ? " YES " : " NO " ) ; } }

import java . io . * ; import java . math . * ; import java . text . * ; import java . util . * ; import java . util . regex . * ; public class Main { private static final Scanner scan = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String s = scan . nextLine ( ) ; List < Character > list = new ArrayList < > ( ) ; list . add ( ' I ' ) ; list . add ( ' C ' ) ; list . add ( ' T ' ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == list . get ( 0 ) || s . charAt ( i ) == list . get ( 0 ) - ' A ' + ' a ' ) { list . remove ( 0 ) ; if ( list . size ( ) == 0 ) { System . out . println ( " YES " ) ; return ; } } } System . out . println ( " NO " ) ; } }

import java . util . * ; import static java . lang . System . * ; import static java . lang . Math . * ; public class Main { public static void main ( String [ ] $ ) { Scanner sc = new Scanner ( in ) ; String s = sc . next ( ) ; int I = - 1 , C = - 1 , T = - 1 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( I == - 1 && ( s . charAt ( i ) == ' I ' || s . charAt ( i ) == ' i ' ) ) I = i ; } for ( int i = s . length ( ) - 1 ; i > - 1 ; i -- ) { if ( T == - 1 && ( s . charAt ( i ) == ' T ' || s . charAt ( i ) == ' t ' ) ) T = i ; } for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == ' C ' || s . charAt ( i ) == ' c ' ) { if ( I != - 1 && T != - 1 ) { if ( I < i && i < T ) { out . println ( " YES " ) ; exit ( 0 ) ; } } } } out . println ( " NO " ) ; } }

s = input ( ) NEW_LINE d = " ICT " NEW_LINE e = 0 NEW_LINE for i in range ( len ( s ) ) : NEW_LINE INDENT if e < 3 : NEW_LINE INDENT if d [ e ] == str . upper ( s [ i ] ) : NEW_LINE INDENT e += 1 NEW_LINE DEDENT DEDENT DEDENT print ( " NO " if e != 3 else " YES " ) NEW_LINE

S = [ str ( _ ) . upper ( ) for _ in input ( ) ] NEW_LINE N = len ( S ) NEW_LINE flag = False NEW_LINE for i in range ( N ) : NEW_LINE INDENT if S [ i ] == " I " : NEW_LINE INDENT flag = True NEW_LINE break NEW_LINE DEDENT DEDENT if flag : NEW_LINE INDENT flag = False NEW_LINE for j in range ( i + 1 , N ) : NEW_LINE INDENT if S [ j ] == " C " : NEW_LINE INDENT flag = True NEW_LINE break NEW_LINE DEDENT DEDENT DEDENT if flag : NEW_LINE INDENT flag = False NEW_LINE for k in range ( j + 1 , N ) : NEW_LINE INDENT if S [ k ] == " T " : NEW_LINE INDENT flag = True NEW_LINE break NEW_LINE DEDENT DEDENT DEDENT print ( " YES " if flag else " NO " ) NEW_LINE

s = input ( ) NEW_LINE I = [ ] NEW_LINE C = [ ] NEW_LINE T = [ ] NEW_LINE for j in range ( len ( s ) ) : NEW_LINE INDENT if s [ j ] == ' I ' or s [ j ] == ' i ' : NEW_LINE INDENT I . append ( j ) NEW_LINE DEDENT elif s [ j ] == ' C ' or s [ j ] == ' c ' : NEW_LINE INDENT C . append ( j ) NEW_LINE DEDENT elif s [ j ] == ' T ' or s [ j ] == ' t ' : NEW_LINE INDENT T . append ( j ) NEW_LINE DEDENT else : NEW_LINE INDENT None NEW_LINE DEDENT DEDENT flag = False NEW_LINE I . sort ( ) NEW_LINE C . sort ( ) NEW_LINE T . sort ( ) NEW_LINE if len ( I ) == 0 or len ( C ) == 0 or len ( T ) == 0 : NEW_LINE INDENT print ( ' NO ' ) NEW_LINE DEDENT else : NEW_LINE INDENT for i in range ( len ( I ) ) : NEW_LINE INDENT for j in range ( len ( C ) ) : NEW_LINE INDENT if I [ i ] < C [ j ] < T [ len ( T ) - 1 ] : NEW_LINE INDENT flag = True NEW_LINE break NEW_LINE DEDENT else : NEW_LINE INDENT None 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

S = input ( ) NEW_LINE res = ' NO ' NEW_LINE tmp = 0 NEW_LINE for i in range ( len ( S ) ) : NEW_LINE INDENT if ( S [ i ] == ' I ' or S [ i ] == ' i ' ) and tmp == 0 : NEW_LINE INDENT tmp += 1 NEW_LINE DEDENT if ( S [ i ] == ' C ' or S [ i ] == ' c ' ) and tmp == 1 : NEW_LINE INDENT tmp += 1 NEW_LINE DEDENT if ( S [ i ] == ' T ' or S [ i ] == ' t ' ) and tmp == 2 : NEW_LINE INDENT res = ' YES ' NEW_LINE DEDENT DEDENT print ( res ) NEW_LINE

def ans ( ) : NEW_LINE INDENT S = input ( ) . lower ( ) NEW_LINE f = 0 NEW_LINE for s in S : NEW_LINE INDENT if ( s == " i " and f == 0 ) : NEW_LINE INDENT f = 1 NEW_LINE DEDENT if ( s == " c " and f == 1 ) : NEW_LINE INDENT f = 2 NEW_LINE DEDENT if ( s == " t " and f == 2 ) : NEW_LINE INDENT f = 3 NEW_LINE DEDENT DEDENT if ( f == 3 ) : NEW_LINE INDENT print ( " YES " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " NO " ) NEW_LINE DEDENT DEDENT ans ( ) NEW_LINE


import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a = 0 ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a = sc . nextInt ( ) ; while ( a % 2 == 0 ) { a /= 2 ; ans ++ ; } } sc . close ( ) ; System . out . println ( ans ) ; } }

import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { PrintWriter out = new PrintWriter ( System . out ) ; InputStreamScanner in = new InputStreamScanner ( System . in ) ; new Main ( ) . solve ( in , out ) ; out . flush ( ) ; } private void solve ( InputStreamScanner in , PrintWriter out ) { int n = in . nextInt ( ) ; int c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x = in . nextInt ( ) ; while ( x % 2 == 0 ) { c ++ ; x /= 2 ; } } out . println ( c ) ; } static class InputStreamScanner { private InputStream in ; private byte [ ] buf = new byte [ 1024 ] ; private int len = 0 ; private int off = 0 ; InputStreamScanner ( InputStream in ) { this . in = in ; } String next ( ) { StringBuilder sb = new StringBuilder ( ) ; for ( int b = skip ( ) ; ! isSpace ( b ) ; ) { sb . appendCodePoint ( b ) ; b = read ( ) ; } return sb . toString ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } char nextChar ( ) { return ( char ) skip ( ) ; } int skip ( ) { for ( int b ; ( b = read ( ) ) != - 1 ; ) { if ( ! isSpace ( b ) ) { return b ; } } return - 1 ; } private boolean isSpace ( int c ) { return c < 33 || c > 126 ; } private int read ( ) { if ( len == - 1 ) { throw new InputMismatchException ( " End ▁ of ▁ Input " ) ; } if ( off >= len ) { off = 0 ; try { len = in . read ( buf ) ; } catch ( IOException e ) { throw new InputMismatchException ( e . getMessage ( ) ) ; } if ( len <= 0 ) { return - 1 ; } } return buf [ off ++ ] ; } } }

import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . ArrayDeque ; import java . util . Queue ; public class Main { public static void main ( String args [ ] ) throws Exception { Input input = new Input ( ) ; final Data l = input . readLine ( ) ; Queue < Integer > q = input . getColQueue ( ) ; input . close ( ) ; int ans = 0 ; while ( ! q . isEmpty ( ) ) { int d = q . poll ( ) ; while ( d % 2 == 0 ) { ans ++ ; d /= 2 ; } } System . out . println ( ans ) ; } static class Input { public BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; public void close ( ) throws Exception { input . close ( ) ; } public Data readLine ( ) throws Exception { return new Data ( input . readLine ( ) . split ( " ▁ " ) ) ; } public Queue < Data > getDataQueue ( int num ) throws Exception { Queue < Data > q ; q = new ArrayDeque < > ( ) ; for ( int i = 0 ; i < num ; i ++ ) { q . offer ( readLine ( ) ) ; } return q ; } public Queue < Integer > getColQueue ( ) throws Exception { Data d = readLine ( ) ; Queue < Integer > q ; q = new ArrayDeque < > ( ) ; for ( int i = 0 ; i < d . col . length ; i ++ ) { q . offer ( d . col [ i ] ) ; } return q ; } } static class Data { public int [ ] col ; public Data ( String [ ] values ) { col = new int [ values . length ] ; for ( int i = 0 ; i < values . length ; i ++ ) { col [ i ] = Integer . parseInt ( values [ i ] ) ; } } } }

public class Main { private static java . util . Scanner scanner = new java . util . Scanner ( System . in ) ; public static void main ( String [ ] args ) { System . out . println ( java . util . stream . Stream . generate ( ( ) -> null ) . limit ( scanner . nextInt ( ) ) . mapToInt ( n -> ( int ) ( Math . log ( Integer . lowestOneBit ( scanner . nextInt ( ) ) ) / Math . log ( 2 ) ) ) . sum ( ) ) ; } }

import java . util . Scanner ; import java . util . Collections ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Queue ; import java . util . ArrayDeque ; import java . util . Deque ; import java . util . PriorityQueue ; import java . util . Set ; import java . util . HashMap ; import java . util . TreeSet ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; long [ ] a = new long [ n ] ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = scanner . nextLong ( ) ; while ( a [ i ] % 2 == 0 ) { a [ i ] /= 2 ; count ++ ; } } System . out . println ( count ) ; } public static int upperBound ( long [ ] a , long val ) { return upperBound ( a , 0 , a . length , val ) ; } public static int upperBound ( long [ ] a , int l , int r , long val ) { if ( r - l == 1 ) { if ( a [ l ] > val ) return l ; return r ; } int mid = ( l + r ) / 2 ; if ( a [ mid ] > val ) { return upperBound ( a , l , mid , val ) ; } else { return upperBound ( a , mid , r , val ) ; } } public static int lowerBound ( long [ ] a , long val ) { return lowerBound ( a , 0 , a . length , val ) ; } public static int lowerBound ( long [ ] a , int l , int r , long val ) { if ( r - l == 1 ) { if ( a [ l ] < val ) return r ; return l ; } int mid = ( l + r ) / 2 ; if ( a [ mid ] < val ) { return lowerBound ( a , mid , r , val ) ; } else { return lowerBound ( a , l , mid , val ) ; } } }

len_list = int ( input ( ) ) NEW_LINE input_list = [ int ( x ) for x in input ( ) . split ( ) ] [ : len_list ] NEW_LINE n = 0 NEW_LINE for x in input_list : NEW_LINE INDENT while ( x % 2 ) == 0 : NEW_LINE INDENT x /= 2 NEW_LINE n += 1 NEW_LINE DEDENT DEDENT print ( n ) NEW_LINE

N = int ( input ( ) ) NEW_LINE a = map ( int , input ( ) . split ( ) ) NEW_LINE def counter ( x ) : NEW_LINE INDENT num = 0 NEW_LINE while x % 2 == 0 : NEW_LINE INDENT num += 1 NEW_LINE x /= 2 NEW_LINE DEDENT return num NEW_LINE DEDENT s = [ counter ( i ) for i in a ] NEW_LINE print ( sum ( s ) ) NEW_LINE

import sys NEW_LINE INF = float ( " inf " ) NEW_LINE import math NEW_LINE import collections NEW_LINE def solve ( N : int , a : " List [ int ] " ) : NEW_LINE INDENT print ( int ( sum ( [ math . log2 ( v & - v ) for v in a ] ) ) ) NEW_LINE return NEW_LINE DEDENT def main ( ) : NEW_LINE INDENT def iterate_tokens ( ) : NEW_LINE INDENT for line in sys . stdin : NEW_LINE INDENT for word in line . split ( ) : NEW_LINE INDENT yield word NEW_LINE DEDENT DEDENT DEDENT tokens = iterate_tokens ( ) NEW_LINE N = int ( next ( tokens ) ) NEW_LINE a = [ int ( next ( tokens ) ) for _ in range ( N ) ] NEW_LINE solve ( N , a ) NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT main ( ) NEW_LINE DEDENT

_ , a = open ( 0 ) ; print ( sum ( bin ( int ( x ) ) [ : : - 1 ] . index ( '1' ) for x in a . split ( ) ) ) NEW_LINE

import sys NEW_LINE def countDiv2 ( n : int ) : NEW_LINE INDENT sum = 0 NEW_LINE while n % 2 == 0 : NEW_LINE INDENT sum += 1 NEW_LINE n //= 2 NEW_LINE DEDENT return sum NEW_LINE DEDENT def solve ( N : int , a : " List [ int ] " ) : NEW_LINE INDENT sum = 0 NEW_LINE for ia in a : NEW_LINE INDENT sum += countDiv2 ( ia ) NEW_LINE DEDENT print ( sum ) NEW_LINE return NEW_LINE DEDENT def main ( ) : NEW_LINE INDENT def iterate_tokens ( ) : NEW_LINE INDENT for line in sys . stdin : NEW_LINE INDENT for word in line . split ( ) : NEW_LINE INDENT yield word NEW_LINE DEDENT DEDENT DEDENT tokens = iterate_tokens ( ) NEW_LINE N = int ( next ( tokens ) ) NEW_LINE a = [ int ( next ( tokens ) ) for _ in range ( N ) ] NEW_LINE solve ( N , a ) NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT main ( ) NEW_LINE DEDENT


import java . util . * ; import static java . lang . Integer . parseInt ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int question = sc . nextInt ( ) ; ArrayList < String > answers = new ArrayList < String > ( ) ; int scores [ ] = new int [ 4 ] ; answers . add ( sc . next ( ) ) ; for ( int i = 0 ; i < 4 ; i ++ ) { for ( int digit = 0 ; digit < question ; digit ++ ) if ( parseInt ( answers . get ( 0 ) . substring ( digit , digit + 1 ) ) == ( i + 1 ) ) { scores [ i ] = scores [ i ] + 1 ; } } int max = scores [ 0 ] ; int min = scores [ 1 ] ; for ( int i = 0 ; i < scores . length ; i ++ ) { int v = scores [ i ] ; if ( v > max ) { max = v ; } if ( v < min ) { min = v ; } } System . out . println ( max + " ▁ " + min ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Task solver = new Task ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class Task { public void solve ( int testNumber , InputReader in , PrintWriter out ) { int N = in . nextInt ( ) ; int [ ] count = new int [ 5 ] ; String str = in . next ( ) ; for ( int i = 0 ; i < N ; i ++ ) { switch ( str . charAt ( i ) ) { case '1' : count [ 1 ] ++ ; break ; case '2' : count [ 2 ] ++ ; break ; case '3' : count [ 3 ] ++ ; break ; case '4' : count [ 4 ] ++ ; break ; } } int max = count [ 1 ] ; int min = count [ 1 ] ; for ( int i = 2 ; i <= 4 ; i ++ ) { max = Math . max ( max , count [ i ] ) ; min = Math . min ( min , count [ i ] ) ; } out . println ( max + " ▁ " + min ) ; } } static class InputReader { public BufferedReader reader ; public StringTokenizer tokenizer ; public InputReader ( InputStream stream ) { reader = new BufferedReader ( new InputStreamReader ( stream ) , 32768 ) ; tokenizer = null ; } public String next ( ) { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { try { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } return tokenizer . nextToken ( ) ; } public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } } }

import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { MyScanner sc = new MyScanner ( ) ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; int a [ ] = new int [ 4 ] ; for ( int i = 0 ; i < n ; i ++ ) { switch ( s . charAt ( i ) ) { case ( '1' ) : a [ 0 ] ++ ; break ; case ( '2' ) : a [ 1 ] ++ ; break ; case ( '3' ) : a [ 2 ] ++ ; break ; case ( '4' ) : a [ 3 ] ++ ; break ; } } Arrays . sort ( a ) ; System . out . println ( a [ 3 ] + " ▁ " + a [ 0 ] ) ; } static int l_min ( int [ ] a ) { Arrays . sort ( a ) ; return a [ 0 ] ; } static int l_max ( int [ ] a ) { int l = a . length ; Arrays . sort ( a ) ; return a [ l - 1 ] ; } public static PrintWriter out ; public static class MyScanner { BufferedReader br ; StringTokenizer st ; public MyScanner ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }

import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num = sc . nextInt ( ) ; String sol = sc . next ( ) ; sc . close ( ) ; String [ ] sols = sol . split ( " " ) ; int one = 0 ; int two = 0 ; int three = 0 ; int four = 0 ; for ( int i = 0 ; i < num ; i ++ ) { switch ( sols [ i ] ) { case "1" : one ++ ; break ; case "2" : two ++ ; break ; case "3" : three ++ ; break ; case "4" : four ++ ; break ; } } int [ ] arr = { one , two , three , four } ; Arrays . sort ( arr ) ; String result = arr [ 3 ] + " ▁ " + arr [ 0 ] ; System . out . println ( result ) ; } }

import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String str = sc . next ( ) ; int [ ] c = new int [ 5 ] ; for ( int i = 0 ; i < n ; i ++ ) { int tmp = Integer . parseInt ( str . substring ( i , i + 1 ) ) ; if ( tmp == 1 ) { c [ 1 ] ++ ; } else if ( tmp == 2 ) { c [ 2 ] ++ ; } else if ( tmp == 3 ) { c [ 3 ] ++ ; } else if ( tmp == 4 ) { c [ 4 ] ++ ; } } int max = c [ 1 ] ; int min = c [ 1 ] ; for ( int i = 2 ; i < 5 ; i ++ ) { max = Math . max ( max , c [ i ] ) ; min = Math . min ( min , c [ i ] ) ; } pl ( max + " ▁ " + min ) ; } private static void pr ( Object o ) { System . out . print ( o ) ; } private static void pl ( Object o ) { System . out . println ( o ) ; } }

n = int ( input ( ) ) NEW_LINE cs = input ( ) . strip ( ) NEW_LINE cd = { '1' : 0 , '2' : 0 , '3' : 0 , '4' : 0 } NEW_LINE for c in cs : NEW_LINE INDENT cd [ c ] += 1 NEW_LINE DEDENT print ( max ( v for v in cd . values ( ) ) , min ( v for v in cd . values ( ) ) ) NEW_LINE

N = int ( input ( ) ) NEW_LINE c = input ( ) NEW_LINE c1 = c . count ( '1' ) NEW_LINE c2 = c . count ( '2' ) NEW_LINE c3 = c . count ( '3' ) NEW_LINE c4 = c . count ( '4' ) NEW_LINE ans = [ c . count ( '1' ) , c . count ( '2' ) , c . count ( '3' ) , c . count ( '4' ) ] NEW_LINE ans . sort ( ) NEW_LINE print ( ans [ 3 ] , ans [ 0 ] ) NEW_LINE

import numpy as np NEW_LINE class Calculator : NEW_LINE INDENT def __init__ ( self , arr ) : NEW_LINE INDENT self . arr = arr NEW_LINE DEDENT def calc ( self ) : NEW_LINE INDENT self . min_num = 9999 NEW_LINE self . max_num = 0 NEW_LINE for i in range ( 1 , 5 ) : NEW_LINE INDENT self . sum = np . sum ( self . arr == i ) NEW_LINE self . min_num = min ( self . min_num , self . sum ) NEW_LINE self . max_num = max ( self . max_num , self . sum ) NEW_LINE DEDENT DEDENT def get_max ( self ) : NEW_LINE INDENT return self . max_num NEW_LINE DEDENT def get_min ( self ) : NEW_LINE INDENT return self . min_num NEW_LINE DEDENT DEDENT def main ( ) : NEW_LINE INDENT N , = map ( int , input ( ) . split ( ) ) NEW_LINE c = list ( map ( int , list ( input ( ) ) ) ) NEW_LINE arr = np . array ( c , dtype = int ) NEW_LINE calc = Calculator ( arr ) NEW_LINE calc . calc ( ) NEW_LINE print ( calc . get_max ( ) , calc . get_min ( ) ) NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT main ( ) NEW_LINE DEDENT

from sys import stdin NEW_LINE N = stdin . readline ( ) . rstrip ( ) NEW_LINE c = stdin . readline ( ) . rstrip ( ) NEW_LINE count = [ ] NEW_LINE count . append ( c . count ( '1' ) ) NEW_LINE count . append ( c . count ( '2' ) ) NEW_LINE count . append ( c . count ( '3' ) ) NEW_LINE count . append ( c . count ( '4' ) ) NEW_LINE print ( max ( count ) , min ( count ) ) NEW_LINE

_ , c = open ( 0 ) ; print ( * sorted ( map ( c . count , '1234' ) ) [ : : - 3 ] ) NEW_LINE