#ifdef NACHIA #define _GLIBCXX_DEBUG #else #define NDEBUG #endif #include #include #include #include using i64 = long long; using u64 = unsigned long long; #define rep(i,n) for(int i=0; i void chmin(A& l, const A& r){ if(r < l) l = r; } template void chmax(A& l, const A& r){ if(l < r) l = r; } using namespace std; #include using Modint = atcoder::static_modint<998244353>; #include #include namespace nachia{ template struct MatrixOnRing{ private: int h; int w; std::vector elems; public: MatrixOnRing(int new_h=0, int new_w=0){ h = new_h; w = new_w; elems.resize(h * w); } MatrixOnRing(MatrixOnRing const&) = default; int numRow() const { return h; } int numColumn() const { return w; } int height() const { return numRow(); } int width() const { return numColumn(); } typename std::vector::iterator operator[](int y){ return elems.begin() + (y*w); } typename std::vector::const_iterator operator[](int y) const { return elems.begin() + (y*w); } static MatrixOnRing Identity(int idx, Elem One){ auto res = MatrixOnRing(idx, idx); for(int i=0; i> a >> b; x = a; y = b; } i64 N; cin >> N; nachia::MatrixOnRing A(4,4); A[0][2] = 1; A[1][3] = 1; A[2][2] = 1; A[3][3] = 1; A[0][0] = x * 1; A[1][0] = y * -5; A[0][1] = y * 1; A[1][1] = x * 1; A = A.pow(N); Modint rx = x * A[0][2] + y * A[1][2]; Modint ry = x * A[0][3] + y * A[1][3]; cout<< rx.val() << " " << ry.val() << "\n"; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); testcase(); return 0; }