#include #include #include #include #include #include using namespace std; char tx[1006][1006]; char pt[106][106]; char qt[106][106]; int decode(char c){ if(isupper(c)) return c-'A'; if(islower(c)) return c-'a'+26; if(isdigit(c)) return c-'0'+52; return c=='+' ? 62 : 63; } void rotate(int p){ memcpy(qt, pt, sizeof(pt)); for(int i=0;i> w >> h >> p, w){ for(int i=0;i> str; for(int j=0;j<(w+5)/6;j++){ int tmp = decode(str[j]); for(int k=0;k<6;k++) tx[i][6*j+k] = ((tmp>>(5-k))&1)+'0'; } } for(int i=0;i> str; for(int j=0;j<(p+5)/6;j++){ int tmp = decode(str[j]); for(int k=0;k<6;k++) pt[i][6*j+k] = ((tmp>>(5-k))&1)+'0'; } } if(p > w || p > h){ cout << 0 << endl; continue; } vector< vector > pat(8, vector(p, 0)); for(int i=0;i<4;i++){ for(int j=0;j<2;j++){ for(int k=0;k hash(h, 0); for(int i=0;i