```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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 ``` ```#include #include #include #define search(key, a, n) bsearch(key, a, n, sizeof(int), compare); #define sort(a, n) qsort(a, n, sizeof(int), compare); #define FOR(i, a, n) for(i = a; i < n; i++) #define loop(i, n) FOR(i, 0, n) typedef long long ll; void swap(int *a, int *b) { int *temp; *temp = *a; *a = *b; *b = *temp; } int min(int a, int b) { if(a > b) return b; return a; } int max(int a, int b) { if(a > b) return a; return b; } int gcd(int a, int b) { return(b == 0 ? a : gcd(b, a%b)); } int compare (const void * a, const void * b) { return ( *(int*)a - *(int*)b ); } int findNextCoin(int n, int * primes) { int i = 0, j; //printf("%d %d", n, primes[i]); while(n % primes[i] != 0 && n > primes[i]) { //printf("%d\n", primes[i]); i ++; } printf("%d ", n / primes[i]); return n / primes[i]; } int main() { int n, i, a[1000001], primes[100000], j = 0, k; scanf(" %d", &n); for(i = 2; i <= 1000000; i ++) { if(a[i] == 0) { primes[j] = i; j ++; for(k = 2 * i; k <= 1000000; k += i) a[k] = 1; } } /*loop(i, 10) printf("%d\n", primes[i]);*/ printf("%d ", n); while(n > 1) { n = findNextCoin(n, primes); } return 0; } ```
 ```1 ``` `0 `