#include <stdio.h>
#define MAX_DIGITS 100
void power3(unsigned long result[]);
void print_result(unsigned long result[]);
void power3(unsigned long result[]) {
unsigned long carry = 0;
for (int i = 0; i < MAX_DIGITS; i++) {
unsigned long temp = result[i] * 3 + carry;
result[i] = temp % 10000000;
carry = temp / 10000000;
}
}
void print_result(unsigned long result[]) {
int started = 0;
for (int i = MAX_DIGITS - 1; i >= 0; i--) {
if (result[i] != 0) {
if (started)
else {
started = 1;
}
} else if (started) {
}
}
}
int main() {
unsigned long result[MAX_DIGITS] = {0};
result[0] = 1;
for (int i = 1; i <= 99; i++) {
power3(result);
print_result(result);
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiAKI2RlZmluZSBNQVhfRElHSVRTIDEwMAogCnZvaWQgcG93ZXIzKHVuc2lnbmVkIGxvbmcgcmVzdWx0W10pOyAKdm9pZCBwcmludF9yZXN1bHQodW5zaWduZWQgbG9uZyByZXN1bHRbXSk7IAp2b2lkIHBvd2VyMyh1bnNpZ25lZCBsb25nIHJlc3VsdFtdKSB7CiAgICB1bnNpZ25lZCBsb25nIGNhcnJ5ID0gMDsgIAogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBNQVhfRElHSVRTOyBpKyspIHsKICAgICAgICB1bnNpZ25lZCBsb25nIHRlbXAgPSByZXN1bHRbaV0gKiAzICsgY2Fycnk7CiAgICAgICAgcmVzdWx0W2ldID0gdGVtcCAlIDEwMDAwMDAwOyAgCiAgICAgICAgY2FycnkgPSB0ZW1wIC8gMTAwMDAwMDA7IAogICAgfQp9CnZvaWQgcHJpbnRfcmVzdWx0KHVuc2lnbmVkIGxvbmcgcmVzdWx0W10pIHsKICAgIGludCBzdGFydGVkID0gMDsgCiAgICBmb3IgKGludCBpID0gTUFYX0RJR0lUUyAtIDE7IGkgPj0gMDsgaS0tKSB7CiAgICAgICAgaWYgKHJlc3VsdFtpXSAhPSAwKSB7CiAgICAgICAgICAgIGlmIChzdGFydGVkKQogICAgICAgICAgICAgICAgcHJpbnRmKCIlMDdsdSIsIHJlc3VsdFtpXSk7IAogICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgIHByaW50ZigiJWx1IiwgcmVzdWx0W2ldKTsKICAgICAgICAgICAgICAgIHN0YXJ0ZWQgPSAxOwogICAgICAgICAgICB9CiAgICAgICAgfSBlbHNlIGlmIChzdGFydGVkKSB7CiAgICAgICAgICAgIHByaW50ZigiJTA3bHUiLCByZXN1bHRbaV0pOwogICAgICAgIH0KICAgIH0KICAgIHByaW50ZigiXG4iKTsKfQppbnQgbWFpbigpIHsKICAgIHVuc2lnbmVkIGxvbmcgcmVzdWx0W01BWF9ESUdJVFNdID0gezB9OyAKICAgIHJlc3VsdFswXSA9IDE7CiAKICAgIGZvciAoaW50IGkgPSAxOyBpIDw9IDk5OyBpKyspIHsKICAgICAgICBwb3dlcjMocmVzdWx0KTsKICAgICAgICBwcmludGYoIjNeJWQgPSAiLCBpKTsKICAgICAgICBwcmludF9yZXN1bHQocmVzdWx0KTsKICAgIH0KIAogICAgcmV0dXJuIDA7Cn0=