Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define int long long
- using namespace std;
- signed main() {
- ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
- int t;
- cin >> t;
- while(t--){
- int n, m;
- cin >> n >> m;
- int idx = 0, k = 0, mx = 0;
- vector<string> v(n);
- for(int i = 0; i < n; ++i){
- cin >> v[i];
- for(int j = 0; j < m; ++j){
- if(v[i][j] == '#'){
- ++k;
- }
- }
- if(mx < k){
- mx = k;
- idx = i;
- }
- k = 0;
- }
- for(int i = 0; i < m; ++i){
- for(int j = 0; j < n; ++j){
- if(v[j][i] == '#'){
- k++;
- }
- }
- if(k == mx){
- cout << idx + 1 << ' ' << i + 1 << '\n';
- break;
- }
- k = 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement