Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define io ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
- #define PB push_back
- #define MP make_pair
- #define F first
- #define S second
- typedef long long LL;
- typedef vector<int> VI;
- typedef pair<int,int> PI;
- bool compare(const pair<int, int>&i, const pair<int, int>&j) {
- return i.first > j.first;
- }
- char a[101][101];
- int n,k,mc,ml,mx;
- int main() {
- io;
- cin >> n >> k;
- for(int i = 0 ; i < n ; i++)
- for(int j = 0 ; j < n ; j++)
- cin >> a[i][j];
- for(int i = 0 ; i < n ; i++) {
- int m = 0;
- for(int j = 0 ; j < n ; j++) {
- if(m >= k && m > mx) {
- ml = i+1;
- mx = m;
- }
- if(a[i][j] == '.')
- m++;
- else
- m = 0;
- }
- }
- mx = 0;
- for(int j = 0 ; j < n ; j++) {
- int m = 0;
- for(int i = 0 ; i < n ; i++) {
- if(m >= k && m > mx) {
- mc = j+1;
- mx = m;
- }
- if(a[i][j] == '.')
- m++;
- else
- m = 0;
- }
- }
- cout << ml << " " << mc;
- }
Add Comment
Please, Sign In to add comment