fork download
  1. #include <bits/stdc++.h>
  2. #define M 1000000007
  3. #define pb push_back
  4. typedef long long ll;
  5. using namespace std;
  6. int atoi(string s)
  7. {
  8. int num = 0;
  9. for(int i=0;i<s.length();i++)
  10. num = num*10 + (s[i]-'0');
  11. return num;
  12. }
  13. vector<ll> vc,ls[3];
  14. int comp(ll a,ll b)
  15. {
  16. return (a>b);
  17. }
  18. ll nCr[1003][1003];
  19. int main()
  20. {
  21. for(int i=0;i<1003;i++)
  22. {
  23. for(int j=0;j<=i;j++)
  24. {
  25. if(j==0 || j==i) nCr[i][j] = 1;
  26. else nCr[i][j] = (nCr[i-1][j-1] + nCr[i-1][j])%M;
  27. }
  28. }
  29. //if (in.is_open())
  30. {
  31. int tc;
  32. cin >> tc;
  33. //tc = atoi(str);
  34. while(tc--)
  35. {
  36. ll N,ans=0;
  37. cin >> N;
  38. for(ll i = 2;i<=N;i+=2)
  39. ans = (ans + ((nCr[N][i]*nCr[N][i/2])%M))%M;
  40. cout << ans <<endl;
  41. }
  42. }
  43. //in.close();
  44. //out.close();
  45. return 0;
  46. }
  47.  
Runtime error #stdin #stdout 0s 10600KB
stdin
Standard input is empty
stdout
Standard output is empty