fork download
  1. //while(!GM)
  2. //Practice++;
  3. #include <bits/stdc++.h>
  4. using namespace std;
  5. #include <ext/pb_ds/assoc_container.hpp>
  6. #include <ext/pb_ds/tree_policy.hpp>
  7. using namespace __gnu_pbds;
  8. template <typename F> using o_set = tree<F, null_type, less<F>, rb_tree_tag, tree_order_statistics_node_update>;
  9. template <typename F> using o_multiset = tree<F, null_type, less_equal<F>, rb_tree_tag, tree_order_statistics_node_update>;
  10. #define wlo '\n'
  11. #define fast ios::sync_with_stdio(false); cin.tie(nullptr);
  12. #define int long long
  13. const int mod= 1e9+7;// 998244353;
  14. using ll =long long ;
  15.  
  16. ll exp(ll x, ll n, ll m) {
  17. x %= m;
  18. ll res = 1;
  19. while (n > 0) {
  20. if (n % 2 == 1) { res = res * x % m;
  21. }
  22. x = x * x % m;
  23. n /= 2;
  24. }
  25. return res;
  26. }
  27. void dbrhawlo ()
  28. {
  29. int n;
  30. cin>>n;
  31. int cnt = 1 ;
  32. for(int i =1;i<=2*n;i++)
  33. {
  34. cnt = (i*cnt)%mod;
  35. }
  36. int qwe = exp(2,mod-2,mod);// 2^(-1)
  37. cnt=(cnt*qwe)%mod;
  38. cout<<cnt<<wlo;
  39.  
  40. }
  41. int32_t main()
  42. {
  43. fast;
  44. int t=1;
  45. cin>>t;
  46. while(t--)
  47. {
  48. dbrhawlo();
  49. }
  50. return 0;
  51. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
500000004