import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());

        // 主処理
        int[] abc = new int[] { a, b, c };
        Arrays.sort(abc);

        int result = abc[0] + abc[1] + (abc[2] * 10);

        // 出力
        System.out.println(result);
        sc.close();
    }
}

Score : 100 points

Problem Statement

You have decided to give an allowance to your child depending on the outcome of the game that he will play now.

The game is played as follows:

There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a + printed on it.

The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)

Then, the amount of the allowance will be equal to the resulting value of the formula.

Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

Constraints

All values in input are integers.

1 \leq A, B, C \leq 9

Input

Input is given from Standard Input in the following format:

A B C

Output

Print the maximum possible amount of the allowance.

Sample Input 1

1 5 2

Sample Output 1

53

The amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.

Sample Input 2

9 9 9

Sample Output 2

108

Sample Input 3

6 6 7

Sample Output 3

82


import java.util.*;

public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[3];
        for (int i = 0; i < 3; i++)
            a[i] = sc.nextInt();
        Arrays.sort(a);
        System.out.println(a[2] * 10 + a[1] + a[0]);
    }

}

Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.

Submitted source-code file size, in bytes.

Execution CPU time reported by official Project CodeNet metadata, in milliseconds.

Peak memory usage reported by official Project CodeNet metadata, in kilobytes.


import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        Arrays.sort(arr);
        System.out.println(arr[0]*10+arr[1]+arr[2]);
    }
}


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

public class Main implements Runnable { //Runnableを実装する
    public static void main(String[] args) {
        new Thread(null, new Main(), "", 64 * 1024 * 1024).start(); //16MBスタックを確保して実行
    }

    public void run() {
        //ここに処理を書く
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int[]s = {a,b,c};
        Arrays.sort(s);
        System.out.println(s[2]*10+s[1]+s[0]);
    }
}


import java.util.Scanner;
import java.util.Arrays;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num[] = new int[3];
        for (int i = 0; i < 3; ++i) num[i] = sc.nextInt();
        sc.close();
        Arrays.sort(num);
        System.out.print(num[0] + num[1] + num[2] * 10);
    }
}


import java.util.*;
public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int[] data = new int[3];
		for(int i=0; i<3; i++) {
			data[i]=sc.nextInt();
		}
		int max=data[0];
		for(int i=0; i<3; i++) {
			if(data[i]>max) {
				max=data[i];
			}
		}
		int ans = (max*10)+data[0]+data[1]+data[2]-max;
		System.out.println(ans);
	}
}


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] a = new int[3];
		int max = 0;
		int sum = 0;
		for (int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
			sum += a[i];
			max = Math.max(max, a[i]);
		}
		int money = sum + max * 9;
		System.out.println(money);
	}
}


import java.util.*;

public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int[] xm = new int[n];
        int[] ym = new int[m];
        for (int i = 0; i < n; i++) {
            xm[i] = sc.nextInt();
        }
        for (int i = 0; i < m; i++) {
            ym[i] = sc.nextInt();
        }
        boolean ok = false;
        IN: for (int z = x + 1; z <= y; z++) {
            for (int i = 0; i < n; i++) {
                if (xm[i] >= z)
                    continue IN;
            }
            for (int i = 0; i < m; i++) {
                if (ym[i] < z)
                    continue IN;
            }
            ok = true;
        }

        System.out.println(ok ? "No War" : "War");

    }

}

Score : 200 points

Problem Statement

Our world is one-dimensional, and ruled by two empires called Empire A and Empire B.

The capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.

One day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.

If there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.

X < Z \leq Y

x_1, x_2, ..., x_N < Z

y_1, y_2, ..., y_M \geq Z

Determine if war will break out.

Constraints

All values in input are integers.

1 \leq N, M \leq 100

-100 \leq X < Y \leq 100

-100 \leq x_i, y_i \leq 100

x_1, x_2, ..., x_N \neq X

x_i are all different.

y_1, y_2, ..., y_M \neq Y

y_i are all different.

Input

Input is given from Standard Input in the following format:

N M X Y
x_1 x_2 ... x_N
y_1 y_2 ... y_M

Output

If war will break out, print War; otherwise, print No War.

Sample Input 1

3 2 10 20
8 15 13
16 22

Sample Output 1

No War

The choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.

X = 10 < 16 \leq 20 = Y

8, 15, 13 < 16

16, 22 \geq 16

Sample Input 2

4 2 -48 -1
-20 -35 -91 -23
-22 66

Sample Output 2

War

Sample Input 3

5 3 6 8
-10 3 1 5 -100
100 6 14

Sample Output 3

War


import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の標準入力
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int y = sc.nextInt();
		int z;
		Integer nArray[] = new Integer[n];
		int mArray[] = new int[m];
		for(int i = 0; i < n; i++) {
			nArray[i] = sc.nextInt();
		}
		for(int j = 0; j < m; j++) {
			mArray[j] = sc.nextInt();
		}
		Arrays.sort(nArray, Collections.reverseOrder());
		Arrays.sort(mArray);
		z = mArray[0];
		if(x < z && z <= y && nArray[0] < z) {
			System.out.println("No War");
		} else {
			System.out.println("War");
		}
		sc.close();
	}
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N, n, M, m, X, Y;
		int xmax = -101, ymin = 101;
		N = scanner.nextInt();
		M = scanner.nextInt();
		X = scanner.nextInt();
		Y = scanner.nextInt();

		int x[] = new int[N];
		int y[] = new int[M];

		for (n = 1; n <= N; n++) {
			x[n - 1] = scanner.nextInt();
			xmax = Math.max(xmax, x[n - 1]);
		}
		for (m = 1; m <= M; m++) {
			y[m - 1] = scanner.nextInt();
			ymin = Math.min(ymin, y[m - 1]);
		}

		scanner.close();

		if (xmax <= ymin && X < xmax && ymin <= Y) {
			System.out.println("No War");
		} else {
			System.out.println("War");
		}

	}
}


import java.util.*;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;

class Main {

    public static void main(String[] args) throws IOException {
    	int n = in.nextInt() + 1;
    	int m = in.nextInt() + 1;
    	int[] x = new int[n];
    	x[0] = in.nextInt();
    	int[] y = new int[m];
    	y[0] = in.nextInt();
    	for(int i = 1; i < n; i ++)
    		x[i] = in.nextInt();
    	for(int i = 1; i < m; i ++)
    		y[i] = in.nextInt();
    	Arrays.sort(x);
    	Arrays.sort(y);
    	if(y[0] > x[n - 1])
    		sop("No War");
    	else
    		sop("War");
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        char nextChar() {
            return in.next().charAt(0);
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    static FastReader in = new FastReader();
    static OutputStream out = new BufferedOutputStream(System.out);

    public static byte[] toByte(Object o) {
        return String.valueOf(o).getBytes();
    }

    public static void sop(Object o) {
        System.out.print(o);
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();

        System.out.println(solve(A, B) ? "Yes" : "No");

        sc.close();
    }

    static boolean solve(int A, int B) {
        return A * B % 2 != 0;
    }
}

Score : 100 points

Problem Statement

You are given integers A and B, each between 1 and 3 (inclusive).

Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Constraints

All values in input are integers.

1 \leq A, B \leq 3

Input

Input is given from Standard Input in the following format:

A B

Output

If there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.

Sample Input 1

3 1

Sample Output 1

Yes

Let C = 3. Then, A \times B \times C = 3 \times 1 \times 3 = 9, which is an odd number.

Sample Input 2

1 2

Sample Output 2

No

Sample Input 3

2 2

Sample Output 3

No


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc= new Scanner(System.in);
		int A =sc.nextInt(),B=sc.nextInt();

		System.out.println(A*B%2!=0?"Yes":"No");
	}
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		sc.close();

		if((A * B) % 2 == 0) {
			System.out.println("No");
		}else {
			System.out.println("Yes");
		}
	}
}


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

class Main {

	void solve() {

		int a = inint(), b = inint();
		String ans = "No";
		if (a*b*1%2 == 1) ans = "Yes";
		if (a*b*2%2 == 1) ans = "Yes";
		if (a*b*3%2 == 1) ans = "Yes";
		out.println(ans);

	}

	public static Scanner in = new Scanner(System.in);
	public static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) {
		new Main().solve();
		out.flush();
	}

	public int inint() {
		return in.nextInt();
	}

	public String instr() {
		return in.next();
	}

	public int[] inintar(int num) {
		int[] a = new int[num];
		for (int i=0; i<num; i++) {
			a[i] = in.nextInt();
		}
		return a;
	}

	public char[] incharar() {
		return in.next().toCharArray();
	}

}


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

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] nums = reader.readLine().split(" ");
        boolean b = false;
        for(int i = 1; i <= 3; i++){
            b = (Integer.parseInt(nums[0]) + Integer.parseInt(nums[1]) + i) % 2 == 1;
        }
        if(b){
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();

		if(a % 2 == 1 && b % 2 == 1){
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}


import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
        int b = sc.nextInt();
        int flag = 0;
        for(int c=1;c<=3;c++){
            if((a*b*c)%2 == 1) flag = 1;
        }
        if(flag == 0)System.out.println("NO");
        else System.out.println("YES");
	}
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a, b;

		a = sc.nextInt();
		b = sc.nextInt();

		if (a % 2 != 0 && b % 2 != 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

		sc.close();
	}

}


