fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. unsigned test,size,count;
  7. for(cin>>test;test--;cout<<endl)
  8. {
  9. for(cin>>size;size;)
  10. {
  11. char ch;
  12. cin>>count>>ch;
  13. size-=count;
  14. while(count--) cout<<ch;
  15. }
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0s 3300KB
stdin
3
2
1 x 1 y
4
2 z 1 x 1 y
7
4 x 3 y
stdout
xy
zzxy
xxxxyyy