about summary refs log tree commit diff
path: root/codechef/hmappy2.p6
diff options
context:
space:
mode:
Diffstat (limited to 'codechef/hmappy2.p6')
-rwxr-xr-xcodechef/hmappy2.p65
1 files changed, 5 insertions, 0 deletions
diff --git a/codechef/hmappy2.p6 b/codechef/hmappy2.p6
new file mode 100755
index 0000000..cfe4cf5
--- /dev/null
+++ b/codechef/hmappy2.p6
@@ -0,0 +1,5 @@
+#!/usr/bin/env perl6
+for ^get() {
+    my ($N, $A, $B, $K) = get.words.map: *.Int;
+    put $N div $A + $N div $B - $N div ($A lcm $B) * 2 < $K ?? 'Lose' !! 'Win';
+}