about summary refs log tree commit diff
path: root/others/volume1/010.pas
diff options
context:
space:
mode:
Diffstat (limited to 'others/volume1/010.pas')
-rw-r--r--others/volume1/010.pas21
1 files changed, 21 insertions, 0 deletions
diff --git a/others/volume1/010.pas b/others/volume1/010.pas
new file mode 100644
index 0000000..bf8ae90
--- /dev/null
+++ b/others/volume1/010.pas
@@ -0,0 +1,21 @@
+const
+  pow5: array[2..25] of qword = (25, 125, 625, 3125, 15625, 78125, 390625,
+                                 1953125, 9765625, 48828125, 244140625,
+                                 1220703125, 6103515625, 30517578125,
+                                 152587890625, 762939453125, 3814697265625,
+                                 19073486328125, 95367431640625,
+                                 476837158203125, 2384185791015625,
+                                 11920928955078125, 59604644775390625,
+                                 298023223876953125);
+
+var
+  n, count: qword;
+  i: byte;
+
+begin
+  readln(n);
+  count := n div 5;
+  for i := 2 to 25 do
+    count := count + n div pow5[i] * (i - 1);
+  writeln(count)
+end.