import java.io.BufferedInputStream;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedInputStream(System.in));
        int A = scan.nextInt();
        int B = scan.nextInt();
        System.out.println(A%2 == 1 && B%2 == 1?"Yes": "No");
//        Task tsk = new Task();
//        tsk.solve();
    }

    static class Task{
        public void solve(){
        }
    }
}


import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    String ans = "Yes";
    if(((a * b) % 2) == 0) ans = "No";
    System.out.println(ans);
  }
}


import java.util.Scanner;

public class Main implements Runnable {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Thread(null, new Main(), "", 128 * 1024 * 1024).start();
    }

    public void run() {
        int a = sc.nextInt(), b = sc.nextInt();
        System.out.println((a % 2 == 0 || b % 2 == 0) ? "No" : "Yes");
    }
}


import java.text.DecimalFormat;
import java.util.stream.LongStream;
import java.util.stream.IntStream;
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        AtCoder problem = new AtCoder(sc);
        problem.solve(out);

        out.flush();
    }

}

class AtCoder {

    final int N;
    String[] ss;

    AtCoder(FastScanner sc) {
        N = sc.nextInt();
        ss = new String[N];
        for (int i = 0; i < N; i++) {
            ss[i] = sc.next();
        }
    }

    void solve(PrintWriter out) {
        for (int i = 0; i < N - 1; i++) {
            int j = ss[i].length() - 1;
            if (ss[i].charAt(j) != ss[i + 1].charAt(0)) {
                out.println("No");
                return;
            }
        }
        Arrays.sort(ss);
        for (int i = 0; i < N - 1; i++) {
            if (ss[i].equals(ss[i + 1])) {
                out.println("No");
                return;
            }
        }
        out.println("Yes");
    }

}

// https://qiita.com/p_shiki37/items/a0f6aac33bf60f5f65e4
class FastScanner {

    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte()) {
            return buffer[ptr++];
        } else {
            return -1;
        }
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
            ptr++;
        }
        return hasNextByte();
    }

    public String next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
            throw new NumberFormatException();
        }
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}

Score : 200 points

Problem Statement

Takahashi is practicing shiritori alone again today.

Shiritori is a game as follows:

In the first turn, a player announces any one word.

In the subsequent turns, a player announces a word that satisfies the following conditions:

That word is not announced before.

The first character of that word is the same as the last character of the last word announced.

In this game, he is practicing to announce as many words as possible in ten seconds.

You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Constraints

N is an integer satisfying 2 \leq N \leq 100.

W_i is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.

Input

Input is given from Standard Input in the following format:

N
W_1
W_2
:
W_N

Output

If every word announced by Takahashi satisfied the conditions, print Yes; otherwise, print No.

Sample Input 1

4
hoge
english
hoge
enigma

Sample Output 1

No

As hoge is announced multiple times, the rules of shiritori was not observed.

Sample Input 2

9
basic
c
cpp
php
python
nadesico
ocaml
lua
assembly

Sample Output 2

Yes

Sample Input 3

8
a
aa
aaa
aaaa
aaaaa
aaaaaa
aaa
aaaaaaa

Sample Output 3

No

Sample Input 4

3
abc
arc
agc

Sample Output 4

No


import java.util.*;

public class Main {

    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	char save = 0;
    	String ans = "Yes";
    	Set<String> old = new HashSet<>();
    	for (int i = 0; i < N; i++) {
    		String s = sc.next();
    		if (i != 0 && (s.charAt(0) != save || old.contains(s))) {
    			ans = "No";
    			break;
    		}
    		save = s.charAt(s.length()-1);
    		old.add(s);
    	}
    	System.out.println(ans);
    }
}


import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        long N = scanner.nextLong(); scanner.nextLine();

        Set<String> strs = new HashSet<>();

        String first = scanner.nextLine();
        strs.add(first);

        char tail = first.charAt(first.length() - 1);

        String ans = "Yes";
        for(int i = 1; i < N; i++) {
            String str = scanner.nextLine();
            char h = str.charAt(0);
            char t = str.charAt(str.length() - 1);

            if(tail != h || strs.contains(str)) {
                ans = "No";
                scanner.nextLine();
                scanner.close();
                break;
            }
            tail = t;
            strs.add(str);
        }

        System.out.println(ans);
    }
}


import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int N = scanner.nextInt();
    HashSet<String> words = new HashSet<>();
    String lastWord = scanner.next();
    words.add(lastWord);
    for (int i = 1; i < N; ++i) {
      String word = scanner.next();
      if (word.charAt(0) != lastWord.charAt(lastWord.length() - 1)) {
        System.out.println("No");
        return;
      }
      if (words.contains(word)) {
        System.out.println("No");
        return;
      }
      lastWord = word;
      words.add(word);
    }
    System.out.println("Yes");
    return;
  }
}


import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int wordsN = scanner.nextInt();
        String[] shiritoriW = new String[wordsN];
        String ans="Yes";
        shiritoriW[0] = scanner.next();
        checkLoop:
        for(int i=1;i<wordsN;i++){
            shiritoriW[i] = scanner.next();
            if(!(shiritoriW[i].charAt(0)==shiritoriW[i-1].charAt(shiritoriW[i-1].length()-1))){
                ans="No";
              break;
            } else {
                for(int j=i-1;j>=0;j--){
                    if(shiritoriW[i].equals(shiritoriW[j])){
                        ans = "No";
                        break checkLoop;
                    }
                }
            }
        }
        System.out.println(ans);
    }
}


import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int N = sc.nextInt();
        int flag = 0;

        String[] moji = new String[N];
        for(int i=0; i<N; i++){
            moji[i] = sc.next();
            if(i>0){
                //if((moji[i].charAt(0)) != moji[i-1].charAt((moji[i-1].length)-1))flag=1;
                String tmp = moji[i-1];
                char Ctmp = (tmp.charAt(tmp.length()-1));
                if((moji[i].charAt(0)) != Ctmp)flag=1;
            }
            if(flag == 1)break;
        }

        for(int i=0; i<N-2; i++){
            int c=0;

            for(int j=0; j<N-1; j++){
                if(moji[i]==moji[j])c++;

            }if(c>1)flag=1;break;
        }

        if(flag==0)System.out.println("Yes");
        else System.out.println("No");
	}
}


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

		Map<String, Boolean> wMap = new HashMap<>();
		boolean isRuled = true;
		String previousLastWord = "";
		for(int i=0;i<n;i++){
				String w = sc.next();
				// System.out.println(w);
				if(wMap.containsKey(w)){
					// System.out.println("containsKey");
					isRuled=false;
					break;
				}
				// System.out.println(w.substring(0,1));
				// System.out.println(previousLastWord);
				// System.out.println(w.substring(0,1).equals(previousLastWord));

				if(i>0 && !w.substring(0,1).equals(previousLastWord)){

					// System.out.println("equals");
					isRuled=false;
					break;
				}

				wMap.put(w,true);

				previousLastWord = w.substring(w.length()-1,w.length());
		}

		if(isRuled){
		System.out.println("Yes");
		}else{
		System.out.println("No");
		}

	}
}


import java.io.BufferedInputStream;
import java.util.HashSet;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedInputStream(System.in));
        int N = scan.nextInt();
        String[] words = new String[N];
        for (int i=0;i<N;i++) words[i] = scan.next();
        Task tsk = new Task();
        System.out.println(tsk.solve(words)?"Yes":"No");
    }

    static class Task{
        public boolean solve(String[] words){
            HashSet<String> visited = new HashSet<>();
            for (int i=0;i<words.length;i++) {
                if (!visited.add(words[i])) return false;
                if (i > 0 && words[i].charAt(0) != words[i-1].charAt(words[i-1].length()-1)) return false;
            }
            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 offset = Integer.parseInt(scanner.nextLine().split(" ")[1]);
		System.out.println(
				Arrays.stream(scanner.nextLine().split(" "))
					.mapToInt(Integer::parseInt)
					.map(i -> i - offset)
					.map(Math::abs)
					.filter(i -> i != 0)
					.reduce((i1, i2) -> gcd(i1, i2))
					.getAsInt()
				);
	}
	public static int gcd(int i1, int i2) {
		int bg = i1 > i2 ? i1 : i2;
		int sm = i1 > i2 ? i2 : i1;
		int remainder = sm;
		while(bg % sm != 0) {
			remainder = bg % sm;
			bg = sm;
			sm = remainder;
		}
		return remainder;
	}
}

Score : 300 points

Problem Statement

There are N cities on a number line. The i-th city is located at coordinate x_i.

Your objective is to visit all these cities at least once.

In order to do so, you will first set a positive integer D.

Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:

Move 1: travel from coordinate y to coordinate y + D.

Move 2: travel from coordinate y to coordinate y - D.

Find the maximum value of D that enables you to visit all the cities.

Here, to visit a city is to travel to the coordinate where that city is located.

Constraints

All values in input are integers.

1 \leq N \leq 10^5

1 \leq X \leq 10^9

1 \leq x_i \leq 10^9

x_i are all different.

x_1, x_2, ..., x_N \neq X

Input

Input is given from Standard Input in the following format:

N X
x_1 x_2 ... x_N

Output

Print the maximum value of D that enables you to visit all the cities.

Sample Input 1

3 3
1 7 11

Sample Output 1

2

Setting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.

Perform Move 2 to travel to coordinate 1.

Perform Move 1 to travel to coordinate 3.

Perform Move 1 to travel to coordinate 5.

Perform Move 1 to travel to coordinate 7.

Perform Move 1 to travel to coordinate 9.

Perform Move 1 to travel to coordinate 11.

Sample Input 2

3 81
33 105 57

Sample Output 2

24

Sample Input 3

1 1
1000000000

Sample Output 3

999999999


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.NoSuchElementException;

public class Main{
	static FastScanner sc = new FastScanner();
	static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) {
		int N = sc.nextInt();
		int X = sc.nextInt();

		int a [] = sc.nextIntArray(N, false);

		Arrays.sort(a);

		if (N==1){
			out.println(Math.abs(X-a[0]));
		}

		else {
			int min = 2000000001;
			int initial = 2000000001;
			for (int i=0; i<N-1; i++){
				min = Math.min(min, a[i+1]-a[i]);
				initial = Math.min(initial, Math.abs(X-a[i]));
			}
			initial = Math.min(initial, Math.abs(X-a[N-1]));
			out.println(GCF(min,initial));

		}
		out.flush();
	}
	public static int GCF(int a, int b) {
	    if (b == 0) return a;
	    else return (GCF (b, a % b));
	}
		static class FastScanner {
		    private final InputStream in = System.in;
		    private final byte[] buffer = new byte[1024];
		    private int ptr = 0;
		    private int buflen = 0;

		    private boolean hasNextByte() {
		      if (ptr < buflen) {
		        return true;
		      } else {
		        ptr = 0;
		        try {
		          buflen = in.read(buffer);
		        } catch (IOException e) {
		          e.printStackTrace();
		        }
		        if (buflen <= 0) {
		          return false;
		        }
		      }
		      return true;
		    }

		    private int readByte() {
		      if (hasNextByte()) return buffer[ptr++];
		      else return -1;
		    }

		    private static boolean isPrintableChar(int c) {
		      return 33 <= c && c <= 126;
		    }

		    private void skipUnprintable() {
		      while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
		    }

		    public boolean hasNext() {
		      skipUnprintable();
		      return hasNextByte();
		    }

		    public String next() {
		      if (!hasNext()) throw new NoSuchElementException();
		      StringBuilder sb = new StringBuilder();
		      int b = readByte();
		      while (isPrintableChar(b)) {
		        sb.appendCodePoint(b);
		        b = readByte();
		      }
		      return sb.toString();
		    }

		    public long nextLong() {
		      if (!hasNext()) throw new NoSuchElementException();
		      long n = 0;
		      boolean minus = false;
		      int b = readByte();
		      if (b == '-') {
		        minus = true;
		        b = readByte();
		      }
		      if (b < '0' || '9' < b) {
		        throw new NumberFormatException();
		      }
		      while (true) {
		        if ('0' <= b && b <= '9') {
		          n *= 10;
		          n += b - '0';
		        } else if (b == -1 || !isPrintableChar(b)) {
		          return minus ? -n : n;
		        } else {
		          throw new NumberFormatException();
		        }
		        b = readByte();
		      }
		    }

		    public int nextInt() {
		      return (int) nextLong();
		    }

		    public int[] nextIntArray(int N, boolean oneBased) {
		      if (oneBased) {
		        int[] array = new int[N + 1];
		        for (int i = 1; i <= N; i++) {
		          array[i] = sc.nextInt();
		        }
		        return array;
		      } else {
		        int[] array = new int[N];
		        for (int i = 0; i < N; i++) {
		          array[i] = sc.nextInt();
		        }
		        return array;
		      }
		    }

		    public long[] nextLongArray(int N, boolean oneBased) {
		      if (oneBased) {
		        long[] array = new long[N + 1];
		        for (int i = 1; i <= N; i++) {
		          array[i] = sc.nextLong();
		        }
		        return array;
		      } else {
		        long[] array = new long[N];
		        for (int i = 0; i < N; i++) {
		          array[i] = sc.nextLong();
		        }
		        return array;
		      }
		    }
		  }

		}


import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int N = Integer.parseInt(scan.next());
        long X = Integer.parseInt(scan.next());

        long distance;
        long[] distanceArray = new long[N];
        for(int i = 0; i < N; i++){
            distance = Long.parseLong(scan.next()) - X;
            if(distance < 0) distance = -(distance);
            distanceArray[i] = distance;
        }

        Arrays.sort(distanceArray);

        if(distanceArray.length == 1){

            System.out.println(distanceArray[0]);

        }else{

            System.out.println(gcd(distanceArray[1], distanceArray[0]));
        }

    }

    private static long gcd(long a, long b){

        if(a%b == 0){

            return b;

        }else{

            return gcd(b, a%b);

        }
    }
}


import java.io.PrintWriter;
import java.util.*;

public class Main {
  public static void main(String[] args) {
    try (PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in)) {
      Task task = new Task();
      task.solve(sc, out);
      out.flush();

    } catch (Exception e) {
      // DO NOT USE
    }
  }

  static class Task {
    public void solve(Scanner sc, PrintWriter out) {
      // TODO
      int n = nint(sc);
      long x = nlong(sc);

      List<Long> list = getLongList(sc, n);
      list.add(x);
      Collections.sort(list);
      long max = 0;
      long stock = list.get(0);
      for (int i = 1; i < list.size(); i++) {
        if (gcd(list.get(i), stock) > max) {
          max = gcd(list.get(i), stock);
        }
      }

      if (max == 0) {
        max = 1;
      }
      out.println(max);
    }
  }

  // method
  static int nint(Scanner sc) {
    return Integer.parseInt(sc.next());
  }

  static long nlong(Scanner sc) {
    return Long.parseLong(sc.next());
  }

  static double ndouble(Scanner sc) {
    return Double.parseDouble(sc.next());
  }

  static float nfloat(Scanner sc) {
    return Float.parseFloat(sc.next());
  }

  static String nstr(Scanner sc) {
    return sc.next();
  }

  static long[] longLine(Scanner sc, int size) {
    long[] lLine = new long[size];
    for (int i = 0; i < size; i++) {
      lLine[i] = nlong(sc);
    }
    return lLine;
  }

  static int[] intLine(Scanner sc, int size) {
    int[] iLine = new int[size];
    for (int i = 0; i < size; i++) {
      iLine[i] = nint(sc);
    }
    return iLine;
  }

  static String[] strLine(Scanner sc, int size) {
    String[] strLine = new String[size];
    for (int i = 0; i < size; i++) {
      strLine[i] = nstr(sc);
    }
    return strLine;
  }

  static long maxFromList(List<Long> longList) {
    return longList.stream().max(Comparator.naturalOrder()).get();
  }

  static long minFromList(List<Long> longList) {
    return longList.stream().min(Comparator.naturalOrder()).get();
  }

  static int sumDigits(int n) {
    int sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  }

  static long sumDigits(long n) {
    long sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  }

  static List<Integer> getIntegerList(Scanner sc, int size) {
    List<Integer> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nint(sc));
    }
    return list;
  }

  static List<Long> getLongList(Scanner sc, int size) {
    List<Long> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nlong(sc));
    }
    return list;
  }

  static long gcd(long m, long n) {
    if (m < n) return gcd(n, m);
    if (n == 0) return m;
    return gcd(n, m % n);
  }
}


