fork(1) download
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6. int t,i,j;
  7. cin>>t;
  8. while(t--){
  9. int l,c;
  10. cin>>l;
  11. cin>>c;
  12. for(i=0;i<l;i++){
  13. for(j=0;j<c;j++){
  14. if((l==4)&&(c==4)){
  15. if(((i==1)&&(j==1))|| (i==1)&&(j==2) || (i==2)&&(j==1) || (i==2)&&(j==2)){
  16. cout<<".";
  17. }
  18. else cout<<"*";
  19.  
  20. }
  21. else cout<<"*";
  22. }
  23. cout<<endl;
  24. }
  25. cout<<endl;
  26. }
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0s 15232KB
stdin
3
3 1
4 4
2 5
stdout
*
*
*

****
*..*
*..*
****

*****
*****