CSES - Datatähti 2022 alku - Results
Submission details
Task:Karkit
Sender:user2874
Submission time:2021-10-12 10:18:14 +0300
Language:Java
Status:COMPILE ERROR

Compiler report

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

Code

import java.util.Scanner;
import java.util.ArrayList;
public class Vastaus {
	public static void main (String [] args){
		Scanner lukija = new Scanner(System.in);
		int eka = Integer.valueOf(lukija.nextLine());
		ArrayList<Integer> lista = new ArrayList<>();
		lista.add(Integer.valueOf(lukija.nextLine()));
		lista.add(Integer.valueOf(lukija.nextLine()));
		lista.add(Integer.valueOf(lukija.nextLine()));
        int apu = 2;
        int apu2 = 100000;
        while(0 <apu){
            if(lista.get(apu)<apu2){
                apu2 = lista.get(apu);
            }
        apu--;
        }
        System.out.println(eka/apu2);
	}
}