import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Zahyou = sc.nextInt();

		List<Integer> list = new ArrayList<>();
		for(int i = 0; i < N; i++) {
			list.add(sc.nextInt());
		}
		list.add(Zahyou);
		Collections.sort(list);

		int kyori = 1000000001;
		int num = 0;
		for(int i = 0; i < N; i++) {
			num = Math.abs(list.get(i+1)-list.get(i));

			if(num == 0) {
				continue;
			}
			if(kyori == 1000000001) {
				kyori = num;
				continue;
			}
			kyori = gcd(kyori,num);

		}

		if(kyori == 1000000001) {
			kyori = 0;
		}
		System.out.println(kyori);
		sc.close();
	}

	//最大公約数gcd
	static int gcd (int a, int b) {
		if(b == 0) {
			return a;
		}
		if(b % a == 0) {
			return a;
		}
		if(a % b == 0) {
			return b;
		}

		int temp;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return b;
	}

}


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);

		int N = in.nextInt();
		int S = in.nextInt();

		int[] x = new int[N+1];
		int[] y = new int[N+1];

		int min = Integer.MAX_VALUE;
		int key = -1;

		for (int i=1;i<=N;i++)
		{
			x[i]= in.nextInt();
			y[i]= Math.abs(x[i] - S);

				if ( y[i] < min)
				{
					min = y[i];
					key = i;
				}
		}

		int D=min;

		while (D>=1) {
			for (int i=1;i<=N;i++) {
				if (y[i]%D!=0) {
					D--;
					break;
				}
			}
			System.out.println(D);
			break;
		}
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.math.BigInteger;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Kenji
 */
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);
        ABC109C solver = new ABC109C();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC109C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int X = in.nextInt();
            long[] arr = new long[N + 1];
            for (int i = 0; i < N; i++) {
                arr[i] = in.nextLong();
            }
            arr[N] = X;
            Arrays.sort(arr);
            long ans = 0;
            for (int i = 0; i < N; i++) {
                long a = arr[i];
                long b = arr[i + 1];
                if (i == 0) {
                    ans = b - a;
                } else {
                    ans = gcd(ans, b - a);
                }
            }
            out.println(ans);
        }

        public static long gcd(long m, long n) {
            return BigInteger.valueOf(m).gcd(BigInteger.valueOf(n)).longValue();
        }

    }
}


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		long D = sc.nextLong();
		long N = sc.nextLong();
		long ans = 0;
		if ((long)Math.pow(100, D) * N % (long)Math.pow(100, D) == 0 ) {
			ans = (long)Math.pow(100, D) * N;
		}else {
			ans = (long)Math.pow(100, D) * (N + 1);
		}

		System.out.println(ans);

	}
}

Score: 200 points

Problem Statement

Today, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.

As the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.

Find the N-th smallest integer that would make Ringo happy.

Constraints

D is 0, 1 or 2.

N is an integer between 1 and 100 (inclusive).

Input

Input is given from Standard Input in the following format:

D N

Output

Print the N-th smallest integer that can be divided by 100 exactly D times.

Sample Input 1

0 5

Sample Output 1

5

The integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...

Thus, the 5-th smallest integer that would make Ringo happy is 5.

Sample Input 2

1 11

Sample Output 2

1100

The integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \ 000, 1 \ 100, ...

Thus, the integer we are seeking is 1 \ 100.

Sample Input 3

2 85

Sample Output 3

850000

The integers that can be divided by 100 exactly twice are as follows: 10 \ 000, 20 \ 000, 30 \ 000, ...

Thus, the integer we are seeking is 850 \ 000.


import java.util.*;
import java.lang.Math;
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int D = sc.nextInt();
        int N = sc.nextInt();
        if(D == 0){
            if(N == 100){
                System.out.println(101);
            }else{
                System.out.println(N);
            }
        }
        if(D == 1){
            if(N == 100){
                System.out.println(10100);
            }else{
            System.out.println(N * 100);
            }
        }
        if(D == 2){
            if(N == 100){
                System.out.println(1010000);
            }else{
            System.out.println(N * 10000);
            }
        }
    }
}


import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//数値
		int d = Integer.parseInt(sc.next());
		int n = Integer.parseInt(sc.next());
		if(d==0) {
		    System.out.println(n);
		}
		if(d==1) {
			System.out.println(n*100);
		}
		if(d==2) {
		    System.out.println(n*10000);
		}
     }
}


import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        int D = sc.nextInt();
        int N = sc.nextInt();

        int ans = 0;
        if( N ==  100 ) {
            ans = (int)Math.pow(100, D) * (N + 1);
        } else {
            ans = (int)Math.pow(100, D) * N;
        }
        System.out.println( ans );
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.math.*;

public class Main {
    private static Scanner sc;

    public static void main(final String[] args) {
        final Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    }

    private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null)
                br.close();
        }

        public String next() throws IOException {
            if (i < s.length)
                return s[i++];
            String st = br.readLine();
            while (st == "")
                st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
    }

    private void solve() {
        try {

            int a = sc.nextInt();
            int b = sc.nextInt();

            if (a == 0) {
                System.out.println(b);

            } else if (a == 1) {
                System.out.println(b * 100);
            } else {
                System.out.println(b * 10000);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}


import java.util.*;
import java.util.function.BiPredicate;
import java.util.function.BinaryOperator;
import java.util.stream.IntStream;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int inputD = Integer.parseInt(sc.next());
        int inputN = Integer.parseInt(sc.next());

        int[] arr = IntStream.range(1, 10000000)
                .filter(num -> calc(num,inputD)).toArray();
        System.out.println(arr[inputN -1]);
    }
    private static boolean calc(int x, int d) {
        int count = 0;
        int tmp = x;
        while (true) {
            if (tmp % 100 == 0) {
                count++;
                tmp = tmp/ 100;
            } else {
                break;
            }
        }
        if (count == d) {
            return true;
        } else {
            return false;
        }
    };
}


import java.util.*;
public class Main{
  public static void main(String arg[]){
  Scanner sc=new Scanner(System.in);
    int a=sc.nextInt();
    int b=sc.nextInt();
	int c=0;
	int arr[]={1,100,10000,1000000};
	for(int i=1;;i++){
		if((i%arr[a]==0)&&(i%arr[a+1]!=0))
			c++;
		if(c==b){
			System.out.println(i);
			break;
		}
	}

  }
}


import java.util.*;
public class Main {
	public static void myout(Object text){//standard output
		System.out.println(text);
	}
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      int D = sc.nextInt();
      int N = sc.nextInt();
      int output = (int)Math.pow(100,D);
      myout(output * N);
	}
}


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int d = sc.nextInt();
		int n = sc.nextInt();

		int x = 0;
		if (d == 0) {
			x = 1;
		} else if (d == 1) {
			x = 100;
		} else {
			x = 10000;
		}

		System.out.println(x*n);

		sc.close();

	}
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int time = in.nextInt();
        int num = in.nextInt();
        in.close();
        int ans = (int)Math.pow(100, time) * num;
        System.out.println(ans);
    }
}


import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);

		int D = sc.nextInt();
		int N = sc.nextInt();

		if (D == 0 && N != 100) {
			System.out.println(N);
		} else if (D == 0 && N == 100){
			System.out.println(N + 1);
		} else if (D == 1 && N != 100){
			System.out.println(N * 100);
		} else if (D == 1 && N == 100){
			System.out.println((N + 1)* 100);
		} else if (D == 2 && N != 100){
			System.out.println(N * 10000);
		} else if (D == 2 && N == 100){
			System.out.println((N + 1)* 10000);
		}

	}
}


import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int d = sc.nextInt();
		int n = sc.nextInt();
		System.out.println((int)(n+n/100)*(Math.pow(100,d)));
	}
}


import java.util.*;

class Main{

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int d,n;
    d = sc.nextInt();
    n = sc.nextInt();
    if(d==0){
      System.out.println(n);
    }
    else if(d==1){
      System.out.println(100*n);
    }
    else{
      System.out.println(10000*n);
    }
  }

}


import java.util.*;

public class Main {
	public static void main(String[] orgs) {
		Scanner sc = new Scanner(System.in);
		int D = sc.nextInt();
		int N = sc.nextInt();

		if(D == 0&&N ==100){
			System.out.println(100);
		}else{
			System.out.print(N * Math.pow(100,D));
		}
	}
}


import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);

		int D = sc.nextInt();
		int N = sc.nextInt();

		int q=(N-1)/99;

		int base=0;
		if(D==0) {
			base=1;
		}else if(D==1) {
			base=100;
		}else {
			base=100*100;
		}

		int ans=(N+q)*base;
		System.out.println(ans);
	}

	//以下テンプレート

	public static int[] extgcd(int a, int b) {

		int x0 = 1;
		int x1 = 0;

		int y0 = 0;
		int y1 = 1;

		while (b != 0) {
			int q = a / b;
			int r = a % b;

			int x2 = x0 - q * x1;
			int y2 = y0 - q * y1;

			a = b;
			b = r;

			x0 = x1;
			x1 = x2;

			y0 = y1;
			y1 = y2;
		}

		return new int[] { a, x0, y0 };

	}

	static int gcd(int a, int b) {

		if (b == 0)
			return a;

		if (a < b) {
			int t = a;
			a = b;
			b = t;
		}

		return gcd(b, a % b);

	}

	static int lcm(int a, int b) {
		return a * b / gcd(a, b);
	}

	static void swap(int[] a) {
		int t;

		t = a[0];
		a[0] = a[1];
		a[1] = t;

		return;
	}

	static <T> void output(List<T> list) {

		for (int i = 0; i < list.size(); i++) {
			System.out.print(list.get(i));

			if (i != list.size() - 1) {
				System.out.print(" ");
			} else {
				nl();
			}
		}

	}

	static void output(String[][] str) {

		for (int i = 0; i < str.length; i++) {
			for (int j = 0; j < str[i].length; j++) {
				print(str[i][j]);
			}

			nl();
		}

	}

	static void output(boolean flg, String Yes, String No) {

		if (flg) {
			pln(Yes);
		} else {
			pln(No);
		}

	}

	static void output(String[][] str, int digit) {

		String dig = "%" + String.valueOf(digit) + "s";

		for (int i = 0; i < str.length; i++) {
			for (int j = 0; j < str[i].length; j++) {
				System.out.printf(dig, str[i][j]);
			}
			nl();
		}

	}

	static void pln(String str) {
		System.out.println(str);
	}

	static void pln(int x) {
		System.out.println(x);
	}

	static void print(String str) {
		System.out.print(str);
	}

	static void print(int x) {
		System.out.print(x);
	}

	static void print(String str, int times) {
		for (int i = 0; i < times; i++) {
			print(str);
		}
	}

	static void print(int x, int times) {
		for (int i = 0; i < times; i++) {
			print(x);
		}
	}

	static void nl() {
		System.out.println();
	}

}


import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int d = sc.nextInt(),
        n = sc.nextInt();
    if(d == 0)
      System.out.println(n);
    else{
      int p = 1;
      for(int j = 0; j < d; j++)
        p *= 100;
      if(d == 100)
        System.out.println(p * n + p);
      else
        System.out.println(p * n);

    }
  }
}


import java.util.Scanner;

class Main{

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		if(A == 0){
			System.out.println(B);
		}else{
		int x = (int)Math.pow(100.0, (double)A);
		System.out.println(x*B);
		}

	}

}


import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Random;

public class Main
{
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int D = ni(), N = ni();
		if(D == 0) {
			//if(N == 100) {
				//out.println(101);
			//}
			//else {
				out.println(N);
		//	}
		}
		else if(D == 1) {
			out.println(N*100);
		}
		else if(D == 2) {
			out.println(N*10000);
		}
	}

	void run() throws Exception
	{
		is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{ new Main().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf)
		{
			ptrbuf = 0;
			try
			{ lenbuf = is.read(inbuf); }
			catch (IOException e)
			{ throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c)
	{ return !(c >= 33 && c <= 126); }
	private int skip()
	{ int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd()
	{ return Double.parseDouble(ns()); }
	private char nc()
	{ return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b)))
		{ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private String nsl()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b) && b != ' '))
		{ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b)))
		{
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-')
		{
			minus = true;
			b = readByte();
		}

		while(true)
		{
			if(b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			}else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-')
		{
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			}else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private static void tr(Object... o)
	{ System.out.println(Arrays.deepToString(o)); }
}


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

public class Main{
    public static void main (String[] args) throws java.lang.Exception {
        InputReader in = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
        int n = in.nextInt(), d = in.nextInt();
        int temp = (int)Math.pow(100, n), ans = 0;

        while (d-- > 0)
            ans += temp;
        w.println(ans);
        w.close();
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int peek() {
            if (numChars == -1)
                return -1;
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    return -1;
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar];
        }

        public void skip(int x) {
            while (x-- > 0)
                read();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public String nextString() {
            return next();
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        public String nextLine() {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r')
                    buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }
        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
        public boolean hasNext() {
            int value;
            while (isSpaceChar(value = peek()) && value != -1)
                read();
            return value != -1;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}


import java.util.*;
    public class Main{
	public static void main(String[] args){
	    Scanner scan = new Scanner(System.in);
	    int numD = scan.nextInt();
	    int numN = scan.nextInt();
	    if(numD == 0 ){
		System.out.println(numN);

	    }else if(numD == 1){
		System.out.println(numN*100);
	    }else if(numD == 2){
		System.out.println(numN*10000);
	    }

	}

    }


import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int D = sc.nextInt();
        int N = sc.nextInt();
        if(D == 0) {
            System.out.println(N);
        } else {
            System.out.println(N * (int)Math.pow(100, D));
        }
    }
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int D = sc.nextInt();

        if(N == 0){
            System.out.println(D);
            return;
        }

        int pow = (int)Math.pow(100, N);
        int res = pow * D;
        if (N == 100){
            res = res - 1;
        }
        System.out.println(res);

    }
}


import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int d = sc.nextInt();
        int n = sc.nextInt();
        long x = 1;
        for(int i = 1;i <= d;i++){
            x *= 100;
        }
        if(n < 100){
            System.out.println(x*n);
        }
        else{
            System.out.println(x*n+x);
        }
    }
}


import java.util.Scanner;

/*
 * AtCoder Beginner Contest 100 B
 */
public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int D = scanner.nextInt();
		int N = scanner.nextInt();

		int result = (int) Math.pow(100, D) * N;

		System.out.println(result);

	}

}


import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int D = sc.nextInt();
		int N = sc.nextInt();

		System.out.println((int)Math.pow(100, D)*N);

	}

}


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();

		int ans = 0;

		switch (a) {
		case 0:
			ans = b;

			break;
		case 1:
			ans = 100 * b;
			break;
		case 2:
			ans = 10000 * b;

			break;

		default:
			break;
		}

		System.out.println(ans);

		sc.close();

	}

}


import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(),x=sc.nextInt();
        int count = 0;
        for(int i = 0;i<=a;i++){
            for(int j =0;j<=b;j++){
                for(int k =0;k<=c;k++){
                    if(i*500+j*100+k*50==x){
                        count++;
                    }
                }
            }
        }
        System.out.println(count);
    }
}

Score : 200 points

Problem Statement

You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).
In how many ways can we select some of these coins so that they are X yen in total?

Coins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.

Constraints

0 \leq A, B, C \leq 50

A + B + C \geq 1

50 \leq X \leq 20 000

A, B and C are integers.

X is a multiple of 50.

Input

Input is given from Standard Input in the following format:

A
B
C
X

Output

Print the number of ways to select coins.

Sample Input 1

2
2
2
100

Sample Output 1

2

There are two ways to satisfy the condition:

Select zero 500-yen coins, one 100-yen coin and zero 50-yen coins.

Select zero 500-yen coins, zero 100-yen coins and two 50-yen coins.

Sample Input 2

5
1
0
150

Sample Output 2

0

Note that the total must be exactly X yen.

Sample Input 3

30
40
50
6000

Sample Output 3

213


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();

		int count = 0;
		for(int numA = 0;numA <= a;numA++) {
		    for(int numB = 0;numB <= b;numB++) {
		        int numC = (x - (500 * numA + 100 * numB)) / 50;
		        int total = 500 * numA + 100 * numB + 50 * numC;
		        if(numC >= 0 && numC <= c && total == x) count++;
		    }
		}

		System.out.println(count);
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
    	InputStream input = System.in;
      	OutputStream output = System.out;
      	Scanner sc = new Scanner(input);
      	PrintWriter out = new PrintWriter(output);
      	int A = sc.nextInt();
      	int B = sc.nextInt();
      	int C = sc.nextInt();
      	int X = sc.nextInt();
      	int count = 0;
      	for(int i = 0; i <= A; i++){
        	for(int j = 0; j <= B; j++){
            	for(int l = 0; l <= C; l++){
                	if((500 * i) + (100 * j) + (50 * l) == X){
                    	count++;
                    }
                }
            }
        }
      	out.println(count);
      	out.close();
    }
}


import java.util.*;

public class Main {
    public static void main(String... args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int X = sc.nextInt();
        sc.close();

        int ans = 0;
        for (int i = 0; i <= A; i++) {
            for (int j = 0; j <= B; j++) {
                for (int k = 0; k <= C; k++) {
                    if (X == 500 * i + 100 * j + 50 * k)
                        ans++;
                }
            }
        }
        System.out.println(ans);
    }
}


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

		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		int count = 0;

		for (int ia = 0; ia <= a; ia++) {
			for (int ib = 0; ib <= b; ib++) {
				for (int ic = 0; ic <= c; ic++) {
					if (x == ia * 500 + ib * 100 + ic * 50) {
						count++;
					}
				}
			}
		}

		System.out.println(count);
	}
}


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		int ans = 0;
		for(int i = 0; i < a + 1; i++) {
			for(int j = 0; j < b + 1; j++) {
				for(int k = 0; k < c + 1; k++) {
					int tmp = 50 * k + 100 * j + 500 * i;
					if(tmp > x)
						break;
					else if(tmp == x)
						ans++;
				}
			}
		}
		System.out.println(ans);
	}
}


import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();

		int count = 0;
		for(int i=0; i<a+1; i++) {
			for(int j=0; j<b+1; j++) {
				for(int k=0; k<c+1; k++) {
					int sw = i*500 + j*100 + k*50;
					if(sw == x) {
						count++;
					}
				}
			}
		}
		System.out.println(count);
	}
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] inputNumbers = new int[4];
		for (int i = 0; i < 4; i++) {
			inputNumbers[i] = Integer.parseInt(sc.nextLine());
		}

		int count = 0;
		for (int i = 0; i <= inputNumbers[3] / 500; i++) {
			for (int j = 0; j <= (inputNumbers[3] - 500 * i) / 100; j++) {
				if ((inputNumbers[3] - 500 * i - 100 * j) % 50 == 0) {
					count++;
				}
			}
		}
		System.out.println(count);

	}
}


