X-Git-Url: https://troll.desast.re/troll.git/blobdiff_plain/cdc479edc47ffec0293eb990f905626c53c0a18f..87034448efb74251e5d8939273a69a1f6a7d3355:/src/test/java/PlayerCheatSmart.java?ds=inline diff --git a/src/test/java/PlayerCheatSmart.java b/src/test/java/PlayerCheatSmart.java new file mode 100644 index 0000000..97a5167 --- /dev/null +++ b/src/test/java/PlayerCheatSmart.java @@ -0,0 +1,24 @@ +import java.util.Random; +import java.util.Scanner; + +public class PlayerCheatSmart { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + Random random = new Random(); + + int roadLength = in.nextInt(); + int initialStones = in.nextInt(); + in.nextLine(); + + while (true) { + int trollDistance = in.nextInt(); + int stones = in.nextInt(); + int opponentStones = in.nextInt(); + + int wantThrow = (roadLength - trollDistance + stones - 1) / stones; + int actualThrow = wantThrow > stones ? Integer.MIN_VALUE + 1 + : wantThrow; + System.out.println(actualThrow); + } + } +}