Time Lapse :NONE 9095.c123456789101112131415161718192021222324252627282930313233343536#include <iostream>#include <math.h>#include <string>#include <algorithm>#include <cstring>#include <vector>#include <cstdio>using namespace std;#define MAXSIZE 20int n;int cache[MAXSIZE];int testcase[MAXSIZE];int main(void){ cin >> n; memset(cache, -1, sizeof(cache)); cache[1] = 1; cache[2] = 2; cache[3] = 4; for (int i = 4; i <= 11; i++) { cache[i] = cache[i - 1] + cache[i - 2] + cache[i - 3]; } for (int i = 0; i < n; i++) { cin >> testcase[i]; } for (int i = 0; i < n; i++) { cout << cache[testcase[i]] << endl;; }} 9095.cpp1234567891011121314151617181920212223242526272829303132333435363738#include <iostream>#include <math.h>#include <string>#include <algorithm>#include <cstring>#include <vector>#include <cstdio>using namespace std;#define MAXSIZE 20int n;int cache[MAXSIZE];int testcase[MAXSIZE];int main(void){ cin >> n; memset(cache, -1, sizeof(cache)); cache[1] = 1; cache[2] = 2; cache[3] = 4; for (int i = 4; i <= 11; i++) { cache[i] = cache[i - 1] + cache[i - 2] + cache[i - 3]; } for (int i = 0; i < n; i++) { cin >> testcase[i]; } for (int i = 0; i < n; i++) { cout << cache[testcase[i]] << endl;; }}