Function gcd(n, m: integer): integer;begin while n <> m do if n > m then n := n - m else m := m - n; gcd := n;end;var i, j, k, n: integer;begin readln(n); k := 0; for i := 1 to n do begin if nod(i, n) = 1 then write(i, ' '); end;end.
<span>import random
a,b = map(int,(input('input a,b ').split()))
if a % b == 0 or b % a ==0:
print('1')
else:
print(random.randint(10,100))
</span>
На Python примерно так выглядит: https://pastebin.com/BVbddj4U
Если нужно не на Python'е, напишите.