about summary refs log tree commit diff
path: root/daily/286easy/lairotcaf.pas
blob: ef2c910054e8a7c7f5667620ae0d6ec307a33ca0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var
  fi, fo: text;
  n, i: int64;

begin
  assign(fi, 'lairotcaf.inp');
  assign(fo, 'lairotcaf.out');
  reset(fi);
  rewrite(fo);
  repeat
    readln(fi, n);
    write(fo, n);
    if n > 0 then
      begin
        i := 2;
        while n mod i = 0 do
          begin
            n := n div i;
            inc(i)
          end;
        if n = 1 then
          begin
            writeln(fo, ' = ', i - 1, '!');
            continue
          end
      end;
    writeln(fo, ' NONE')
  until eof(fi);
  close(fi);
  close(fo)
end.