37 lines
439 B
C
37 lines
439 B
C
#include <stdio.h>
|
|
#include <assert.h>
|
|
|
|
#define ull unsigned long long
|
|
|
|
void cf(ull x, ull y);
|
|
|
|
int main() {
|
|
ull x = 0, y = 0;
|
|
int res;
|
|
|
|
res = scanf("%llu %llu", &x, &y);
|
|
assert(res == 2);
|
|
|
|
cf(x, y);
|
|
|
|
return 0;
|
|
}
|
|
|
|
void cf(ull x, ull y) {
|
|
ull a = x;
|
|
ull b = y;
|
|
|
|
ull q = a / b;
|
|
ull r = a % b;
|
|
printf("%llu ", q);
|
|
|
|
while (r > 0) {
|
|
a = b;
|
|
b = r;
|
|
q = a / b;
|
|
r = a % b;
|
|
printf("%llu ", q);
|
|
}
|
|
}
|
|
|