about summary refs log tree commit diff
path: root/codechef/xypizq.p6
diff options
context:
space:
mode:
Diffstat (limited to 'codechef/xypizq.p6')
-rwxr-xr-xcodechef/xypizq.p66
1 files changed, 6 insertions, 0 deletions
diff --git a/codechef/xypizq.p6 b/codechef/xypizq.p6
new file mode 100755
index 0000000..ff0598f
--- /dev/null
+++ b/codechef/xypizq.p6
@@ -0,0 +1,6 @@
+#!/usr/bin/env perl6
+multi xypizq($N, 1, $x, $y, $z where $x == $z) { $x / ($N * 2 + 1) }
+multi xypizq($N, 1, $x, $y, $z) { 1 - xypizq $N, 1, $z, $y, $z }
+multi xypizq($N, 3, $x, $y, $z) { xypizq $N, 1, $z, $y, $x }
+multi xypizq($N, $t, $x, $y, $z) { 1 - $y * 2 / ($N * 2 + 1) }
+xypizq(|get.words>>.Int).nude.put for ^get