Last active
April 8, 2022 03:23
-
-
Save Trimad/db3197d5a0cfc2610020dc54cce4cb29 to your computer and use it in GitHub Desktop.
UVa 10550
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* * * * * * * * * | |
* Tristan Madden | |
* 11/09/2017 | |
* UVa 10550 | |
* * * * * * * * */ | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
while (sc.hasNext()) { | |
String temp[] = sc.nextLine().split(" "); | |
if (Integer.parseInt(temp[0]) == 0 && Integer.parseInt(temp[1]) == 0 && Integer.parseInt(temp[2]) == 0 | |
&& Integer.parseInt(temp[3]) == 0) { | |
break; | |
} else { | |
System.out.println(1080 + ((Integer.parseInt(temp[0]) - Integer.parseInt(temp[1]) + 40) % 40 | |
+ (Integer.parseInt(temp[2]) - Integer.parseInt(temp[1]) + 40) % 40 | |
+ (Integer.parseInt(temp[2]) - Integer.parseInt(temp[3]) + 40) % 40) * 9); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment