about summary refs log tree commit diff
path: root/12/TP-HN-2015/bai1.pas
diff options
context:
space:
mode:
Diffstat (limited to '12/TP-HN-2015/bai1.pas')
-rw-r--r--12/TP-HN-2015/bai1.pas38
1 files changed, 0 insertions, 38 deletions
diff --git a/12/TP-HN-2015/bai1.pas b/12/TP-HN-2015/bai1.pas
deleted file mode 100644
index 312f2b4..0000000
--- a/12/TP-HN-2015/bai1.pas
+++ /dev/null
@@ -1,38 +0,0 @@
-var
-  a, b, c, x, v: smallint;
-  f: text;
-
-
-function gcd(m, n: smallint): smallint;
-  var
-    p: smallint;
-
-  begin
-    while (n <> 0) do
-      begin
-        p := m mod n;
-        m := n;
-        n := p
-      end;
-
-    exit(m)
-  end;
-
-
-begin
-  assign(f, 'BAI1.INP');
-  reset(f);
-  read(f, a, b, c);
-  close(f);
-
-  v := 0;
-  for x := 1 to c div a do
-    if ((c - a * x) mod b = 0) and
-       (gcd(x, (c - a * x) div b) = 1) then
-      inc(v);
-
-  assign(f, 'BAI1.OUT');
-  rewrite(f);
-  writeln(f, v);
-  close(f)
-end.