Start: Jun, 27, 2019 08:30:00
2019年度暑期短学期第二天
End: Jun, 27, 2019 11:30:00
Time elapsed:
Time remaining:

Problem_ID: I
Result: Accepted
Time: 7ms
Memory: 1712kB
Author: 2017212212174
In contest: 1275

#include <bits/stdc++.h>

using namespace std;

int main() {
	unsigned long long int t, n, m, k;
	cin >> t;
	while (t--) {
		scanf("%x", &n);
		cin >> m >> k;
		k<<=(32-m);
		int date = n; date>>=(32-m);date<<=(32-m);
		n -= date;n+=k; 
		printf("%08x\n", n);
	}
	return 0;
}