Created
August 28, 2021 05:18
-
-
Save yeopgi/ed26adc880cdda9284f7590e169ac526 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(void) | |
{ | |
ios_base::sync_with_stdio(false); | |
cin.tie(nullptr); | |
int test; | |
cin >> test; | |
while (test--) { | |
long long d[101] = {0}; | |
d[0] = 1, d[1] = 1, d[2] = 1, d[3] = 1; | |
int input; | |
cin >> input; | |
for (int i = 4; i <= input; i++) { | |
d[i] = d[i - 2] + d[i - 3]; | |
} | |
cout << d[input] << '\n'; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment