Advertisement
halexandru11

d

Feb 12th, 2021
63
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <algorithm>
  2. #include <array>
  3. #include <bitset>
  4. #include <cassert>
  5. #include <climits>
  6. #include <cmath>
  7. #include <complex>
  8. #include <cstdio>
  9. #include <cstdlib>
  10. #include <cstring>
  11. #include <fstream>
  12. #include <functional>
  13. #include <iomanip>
  14. #include <iostream>
  15. #include <map>
  16. #include <memory>
  17. #include <numeric>
  18. #include <queue>
  19. #include <random>
  20. #include <set>
  21. #include <stack>
  22. #include <string>
  23. #include <unordered_set>
  24. #include <unordered_map>
  25. #include <vector>
  26. using namespace std;
  27.  
  28. /// START Errichto's debug
  29. #define sim template < class c
  30. #define ris return * this
  31. #define dor > debug & operator <<
  32. #define eni(x) sim > typename \
  33. enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
  34. sim > struct rge { c b, e; };
  35. sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
  36. sim > auto dud(c* x) -> decltype(cerr << *x, 0);
  37. sim > char dud(...);
  38. struct debug {
  39. #ifdef LOCAL
  40. ~debug() { cerr << endl; }
  41. eni(!=) cerr << boolalpha << i; ris; }
  42. eni(==) ris << range(begin(i), end(i)); }
  43. sim, class b dor(pair < b, c > d) {
  44. ris << "(" << d.first << ", " << d.second << ")";
  45. }
  46. sim dor(rge<c> d) {
  47. *this << "[";
  48. for (auto it = d.b; it != d.e; ++it)
  49. *this << ", " + 2 * (it == d.b) << *it;
  50. ris << "]";
  51. }
  52. #else
  53. sim dor(const c&) { ris; }
  54. #endif
  55. };
  56. #define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
  57. // debug & operator << (debug & dd, P p) { dd << "(" << p.x << ", " << p.y << ")"; return dd; }
  58. /// END Errichto's debug
  59.  
  60. #define ff first
  61. #define ss second
  62. #define eb emplace_back
  63. #define mp make_pair
  64. #define pb push_back
  65. #define ppb pop_back
  66. #define all(a) a.begin(), a.end()
  67. #define rall(a) a.rbegin(), a.rend()
  68. #define f0(i, n) for(auto i = 0; i < n; ++i)
  69. #define fo(i, k, n) for(auto i = k; i < n; ++i)
  70. #define foo(i, a, b, k) for(auto i = a; i < b; i += k)
  71. #define rf0(n, i) for(auto i = n-1; ~i; --i)
  72. #define rfo(n, k, i) for(auto i = n-1; i >= k; --i)
  73. #define rfoo(b, a, k, i) for(auto i = b; i > a; i -= k)
  74. #define Im_speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
  75.  
  76. typedef long double ld;
  77. typedef uint32_t uint;
  78. typedef int64_t ll;
  79. typedef uint64_t ull;
  80.  
  81. //ifstream fin("date.in");
  82. //ofstream fout("date.out");
  83.  
  84. const int nax = 1e5 + 3;
  85. const int mod = 1e9 + 7;
  86. const int inf = 1e9 + 7;
  87. const ll infll = 1e18 + 7;
  88. const ld PI = 3.1415926535897932384626433832795;
  89.  
  90. int pow4(int x) {
  91. return x*x*x*x;
  92. }
  93.  
  94. void solve() {
  95. int n, m;
  96. cin >> n >> m;
  97. vector<vector<int>> a(n, vector<int>(m));
  98. f0(i, n) {
  99. f0(j, m) {
  100. cin >> a[i][j];
  101. int x = a[i][j];
  102. a[i][j] = 720720 - ((i+j)%2 ? pow4(a[i][j]) : 0);
  103. // assert(a[i][j]%x == 0);
  104. }
  105. }
  106.  
  107. f0(i, n) {
  108. f0(j, m) {
  109. cout << a[i][j] << " ";
  110. }
  111. cout << "\n";
  112. }
  113. }
  114.  
  115. int main() {
  116. // clock_t _clock = clock();
  117. Im_speed;
  118. cout << fixed << setprecision(12);
  119.  
  120. solve();
  121.  
  122. // cout << ((((double) clock()) - ((double)_clock)) / ((double) CLK_TCK));
  123. }
Advertisement
RAW Paste Data Copied
Advertisement