#include <bits/stdc++.h>
using namespace std;
string temps[1005];
int main(){
ios::sync_with_stdio(0);
int n,s,l;cin >> n >> s >> l;
for(int i = 0;i < l;i++){
int t;cin >> t;
cin >> temps[t];
}
int m;cin >> m;
int len = temps[0].size();
// int len = 120;
int p = len / 8;
while(m--){
int a;cin >> a;
if(a >= p*(n-1)) cout << "-" << endl;
else{
int temp = a % (n*s);
int col = temp / s;
int row1 = a / (s*(n-1));
int q = (a - col*s) / (n*s);
int row2 = row1*s + (a - q*n*s - col*s);
for(int i = row2*8;i < row2*8+8;i++){
cout << temps[col][i];
}
cout << endl;
//cout << row1 << " " << row2 << " " << col << endl;
}
}
}
CCFCSP201903-3 试题名称: 损坏的RAID5(不知道为啥就过了)
最新推荐文章于 2021-08-01 02:23:17 发布