#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR_EACH_C (p,c) for(p=(c).begin(); p!=(c).end();p++) #define FOR_EACH(p,q,r) for(p=q;p!=r;p++) typedef vector ivec_t; typedef vector imat_t; #ifndef DEBUG #define cin fin ifstream fin("C.txt"); #endif #define debug cout const long long MASK=0xfffffffffLL; vector g_data; // string Convertto2Base(string str) // { // long long hex; // string ans(""); // sscanf(str.c_str(),"%llnx",&hex); // while(hex) // { // if(hex&1) // { // ans = "1" + ans; // } // else ans = "0" + ans; // hex /= 2; // } // if((int)ans.size() < 32)ans = "0" + ans; // return ans; // } long long CalcSum(long long n) { long long i; long long sum=0; FOR_EACH(i,0,8){ sum += (g_data[i] % (1LL<<(n+1))); } return sum; } long long GetBit(long long n,long long a) { return (a>>n)&1; } void AddBit(long long n,long long& a) { a |= (1LL<> s; while(s--) { string str; int i; long long num; g_data.clear(); FOR_EACH(i,0,8){ cin >> str; sscanf(str.c_str(),"%llx",&num); g_data.push_back(num); } cin >> str; sscanf(str.c_str(),"%llx",&num); Solve(num); } return 0; }