import java.util.*;
public class Main{
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int x = sc.nextInt();
        int cnt = 0;
        for(int i=0; i<=a; i++){
            for(int j=0; j<=b; j++){
                int nd_c = (x - i*500 - j*100)/50;
                if(nd_c<=c && nd_c>=0){
                    cnt++;
                }
            }
        }
        System.out.println(cnt);
    }
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int pattern = 0;
		for(int i = 0; i < A + 1; i++) {
			int sumi = 500 * i;
			if(!(sumi > X)) {
				for(int j = 0; j < B + 1; j++) {
					int sumj = sumi + 100 * j;
					if(!(sumj > X)) {
						if(!((X - sumj) / 50 > C)) {
							pattern++;
						}
					} else {
						break;
					}
				}
			} else {
				break;
			}
		}
		System.out.println(pattern);
	}

}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int pattern = 0;
		for(int i = 0; i < A + 1; i++) {
			int sum = 500 * i;
			if(!(sum > X)) {
				for(int j = 0; j < B + 1; j++) {
					sum += 100 * j;
					if(!(sum > X)) {
						if(!((X - sum) / 50 > C)) {
							pattern++;
						}
					} else {
						break;
					}
				}
			} else {
				break;
			}
		}
		System.out.println(pattern);
	}

}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();// 500
        int b = sc.nextInt();// 100
        int c = sc.nextInt();// 50
        int x = sc.nextInt();
        int count = 0;
        for (int i = 0; i <= c; i++) {
            for (int j = 0; j <= b; j++) {
                for (int k = 0; k <= a; k++) {
                    if ((50 * i) + (100 * j) + (500 * k) == x) {
                        count++;
                    }
                }
            }
        }
        System.out.println(count);
    }
}


import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();// 几个500
		int B = sc.nextInt();// 几个100
		int C = sc.nextInt();// 几个50
		int X = sc.nextInt();
		int ans = 0;
		int i,j,k;
		for (i = 0; i <= A; i++) {
			for (j = 0; j <= B; j++) {
				for (k = 0; k <= C; k++) {
					if (500 * i + 100 * j + 50 * k == X)
						ans+=1;
				}
			}
		}
		System.out.println(ans);

	}
}


import java.util.*;

public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int fh,oh,ft,result,count;
		count = 0;
		fh = sc.nextInt();
		oh = sc.nextInt();
		ft = sc.nextInt();
		result = sc.nextInt();
		for(int i=0;i<=fh;i++){
			for(int j=0;j<=oh;j++){
				for(int l=0;l<=ft;l++){
					if(i*500 + j*100 + l*50 == result){
						count++;
					}
				}
			}
		}
		System.out.println(count);
	}
}


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

public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

        String[] input = br.readLine().split(" ");
        int a = Integer.parseInt(input[0]);
        int b = Integer.parseInt(input[1]);

        out.println(a * b % 2 == 0 ? "Even" : "Odd");
        out.close();

    }
}

Score : 100 points

Problem Statement

AtCoDeer the deer found two positive integers, a and b.
Determine whether the product of a and b is even or odd.

Constraints

1 ≤ a,b ≤ 10000

a and b are integers.

Input

Input is given from Standard Input in the following format:

a b

Output

If the product is odd, print Odd; if it is even, print Even.

Sample Input 1

3 4

Sample Output 1

Even

As 3 × 4 = 12 is even, print Even.

Sample Input 2

1 21

Sample Output 2

Odd

As 1 × 21 = 21 is odd, print Odd.


import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception{
        // Your code here!
     		Scanner sc = new Scanner(System.in);
            int a = sc.nextInt();
            int b = sc.nextInt();
            int i = a * b;
            if(i % 2==0){
                System.out.println("Even");

            }
            if(i % 2!=0){
                System.out.println("Odd");

            }

    }
}


import java.util.Scanner;

public class Main {
	static int[][] bingo = new int[3][3];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		if(a*b%2==0) {
			System.out.println("Even");
		}else {
			System.out.println("Odd");
		}
	}

}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		sc.close();

		if(a % 2 == 0 || b % 2 == 0) {
			System.out.println("Even");
		} else {
			System.out.println("Odd");
		}
	}

}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan =new Scanner(System.in);

       int a=scan.nextInt();
       int b=scan.nextInt();

       if ((a*b)%2==0){System.out.println("Even");}
       else{System.out.println("Odd");}

	// write your code here

    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;
import java.util.stream.LongStream;

public class Main {

    public Main() throws IOException {
    }

    public static void main(String[] args) throws IOException {
        new Main().solve();
    }

    //    private final InputStream in = Files.newInputStream(Paths.get("C:\\Users\\ryo.suzuki\\Downloads\\02.txt"));
    private final InputStream in = System.in;
    private final PrintWriter out = new PrintWriter(System.out);
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private void solve() throws IOException {
        try {
            solveA();
//            solveB();
//            solveC();
//            solveD();
//            solveE();
//            solveF();
        } finally {
            if (in != null) {
                in.close();
            }
            if (out != null) {
                out.flush();
                out.close();
            }
        }

    }

    // mods
    long MOD = (long) Math.pow(10, 9) + 7;

    private void solveA() {
        int a = nextInt();
        int b = nextInt();
        out.println((a * b) % 2 == 0 ? "Even" : "Odd");
    }

    private void solveB() {

    }

    private void solveC() {

    }

    private void solveD() {

    }

    private void solveE() {

    }

    private void solveF() {

    }

    static final long CONST_INF = Long.MAX_VALUE / 4;

    private static class VectorCalculation {
        /**
         * 点Pと線(AB)の距離
         *
         * @param p
         * @param a
         * @param b
         * @return
         */
        private double distanceDotAndLine(DoublePair p, DoublePair a, DoublePair b) {
            DoublePair ab = new DoublePair(b.x - a.x, b.y - a.y);
            DoublePair ap = new DoublePair(p.x - a.x, p.y - a.y);

            // ベクトルAB、APの外積の絶対値が平行四辺形Dの面積になる
            double d = Math.abs(crossVector(ab, ap));

            double l = distanceVertex(a, b); // AB間の距離

            double h = d / l;
            return h;
        }

        /**
         * 2点間距離
         *
         * @param p1
         * @param p2
         * @return
         */
        private double distanceVertex(DoublePair p1, DoublePair p2) {
            double dx = p1.x - p2.x;
            double dy = p1.y - p2.y;
            return Math.sqrt(dx * dx + dy * dy);
        }

        /**
         * ベクトル外積
         *
         * @param vl
         * @param vr
         * @return
         */
        private double crossVector(DoublePair vl, DoublePair vr) {
            return vl.x * vr.y - vl.y * vr.x;
        }
    }

    private static class DoublePair implements Comparable<DoublePair> {
        double x;
        double y;

        public DoublePair(double k, double v) {
            this.x = k;
            this.y = v;
        }

        public int compareTo(DoublePair pair) {
            return Double.compare(this.y, pair.y);
        }
    }

    private static class SimplePair implements Comparable<SimplePair> {
        long k;
        long v;

        public SimplePair(int k, int v) {
            this.k = k;
            this.v = v;
        }

        public SimplePair(long k, long v) {
            this.k = k;
            this.v = v;
        }

        public int compareTo(SimplePair pair) {
            return Long.compare(this.v, pair.v);
        }
    }

    private static class SimpleGraphNode {
        private int n;
        private Map<Integer, Integer> childs;

        public SimpleGraphNode(int n) {
            this.n = n;
            childs = new HashMap<Integer, Integer>();
        }

        public void addChild(int child, int d) {
            this.childs.put(child, d);
        }
    }

    private static class SimpleGraph {

        private Map<Integer, SimpleGraphNode> graph;

        public SimpleGraph(int[][] list) {
            graph = new HashMap<Integer, SimpleGraphNode>();
            Arrays.stream(list).forEach(l -> {
                int a = l[0];
                int b = l[1];
                int d = l[2];
                graph.put(a, graph.getOrDefault(a, new SimpleGraphNode(a)));
                graph.get(a).addChild(b, d);
                graph.put(b, graph.getOrDefault(b, new SimpleGraphNode(b)));
                graph.get(b).addChild(a, d);
            });
        }

        public SimpleGraphNode getNode(int i) {
            return graph.getOrDefault(i, new SimpleGraphNode(-1));
        }

    }

    private static class GraphNode {
        private long n;
        private Map<Long, SimplePair> childs;

        public GraphNode(long n) {
            this.n = n;
            childs = new TreeMap<Long, SimplePair>();
        }

        /**
         * not update
         *
         * @param child
         * @param d
         */
        public void addChild(long child, long d) {
            this.childs.put(child, this.childs.getOrDefault(child, new SimplePair(child, d)));
        }

        public SimplePair getChild(long child) {
            return this.childs.getOrDefault(child, new SimplePair(child, CONST_INF));
        }
    }

    private static class Graph {

        private Map<Long, GraphNode> graph;
        int n;

        /**
         * @param n    頂点数
         * @param list
         */
        public Graph(int n, int[][] list) {
            this.n = n;
            graph = new HashMap<Long, GraphNode>();
            /*
            隣接行列作成
            0-indexed
             */
            Arrays.stream(list).forEach(l -> {
                long a = l[0] - 1;
                long b = l[1] - 1;
                long d = l[2];
                graph.put(a, graph.getOrDefault(a, new GraphNode(a)));
                graph.get(a).addChild(b, d);
                graph.put(b, graph.getOrDefault(b, new GraphNode(b)));
                graph.get(b).addChild(a, d);
            });
            /*
            たどり着けない場所はCONST_INFで埋める
            自分へはCOST=0でたどり着ける
             */
            for (long i = 0; i < n; i++) {
                graph.put(i, graph.getOrDefault(i, new GraphNode(i)));
                GraphNode node = graph.get(i);
                for (int j = 0; j < n; j++) {
                    if (i == j)
                        node.addChild(j, 0L);
                    else
                        node.addChild(j, CONST_INF);
                }
            }
        }

        /**
         * ワーシャルフロイド
         */
        public void warshallFloyd() {
            for (long k = 0; k < n; k++) {
                for (long i = 0; i < n; i++) {
                    for (long j = 0; j < n; j++) {
                        long min = Math.min(graph.get(i).getChild(j).v, graph.get(i).getChild(k).v + graph.get(k).getChild(j).v);
                        graph.get(i).getChild(j).v = min;
                    }
                }
            }
        }

        public void partialUpdateAndWarshallFloyd(long x, long y, long w) {
            if (graph.get(x).getChild(y).v > w)
                graph.get(x).getChild(y).v = graph.get(y).getChild(x).v = w;
            long[] l = {x, y};
            for (long k : l) {
                for (long i = 0; i < n; i++) {
                    for (long j = 0; j < n; j++) {
                        if (graph.get(i).getChild(j).v > graph.get(i).getChild(k).v + graph.get(k).getChild(j).v) {
                            graph.get(i).getChild(j).v = graph.get(i).getChild(k).v + graph.get(k).getChild(j).v;
                        }
                    }
                }
            }
        }

        /**
         * 2点間の距離
         *
         * @param from
         * @param to
         * @return
         */
        public long getDistance(long from, long to) {
            return graph.get(from).getChild(to).v;
        }

    }

    public long calcSimpleCombination(long n, long m, long CONST_MOD) {
        long mole = 1;
        for (long i = 1; i <= n + m; i++) {
            mole *= i;
            mole %= CONST_MOD;
        }
        long deno = 1;
        for (long i = 1; i <= n; i++) {
            deno *= i;
            deno %= CONST_MOD;
        }
        for (int i = 1; i <= m; i++) {
            deno *= i;
            deno %= CONST_MOD;
        }
        deno = modInverse(deno, CONST_MOD);
        return (mole * deno) % CONST_MOD;
    }

    long abs(double x) {
        return (long) Math.abs(x);
    }

    long round(double x) {
        return Math.round(x);
    }

    long floor(double x) {
        return (long) Math.floor(x);
    }

    long ceil(double x) {
        return (long) Math.ceil(x);
    }

    double sqrt(double x) {
        return Math.sqrt(x);
    }

    double pow(double x, double y) {
        return Math.pow(x, y);
    }

    long pow(long x, long y) {
        return (long) Math.pow(x, y);
    }

    int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }

    public long lcmMod(long... ab) {

        Map<Long, Long> ps = new HashMap<Long, Long>();

        for (int abl = 0; abl < ab.length; abl++) {
            long target = ab[abl];
            long l = target;
            for (long p = 2; p * p <= l; p++) {
                long cnt = 0;
                while (target > 1 && target % p == 0) {
                    cnt++;
                    target /= p;
                }
                if (cnt == 0)
                    continue;
                ps.put(p, Long.max(cnt, ps.getOrDefault(p, 0L)));
            }
            if (target > 1)
                ps.put(target, Long.max(1, ps.getOrDefault(target, 0L)));
        }
        long res = 1L;
        for (Map.Entry<Long, Long> e : ps.entrySet()) {
            res *= powMod(e.getKey(), e.getValue());
            res %= MOD;
        }
        return res;
    }

    int upperToInt(char a) {
        return a - 'A';
    }

    int lowerToInt(char a) {
        return a - 'a';
    }

    int numToInt(char a) {
        return a - '0';
    }

    int charToInt(char a) {
        return a >= 'a' ? lowerToInt(a) : a >= 'A' ? upperToInt(a) : numToInt(a);
    }

    char intToUpper(int a) {
        return (char) (a + 'A');
    }

    char intToLower(int a) {
        return (char) (a + 'a');
    }

    char intToNum(int a) {
        return (char) (a + '0');
    }

    void reverse(String array[]) {
        String reversed[] = new String[array.length];
        for (int i = 0; i < array.length; i++) {
            reversed[array.length - i - 1] = array[i];
        }
        for (int i = 0; i < array.length; i++) {
            array[i] = reversed[i];
        }
    }

    void reverse(int array[]) {
        int reversed[] = new int[array.length];
        for (int i = 0; i < array.length; i++) {
            reversed[array.length - i - 1] = array[i];
        }
        for (int i = 0; i < array.length; i++) {
            array[i] = reversed[i];
        }
    }

    void reverse(long array[]) {
        long reversed[] = new long[array.length];
        for (int i = 0; i < array.length; i++) {
            reversed[array.length - i - 1] = array[i];
        }
        for (int i = 0; i < array.length; i++) {
            array[i] = reversed[i];
        }
    }

    void reverse(double array[]) {
        double reversed[] = new double[array.length];
        for (int i = 0; i < array.length; i++) {
            reversed[array.length - i - 1] = array[i];
        }
        for (int i = 0; i < array.length; i++) {
            array[i] = reversed[i];
        }
    }

    void reverse(boolean array[]) {
        boolean reversed[] = new boolean[array.length];
        for (int i = 0; i < array.length; i++) {
            reversed[array.length - i - 1] = array[i];
        }
        for (int i = 0; i < array.length; i++) {
            array[i] = reversed[i];
        }
    }

    void fill(int array[][], int x) {
        for (int a[] : array) {
            Arrays.fill(a, x);
        }
    }

    void fill(long array[][], long x) {
        for (long a[] : array) {
            Arrays.fill(a, x);
        }
    }

    void fill(double array[][], double x) {
        for (double a[] : array) {
            Arrays.fill(a, x);
        }
    }

    void fill(boolean array[][], boolean x) {
        for (boolean a[] : array) {
            Arrays.fill(a, x);
        }
    }

    void fill(int array[][][], int x) {
        for (int a[][] : array) {
            fill(a, x);
        }
    }

    void fill(long array[][][], long x) {
        for (long a[][] : array) {
            fill(a, x);
        }
    }

    void fill(double array[][][], double x) {
        for (double a[][] : array) {
            fill(a, x);
        }
    }

    void fill(boolean array[][][], boolean x) {
        for (boolean a[][] : array) {
            fill(a, x);
        }
    }

    long L_INF = (long) 1e18 + 7;

    boolean isINF(long a) {
        return abs(a) > L_INF / 1000;
    }

    boolean isPlusINF(long a) {
        return a > 0 && isINF(a);
    }

    boolean isMinusINF(long a) {
        return isPlusINF(-a);
    }

    int I_INF = (int) 1e9 + 7;

    boolean isINF(int a) {
        return abs(a) > I_INF / 1000;
    }

    boolean isPlusINF(int a) {
        return a > 0 && isINF(a);
    }

    boolean isMinusINF(int a) {
        return isPlusINF(-a);
    }

    /**
     * 指定したx以下の素数をリストアップする
     */
    public long[] getPrimesUnderX(long x) {
        return LongStream.rangeClosed(2, x)
                .filter(i -> LongStream.rangeClosed(2, (long) Math.sqrt(i)).allMatch(j -> i % j != 0)).toArray();
    }

    public long mod(long i) {
        return i % MOD + ((i % MOD) < 0 ? MOD : 0);
    }

    long powMod(long x, long y) {
        if (y == 0) {
            return 1;
        } else {
            long tmp = powMod(x, y / 2);
            return mod(mod(tmp * tmp) * (y % 2 == 0 ? 1 : x));
        }
    }

    long inv(long x) {
        return powMod(x, MOD - 2);
    }

    int MAX_FACT = 5_000_100;
    long fact[];
    long invFact[];

    /**
     * Combination簡易版
     * 5 C 2
     * 異なる n個のものから r個を選ぶ組み合わせの総数 nCr を求めます。
     * 5!(5*4*3*2*1)
     * /
     * 2!(2*1) *  (5-2)!(3*2*1)
     *
     * @param n
     * @param r
     * @return
     */
    private long getComb(int n, int r) {
        long tmp = 1;
        for (int i = 1; i <= r; i++) {
            tmp *= n - i + 1;
            tmp = mod(tmp);
            tmp *= inv(i);
            tmp = mod(tmp);
        }
        return tmp;
    }

    /**
     * 階乗計算の事前累積和
     * [1, 1, 2, 3, 4, 5, … FACTORIAL_NUM]
     * mod済
     */
    void prepareFact() {
        fact = new long[MAX_FACT];
        Arrays.fill(fact, 0);
        invFact = new long[MAX_FACT];
        Arrays.fill(invFact, 0);
        fact[0] = 1;
        int maxIndex = (int) min(MAX_FACT, (int) MOD);
        for (int i = 1; i < maxIndex; i++) {
            fact[i] = mod(fact[i - 1] * i);
        }
        invFact[maxIndex - 1] = inv(fact[maxIndex - 1]);
        for (int i = maxIndex - 1; i > 0; i--) {
            invFact[i - 1] = mod(invFact[i] * i);
        }
    }

    /**
     * 順列
     * nPk -> n! / (n-k)!
     *
     * @param n
     * @param r
     * @return
     */
    long permutation(int n, int r) {
        if (n < 0 || r < 0 || n < r) {
            return 0;
        }
        return mod(fact[n] * invFact[n - r]);
    }

    /**
     * 組み合わせ
     * nCk -> n! / k!・(n-k)!
     *
     * @param n
     * @param r
     * @return
     */
    long combination(int n, int r) {
        if (n < 0 || r < 0 || n < r) {
            return 0;
        }
        return mod(permutation(n, r) * invFact[r]);
    }

    /**
     * 重複組合せ nHr （同次積）
     * nHr = (n+r-1)Cr
     * 異なるn個のものから重複を許してr個取る組合せの総数
     * 例：
     * リンゴ，ミカン，牛肉の3種類の果物があります．これらの中から6個の食材を買って帰ります．
     * このとき，何通りの買い方がありますか？ただし，含まれない食材があってもよいものとします
     *
     * @param n
     * @param r
     * @return
     */
    long homogeneousProduct(int n, int r) {
        return combination((n - 1) + r, r);
    }

    /**
     * 多項係数
     * 文字aをp個,bをq個,cをr個, dをs個 あわせてn個を1列に並べるときの並べ方
     * n! / p!・q!・r!・s!
     *
     * @param n
     * @param strNum
     * @param mod
     * @return
     */

    /**
     * フェルマーの小定理を用いて逆元を求める。
     * ある数xのmod p（pは素数）の逆数x'はx' = x^(p-2)
     * 繰り返し二乗法を用いて計算する。
     * http://satanic0258.hatenablog.com/entry/2016/04/29/004730
     * {@link BigInteger#modInverse(BigInteger)}とどちらが速いか？
     *
     * @param x
     * @return
     */
    private long modInverse(long x, long mod) {
        long res = 1L;
        long k = mod - 2L;
        long y = x;
        while (k != 0) {
            if (k % 2 != 0) {
                res = (res * y) % mod;
            }
            y = (y * y) % mod;
            k /= 2;
        }
        return res;
    }

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    private void skipUnprintable() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
    }

    public boolean hasNext() {
        skipUnprintable();
        return hasNextByte();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public long min(long... v) {
        long min = Long.MAX_VALUE;
        for (long i : v) min = Math.min(min, i);
        return min;
    }

    public long max(long... v) {
        long max = Long.MIN_VALUE;
        for (long i : v) max = Math.max(max, i);
        return max;
    }
}


import java.util.*;

public class Main {

	public static void main(String[]$) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		if ((a*b)%2 == 0) {
			System.out.println("Even");
		} else {
			System.out.println("Odd");
		}

	}

}


import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.Scanner;
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}
public class Main {
    static FastScanner scan=new FastScanner();
    static Scanner scanner=new Scanner(System.in);
    static long gcd (long a, long b) {return b>0?gcd(b,a%b):a;}
    static long lcm (long a, long b) {return a*b/gcd(a,b);}
    static int max(int a,int b) {return a>b?a:b;}
    static int min(int a,int b) {return a<b?a:b;}
    static long factorial(int i) {return i==1?1:i*factorial(i-1);}
    static int lower_bound(int a[],int key) {
        int low=0,high=a.length;
        while(low<high) {
            int mid=((high-low)/2)+low;
            if(a[mid]<=key)low=mid+1;
            else high=mid;
        }
        return high;
        }
    static int upper_bound(int a[],int key) {
        int low=0,high=a.length;
        while(low<high) {
            int mid=((high-low)/2)+low;
            if(a[mid]<key)low=mid+1;
            else high=mid;
        }
        return high;
        }
    static boolean isPrime (long n) {
        if (n==2) return true;
        if (n<2 || n%2==0) return false;
        double d = Math.sqrt(n);
        for (int i=3; i<=d; i+=2)if(n%i==0){return false;}
        return true;
    }
    static int upper_division(int a,int b) {
        if(a%b==0) {
            return a/b;
        }
        else {
            return a/b+1;
        }
    }
    static long lupper_division(long a,long b) {
        if(a%b==0) {
            return a/b;
        }
        else {
            return a/b+1;
        }
    }
    static long lmax(long a,long b) {return Math.max(a, b);}
    static long lmin(long a,long b) {return Math.min(a, b);}
    static int[] setArray(int a) {
        int b[]=new int[a];
        for(int i=0;i<a;i++) {
            b[i]=scan.nextInt();
        }
        return b;
    }
    static String reverce(String str) {
        String strr="";
        for(int i=str.length()-1;i>=0;i--) {
            strr+=str.charAt(i);
        }
        return strr;
    }
    public static void printArray(int[] a) {
        for(int i=0;i<a.length-1;i++) {
        System.out.print(a[i]+" ");
        }
        System.out.println(a[a.length-1]);
    }
    public static int[][] doublesort(int[][]a) {
        Arrays.sort(a,(x,y)->Integer.compare(x[0],y[0]));
        return a;
    }
    static long modpow(long x,long n,long mo) {//x^n%mo
        long sum=1;
        while(n>0) {
            if((n&1)==1) {
                sum=sum*x%mo;
            }
            x=x*x%mo;
            n>>=1;
        }
        return sum;
    }
    public static void main(String[] args) {
    	int a=scan.nextInt();
    	int b=scan.nextInt();
    	System.out.println(a*b%2==0?"Even":"Odd");
    }
}


import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int b=sc.nextInt();

		if((a*b)%2==0){
			System.out.println("Even");
		}else{
			System.out.println("Odd");
		}
	}
}


import java.util.*;

class Main{
  public static void main(String[] args){
    try(Scanner sc = new Scanner(System.in)){
      int a = Integer.parseInt(sc.next());
      int b = Integer.parseInt(sc.next());
      int term = a * b;
      if((term % 2) == 0){
        System.out.println("Even");
      }else{
        System.out.println("Odd");
      }
    }
  }
}


import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if (a % 2 == 1 && b % 2 == 1) {
            System.out.println("Odd");
        }else{
            System.out.println("Even");
        }
    }
}


import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    if((a*b) %2 == 0)
      System.out.println("Even");
    else
      System.out.println("Odd");
  }
}


import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();

        if ( (a * b) % 2 == 0 ){
            System.out.println( "Even" );
        }else{
            System.out.println("Odd");
        }
    }
}


// https://atcoder.jp/contests/abc086/tasks/abc086_a

import java.util.Scanner;

public class Main {
    public static void main() {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();

        if ((a * b % 2) == 0) {
            System.out.println("Even");
        } else {
            System.out.println("Odd");
        }
    }
}


import java.util.*;
public class Main {
	public static void main(String[] args){
		List<String> list = new ArrayList<>();
		list.add("Even");
		list.add("Odd");
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		// スペース区切りの整数の入力
		int b = sc.nextInt();

		System.out.println(list.get(a*b % 2));

	}
}


import java.util.Scanner;
class Main
{
  public static void main(String[] args)
  {
    Scanner input=new Scanner(System.in);
    int a=input.nextInt();
    int b=input.nextInt();
    if(a>=1 && b>=1 && a<=10000 && b<=10000)
    {
      a=a*b;
      if(a%2==0)
      {
        System.out.println("Even");
      }else
      System.out.println("Odd");
    }
  }
}


import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
               Scanner sc = new Scanner(System.in);
               int a = sc.nextInt();
               int b = sc.nextInt();

		String odd = "Odd";
		String even = "Even";
		String answer = "";

		int result = a * b;
		if (result % 2 == 1 ) {
			answer = odd;
		}else{
			answer = even;
		}

		System.out.println(answer);

	}

}