#include #define MOD 17 int main(void) { int Q, i, j, k, l; scanf("%d", &Q); int data[Q]; for(i=0; imax) ? data[j] : max); int dp[max]; dp[0] = dp[1] = dp[2] = 0; dp[3] = 1; for(k=4; k < max; k++) { dp[k] = (dp[k-1] + dp[k-2] + dp[k-3] + dp[k-4])%MOD; } for(l=0; l