Submission #3590802


Source Code Expand

import java.util.Scanner;

public class C {

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

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

		int x;
		for (int z = 0; z <= N; z++) {
			for (int y = 0; y <= N; y++) {
				x = N - y - z;
				if (x >= 0 && 10000 * x + 5000 * y + 1000 * z == Y) {
					System.out.println(x + " " + y + " " + z);
					return;
				}
			}
		}
		System.out.println("-1 -1 -1");
	}
}

Submission Info

Submission Time
Task A - Already 2018
User myamagishi
Language Java8 (OpenJDK 1.8.0)
Score 0
Code Size 465 Byte
Status CE

Compile Error

./Main.java:3: error: class C is public, should be declared in a file named C.java
public class C {
       ^
1 error