Skip to content

Instantly share code, notes, and snippets.

@WillemVansteyvoort
Created November 1, 2017 13:36
Show Gist options
  • Save WillemVansteyvoort/d8ba45d9e6050c6944554237af1ebb47 to your computer and use it in GitHub Desktop.
Save WillemVansteyvoort/d8ba45d9e6050c6944554237af1ebb47 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner invoer = new Scanner(System.in);
int testgevallen;
int punten;
int sprongen;
testgevallen = invoer.nextInt();
for (int i = 1; i <= testgevallen; i++) {
sprongen = invoer.nextInt();
punten = 0;
for (int f = 0; f < sprongen; f++){
int seconden = invoer.nextInt();
if (seconden > 4) {
punten += 100;
seconden -= 4;
} else {
punten += seconden*25;
seconden -= seconden;
}
if (seconden > 4) {
punten += 400;
seconden -= 4;
} else {
punten += 100*seconden;
seconden -= seconden;
}
if (seconden > 4) {
punten += 2000;
seconden -= 4;
} else {
punten += 500*seconden;
seconden -= seconden;
}
if (seconden > 0) {
punten += seconden*1000;
}
} System.out.println(i + " " + punten);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment