Advertisement
Junaid_Hossain

Gift Carpet

Aug 24th, 2023
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(){
  5. int t;
  6. cin >> t;
  7. char name[4]={'v', 'i' ,'k', 'a'};
  8.  
  9. while(t--){
  10. int a, b;
  11. cin >> a >> b;
  12. char arr[a][b];
  13. int check=0, count_=0;;
  14. for(int i=0; i<a; i++){
  15. if(arr[i][0]==name[check]){
  16. count_++;
  17. check++;
  18. for(int j=i+1; j<b; j++){
  19. if(arr[i][j]==name[check]){
  20. check++;
  21. count_++;
  22. }
  23. }
  24. }
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement