Increase cheating reserve bots' variety
[troll.git] / src / test / java / PlayerCheatSmart.java
diff --git a/src/test/java/PlayerCheatSmart.java b/src/test/java/PlayerCheatSmart.java
new file mode 100644 (file)
index 0000000..97a5167
--- /dev/null
@@ -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);
+        }
+    }
+}