#include<iostream>#include<algorithm>usingnamespace std;constint mod =998244353;typedeflonglong LL;LL qmi(int a,int b,int p){LL res =1% p;while(b){if(b &1) res = res * a % p;a = a *(LL)a % p;b >>=1;}return res;}intmain(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);int T;cin >> T;while(T --){int a, b, k;cin >> a >> b >> k;if(!(k %2)){LL kk =qmi(2, k /2, mod);cout <<((kk * a)% mod + mod)% mod <<" "<<((kk * b)% mod + mod)% mod << endl;}else{LL kk =qmi(2,(k -1)/2, mod);cout <<((kk *(a + b))% mod + mod)% mod <<" "<<((kk *(a - b))% mod + mod)% mod << endl;}}return0;}#include<iostream>#include<algorithm>usingnamespace std;constint mod =998244353;typedeflonglong LL;LL qmi(int a,int b,int p){LL res =1% p;while(b){if(b &1) res = res * a % p;a = a *(LL)a % p;b >>=1;}return res;}intmain(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);int T;cin >> T;while(T --){int a, b, k;cin >> a >> b >> k;LL kk =qmi(2, k /2, mod);// k偶為k / 2,k奇為(k - 1) / 2,則統一為k / 2 向下取整if(!(k %2))cout <<((kk * a)% mod + mod)% mod <<" "<<((kk * b)% mod + mod)% mod << endl;elsecout <<((kk *(a + b))% mod + mod)% mod <<" "<<((kk *(a - b))% mod + mod)% mod << endl;}return0;}