Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- #include <array>
- #include <bitset>
- #include <cassert>
- #include <climits>
- #include <cmath>
- #include <complex>
- #include <cstdio>
- #include <cstdlib>
- #include <cstring>
- #include <fstream>
- #include <functional>
- #include <iomanip>
- #include <iostream>
- #include <map>
- #include <memory>
- #include <numeric>
- #include <queue>
- #include <random>
- #include <set>
- #include <stack>
- #include <string>
- #include <unordered_set>
- #include <unordered_map>
- #include <vector>
- using namespace std;
- /// START Errichto's debug
- #define sim template < class c
- #define ris return * this
- #define dor > debug & operator <<
- #define eni(x) sim > typename \
- enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
- sim > struct rge { c b, e; };
- sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
- sim > auto dud(c* x) -> decltype(cerr << *x, 0);
- sim > char dud(...);
- struct debug {
- #ifdef LOCAL
- ~debug() { cerr << endl; }
- eni(!=) cerr << boolalpha << i; ris; }
- eni(==) ris << range(begin(i), end(i)); }
- sim, class b dor(pair < b, c > d) {
- ris << "(" << d.first << ", " << d.second << ")";
- }
- sim dor(rge<c> d) {
- *this << "[";
- for (auto it = d.b; it != d.e; ++it)
- *this << ", " + 2 * (it == d.b) << *it;
- ris << "]";
- }
- #else
- sim dor(const c&) { ris; }
- #endif
- };
- #define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
- // debug & operator << (debug & dd, P p) { dd << "(" << p.x << ", " << p.y << ")"; return dd; }
- /// END Errichto's debug
- #define ff first
- #define ss second
- #define eb emplace_back
- #define mp make_pair
- #define pb push_back
- #define ppb pop_back
- #define all(a) a.begin(), a.end()
- #define rall(a) a.rbegin(), a.rend()
- #define f0(i, n) for(auto i = 0; i < n; ++i)
- #define fo(i, k, n) for(auto i = k; i < n; ++i)
- #define foo(i, a, b, k) for(auto i = a; i < b; i += k)
- #define rf0(n, i) for(auto i = n-1; ~i; --i)
- #define rfo(n, k, i) for(auto i = n-1; i >= k; --i)
- #define rfoo(b, a, k, i) for(auto i = b; i > a; i -= k)
- #define Im_speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
- typedef long double ld;
- typedef uint32_t uint;
- typedef int64_t ll;
- typedef uint64_t ull;
- //ifstream fin("date.in");
- //ofstream fout("date.out");
- const int nax = 1e5 + 3;
- const int mod = 1e9 + 7;
- const int inf = 1e9 + 7;
- const ll infll = 1e18 + 7;
- const ld PI = 3.1415926535897932384626433832795;
- int pow4(int x) {
- return x*x*x*x;
- }
- void solve() {
- int n, m;
- cin >> n >> m;
- vector<vector<int>> a(n, vector<int>(m));
- f0(i, n) {
- f0(j, m) {
- cin >> a[i][j];
- int x = a[i][j];
- a[i][j] = 720720 - ((i+j)%2 ? pow4(a[i][j]) : 0);
- // assert(a[i][j]%x == 0);
- }
- }
- f0(i, n) {
- f0(j, m) {
- cout << a[i][j] << " ";
- }
- cout << "\n";
- }
- }
- int main() {
- // clock_t _clock = clock();
- Im_speed;
- cout << fixed << setprecision(12);
- solve();
- // cout << ((((double) clock()) - ((double)_clock)) / ((double) CLK_TCK));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement