QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#342554#4084. 카드 뒤집기 게임duongnc000100 ✓426ms264188kbC++205.5kb2024-03-01 12:39:032024-03-01 12:39:04

Judging History

你现在查看的是最新测评结果

  • [2024-03-01 12:39:04]
  • 评测
  • 测评结果:100
  • 用时:426ms
  • 内存:264188kb
  • [2024-03-01 12:39:03]
  • 提交

answer

/*
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,fma,bmi,bmi2,sse4.2,popcnt,lzcnt")
*/

#include <bits/stdc++.h>
#define taskname ""
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define i64 long long
#define pb push_back
#define ff first
#define ss second
#define isz(x) (int)x.size()
using namespace std;

const int mxN = 2e5 + 5;
const int mod = 1e9 + 7;
const i64 oo = 1e18;

struct two_sat_solver{
private:
    int n;
    vector<vector<int>> adj;
    vector<int> val, comp, z;
public:
    vector<int> value;
    two_sat_solver(int n = 0): n(n), adj(n << 1){ }
    int add_variable(){
        adj.emplace_back();
        adj.emplace_back();
        return n ++;
    }
    void either(int u, int v){
        u = max(2 * u, -1 - 2 * u);
        v = max(2 * v, -1 - 2 * v);
        adj[u].push_back(v ^ 1);
        adj[v].push_back(u ^ 1);
    }
    void implies(int u, int v){
        either(~u, v);
    }
    void equals(int u, int v){
        // cout << u << " == " << v << endl;
        either(~u, v), either(u, ~v);
    }
    void differs(int u, int v){
        // cout << u << " != " << v - 10 << endl;
        either(u, v), either(~u, ~v);
    }
    void set_value(int u, bool x = true){
        x ? either(u, u) : either(~u, ~u);
    }
    void at_most_one(const vector<int> &arr){
        if((int)arr.size() <= 1) return;
        int cur = ~arr[0];
        for(auto u = 2; u < (int)arr.size(); ++ u){
            int next = add_variable();
            either(cur, ~arr[u]), either(cur, next), either(~arr[u], next);
            cur = ~next;
        }
        either(cur, ~arr[1]);
    }
    int time, comp_cnt;
    int dfs(int u){
        int low = val[u] = ++ time, v;
        z.push_back(u);
        for(auto v: adj[u]) if(!~comp[v]) low = min(low, val[v] ?: dfs(v));
        ++ time;
        if(low == val[u]){
            do{
                v = z.back();
                z.pop_back();
                comp[v] = comp_cnt;
                if(value[v >> 1] == -1) value[v >> 1] = v & 1;
            }while(v != u);
            comp_cnt ++;
        }
        return val[u] = low;
    }
    // O(n)
    bool solve(){
        value.assign(n, -1);
        val.assign(2 * n, 0);
        comp.assign(2 * n, -1);
        time = comp_cnt = 0;
        for(auto u = 0; u < n << 1; ++ u) if(!~comp[u]) dfs(u);
        for(auto u = 0; u < n; ++ u) if(comp[u << 1] == comp[u << 1 ^ 1]) return false;
        return true;
    }
    // Enumerate solutions while act_while() returns true.
    // O(n^2 + (m + n * (# of solutions found))*S/w)
    template<size_t S>
    bool enumerate_solutions(auto act_while){
        assert(2 * n <= S);
        if(!solve()) return false;
        fill(value.begin(), value.end(), -1);
        bitset<S> has_value;
        vector<vector<int>> has(comp_cnt);
        vector<bitset<S>> reachable(n << 1);
        for(auto u = 0; u < n << 1; ++ u) has[comp[u]].push_back(u);
        vector<int> vis(comp_cnt, -1);
        for(auto t = 0; t < comp_cnt; ++ t){
            int u = has[t][0];
            vis[t] = t;
            for(auto v: has[t]){
                reachable[u].set(v);
                for(auto w: adj[v]) if(vis[comp[w]] != t){
                    vis[comp[w]] = t;
                    reachable[u] |= reachable[w];
                }
            }
            for(auto v: has[t]) reachable[v] = reachable[u];
        }
        for(auto u = 0; u < n << 1; ++ u){
            if(!reachable[u][u ^ 1]) continue;
            has_value[u] = has_value[u ^ 1] = true;
            value[u >> 1] = ~u & 1;
            for(auto v = 0; v < n << 1; ++ v) if(reachable[u ^ 1][v]){
                has_value[v] = has_value[v ^ 1] = true;
                value[v >> 1] = v & 1;
            }
        }
        vector<bitset<S>> delta(comp_cnt);
        auto dfs = [&](auto self, int t)->bool{
            if(!~t) return act_while(value);
            int u = has[t][0];
            if(~value[u >> 1]) return self(self, t - 1);
            for(auto v: has[t]){
                has_value[v] = has_value[v ^ 1] = true;
                value[v >> 1] = ~v & 1;
            }
            if(!self(self, t - 1)) return false;
            for(auto v: has[t]) value[v >> 1] = v & 1;
            delta[t] = reachable[u] & ~has_value;
            for(auto v = delta[t]._Find_first(); v != S; v = delta[t]._Find_next(v)){
                has_value[v] = has_value[v ^ 1] = true;
                value[v >> 1] = v & 1;
            }
            if(!self(self, t - 1)) return false;
            for(auto v: has[t]){
                has_value[v] = has_value[v ^ 1] = false;
                value[v >> 1] = -1;
            }
            for(auto v = delta[t]._Find_first(); v != S; v = delta[t]._Find_next(v)){
                has_value[v] = has_value[v ^ 1] = false;
                value[v >> 1] = -1;
            }
            return true;
        };
        dfs(dfs, comp_cnt - 1);
        return true;
    }
};

bool reversal(int n, int m, vector<string> a) {
    two_sat_solver tss(2 * m * n);
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            if (a[i][j] == 'X') tss.differs(j * m + i % m, i * m + j % m + m * n);
            else tss.equals(j * m + i % m, i * m + j % m + m * n);
        }
    }
    return tss.solve();
}

// int main() {
//     cout << reversal(5, 2, {"XOOOX", "XOXOO", "OXXOO", "OXOOO", "OOOXO"}) << endl;
// }

详细

Subtask #1:

score: 11
Accepted

Test #1:

score: 11
Accepted
time: 0ms
memory: 3636kb

input:

10 1
OOOOOOOOOX
XOXXOOOOOO
XOOXOOOXOO
OOOOOOOOOO
OOOXOOOOOO
OOXOOXXOOO
OOOOXOOOOO
XOOOOOOOXO
OOOXXOOOXO
OOOOOOOOOO

output:

0

result:

ok single line: '0'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

10 1
OOOOOOOOXX
OOOOOOOOXX
XXXXXXXXOO
XXXXXXXXOO
OOOOOOOOXX
OOOOOOOOXX
OOOOOOOOXX
OOOOOOOOXX
OOOOOOOOXX
OOOOOOOOXX

output:

1

result:

ok single line: '1'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

10 1
OOOOOOOOXX
OOOOOOOOXX
XXXXXXXOOO
XXXXXXXXOO
OOOOOOOOXX
OOOOOOOOXX
OOOOOOOOXX
OOOOOOOOXX
OOOOOOOOXX
OOOOOOOOXX

output:

0

result:

ok single line: '0'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

10 1
OOXOXOOOOX
XOOOOOXOOO
OOXOOXXOOO
OOOOOOOOXO
XOOOOOXOOX
OOOOXOXOXX
OXOOXOOXOX
OXXOOXOOOO
OOOXOXOOXO
OOOOOXOOOO

output:

0

result:

ok single line: '0'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

10 1
OXOXOOOOXX
OXOXOOOOXX
OXOXOOOOXX
OXOXOOOOXX
OXOXOOOOXX
OXOXOOOOXX
XOXOXXXXOO
OXOXOOOOXX
OXOXOOOOXX
OXOXOOOOXX

output:

1

result:

ok single line: '1'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

10 1
OXOXOOOOXX
OXOXOOOOXX
OXOXOOOOXX
OXOXOOOOXX
OXOXOOOOXX
OXOXOOOOXX
XOXOXXXXOO
OXOXOOOOXX
OXXXOOOOXX
OXOXOOOOXX

output:

0

result:

ok single line: '0'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3804kb

input:

10 1
XXXXXOOOXX
OOOOOXXOXO
XOOOOXXXXO
OOXOXOOOXO
XOOOOOOOXX
XXOXXOOXOO
XOXXOXXXOX
OOOXXXOXXX
XOXXXOXOXX
OXXXXXOXOO

output:

0

result:

ok single line: '0'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

10 1
OOOOXXXOOX
XXXXOOOXXO
XXXXOOOXXO
XXXXOOOXXO
XXXXOOOXXO
OOOOXXXOOX
OOOOXXXOOX
XXXXOOOXXO
OOOOXXXOOX
XXXXOOOXXO

output:

1

result:

ok single line: '1'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3636kb

input:

10 1
OOOOXXXOOX
XXXXOOOXXO
XXXXOOOXXO
XXXXOOOXXO
XXXXOOOXXO
OOOOXXXOOX
OOOOXXXOOX
XXXXOOOXXO
OOOOXXXOOX
XXXOOOOXXO

output:

0

result:

ok single line: '0'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3636kb

input:

10 1
XXOXXXXXXX
XXXOXXXOXX
XXXXOOXOXX
XXOOXXOOOX
XXXOXXOOXX
OOXXOXOXXX
XOXOXOXXXO
XXXOOXXXOX
OXOOXXXXOO
XXOXOOOXXO

output:

0

result:

ok single line: '0'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

10 1
OXOOOOOOOO
OXOOOOOOOO
OXOOOOOOOO
XOXXXXXXXX
OXOOOOOOOO
OXOOOOOOOO
OXOOOOOOOO
XOXXXXXXXX
OXOOOOOOOO
OXOOOOOOOO

output:

1

result:

ok single line: '1'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

10 1
OXOOOOOOOO
OXOOOOOOOO
OXOOOOOOOO
XOXXXXXXXX
OXOOOOOOOX
OXOOOOOOOO
OXOOOOOOOO
XOXXXXXXXX
OXOOOOOOOO
OXOOOOOOOO

output:

0

result:

ok single line: '0'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3672kb

input:

10 1
XOXXXXOXXX
XXXXOOXXXX
OOXXOXXXXX
XXXOOXXOOX
OXXXXXXXXX
XXXXXXXXOX
XXXXXXXOXO
OXXXXXXXXX
XXXOOXXXOX
XXXXXXXXXX

output:

0

result:

ok single line: '0'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

10 1
XOOOOXOOOO
XOOOOXOOOO
XOOOOXOOOO
XOOOOXOOOO
OXXXXOXXXX
OXXXXOXXXX
XOOOOXOOOO
XOOOOXOOOO
XOOOOXOOOO
XOOOOXOOOO

output:

1

result:

ok single line: '1'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3872kb

input:

10 1
XOOOOXOOOO
XOOOOXOOOO
XOOOOXOOOO
XOOOOXOOOO
OXXXXOXXXX
OXXXXOXXXX
XOOOOXOOOO
XOOOOXOOOX
XOOOOXOOOO
XOOOOXOOOO

output:

0

result:

ok single line: '0'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

5 2
XOOOX
XOXOO
OXXOO
OXOOO
OOOXO

output:

0

result:

ok single line: '0'

Test #17:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

5 2
XOOXX
XOOXX
OOXXO
XOOXX
OOXXO

output:

1

result:

ok single line: '1'

Test #18:

score: 0
Accepted
time: 0ms
memory: 3828kb

input:

5 2
XOOXX
XOOXX
OOXXO
XOOOX
OOXXO

output:

0

result:

ok single line: '0'

Test #19:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

5 2
XOXOO
OOXOO
OOOXO
OOXOX
XOXXO

output:

0

result:

ok single line: '0'

Test #20:

score: 0
Accepted
time: 0ms
memory: 3864kb

input:

5 2
XXXXX
XOXOO
OOOOO
OXOXX
OXOXO

output:

1

result:

ok single line: '1'

Test #21:

score: 0
Accepted
time: 1ms
memory: 3632kb

input:

5 2
XXXXX
XOXOO
OOOOO
OOOXX
OXOXO

output:

0

result:

ok single line: '0'

Test #22:

score: 0
Accepted
time: 1ms
memory: 3628kb

input:

5 2
XXOXO
XXXXO
XXOXO
XXOOX
OOOOO

output:

0

result:

ok single line: '0'

Test #23:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

5 2
OXXXO
OXOOO
XOOOX
OXOOO
XOOOX

output:

1

result:

ok single line: '1'

Test #24:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

5 2
OXXXO
OXOOO
XOOOX
OXOOO
XXOOX

output:

0

result:

ok single line: '0'

Test #25:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

5 2
XXOOX
OXXXX
OXXXX
XXOOX
XXXXX

output:

0

result:

ok single line: '0'

Test #26:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

5 2
OOOOO
OXOOO
OXOXO
OOOXO
XXXXX

output:

1

result:

ok single line: '1'

Test #27:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

5 2
OOOOO
OXOOX
OXOXO
OOOXO
XXXXX

output:

0

result:

ok single line: '0'

Test #28:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

5 2
XOXOO
XXXXX
XXXXX
XOXXX
XXOXX

output:

0

result:

ok single line: '0'

Test #29:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

5 2
XXXOO
OOOOO
XXXOO
XOXOX
XXXOO

output:

1

result:

ok single line: '1'

Test #30:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

5 2
XXXOO
OOOOO
XXOOO
XOXOX
XXXOO

output:

0

result:

ok single line: '0'

Test #31:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

3 3
OOO
XXO
OOX

output:

1

result:

ok single line: '1'

Test #32:

score: 0
Accepted
time: 0ms
memory: 3804kb

input:

3 3
OXX
OXO
OXO

output:

1

result:

ok single line: '1'

Test #33:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

3 3
OXX
OXO
OXX

output:

1

result:

ok single line: '1'

Test #34:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

3 3
OOO
OOO
OOX

output:

1

result:

ok single line: '1'

Test #35:

score: 0
Accepted
time: 0ms
memory: 3868kb

input:

3 3
OOO
OXO
XOO

output:

1

result:

ok single line: '1'

Test #36:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

3 3
OOO
OXO
XXO

output:

1

result:

ok single line: '1'

Test #37:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

3 3
OXX
OOX
OOO

output:

1

result:

ok single line: '1'

Test #38:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

3 3
XXX
OOX
XXO

output:

1

result:

ok single line: '1'

Test #39:

score: 0
Accepted
time: 0ms
memory: 3516kb

input:

3 3
XXX
OOX
XXX

output:

1

result:

ok single line: '1'

Test #40:

score: 0
Accepted
time: 0ms
memory: 3828kb

input:

3 3
OOX
XXO
XXO

output:

1

result:

ok single line: '1'

Test #41:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

3 3
OOX
OXO
OOX

output:

1

result:

ok single line: '1'

Test #42:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

3 3
OOX
OXO
OOO

output:

1

result:

ok single line: '1'

Test #43:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

3 3
XXX
XOX
OXX

output:

1

result:

ok single line: '1'

Test #44:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

3 3
OOX
XOX
XOO

output:

1

result:

ok single line: '1'

Test #45:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

3 3
OOX
XOO
XOO

output:

1

result:

ok single line: '1'

Subtask #2:

score: 50
Accepted

Test #46:

score: 50
Accepted
time: 30ms
memory: 22952kb

input:

1000 1
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOXOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOXOOOOOOXOOOOOOOOOOOOOOOOXOOOOOOXOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOXOOOOO...

output:

0

result:

ok single line: '0'

Test #47:

score: 0
Accepted
time: 30ms
memory: 22656kb

input:

1000 1
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOXOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOXOOOOOOXOOOOOOOOOOOOOOOOXOOOOOOXOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOXOOOOOO...

output:

1

result:

ok single line: '1'

Test #48:

score: 0
Accepted
time: 21ms
memory: 22804kb

input:

1000 1
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOXOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOXOOOOOOXOOOOOOOOOOOOOOOOXOOOOOOXOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOXOOOOOO...

output:

0

result:

ok single line: '0'

Test #49:

score: 0
Accepted
time: 30ms
memory: 22868kb

input:

1000 1
XOOOOOOOOOOOXOOOOXXOOOOOOOOOOOOOXOXOOXXOOOXOXXOOOXOXOXOOOOOOOOOOOOOOOOXOOOOXOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOXOXOXOXOOOOOOOOOOOOOOOOOOOOOXOOOOOOOXOOOOOOOOOOXOOOOOOOOOOOOOOOOOOXOOOOOXOOOOOOOOOOOOOOOOOOOOXOOOOOOXOOOOOXOXOXOOOOOOOOXOOOOOOOOOOXOOXXOOOOOOXOOOXOOOOOOOOOXOXOOOOOXOOOOOOOOOOOOOOOOO...

output:

0

result:

ok single line: '0'

Test #50:

score: 0
Accepted
time: 34ms
memory: 22648kb

input:

1000 1
XXXXXXXXXXXOXXXXOOXXXXXXXXXXXXXOXOXXOOXXXOXOOXXXOXOXOXXXXXXXXXXXXXXXXOXXXXOXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXOXOXOXOXXXXXXXXXXXXXXXXXXXXXOXXXXXXXOXXXXXXXXXXOXXXXXXXXXXXXXXXXXXOXXXXXOXXXXXXXXXXXXXXXXXXXXOXXXXXXOXXXXXOXOXOXXXXXXXXOXXXXXXXXXXOXXOOXXXXXXOXXXOXXXXXXXXXOXOXXXXXOXXXXXXXXXXXXXXXXXX...

output:

1

result:

ok single line: '1'

Test #51:

score: 0
Accepted
time: 30ms
memory: 23012kb

input:

1000 1
XXXXXXXXXXXOXXXXOOXXXXXXXXXXXXXOXOXXOOXXXOXOOXXXOXOXOXXXXXXXXXXXXXXXXOXXXXOXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXOXOXOXOXXXXXXXXXXXXXXXXXXXXXOXXXXXXXOXXXXXXXXXXOXXXXXXXXXXXXXXXXXXOXXXXXOXXXXXXXXXXXXXXXXXXXXOXXXXXXOXXXXXOXOXOXXXXXXXXOXXXXXXXXXXOXXOOXXXXXXOXXXOXXXXXXXXXOXOXXXXXOXXXXXXXXXXXXXXXXXX...

output:

0

result:

ok single line: '0'

Test #52:

score: 0
Accepted
time: 34ms
memory: 22712kb

input:

1000 1
OOXXOOOXOOOOOOOOOOOOXXOOXOXXXXOOOOOXXOOXXOOXXOXOXOOOOOXOOOOOOXOOOOOOOOXOOOOOXXOOOOOXOOOOXXXXOXOOOOXXOOOXXXOXOOXOOXOOXOXOOOXOXOXOXOOOOOOOOOXOOOOXOOOXOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOXOXOOXOXOXOXOXOOXOOOOOOXOOOOOOOOOOOOXXOOXOOOOXOOOXOOOOOOXOXOXOOOOXOOOOOOOOOOOOXOOOOOOOOXOXOOXOOOOOOXOOOOOO...

output:

0

result:

ok single line: '0'

Test #53:

score: 0
Accepted
time: 23ms
memory: 22820kb

input:

1000 1
OXXOOOXOOOOOOOOOOOOXXOOXOXXXXOOOOOXXOOXXOOXXOXOXOOOOOXOOOOOOXOOOOOOOOXOOOOOXXOOOOOXOOOOXXXXOXOOOOXXOOOXXXOXOOXOOXOOXOXOOOXOXOXOXOOOOOOOOOXOOOOXOOOXOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOXOXOOXOXOXOXOXOOXOOOOOOXOOOOOOOOOOOOXXOOXOOOOXOOOXOOOOOOXOXOXOOOOXOOOOOOOOOOOOXOOOOOOOOXOXOOXOOOOOOXOOOOOOO...

output:

1

result:

ok single line: '1'

Test #54:

score: 0
Accepted
time: 37ms
memory: 22868kb

input:

1000 1
OXXOOOXOOOOOOOOOOOOXXOOXOXXXXOOOOOXXOOXXOOXXOXOXOOOOOXOOOOOOXOOOOOOOOXOOOOOXXOOOOOXOOOOXXXXOXOOOOXXOOOXXXOXOOXOOXOOXOXOOOXOXOXOXOOOOOOOOOXOOOOXOOOXOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOXOXOOXOXOXOXOXOOXOOOOOOXOOOOOOOOOOOOXXOOXOOOOXOOOXOOOOOOXOXOXOOOOXOOOOOOOOOOOOXOOOOOOOOXOXOOXOOOOOOXOOOOOOO...

output:

0

result:

ok single line: '0'

Test #55:

score: 0
Accepted
time: 37ms
memory: 22928kb

input:

1000 1
OOOOOOXOOXXXOOOOOXOOOOOOOOOOOXOOOOOOOXOOOOOXXOOXXOXXOXOXXOOOOOOXXOXOOOXXXOOXOOOOOOOXOOOOXOOXXOOOOOOXOOOXOOOOOOOXOXOOXOXXXOXOOOOXOOOOOXOXOXXOOOXOOOOOOXXOOXOOOXOOXXOOXOXOOOOOOOOOOXOXOOXOXOXOXOOOOOOOXXOOOXOXOOOOXXXOOOOOXXOXOOXOOXOXOXOXOXOXOOOXOXOXXXOXOXOOOOXOOOXXOOXXXOOOOXOXOXXOOOXXOXXOOOOOXOOOO...

output:

0

result:

ok single line: '0'

Test #56:

score: 0
Accepted
time: 29ms
memory: 22708kb

input:

1000 1
OOOOOXOOXXXOOOOOXOOOOOOOOOOOXOOOOOOOXOOOOOXXOOXXOXXOXOXXOOOOOOXXOXOOOXXXOOXOOOOOOOXOOOOXOOXXOOOOOOXOOOXOOOOOOOXOXOOXOXXXOXOOOOXOOOOOXOXOXXOOOXOOOOOOXXOOXOOOXOOXXOOXOXOOOOOOOOOOXOXOOXOXOXOXOOOOOOOXXOOOXOXOOOOXXXOOOOOXXOXOOXOOXOXOXOXOXOXOOOXOXOXXXOXOXOOOOXOOOXXOOXXXOOOOXOXOXXOOOXXOXXOOOOOXOOOOX...

output:

1

result:

ok single line: '1'

Test #57:

score: 0
Accepted
time: 29ms
memory: 22980kb

input:

1000 1
OOOOOXOOXXXOOOOOXOOOOOOOOOOOXOOOOOOOXOOOOOXXOOXXOXXOXOXXOOOOOOXXOXOOOXXXOOXOOOOOOOXOOOOXOOXXOOOOOOXOOOXOOOOOOOXOXOOXOXXXOXOOOOXOOOOOXOXOXXOOOXOOOOOOXXOOXOOOXOOXXOOXOXOOOOOOOOOOXOXOOXOXOXOXOOOOOOOXXOOOXOXOOOOXXXOOOOOXXOXOOXOOXOXOXOXOXOXOOOXOXOXXXOXOXOOOOXOOOXXOOXXXOOOOXOXOXXOOOXXOXXOOOOOXOOOOX...

output:

0

result:

ok single line: '0'

Test #58:

score: 0
Accepted
time: 29ms
memory: 22736kb

input:

1000 1
XOOXOXOOXOOXXOXOOOXOOOOXOOXOXOXXXXXXXOXXOOXXXOOOXXOOOOOOOOXOOOXOXOOXOOXOOOXOXXOOOOXOOOOOXOOOXOOXOOOOOXOOOXXOOXOOOOXXXXOXXOOXXOXXXOXOOOOXXXXXXOOXXXOOXXOXOOXXXXXOXOXXXOOOXOOOXXOXXXXXOXOXOOOOOOOXXXOOXOOXXXXXXOXXOOOOXOOXOOXOXXOOXOOOXOXOXXXXOOOXOOOXXXOXXOOOOOXXOXOOOXXXXXOOOOXXOXXOOOXXXOOOOXXOXXOOX...

output:

0

result:

ok single line: '0'

Test #59:

score: 0
Accepted
time: 27ms
memory: 22732kb

input:

1000 1
XXOXOXXOXXOOXOXXXOXXXXOXXOXOXOOOOOOOXOOXXOOOXXXOOXXXXXXXXOXXXOXOXXOXXOXXXOXOOXXXXOXXXXXOXXXOXXOXXXXXOXXXOOXXOXXXXOOOOXOOXXOOXOOOXOXXXXOOOOOOXXOOOXXOOXOXXOOOOOXOXOOOXXXOXXXOOXOOOOOXOXOXXXXXXXOOOXXOXXOOOOOOXOOXXXXOXXOXXOXOOXXOXXXOXOXOOOOXXXOXXXOOOXOOXXXXXOOXOXXXOOOOOXXXXOOXOOXXXOOOXXXXOOXOOXXOX...

output:

1

result:

ok single line: '1'

Test #60:

score: 0
Accepted
time: 24ms
memory: 22712kb

input:

1000 1
XXOXOXXOXXOOXOXXXOXXXXOXXOXOXOOOOOOOXOOXXOOOXXXOOXXXXXXXXOXXXOXOXXOXXOXXXOXOOXXXXOXXXXXOXXXOXXOXXXXXOXXXOOXXOXXXXOOOOXOOXXOOXOOOXOXXXXOOOOOOXXOOOXXOOXOXXOOOOOXOXOOOXXXOXXXOOXOOOOOXOXOXXXXXXXOOOXXOXXOOOOOOXOOXXXXOXXOXXOXOOXXOXXXOXOXOOOOXXXOXXXOOOXOOXXXXXOOXOXXXOOOOOXXXXOOXOOXXXOOOXXXXOOXOOXXOX...

output:

0

result:

ok single line: '0'

Test #61:

score: 0
Accepted
time: 36ms
memory: 23056kb

input:

1000 1
XOXXOXXXXXXOXXOOXXOXOOXOXOXXOOXOOXXOOXXOXOOXXXXXXOXXXXXXXOXOOXXXXXOOOXXXOOXXXOOOOXXOOXXOXXXOXXOOXXOOXXOOXOOXOOXOXOXXXXOXOXOOOXOOOOXOXXXOXOXOXXXOXXOXOXXXXOXOXOOXXOOOXOOOXOXOXOXXOXOXXOOXXXXXOOOXOXXOXOXOXXXOOOXXOOOOXOXXOXOOOOXXOXXOOXXOOOXXXOOXOOOXOXOXOOXXXXXOOXXOOOOOOXXXXOXOOXXOXXOXXXOOOXXXXXOOO...

output:

0

result:

ok single line: '0'

Test #62:

score: 0
Accepted
time: 29ms
memory: 22660kb

input:

1000 1
XOOXOOOOOOXOOXXOOXOXXOXOXOOXXOXXOOXXOOXOXXOOOOOOXOOOOOOOXOXXOOOOOXXXOOOXXOOOXXXXOOXXOOXOOOXOOXXOOXXOOXXOXXOXXOXOXOOOOXOXOXXXOXXXXOXOOOXOXOXOOOXOOXOXOOOOXOXOXXOOXXXOXXXOXOXOXOOXOXOOXXOOOOOXXXOXOOXOXOXOOOXXXOOXXXXOXOOXOXXXXOOXOOXXOOXXXOOOXXOXXXOXOXOXXOOOOOXXOOXXXXXXOOOOXOXXOOXOOXOOOXXXOOOOOXXXO...

output:

1

result:

ok single line: '1'

Test #63:

score: 0
Accepted
time: 33ms
memory: 23048kb

input:

1000 1
XOOXOOOOOOXOOXXOOXOXXOXOXOOXXOXXOOXXOOXOXXOOOOOOXOOOOOOOXOXXOOOOOXXXOOOXXOOOXXXXOOXXOOXOOOXOOXXOOXXOOXXOXXOXXOXOXOOOOXOXOXXXOXXXXOXOOOXOXOXOOOXOOXOXOOOOXOXOXXOOXXXOXXXOXOXOXOOXOXOOXXOOOOOXXXOXOOXOXOXOOOXXXOOXXXXOXOOXOXXXXOOXOOXXOOXXXOOOXXOXXXOXOXOXXOOOOOXXOOXXXXXXOOOOXOXXOOXOOXOOOXXXOOOOOXXXO...

output:

0

result:

ok single line: '0'

Test #64:

score: 0
Accepted
time: 37ms
memory: 22860kb

input:

1000 1
OXXOOXXOXXXOOXXOXOXXXXXXXOOXXOXXXXXXXXOXXOXXXXOXXXXOOOOXXOXOOXOXXXXXOXXXXXOOXXXOOOXOXOXXXXXXXXXXXOXOXXOOXXXOOXXXXOOXXOOOXXOXXOXOXOXXXXXOXXXXOXXXOXXOXXXOXXXXXOXXXXXXOOXOXOXOXOXOXOXXXXXXXOXXXXOXXXXXXXXXOOOOOOXXXXOOOOXXXOXXOOXOXXXXXXXXXOXXOOXXXXOXXXXXXXXXOXXXOOXXOOXOOOXXXXOXOXXOXXXXOOXOXXOOXXXXX...

output:

0

result:

ok single line: '0'

Test #65:

score: 0
Accepted
time: 22ms
memory: 22692kb

input:

1000 1
XXOOXXOXXXOOXXOXOXXXXXXXOOXXOXXXXXXXXOXXOXXXXOXXXXOOOOXXOXOOXOXXXXXOXXXXXOOXXXOOOXOXOXXXXXXXXXXXOXOXXOOXXXOOXXXXOOXXOOOXXOXXOXOXOXXXXXOXXXXOXXXOXXOXXXOXXXXXOXXXXXXOOXOXOXOXOXOXOXXXXXXXOXXXXOXXXXXXXXXOOOOOOXXXXOOOOXXXOXXOOXOXXXXXXXXXOXXOOXXXXOXXXXXXXXXOXXXOOXXOOXOOOXXXXOXOXXOXXXXOOXOXXOOXXXXXO...

output:

1

result:

ok single line: '1'

Subtask #3:

score: 39
Accepted

Test #66:

score: 39
Accepted
time: 27ms
memory: 22648kb

input:

1000 1
XXOOXXOXXXOOXXOXOXXXXXXXOOXXOXXXXXXXXOXXOXXXXOXXXXOOOOXXOXOOXOXXXXXOXXXXXOOXXXOOOXOXOXXXXXXXXXXXOXOXXOOXXXOOXXXXOOXXOOOXXOXXOXOXOXXXXXOXXXXOXXXOXXOXXXOXXXXXOXXXXXXOOXOXOXOXOXOXOXXXXXXXOXXXXOXXXXXXXXXOOOOOOXXXXOOOOXXXOXXOOXOXXXXXXXXXOXXOOXXXXOXXXXXXXXXOXXXOOXXOOXOOOXXXXOXOXXOXXXXOOXOXXOOXXXXXO...

output:

0

result:

ok single line: '0'

Test #67:

score: 0
Accepted
time: 27ms
memory: 22744kb

input:

1000 1
XXXXXXXXXOOXXXXOXXXXXXXXXXXOXXXXXOOOXXXOXOXXXXXXXXOXXXXOOXOXXOXXXXOOOXXXXXXXXXXOOXOXXXOOXOXXXXXXXXXXOOXXXXXXOXXOOXXXXXOOXXXXXXXXXOXXXXXXXXXXXXOXXXXXXOXXOXXOXXOOXXXXOOXOXOXXXXXXOOXOXOXXXXXOXXOXOXOXOXXOXOXOXXXXXXXOXXOXXXXXXXXXXOXXXXOOXXOXXOXXXXXXXXOXOOXXXOXOOXXXOXXXXXXXXOXXXXXXOXXXXXXOXXXXXOXXO...

output:

0

result:

ok single line: '0'

Test #68:

score: 0
Accepted
time: 19ms
memory: 22692kb

input:

1000 1
OOOOOOOOXXOOOOXOOOOOOOOOOOXOOOOOXXXOOOXOXOOOOOOOOXOOOOXXOXOOXOOOOXXXOOOOOOOOOOXXOXOOOXXOXOOOOOOOOOOXXOOOOOOXOOXXOOOOOXXOOOOOOOOOXOOOOOOOOOOOOXOOOOOOXOOXOOXOOXXOOOOXXOXOXOOOOOOXXOXOXOOOOOXOOXOXOXOXOOXOXOXOOOOOOOXOOXOOOOOOOOOOXOOOOXXOOXOOXOOOOOOOOXOXXOOOXOXXOOOXOOOOOOOOXOOOOOOXOOOOOOXOOOOOXOOXO...

output:

1

result:

ok single line: '1'

Test #69:

score: 0
Accepted
time: 29ms
memory: 22832kb

input:

1000 1
OOOOOOOOXXOOOOXOOOOOOOOOOOXOOOOOXXXOOOXOXOOOOOOOOXOOOOXXOXOOXOOOOXXXOOOOOOOOOOXXOXOOOXXOXOOOOOOOOOOXXOOOOOOXOOXXOOOOOXXOOOOOOOOOXOOOOOOOOOOOOXOOOOOOXOOXOOXOOXXOOOOXXOXOXOOOOOOXXOXOXOOOOOXOOXOXOXOXOOXOXOXOOOOOOOXOOXOOOOOOOOOOXOOOOXXOOXOOXOOOOOOOOXOXXOOOXOXXOOOXOOOOOOOOXOOOOOOXOOOOOOXOOOOOXOOXO...

output:

0

result:

ok single line: '0'

Test #70:

score: 0
Accepted
time: 25ms
memory: 22616kb

input:

1000 1
XXOOXXXXXXXXXXXXXXOXXXXXOXXXXXXOXXXXXXXXXOXXXXXXXOXXOXXXXXOXXXXXXOXXOXXXXXXXOXXOOXXXXOXXXXXXXOXOXXXXXOXXXXXXXXXXXXXOXXOXXXXXXXXXXXOXXXXXOOXXXXXXXXXXXOXXXOXXXXXXXOXOXXXXXXXXXXOXXXXOXXXOXXXXXXXOXXXXOXXXOXXXXXXXXOXOXXXXOXXOXXXXOXXXOXOXXXXXXOXXXOXXXXXXXXXXXXOXXXXOOXXXXOXXOXXXXXXXXXOXXOXOXOOXXXXXX...

output:

0

result:

ok single line: '0'

Test #71:

score: 0
Accepted
time: 32ms
memory: 22740kb

input:

1000 1
OXXOOOOOOOOOOOOOOXOOOOOXOOOOOOXOOOOOOOOOXOOOOOOOXOOXOOOOOXOOOOOOXOOXOOOOOOOXOOXXOOOOXOOOOOOOXOXOOOOOXOOOOOOOOOOOOOXOOXOOOOOOOOOOOXOOOOOXXOOOOOOOOOOOXOOOXOOOOOOOXOXOOOOOOOOOOXOOOOXOOOXOOOOOOOXOOOOXOOOXOOOOOOOOXOXOOOOXOOXOOOOXOOOXOXOOOOOOXOOOXOOOOOOOOOOOOXOOOOXXOOOOXOOXOOOOOOOOOXOOXOXOXXOOOOOOX...

output:

1

result:

ok single line: '1'

Test #72:

score: 0
Accepted
time: 23ms
memory: 22848kb

input:

1000 1
OXXOOOOOOOOOOOOOOXOOOOOXOOOOOOXOOOOOOOOOXOOOOOOOXOOXOOOOOXOOOOOOXOOXOOOOOOOXOOXXOOOOXOOOOOOOXOXOOOOOXOOOOOOOOOOOOOXOOXOOOOOOOOOOOXOOOOOXXOOOOOOOOOOOXOOOXOOOOOOOXOXOOOOOOOOOOXOOOOXOOOXOOOOOOOXOOOOXOOOXOOOOOOOOXOXOOOOXOOXOOOOXOOOXOXOOOOOOXOOOXOOOOOOOOOOOOXOOOOXXOOOOXOOXOOOOOOOOOXOOXOXOXXOOOOOOX...

output:

0

result:

ok single line: '0'

Test #73:

score: 0
Accepted
time: 28ms
memory: 22984kb

input:

1000 1
OXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXOXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXOXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXO...

output:

0

result:

ok single line: '0'

Test #74:

score: 0
Accepted
time: 28ms
memory: 22676kb

input:

1000 1
XXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXOXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXOXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXOX...

output:

1

result:

ok single line: '1'

Test #75:

score: 0
Accepted
time: 32ms
memory: 22892kb

input:

1000 1
XXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXOXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXOXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXOX...

output:

0

result:

ok single line: '0'

Test #76:

score: 0
Accepted
time: 24ms
memory: 22980kb

input:

1000 2
OOOXOOOXOOOXOOOOOOOOOOOOOOOOOXXOOOOOOOOOOXOOOOOOOXOOOOXOOOOOOOOOXOOOOOOOOOXOOOOOOOOXOOOOOOOOOOOOOXOOOOOXOOOOOOOOOOOOOOOOXXOOOOOXOXOOOXOOOOOOOOOOOOOOOXXOXOOOXXOOOOXXOXOOXOOOOOOOOOOOOOXOOOOOXOOOOOXOOOXOXOOOOOOOOOOOOXOOXOXOOOOXXOOOXOOOOOOOOOOOXOOXXXOOOXXOOOOOOOOXOXOOXOOOOXXOOOOOOOXOXXOOOXOXOOOOO...

output:

0

result:

ok single line: '0'

Test #77:

score: 0
Accepted
time: 31ms
memory: 22848kb

input:

1000 2
OXOOOXOOOXOOOOOOOOOOOOOOOOOXXOOOOOOOOOOXOOOOOOOXOOOOXOOOOOOOOOXOOOOOOOOOXOOOOOOOOXOOOOOOOOOOOOOXOOOOOXOOOOOOOOOOOOOOOOXXOOOOOXOXOOOXOOOOOOOOOOOOOOOXXOXOOOXXOOOOXXOXOOXOOOOOOOOOOOOOXOOOOOXOOOOOXOOOXOXOOOOOOOOOOOOXOOXOXOOOOXXOOOXOOOOOOOOOOOXOOXXXOOOXXOOOOOOOOXOXOOXOOOOXXOOOOOOOXOXXOOOXOXOOOOOOO...

output:

1

result:

ok single line: '1'

Test #78:

score: 0
Accepted
time: 31ms
memory: 22828kb

input:

1000 2
OXOOOXOOOXOOOOOOOOOOOOOOOOOXXOOOOOOOOOOXOOOOOOOXOOOOXOOOOOOOOOXOOOOOOOOOXOOOOOOOOXOOOOOOOOOOOOOXOOOOOXOOOOOOOOOOOOOOOOXXOOOOOXOXOOOXOOOOOOOOOOOOOOOXXOXOOOXXOOOOXXOXOOXOOOOOOOOOOOOOXOOOOOXOOOOOXOOOXOXOOOOOOOOOOOOXOOXOXOOOOXXOOOXOOOOOOOOOOOXOOXXXOOOXXOOOOOOOOXOXOOXOOOOXXOOOOOOOXOXXOOOXOXOOOOOOO...

output:

0

result:

ok single line: '0'

Test #79:

score: 0
Accepted
time: 46ms
memory: 31052kb

input:

1000 3
OXOXXXOXOXOOOOXOXOXOXXXOOOOXOXXXXOXXOXOXXOXXOXOOOXOOXOOXOXXOXXOXOOOXXXOXOXOOXOOXXOOOOOXOOOXOOOXXOOXXOXOOXXOXXOXOXXXXOOXXOXOOXXOOXOXOXXXXXXXXOOOXXXXXOOOXOXXOOOOXXXXOXXXOXXXXOXXOXXOOOXOXOXXXXXOXXOOOOXOXXXXXXOXOXOOXOOOXOXXXOXOOXOOOXOOXXXOXXOOOOOXXXOOOOOXXOOXXOOXOXXXXOOXOOXXXOXXOOXXOOXXXXXOOXOXXO...

output:

0

result:

ok single line: '0'

Test #80:

score: 0
Accepted
time: 35ms
memory: 30872kb

input:

1000 3
XXOOXXXOXOOOOXXXOOXXXOOXXOOXXOOXOOXXXXXXXXXOXOXXOXXOXXXXXXXXXOXOXOXOOOXXOXXOXOOOXOOOOOXXOXOXOOOOXOOOOOXOOXOOOXOXXXOXOOXXOXOOOOOXXXXOXXOXXXOOOXXOXOXOXXXXXOOXXXOXOOXXXXXOXOOXOOXOXOXXXOOXXOXOOXOXOOOOXOXXOXOOOXXOXXOOOOXOXOOOOOOOXXOXXXOOXOOOXOOOXXXOOXOXOOOOXOXXOOXXOOOOOOOXXXXXXOXOOOOXXOXOXXOOXOOXO...

output:

1

result:

ok single line: '1'

Test #81:

score: 0
Accepted
time: 42ms
memory: 31120kb

input:

1000 3
XXOOXXXOXOOOOXXXOOXXXOOXXOOXXOOXOOXXXXXXXXXOXOXXOXXOXXXXXXXXXOXOXOXOOOXXOXXOXOOOXOOOOOXXOXOXOOOOXOOOOOXOOXOOOXOXXXOXOOXXOXOOOOOXXXXOXXOXXXOOOXXOXOXOXXXXXOOXXXOXOOXXXXXOXOOXOOXOXOXXXOOXXOXOOXOXOOOOXOXXOXOOOXXOXXOOOOXOXOOOOOOOXXOXXXOOXOOOXOOOXXXOOXOXOOOOXOXXOOXXOOOOOOOXXXXXXOXOOOOXXOXOXXOOXOOXO...

output:

0

result:

ok single line: '0'

Test #82:

score: 0
Accepted
time: 39ms
memory: 23264kb

input:

1000 4
XXXXXXOXXXOXXXXXXXXXXXXXXXXXXXXXXOXXXOXXXXXXXXXXXXXXXXXXOOXOXOXOXOOXXXXXXXXXXXXXXOXXXOXXXXXOOXXXOOOXXXXOXXOOXXXXOXXOOXXOXXXXXXXXXXOXXOOXOXXXXOXXXXXXXOXXXXXXXOOXXXXOXXOXXXXXXXXXXXXOXOXOXXXXOOOXXXOXXXXXXXXOXXXXXXXXOXXOXOXXXXXXXXOXXXXXXXXXOOXOXXOXOXOXXOOXXOOXOXXOXXXXXXOXXXOOXOXXXXXOXOXXXXOXXXXOX...

output:

0

result:

ok single line: '0'

Test #83:

score: 0
Accepted
time: 37ms
memory: 23136kb

input:

1000 4
OOOXOOXXOOOXOOOXOOOXOOOXOOOXOXOXOXOXOOOXOOOXOOOXOOOXXXOOOXOOOXXXOOOXOOOXOOOXOXOXOXOXOOOOXOOXXXXXOOOOOOXOOOOXXOOOXOOOOOOXOOOXOOXXOXXXXOOXOXOXOOOXOXOXOOOXOXXXOOOOOOXXOOOXOOOXOOOOOXOOOOOXXXXXOOXXOOOXOOOOOOOXOOOXXOOOOXOXOOOXOOXXOOOXOOOXXXOOOOXXXOXXOXXXOXXXXOOOOOOXOOXXOOXOOXOXOOOOOXOXOOXXOOOOOOOXO...

output:

1

result:

ok single line: '1'

Test #84:

score: 0
Accepted
time: 30ms
memory: 23268kb

input:

1000 4
OOOXOOXXOOOXOOOXOOOXOOOXOOOXOXOXOXOXOOOXOOOXOOOXOOOXXXOOOXOOOXXXOOOXOOOXOOOXOXOXOXOXOOOOXOOXXXXXOOOOOOXOOOOXXOOOXOOOOOOXOOOXOOXXOXXXXOOXOXOXOOOXOXOXOOOXOXXXOOOOOOXXOOOXOOOXOOOOOXOOOOOXXXXXOOXXOOOXOOOOOOOXOOOXXOOOOXOXOOOXOOXXOOOXOOOXXXOOOOXXXOXXOXXXOXXXXOOOOOOXOOXXOOXOOXOXOOOOOXOXOOXXOOOOOOOXO...

output:

0

result:

ok single line: '0'

Test #85:

score: 0
Accepted
time: 39ms
memory: 27400kb

input:

1000 5
OOOOOXOOOXOOOXOOOXOOOOOXOOOOOXXOOXOOOOOOXXOOOOOOOXOOOXOOOXXOOOOXOOOOOXOOOOOOXOOOOOOXOOOOOOXOOOOXOOOOOOOOOOOOOOOOXOXOXOOOOOOXXOOXOOOXOOOXOOOOXOOXOOOOOOXOOOOOOOXOOXOOXOXXOOOOXOOOOOOXOXOOOOOOOOOOOOOOOXOOXOOOOXOOXXOOOXOOXXOXOOOOOOOOXOOOOOXOXOXOOOXOXXOXOOOOOOOOOXOOXOXOXOOOOOOOOOOXOOXOOOOOOOOOXXXOX...

output:

0

result:

ok single line: '0'

Test #86:

score: 0
Accepted
time: 39ms
memory: 27232kb

input:

1000 5
OOXOXOOOXOOOXOOOOOXOOOOOXXOOXOOOOOOXXOOOOOOOXOOOXOOOXXOOOOXOOOOOXOOOOOOXOOOOOOXOOOOOOXOOOOXOOOOOOOOOOOOOOOOXOXOXOOOOOOXXOOXOOOXOOOXOOOOXOOXOOOOOOXOOOOOOOXOOXOOXOXXOOOOXOOOOOOXOXOOOOOOOOOOOOOOOXOOXOOOOXOOXXOOOXOOXXOXOOOOOOOOXOOOOOXOXOXOOOXOXXOXOOOOOOOOOXOOXOXOXOOOOOOOOOOXOOXOOOOOOOOOXXXOXOOOOO...

output:

1

result:

ok single line: '1'

Test #87:

score: 0
Accepted
time: 43ms
memory: 27260kb

input:

1000 5
OOXOXOOOXOOOXOOOOOXOOOOOXXOOXOOOOOOXXOOOOOOOXOOOXOOOXXOOOOXOOOOOXOOOOOOXOOOOOOXOOOOOOXOOOOXOOOOOOOOOOOOOOOOXOXOXOOOOOOXXOOXOOOXOOOXOOOOXOOXOOOOOOXOOOOOOOXOOXOOXOXXOOOOXOOOOOOXOXOOOOOOOOOOOOOOOXOOXOOOOXOOXXOOOXOOXXOXOOOOOOOOXOOOOOXOXOXOOOXOXXOXOOOOOOOOOXOOXOXOXOOOOOOOOOOXOOXOOOOOOOOOXXXOXOOOOO...

output:

0

result:

ok single line: '0'

Test #88:

score: 0
Accepted
time: 48ms
memory: 31440kb

input:

1000 6
OOOXOOOOOOXXXXOXXOXXXOXOOXXXXXXXOXOOOOOXOOOOOOXXOXOXOXXXOOOOOXOOOOXOOXOXOOOOXOXOOOOOOXOOXXOXOXOOOOXXXXXXOOOOOXXXOXXXXXOOOXOOOXOOOXXXXXXXXOOXXOOOXXXOOXOXXOOOOOXOOOXOXOOXOOOOOXXOXXXXOOXOOOOXXXOXOXOXXXXOXXOOXOXOXOOOXOXOOOXXXOXXOXOXXOXXOOOXOOOOOXOOOOOXXOOOOXXOOXXXOXXXOXXOOOXXOXXOXXXXXXOXXXOXOOOXO...

output:

0

result:

ok single line: '0'

Test #89:

score: 0
Accepted
time: 53ms
memory: 31544kb

input:

1000 6
OXOOOOXXOXXXXXXOXXOXXXXOXXOXOXOOOXOXOOOOXOOXOXOOXXOOOXOXOOOXXOOXOOOOOOXXXOOOOXOXOOXOOXOXOXOOXXXOXXOOOXOXXXOOXXXXOXOXOOOOOOOXXOXXXXXXOXXOOXXXXOOOOXXOOXOOXOOXXOXOOOOOOOOOXOXXXOOOXOOXOXXXOOOXOXXOXOXXOXXOXOXXOOXOXXOOXXXXXXOXOOXOXXOXOXOOOXOXOOOXOXXOOXOXXOOOXXOXXOOXXOOXXXOXXXXXXXXOOXXXOOOOOXOXOOOOO...

output:

1

result:

ok single line: '1'

Test #90:

score: 0
Accepted
time: 42ms
memory: 31428kb

input:

1000 6
OXOOOOXXOXXXXXXOXXOXXXXOXXOXOXOOOXOXOOOOXOOXOXOOXXOOOXOXOOOXXOOXOOOOOOXXXOOOOXOXOOXOOXOXOXOOXXXOXXOOOXOXXXOOXXXXOXOXOOOOOOOXXOXXXXXXOXXOOXXXXOOOOXXOOXOOXOOXXOXOOOOOOOOOXOXXXOOOXOOXOXXXOOOXOXXOXOXXOXXOXOXXOOXOXXOOXXXXXXOXOOXOXXOXOXOOOXOXOOOXOXXOOXOXXOOOXXOXXOOXXOOXXXOXXXXXXXXOOXXXOOOOOXOXOOOOO...

output:

0

result:

ok single line: '0'

Test #91:

score: 0
Accepted
time: 46ms
memory: 35936kb

input:

1000 7
XXXXXOOXXOXXOXXXXXXXXXXXXOXXXXXXXXXXXXXOXXXXOXXXXXXXXOOXOXXXXXOOXXXXXOOOXOXXXXXXXOXXXXXXXXOXXXXXXXXXOXXXXXOXXXXOXOXOXOXXXXXXXXOXXXXXXXOXOOXXXOXXXXXXXXXXXXXXXXXOXOXXOXXXOOXOOXXXXXOXXXXXXXXXXXXXXXXXXXOOXXXXXXXOXXXXXXXXXXXXXXXXOXOXXXXXXXXXXXXXXXXXXXOXOXXOXXXXXXXXXXXXXXOXOOXXXOXXXXXXXXXXXXXOXOXOX...

output:

0

result:

ok single line: '0'

Test #92:

score: 0
Accepted
time: 47ms
memory: 35752kb

input:

1000 7
OOXXXOXOOOXOOXOOOXXOXOOOXOOXOOOXXOXOOXXOOXOOOXXXXXOOXOOOXOOXOOOXXOOOOXOOOXXOXOOOXOOOOOOXOOXOOXXOOXOXOXOOOOXOOOXXOOOXOOXXOOXOOXOXOOXOXOXOXOOXOOOXOOXOOOXOXXXOOOOOXXXOOXOXOOOOOOXOOOXOOXOOOXOOXOOXOOOXOOOXXOXOOOXOOXOOOXOOXXOXXOOXOOOXOOXOOOXOOXOXOOOOOOOOXOOXOOOXOOXXOXOOOXXOOXOOXOOOXOOXXOXXXOOOXOXOO...

output:

1

result:

ok single line: '1'

Test #93:

score: 0
Accepted
time: 47ms
memory: 35676kb

input:

1000 7
OOXXXOXOOOXOOXOOOXXOXOOOXOOXOOOXXOXOOXXOOXOOOXXXXXOOXOOOXOOXOOOXXOOOOXOOOXXOXOOOXOOOOOOXOOXOOXXOOXOXOXOOOOXOOOXXOOOXOOXXOOXOOXOXOOXOXOXOXOOXOOOXOOXOOOXOXXXOOOOOXXXOOXOXOOOOOOXOOOXOOXOOOXOOXOOXOOOXOOOXXOXOOOXOOXOOOXOOXXOXXOOXOOOXOOXOOOXOOXOXOOOOOOOOXOOXOOOXOOXXOXOOOXXOOXOOXOOOXOOXXOXXXOOOXOXOO...

output:

0

result:

ok single line: '0'

Test #94:

score: 0
Accepted
time: 49ms
memory: 24144kb

input:

1000 8
OOOOOOOOOOOOXOOOXOOOOOOOOXOOOOXOOOOOOOOOOOOXXOOOOOOXOOOOOOOOOOOXOOOOXOXXOOOOOOOOXOOOOOOXOOOOXOXOXOXXXOXOXOXOXXOOOXOOOOXOOOOXOOOXOXOOOOOOOXOXOOOOOXOOOOOOXOXOOOOOOOOOOXOOOOOOOXOXOOOOOOXOOOOOXOOOOOOOOOOOXOOOOOOXOXOOOOOOOOOOXOOOOXOXXOOOOOOOOOOOOXOOOOXOOOXOOOOOOOOXOOOOOOOOOOXOXOOOOXOOOOOOOOOOOOOOX...

output:

0

result:

ok single line: '0'

Test #95:

score: 0
Accepted
time: 45ms
memory: 23796kb

input:

1000 8
OOOOOOXOXOOOOOXOOXOOOOOOOOOOOOXOOOOXXOXOOOOXOOXOOOOOOOXXOOOOXOOXOOOOOOXOXOOOOOXXOOOOXOOOXOXXXOOOXOXOXXXOOXOOOOOOOOOXOOXXOXOOOOXOOXOXOOXOOXOOOOXOXOXOOOXOOOOOOXXOOOOOOXXXOOOOOOOOOOOOXOXOOOOOOOXOXOOOOOXXOXOOOOXOOOOOXOXOOXOXXOXOOOOOOOXOOXOOOOOOOOXOOOXOOOOXOOXOOOOOOOOOXOOOOXXOOOOOOOXOOOOOXOOOXOOOO...

output:

1

result:

ok single line: '1'

Test #96:

score: 0
Accepted
time: 49ms
memory: 24044kb

input:

1000 8
OOOOOOXOXOOOOOXOOXOOOOOOOOOOOOXOOOOXXOXOOOOXOOXOOOOOOOXXOOOOXOOXOOOOOOXOXOOOOOXXOOOOXOOOXOXXXOOOXOXOXXXOOXOOOOOOOOOXOOXXOXOOOOXOOXOXOOXOOXOOOOXOXOXOOOXOOOOOOXXOOOOOOXXXOOOOOOOOOOOOXOXOOOOOOOXOXOOOOOXXOXOOOOXOOOOOXOXOOXOXXOXOOOOOOOXOOXOOOOOOOOXOOOXOOOOXOOXOOOOOOOOOXOOOOXXOOOOOOOXOOOOOXOOOXOOOO...

output:

0

result:

ok single line: '0'

Test #97:

score: 0
Accepted
time: 57ms
memory: 26040kb

input:

1000 9
XOOOOOOXXOOOOXXXXOOXOOOOOOOXXOXXOXOOXXOXXXXXXXOOXOXOXOXOOXOOXOOOXOOOXOXOOXXOXXXXXXOOOOXXOXOXXXXXXOOOOXXOOXXXXXOOXOOXXOOXOOOOOXOOOOXOOXXOXXOOOOXOOXXOXXOXOXXOOXOXOOXOOXXOOXXOXXOOXOXXXOXOXOOXOOOOOOOOOXXOXOOOOOXOOOXOOOOXOXOOXOOXXOXOXOOXOXXXXXXOXXXXOOOOOXOXOOOOXXXXXOOXOXXOOXOOOXXXXXXOOOXOXOXXOXXXO...

output:

0

result:

ok single line: '0'

Test #98:

score: 0
Accepted
time: 56ms
memory: 26248kb

input:

1000 9
XOOXXOXOXXXOOXOOXXOXOXOOXXXOXOXOXXOOOOOXXXOOXOOOXXOXXXXXOOXXOOXXXXOOXXOOOOOOXXXXOXXXXOXXXXXOXXXOXOOOXOOOOOOOXOXOXOOXOXOOOOOOOOXXXOXOOOXXXXOOXOOXOXOOOOXXXOOOXOOOOOXXXOXXOOOOOXOOOOOXXOOOXOOXOOOXOXOOXOXOOXXOOXOXXOOOOOOOXXOXXOXXOOXXXOOXOOOOOOXOXXOXOOOOXXOOXOXOOXOXOXOOXOXXOOXOOXXXOOOXXXXXXOXOXOXXX...

output:

1

result:

ok single line: '1'

Test #99:

score: 0
Accepted
time: 42ms
memory: 26076kb

input:

1000 9
XOOXXOXOXXXOOXOOXXOXOXOOXXXOXOXOXXOOOOOXXXOOXOOOXXOXXXXXOOXXOOXXXXOOXXOOOOOOXXXXOXXXXOXXXXXOXXXOXOOOXOOOOOOOXOXOXOOXOXOOOOOOOOXXXOXOOOXXXXOOXOOXOXOOOOXXXOOOXOOOOOXXXOXXOOOOOXOOOOOXXOOOXOOXOOOXOXOOXOXOOXXOOXOXXOOOOOOOXXOXXOXXOOXXXOOXOOOOOOXOXXOXOOOOXXOOXOXOOXOXOXOOXOXXOOXOOXXXOOOXXXXXXOXOXOXXX...

output:

0

result:

ok single line: '0'

Test #100:

score: 0
Accepted
time: 46ms
memory: 28344kb

input:

1000 10
XXOOXXXXXXXXXXXXXXXOXXXXOXOOXXOXXXXOXXOXXXXOXXXXXXXXXOOXXXOXXXXXXXXXXOXXXXXXXXXXXXXXXXOXXXOXXXXXXXXXXXXXXOXXXXXXXOXXXXXXOXXXXXOXXXXXXXXXOOOXXXXXOXXOXXOXXOOOXXXXXXXXXXXOXXOXXXXXXXXXXXXXXOXXXXOXXXXOXXXXXXXXXXXXXXXXXOXXXXOXOXXXXXXXOXXXXXXOOXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXOXOXXOXXOXOXX...

output:

0

result:

ok single line: '0'

Test #101:

score: 0
Accepted
time: 53ms
memory: 28364kb

input:

1000 10
OOOOOOOOOXOXOOXOXXOOXXOOOXOOXOOXOXOOOOOOOXOXXOOOXOOXOOOOOOOXOXOOOOOOOOOXOOOOXOOOXXOOOOOOOOOXOOOXOOOOOXOXOOOOOOXXOOOOXOOOOXOOOOXXXOOXOOXOOXOOXXOXXXOOOOOXOOOOOXOOXXOOOOOOOOOXOOOXOOOOXXOOOXOOOOOXOOOOOOOOOXOXOOOOXOXXOOOOOOXOOXOOOXXOOOOXOXOOOOOOOXOOOOOOOOOXOOOOOOXOOXOOOOOOOXOOOOXOOXOXOXOXOOOOOOOX...

output:

1

result:

ok single line: '1'

Test #102:

score: 0
Accepted
time: 55ms
memory: 28456kb

input:

1000 10
OOOOOOOOOXOXOOXOXXOOXXOOOXOOXOOXOXOOOOOOOXOXXOOOXOOXOOOOOOOXOXOOOOOOOOOXOOOOXOOOXXOOOOOOOOOXOOOXOOOOOXOXOOOOOOXXOOOOXOOOOXOOOOXXXOOXOOXOOXOOXXOXXXOOOOOXOOOOOXOOXXOOOOOOOOOXOOOXOOOOXXOOOXOOOOOXOOOOOOOOOXOXOOOOXOXXOOOOOOXOOXOOOXXOOOOXOXOOOOOOOXOOOOOOOOOXOOOOOOXOOXOOOOOOOXOOOOXOOXOXOXOXOOOOOOOX...

output:

0

result:

ok single line: '0'

Test #103:

score: 0
Accepted
time: 58ms
memory: 30696kb

input:

1000 11
OOOXOOOOOXOOOOOOXOXOOOXXOOOXOXOOOOOOOXOOXXOOXXOOOOXOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOXOOXOXOXOOOOOOOOOOOOXOXOOOOOOOOOOOXOOXOOOXOOOXXOOOOOOOXOOOOOOXOOXOOOOOXOOOOOOXOOXOOOOOXOOOOOOXXXOXXOXOOXOOOXOXOOXOOOOXOOOOOXOOOOOOOXOOOOXOOOXOXOOXOOOOXOOOOOOOOOOOOOOXOOOXOOOOOOOOOOOOXOXOOOOOOOXXOOOOOXX...

output:

0

result:

ok single line: '0'

Test #104:

score: 0
Accepted
time: 68ms
memory: 30512kb

input:

1000 11
OXOOXOOOXXOXXOOOXOXXXOOOOOXOOXOXOXXOOOOXOXXOOOOXOOOOXXOOOOOOOOOXXOOOOOOOOOXXOOXOXOOXOOXXOOOOOOOOXXOOXOXOOOOXXOOOOOXOOXXXOXOOOXXOOXXOOOXOOOOOXOOOXOOOOOXXXOOOOXOOXOXXOOXOOOOOOOOXOXXOXOOXXXOXOXOOXOOXXXOOOOOXOOXXOOOXOOOOXXXOXOXOOXOOXXXOOOOOOOOXXOOOOXOOOXXXOOOOOOOOOXOOXOOOOOOOOOOOOOOXXXOXOOOOOOOO...

output:

1

result:

ok single line: '1'

Test #105:

score: 0
Accepted
time: 62ms
memory: 30568kb

input:

1000 11
OXOOXOOOXXOXXOOOXOXXXOOOOOXOOXOXOXXOOOOXOXXOOOOXOOOOXXOOOOOOOOOXXOOOOOOOOOXXOOXOXOOXOOXXOOOOOOOOXXOOXOXOOOOXXOOOOOXOOXXXOXOOOXXOOXXOOOXOOOOOXOOOXOOOOOXXXOOOOXOOXOXXOOXOOOOOOOOXOXXOXOOXXXOXOXOOXOOXXXOOOOOXOOXXOOOXOOOOXXXOXOXOOXOOXXXOOOOOOOOXXOOOOXOOOXXXOOOOOOOOOXOOXOOOOOOOOOOOOOOXXXOXOOOOOOOO...

output:

0

result:

ok single line: '0'

Test #106:

score: 0
Accepted
time: 66ms
memory: 32792kb

input:

1000 12
OOXXOXXOXXOOOOOOOOOOXOOOXOOXXXOOOOOXXXXOOOOXOOOOXOXXXXXXXOOXOOXXOOXOOXOOXOXXXXOXOOXXXOOOOOOXOXOOXOOXOOOOOOOXOXXOOOOXOXXXXXXOXXOOXOOOOXOOOXXXOXXXXXOOOXXXOOXOXOOOOOOOXOXXXXXXXOXOXOXOOXXOXOXXOOOXOOXXXOOXXOXOOOXOXOOXXXXXOXXOOXXOXXOOOOOXOOXXOXXXOXXOXOXOXXOOOOOOXOOXOOXXXOXOOOXXOOOOXXXXXXXOXOXXXXOO...

output:

0

result:

ok single line: '0'

Test #107:

score: 0
Accepted
time: 69ms
memory: 32912kb

input:

1000 12
OOXXOOOOOOXOXXOOOXOOOOXXXOXXXOOXOOXOXXXOOXXXXOXXOXXOXOXOOXXOXXXOOXOXOOOXXXOXXOOXOXXOXXOOXOOOOOXXOOXXXOOXOXOXXOXXOXOOXOXOOOOXXXXXOXOXXOOXXXXXOOOOXXOXXOOOXOOXXOXOOOXOXOOOOOXXOOXXOOXXOXXOOOOXXOOOOXXXOOOXXXOXOOXXXXXOXXXOOXOOXOXXOXOXOOXXOOXOXXXOOXOXOOOXOOOXXXXXXOXXOOXOXOXOOXXOXOOXXOOXXXXXOOXOOOXO...

output:

1

result:

ok single line: '1'

Test #108:

score: 0
Accepted
time: 66ms
memory: 32780kb

input:

1000 12
OOXXOOOOOOXOXXOOOXOOOOXXXOXXXOOXOOXOXXXOOXXXXOXXOXXOXOXOOXXOXXXOOXOXOOOXXXOXXOOXOXXOXXOOXOOOOOXXOOXXXOOXOXOXXOXXOXOOXOXOOOOXXXXXOXOXXOOXXXXXOOOOXXOXXOOOXOOXXOXOOOXOXOOOOOXXOOXXOOXXOXXOOOOXXOOOOXXXOOOXXXOXOOXXXXXOXXXOOXOOXOXXOXOXOOXXOOXOXXXOOXOXOOOXOOOXXXXXXOXXOOXOXOXOOXXOXOOXXOOXXXXXOOXOOOXO...

output:

0

result:

ok single line: '0'

Test #109:

score: 0
Accepted
time: 56ms
memory: 35060kb

input:

1000 13
OXOXOXXOXOXXXXXXOXXXXXOXOXXOXXOXXXXXXOOXXXXXOOXXXOXXOXXXXXXXXXXOXOXXXXXXXXXXXXXOOXXXXXXOXXXXXXOXXXXOXXXXXXXOXXXXXXOXOXXOOXXXXXOXXXXXOOXXOXXXXXXXXXXXXXXXXXXOXOXXXXXXXXXXXXXOXOXXXXXXOOXXXXXXOXOXXOOXXXXXXXXXXXXXXXXXXOXOXXXOXXXXXXXXOXXXXOOOXXOXXXOXXXXXOXXXXOXXXXXXXOXXXXXXOXOXXXXXXXXXOXOOXXXXXXXX...

output:

0

result:

ok single line: '0'

Test #110:

score: 0
Accepted
time: 55ms
memory: 35072kb

input:

1000 13
XXXXXOOOXOOXXXOXOXOOOXOOOOXXXOOXXOXOXXXOXXOOOOOXOOOXOXXOOOOOXOOXXXOOOOOOOXXOXXXXXXOOOOOOOXXXXXXOOOOXOXXOXXOXOOOOXXOXXXXOXOOXOXOOXXXXXOOOOOXOOXOXOXOOOOOXOOXXXXOOXOOOXOOOOXXXOOOXOOOOOOXXXOOOOOXOOXXXXXOOXOXXOOOXXXXOOOOXXOOXOOOXOXOOOOOOXXXOXOOOXOXOOXXXOXOOOOOOOXXXXXXOOOOXXXXXXXXXOOOOOOOOXXXXXOOO...

output:

1

result:

ok single line: '1'

Test #111:

score: 0
Accepted
time: 44ms
memory: 35104kb

input:

1000 13
XXXXXOOOXOOXXXOXOXOOOXOOOOXXXOOXXOXOXXXOXXOOOOOXOOOXOXXOOOOOXOOXXXOOOOOOOXXOXXXXXXOOOOOOOXXXXXXOOOOXOXXOXXOXOOOOXXOXXXXOXOOXOXOOXXXXXOOOOOXOOXOXOXOOOOOXOOXXXXOOXOOOXOOOOXXXOOOXOOOOOOXXXOOOOOXOOXXXXXOOXOXXOOOXXXXOOOOXXOOXOOOXOXOOOOOOXXXOXOOOXOXOOXXXOXOOOOOOOXXXXXXOOOOXXXXXXXXXOOOOOOOOXXXXXOOO...

output:

0

result:

ok single line: '0'

Test #112:

score: 0
Accepted
time: 50ms
memory: 37376kb

input:

1000 14
XOOOXOOOOOOOOXOOOXXXOOXOOOOXOXOOOOXOOOOXOOXOXOOXOOOXXXOOXOOXOXOOOOOOXXOOOOOOOXOOXOOOOOOOOOOOOOOOOOOOOOOOXXOOXOOOOOOOXOOXOOOXOOOOXOXXOOOOXOOXXOOOOXOOXOOOOOOXOOOOOOOOOOOOOOOOOOOOOXOXOOOOXOOOOOOOXOOOOOOXXXOOOOOOOXOOOOOOOOXOOOOOOXOOOOOXOOOOOXOOXOXXOOOOXXOOOOXOOXOOOOOOOOOOOOOOOXOOOXOOOOOXXOXXXOOO...

output:

0

result:

ok single line: '0'

Test #113:

score: 0
Accepted
time: 65ms
memory: 37204kb

input:

1000 14
XOXOOOXOXOOXOXXXXOOOXOOXOOOOOOOOOXOOOOXOOOOOXXOXOOOXOXXXXOXOOOOXOXXXOOXOXOOOOOOXOXOOXOXOOOXXOXXXOOXOXOXOOXOXOOOOXOOOXXOOOXXXOXOOXOOXOOXXOXOOXXXOOOOOOXOXOOXOXOOOOOOOOOOOXOOOOOOOOXXXOOXOXXXXOOOXOXOXXOXOOOOOXXOXOOXXXOOOOXOXOXOXXOOOXXOOOXXOOOXOOOOXOOOXOXOOXOXOOOOXOXOOOOXOXXXOXXXXOXXOXXOOXOOOXXOO...

output:

1

result:

ok single line: '1'

Test #114:

score: 0
Accepted
time: 58ms
memory: 37208kb

input:

1000 14
XOXOOOXOXOOXOXXXXOOOXOOXOOOOOOOOOXOOOOXOOOOOXXOXOOOXOXXXXOXOOOOXOXXXOOXOXOOOOOOXOXOOXOXOOOXXOXXXOOXOXOXOOXOXOOOOXOOOXXOOOXXXOXOOXOOXOOXXOXOOXXXOOOOOOXOXOOXOXOOOOOOOOOOOXOOOOOOOOXXXOOXOXXXXOOOXOXOXXOXOOOOOXXOXOOXXXOOOOXOXOXOXXOOOXXOOOXXOOOXOOOOXOOOXOXOOXOXOOOOXOXOOOOXOXXXOXXXXOXXOXXOOXOOOXXOO...

output:

0

result:

ok single line: '0'

Test #115:

score: 0
Accepted
time: 64ms
memory: 39544kb

input:

1000 15
XOXXXXXXXOXXOXXXOOOOOXXOXXXOOXOXXOXXXOXOXXOOXOXXXOOOOOOOXXOXXOOXXOXOXXOXXXXXOXXOXOOXXXXXXOXOOXXOOOXOXOOXOOOOXOOXXOOXXXXOXOXOXOOOXXOXXXOXOOXOXXXXXXXOOXXXXXOOXOOOOOOXOXOXOOOOOOOOXOOXXXOXXXXXXXOOOXOOOXXXXOOXOXXOOOOOOXOOXXXOXOOOOOOOOOXXOXXXXXXXOOOXXOXXOXXXOXOOOXOOXXOXXOXOOXOXOOOXXXOOOOOXXOXOOOXO...

output:

0

result:

ok single line: '0'

Test #116:

score: 0
Accepted
time: 60ms
memory: 39564kb

input:

1000 15
XOOOXOXOOOXXOXXXOOXOOXXXOXOXXXXOOOXXOXOOOOOXXOXXOOXXXXXOOOOXOXOOXOOXXXXOOOOOXXOOXOXXOXXXOOXXXOXXXOOOXOOOOOXOXOXOXXXOOOOOOXXOXOXOXXXOXXXOOOOXXXXOOOXXOOOXOXXXOXOOOOXXXOOXOOOXOXXOXXOOXXOOOOOXXOXOXXOXXXOXXXOXOXXXXOXXXXXOXXXXXOOOXXXXOOXXOOXXOXOOXXOXXOXXXXOOXXXXOXXXOXOOOOXXOXXOXXXOOXOXXOOOXOOXOOXX...

output:

1

result:

ok single line: '1'

Test #117:

score: 0
Accepted
time: 64ms
memory: 39636kb

input:

1000 15
XOOOXOXOOOXXOXXXOOXOOXXXOXOXXXXOOOXXOXOOOOOXXOXXOOXXXXXOOOOXOXOOXOOXXXXOOOOOXXOOXOXXOXXXOOXXXOXXXOOOXOOOOOXOXOXOXXXOOOOOOXXOXOXOXXXOXXXOOOOXXXXOOOXXOOOXOXXXOXOOOOXXXOOXOOOXOXXOXXOOXXOOOOOXXOXOXXOXXXOXXXOXOXXXXOXXXXXOXXXXXOOOXXXXOOXXOOXXOXOOXXOXXOXXXXOOXXXXOXXXOXOOOOXXOXXOXXXOOXOXXOOOXOOXOOXX...

output:

0

result:

ok single line: '0'

Test #118:

score: 0
Accepted
time: 64ms
memory: 25564kb

input:

1000 16
XOOXOXXXXXXOXXXXOXXXOXOXXOXOOOOXOXOXXXXXXOOXOXXXXXXXXXXXXOXXOXXOXXXXXOOXXXOXXXXXXXXXXXOXOXXXXXXXOXXXOXXOXXXXXOXOXXXXXXXXOXXXXOOXXXXXOXXXOXXOXXOOXXXXXXXOXOXOXXOXXXXXXXXXOXXXXOXXXXXXXOXXXXXXXOXOXXOXOXOXXXXXXOXXXXXXOXXXXOXXXXXXXXOXOXXXXXXOXXOXXOXXXXXXXOXXXXXXOXXXXXOXXXXXXXXOXXXXOXXXXXXXXOXXXXXX...

output:

0

result:

ok single line: '0'

Test #119:

score: 0
Accepted
time: 62ms
memory: 25720kb

input:

1000 16
XXXOOXOOXOXXXXOXXXOOOOOOXXOXXOXXOXXOOOOOXXXXXOXOOXXOOXXOXOOXOOXXOXXOOOXOOOXXOOXXXXXOXOOXXOXXOXXOOXXOOOOOOOXXOXOXOXXOXOOOOOXOOOOOOXXOOOOXXXXOOOOXOXXOOOOOOOXXOXXXOXXOOXOOXOXXOXXOOXOOXOXOXOXXOXXXOXXOXOOOXXXXOOXXOXOOXOOOXOXOOOOXOOXOOOOOXXXXOOXXXXXOOOXOXOXXOOXOOXXOXOOOXOXXOXXXOXXOOOOOXOOOXXOXOXXO...

output:

1

result:

ok single line: '1'

Test #120:

score: 0
Accepted
time: 61ms
memory: 25640kb

input:

1000 16
XXXOOXOOXOXXXXOXXXOOOOOOXXOXXOXXOXXOOOOOXXXXXOXOOXXOOXXOXOOXOOXXOXXOOOXOOOXXOOXXXXXOXOOXXOXXOXXOOXXOOOOOOOXXOXOXOXXOXOOOOOXOOOOOOXXOOOOXXXXOOOOXOXXOOOOOOOXXOXXXOXXOOXOOXOXXOXXOOXOOXOXOXOXXOXXXOXXOXOOOXXXXOOXXOXOOXOOOXOXOOOOXOOXOOOOOXXXXOOXXXXXOOOXOXOXXOOXOOXXOXOOOXOXXOXXXOXXOOOOOXOOOXXOXOXXO...

output:

0

result:

ok single line: '0'

Test #121:

score: 0
Accepted
time: 56ms
memory: 26952kb

input:

1000 17
OOOOOXOXOOOOOOXOOXXOOOOOOOOOXOOOXOOOOOOOOOOOOOOOOOOOOOXOXOOXOOOXOOOXOOOOOXOOOXOOOOOOOOOOXOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOXXOOOOXOOOOOOXXXOOOOXOOOOOOOOXXXOXOOXXOOOOOOOOOOOOXOOOOOOOXXOOOOOOOOOOOOOOOXOOXOOOXOOOOXOOOOXOOOOXXOOOOOOOOOXXXOOOXOOXOOOOXOOOOOOOOOOXOOOOOXOXOOOOOOXOXXOOOOOXOXXOXXOOOOXO...

output:

0

result:

ok single line: '0'

Test #122:

score: 0
Accepted
time: 52ms
memory: 27036kb

input:

1000 17
OOXXOOOXXXOOOOXOXOOOOOOOXOXOOOOXOXOOOXOXOXXXOOXOXOOOOOOOXOXOOOOOOXOXOOOXOOOXXXOOOOXOXOOOOOOOXOXOOOOXOXOOOXXOOXOOOOOOXOOXXOOOOXXOXOOOOXXOXOXOOXXXOXOOOOXOXOOXOOOOXOXXXOOXOXOOOOOOOXOXXOOXXOXXOOOOXOXOXXOOOXXOOOOOOOOXOOXXOOXXXOXOOOOXXOXOOOOXOXXOOOOOXXXXOOOOXXXXXOOOOOOOOXOXXXOXOXOOXOOXOXOOXOXOXXOX...

output:

1

result:

ok single line: '1'

Test #123:

score: 0
Accepted
time: 64ms
memory: 26948kb

input:

1000 17
OOXXOOOXXXOOOOXOXOOOOOOOXOXOOOOXOXOOOXOXOXXXOOXOXOOOOOOOXOXOOOOOOXOXOOOXOOOXXXOOOOXOXOOOOOOOXOXOOOOXOXOOOXXOOXOOOOOOXOOXXOOOOXXOXOOOOXXOXOXOOXXXOXOOOOXOXOOXOOOOXOXXXOOXOXOOOOOOOXOXXOOXXOXXOOOOXOXOXXOOOXXOOOOOOOOXOOXXOOXXXOXOOOOXXOXOOOOXOXXOOOOOXXXXOOOOXXXXXOOOOOOOOXOXXXOXOXOOXOOXOXOOXOXOXXOX...

output:

0

result:

ok single line: '0'

Test #124:

score: 0
Accepted
time: 51ms
memory: 28112kb

input:

1000 18
XOXOXXXXOXXXXXOXOOOXXXXXOOOOXOOXOXXXXXXOOXXOXXOOOXOOXXOOXOXXOXOOXXOOOOXXXOXXOXXXOOOXXOOXOXOXXXOXXOOOOOXXXXOXXOOOXXXOXOXXXOXOXOOXXOXOXXOXOXOOOXOXOXXXXOXOOOXOXXXXOXOXOOXOOXXXXOOXXXOXXOXXOXOOOXOOXOOXXXXOXXXOOXOOXOOOXOXXXOXXOOOXXOOXOOOXXOOXOOXXOOXOOOXOXOOOOOXXOXXXXXOXXOXOXOOXOOXOXOOXXXOXXXOXOXOO...

output:

0

result:

ok single line: '0'

Test #125:

score: 0
Accepted
time: 63ms
memory: 28204kb

input:

1000 18
XXOOXOOXOXOOOOXXXOOOOXOOOOXXXXOXXOXOXXOXXOXXOOOOOOXOXOOXOOOOOXOOXOXOXXOOXOOOOOOOOOXXXXOXOOOXXXXOOOXOOOXOOOXXXOOXXXOXOXXOOOXXOOXOOOXXOOOOOXXXOXOOXOXXXXXXXXOXOXOXOOOXOOOOXOOXXXXOXXXOOXOOXXXXOOOXOOOOXOOXOOOXXXXOXOOOXXXXXOXXXOXOXOXXXOOOOXXXOOOOOXXXXOXOOOXXXOXXXXOOOXOOOXOXOOXOXXXOXOOXOOXOOXXXXOOX...

output:

1

result:

ok single line: '1'

Test #126:

score: 0
Accepted
time: 56ms
memory: 28068kb

input:

1000 18
XXOOXOOXOXOOOOXXXOOOOXOOOOXXXXOXXOXOXXOXXOXXOOOOOOXOXOOXOOOOOXOOXOXOXXOOXOOOOOOOOOXXXXOXOOOXXXXOOOXOOOXOOOXXXOOXXXOXOXXOOOXXOOXOOOXXOOOOOXXXOXOOXOXXXXXXXXOXOXOXOOOXOOOOXOOXXXXOXXXOOXOOXXXXOOOXOOOOXOOXOOOXXXXOXOOOXXXXXOXXXOXOXOXXXOOOOXXXOOOOOXXXXOXOOOXXXOXXXXOOOXOOOXOXOOXOXXXOXOOXOOXOOXXXXOOX...

output:

0

result:

ok single line: '0'

Test #127:

score: 0
Accepted
time: 58ms
memory: 29360kb

input:

1000 19
XOOXXOXXXXXXOXXXXXXXXXXXXXOXXOXXXXXXXXXXXOXOXXXXXXXXXXXXXXXXXXOOOXXXXXXOXOXXXXXOXXXXXXXXXXXXXXXOXXXXXXXXXXXXXOXXXOXXXXXXOOXXOOOXXXOXXXXXOXXXOXXXXXXXXXXXXXXOXXXXXXOOXXOOXXXXOXXXXOXXXXXXXOXXXXXXOXXXXXXXXOXXXXXOXXXOXXXXXXXXXXXOXXOOOOXXXXXXXOXXXXOXOXXXXXXXXOOXXXXXXXXXOXXXXOOOXXXXXOXXOOXXXXOXXXXX...

output:

0

result:

ok single line: '0'

Test #128:

score: 0
Accepted
time: 55ms
memory: 29300kb

input:

1000 19
XXXOOOXOOOOOOXXOOOOOXOXOXXOOOOOOXOOOOOOXOOOXOXOOOOOXXOXOOOXOXOOXOOOOOOXOOOOOXXOOOOXOOOOOOXXOOOXOXOOOOOXOOXXXXOOXOOOXOXOOXXOOOOOXOOOOOOXOXOOXOOOXXOXXXOOOOOOOOOOOOOOOOXXOOOOOXXOOOXOOOOXOXOOOXOOXXOOOXOOOOOOXXOOXXXOOOOOXOOXOOOXXOXOOOXOOOOOXOOOOOXOOOXOOXOXXXXOOOOXOXXXOOOOOOOOOXXOOOOXXOOOOOXXXOXOX...

output:

1

result:

ok single line: '1'

Test #129:

score: 0
Accepted
time: 67ms
memory: 29444kb

input:

1000 19
XXXOOOXOOOOOOXXOOOOOXOXOXXOOOOOOXOOOOOOXOOOXOXOOOOOXXOXOOOXOXOOXOOOOOOXOOOOOXXOOOOXOOOOOOXXOOOXOXOOOOOXOOXXXXOOXOOOXOXOOXXOOOOOXOOOOOOXOXOOXOOOXXOXXXOOOOOOOOOOOOOOOOXXOOOOOXXOOOXOOOOXOXOOOXOOXXOOOXOOOOOOXXOOXXXOOOOOXOOXOOOXXOXOOOXOOOOOXOOOOOXOOOXOOXOXXXXOOOOXOXXXOOOOOOOOOXXOOOOXXOOOOOXXXOXOX...

output:

0

result:

ok single line: '0'

Test #130:

score: 0
Accepted
time: 51ms
memory: 30640kb

input:

1000 20
OOOXOOOOOOOXOOOOOXOOOXOOOOOOOOOXOXOOOOOOXOOOOOOOOOXOXXOOOOXXOXOOOOOOXXOOOOOOOXOOOXOXOOOOOOOOOOOOOOXOOOOXOOXOXOOOOOOOOOOOOOXXXOXOXOOOOOOXOOXOOXOOOOOXOOOOOOOOOOOOOOOOOXOOOXOXOOXOXOOOOOOXOOXOOOXOOXOXOOOOOXOOXOXOOOOOOOOOOOOOXOOOOXXOOOOOOOOOOXOOOOXOOOOXOOOOOOXXOOOXXXOOOXOOOOOXXOOXOXOOXOXOOOOOXOXO...

output:

0

result:

ok single line: '0'

Test #131:

score: 0
Accepted
time: 69ms
memory: 30780kb

input:

1000 20
OXOOOXOOXOXOOOOXXOOOXOOOOOOOOOXOXXOOOOXXOXOOOOOOXXOOOOOOOXOOOXOXOOOOOOOOOOOOOOXOOOOXOOXOXOOOOOOOOOOOOOXXXOXOXOOOOOOXOOXOOXOOOOOXOOOOOOOOOOOOOOOOOXOOOXOXOOXOXOOOOOOXOOXOOOXOOXOXOOOOOXOOXOXOOOOOOOOOOOOOXOOOOXXOOOOOOOOOOXOOOOXOOOOXOOOOOOXXOOOXXXOOOXOOOOOXXOOXOXOOXOXOOOOOXOXOOXXOOOOXOXOOOOOOOOOO...

output:

1

result:

ok single line: '1'

Test #132:

score: 0
Accepted
time: 63ms
memory: 30736kb

input:

1000 20
OXOOOXOOXOXOOOOXXOOOXOOOOOOOOOXOXXOOOOXXOXOOOOOOXXOOOOOOOXOOOXOXOOOOOOOOOOOOOOXOOOOXOOXOXOOOOOOOOOOOOOXXXOXOXOOOOOOXOOXOOXOOOOOXOOOOOOOOOOOOOOOOOXOOOXOXOOXOXOOOOOOXOOXOOOXOOXOXOOOOOXOOXOXOOOOOOOOOOOOOXOOOOXXOOOOOOOOOOXOOOOXOOOOXOOOOOOXXOOOXXXOOOXOOOOOXXOOXOXOOXOXOOOOOXOXOOXXOOOOXOXOOOOOOOOOO...

output:

0

result:

ok single line: '0'

Test #133:

score: 0
Accepted
time: 65ms
memory: 32064kb

input:

1000 21
OXXXXOOXOOOOOXXXXOXOXXXXXOOXXXOXXXXXXXOOOXOOOOXXXOXOOOXXXXOXOOOOXXXXXOOOOXXOOXOOOXOOOOXOXOXOOOXXOOOXXOXOOXXOOOXXXXXXXOXOOOXOOOXXXXOOOXXXOOOOOXXXXOXXXOXOOOXXXOXOXOOOOXOOOXOXXOXOOXXXXOOXOXXOOOXOXXOOXXOXOOOXOXXXOOXXOOOXXOXOOXOXOOXOOXOXXXOOOXOXXXOOOXXXOXOOOOOXOXOXOXXOOXXOOXOOOXOOOOXXOOOXXXXOOOOO...

output:

0

result:

ok single line: '0'

Test #134:

score: 0
Accepted
time: 76ms
memory: 32060kb

input:

1000 21
XOXXOOXOXXOOXXOXOOOOXOXXOXXXXOXXXOXOXXOXOOOOOXXXOXXXOOXOOOXXOOOOXOOXOXXXXOOXOXXOXOOOXOXOOXXOOOOOXXXOXOXOOXOOXOOOOOOXXXOXXOOOOXXOXXOOOOOOXOXXXOXXOOOOOXXXOXXXOOOOOXXXOOOOOOXXXOOOOXOXXOOOOOOOOXOXOOXXXOXXOXXXOOXXXOXOOOOOXXOOOXXOOXOXOOOOXXXOXOOXOOXXXOOXOXOOXXXOOXXXXXOOOXXOXXXXXOXXXXOXXOOOXOXOXXOX...

output:

1

result:

ok single line: '1'

Test #135:

score: 0
Accepted
time: 66ms
memory: 31924kb

input:

1000 21
XOXXOOXOXXOOXXOXOOOOXOXXOXXXXOXXXOXOXXOXOOOOOXXXOXXXOOXOOOXXOOOOXOOXOXXXXOOXOXXOXOOOXOXOOXXOOOOOXXXOXOXOOXOOXOOOOOOXXXOXXOOOOXXOXXOOOOOOXOXXXOXXOOOOOXXXOXXXOOOOOXXXOOOOOOXXXOOOOXOXXOOOOOOOOXOXOOXXXOXXOXXXOOXXXOXOOOOOXXOOOXXOOXOXOOOOXXXOXOOXOOXXXOOXOXOOXXXOOXXXXXOOOXXOXXXXXOXXXXOXXOOOXOXOXXOX...

output:

0

result:

ok single line: '0'

Test #136:

score: 0
Accepted
time: 73ms
memory: 33008kb

input:

1000 22
XXXXXXXXXXXXXXXOXXOXXXXXXXXXXXXOXXXXXXXXXXOXXXXXOOXXXOXXXOXXXXXXOXXXXOOXXXOXXXXXXXXXOXOXXXXOXOXXXXXXOOXOXOXXOXXXXXXXXXOXXXXXXOXOXXXOXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXOXXXXXOXOXXOXXXXXXXXXOOXXXXXXXXXXXXXXXXXXOXOXXXXXXXXXXXXXXOXXXOXXXOXXXXXXXXXXXXXXOXOXXXXXXOXXXXXXOXXXOXOXXXXXXXXXXXOXXXXXXXXXXXXXX...

output:

0

result:

ok single line: '0'

Test #137:

score: 0
Accepted
time: 61ms
memory: 33004kb

input:

1000 22
OOOOOOOXOXOOOOOXOOOOOXOOOOXXOOOOOOOXOOOOOOXXOOOXXOOOXXOOOOOOOOXOXXOOOXOXOOOXOOXXOXOXOOXXOOOOOOOOXXOOOOOXOXOOOOOOOOOOOOOXOOOOOOXOOOOXOOOOOOOOXXOOOOXOXOOXOXOOOOOOOXXXOOOOOOOOOOOXOOOOOXOXOXOOOOOOOOOOOXXOOOXOOOXXOOOOOOOOOOOXOXOXOOOOOXXOOOOOOXOOOOOXOOOOOOOXOOOXOOOOOOOXOOOOOOOOOXOXOOOOOOOOOXOOXOOX...

output:

1

result:

ok single line: '1'

Test #138:

score: 0
Accepted
time: 61ms
memory: 33016kb

input:

1000 22
OOOOOOOXOXOOOOOXOOOOOXOOOOXXOOOOOOOXOOOOOOXXOOOXXOOOXXOOOOOOOOXOXXOOOXOXOOOXOOXXOXOXOOXXOOOOOOOOXXOOOOOXOXOOOOOOOOOOOOOXOOOOOOXOOOOXOOOOOOOOXXOOOOXOXOOXOXOOOOOOOXXXOOOOOOOOOOOXOOOOOXOXOXOOOOOOOOOOOXXOOOXOOOXXOOOOOOOOOOOXOXOXOOOOOXXOOOOOOXOOOOOXOOOOOOOXOOOXOOOOOOOXOOOOOOOOOXOXOOOOOOOOOXOOXOOX...

output:

0

result:

ok single line: '0'

Test #139:

score: 0
Accepted
time: 95ms
memory: 41344kb

input:

1000 50
XOOOOXOOOOOOOXOOOOOOOOOOOOOXOOOOXOXXXOOOXOOOOOOOXOOOOXOOOOXOXOXOOXOOXXOOOXOXOOOOXXOOOXOOOXOOOXXOOOOXOOOOOOOOOOOOOOOOOOXOOOOXOOOOOXOOOOOOOOOOXOOOOOOXOOOOOOOOOOOXOXOOOOOOXOOOOOOOOOOOOOOOOOOOOXOOOXXOOOOOOXOOOOOXOOOOOOXOOOOOOOOOOXOOOOOOOOOOOOOOOOXOOOOOOOOXOOOOOOOOOOXOXOOOOOOXOXOOOOXXOOOOOOOOOOOX...

output:

0

result:

ok single line: '0'

Test #140:

score: 0
Accepted
time: 80ms
memory: 41344kb

input:

1000 50
XOXOOOXOOOOOOXOOXOXOXOOOXOXOOXXXXOOOXXOOOOXOXOXXOXXOOOOOOOOOOOOOOOXXOOXOOXXOOOOOXXOOXOOOOOOOOOOOOOOOXOOOOOOOOXOXOOOOXXOOXOOOXOOOOXXXOOXOOOOXXOOXXOOXOOXXOOOOOXOOOOOOXOXXXOXOOOXXOOOXXXOOXOOOOOXOXOOOOXOOXXOOOOOOOOOOXOXOXXXOXXOXXOOOXOXXOOXOOOOOXXXOOOOXXOXOOOXXOOOOXOOXOOXXXOXOOOXOXXXXOXOOOXOOOOXO...

output:

1

result:

ok single line: '1'

Test #141:

score: 0
Accepted
time: 70ms
memory: 41416kb

input:

1000 50
XOXOOOXOOOOOOXOOXOXOXOOOXOXOOXXXXOOOXXOOOOXOXOXXOXXOOOOOOOOOOOOOOOXXOOXOOXXOOOOOXXOOXOOOOOOOOOOOOOOOXOOOOOOOOXOXOOOOXXOOXOOOXOOOOXXXOOXOOOOXXOOXXOOXOOXXOOOOOXOOOOOOXOXXXOXOOOXXOOOXXXOOXOOOOOXOXOOOOXOOXXOOOOOOOOOOXOXOXXXOXXOXXOOOXOXXOOXOOOOOXXXOOOOXXOXOOOXXOOOOXOOXOOXXXOXOOOXOXXXXOXOOOXOOOOXO...

output:

0

result:

ok single line: '0'

Test #142:

score: 0
Accepted
time: 92ms
memory: 42112kb

input:

1000 51
XOXXOOOOXOOXOXOXOOOXXXOXOXXOXXXXOOXXOOOOOXXXOOOOOXOXOOXOOXOXOXXOXXXXXXXOXXXXOXXXXXXXOXXOOOOOOXXXOOXOXOOXOXOXOOOXOOOOOXOXOXOOOXXXXOOXXOXOOXXOXXXXXOOXXXOXOXXOXOOXOOXOOOOOXXOOXOOXXXOOOXOOOOOOXOOOXOXOOXXOOOXOOOXXXXOOOOXXXOOXXOOXOOOXOOXXXXXOXOOXXXOOOXOOXXXOOXOOOXOOXOXOOXXOOOXOXOXXXOXOOXXXXXOOXOXO...

output:

0

result:

ok single line: '0'

Test #143:

score: 0
Accepted
time: 87ms
memory: 42084kb

input:

1000 51
XOOOXXXXOXOXXXOOOOOOXOOOXXOXXXXXOOOXOOXOOOXXOOXOOXXXOOXXXOOOXXOOXXOOOOXOXOXXXXXOXXXOXXOOXXOOOXXOXXOOOXOOOXXOXOOXXOOXXOXXOXOXXXXOOXXOOXXXXOXXOOXOOXXXOXOOXXXXXOXOOOOOXXXXOXXOXOXOXOOXOXXXXOXXOOOOXXOOXXXXXOOXXXXOXXOXOOOXOXXOOOOXXOOXOOXOXXXXXOXOXXOXXXOXOXOOXXXXOXOOOXOOXOOOOOXXXOOXOOOOOXXOXOOXXOOX...

output:

1

result:

ok single line: '1'

Test #144:

score: 0
Accepted
time: 84ms
memory: 42200kb

input:

1000 51
XOOOXXXXOXOXXXOOOOOOXOOOXXOXXXXXOOOXOOXOOOXXOOXOOXXXOOXXXOOOXXOOXXOOOOXOXOXXXXXOXXXOXXOOXXOOOXXOXXOOOXOOOXXOXOOXXOOXXOXXOXOXXXXOOXXOOXXXXOXXOOXOOXXXOXOOXXXXXOXOOOOOXXXXOXXOXOXOXOOXOXXXXOXXOOOOXXOOXXXXXOOXXXXOXXOXOOOXOXXOOOOXXOOXOOXOXXXXXOXOXXOXXXOXOXOOXXXXOXOOOXOOXOOOOOXXXOOXOOOOOXXOXOOXXOOX...

output:

0

result:

ok single line: '0'

Test #145:

score: 0
Accepted
time: 93ms
memory: 42852kb

input:

1000 52
XXOXXOXXXXXOXXXXXXXOXXXXXXXXXXXXXOXXOXXXXOXXXXOXXXXOXXXOXOXXXOXXXXXXXXXXOXXXXXXXXXXOXXXXXXXXOXXOOXXOXXXXXOXXXXOXXXXXXOXOXXXXXXXXXOXXOXOOXXXXXXXOXXXXOXXXXXXXXOXXXOXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXOOXXXXOOXXXXXXXXOXXOXXXXXXXXXOOOXOOOOXXXXXXOOXXXXXXXXXOXXXOXXXXXXXXXOXXXXXXOOXXXXXOXOXOXXXXXXXXOXXX...

output:

0

result:

ok single line: '0'

Test #146:

score: 0
Accepted
time: 85ms
memory: 42836kb

input:

1000 52
OXXOOXOOOXOOOOOOXOXOXOOXOXOXXOXOOOOOXOOOOXOOOOXXXXOOOOOOOOXOOOOOOXOXOOXOOOOXOXOOXOXXOOOOXOOXOOOOXOXOXOOOOOOOOXOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOXXXOOOOXXOXOXOOOOOOOXOOOOOOOOOXXXOOXXXOXOOOOXXOOOOOOXOOXOOOXOOXOXOOOOOOOOOOOXXOOOOOXOXXXOOOXOOOOXOOOOXOOXOXOOOXOOOXOXOOXOOOOOOOOOOOOOOOOOOXOOOOXOOOOOOOO...

output:

1

result:

ok single line: '1'

Test #147:

score: 0
Accepted
time: 79ms
memory: 43012kb

input:

1000 52
OXXOOXOOOXOOOOOOXOXOXOOXOXOXXOXOOOOOXOOOOXOOOOXXXXOOOOOOOOXOOOOOOXOXOOXOOOOXOXOOXOXXOOOOXOOXOOOOXOXOXOOOOOOOOXOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOXXXOOOOXXOXOXOOOOOOOXOOOOOOOOOXXXOOXXXOXOOOOXXOOOOOOXOOXOOOXOOXOXOOOOOOOOOOOXXOOOOOXOXXXOOOXOOOOXOOOOXOOXOXOOOXOOOXOXOOXOOOOOOOOOOOOOOOOOOXOOOOXOOOOOOOO...

output:

0

result:

ok single line: '0'

Test #148:

score: 0
Accepted
time: 121ms
memory: 41012kb

input:

1000 77
OXXOOOXOOOOOOOXOOOOXOXXOOOOOXOOXOOXOOXOOOOOOOOOOOOXOOOXXOOOOOOOXOXOOOOOXXOXOOOXOOOOOXOOXOXOOOOOOOOOOOOOOOOXOXOOXOXOOOOOOXOOOOOOOOOOOXXOOXOXXOOOOOXOXOOOXOXOOOOOOOOOOOOOOOOOOXXOOOOOOOXOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOXOXOXXOOOOOOOOOOOOOOXOOOOOOOOOOOXOXOOOOOXOXXOOOXOXOOOXOOOXOOOOOXXOXOXXOXOOXOOOOO...

output:

0

result:

ok single line: '0'

Test #149:

score: 0
Accepted
time: 108ms
memory: 40724kb

input:

1000 77
XXOXOOOXOXXXOOXXOXXOOOOOOXOOOOOXXOOXXXOXOOXXXOOOOOOOOXXXXOOOXOOOOOOOXOOOXXOXXOXOXOOOXOOOXOOXOOXXXOOOOOXOOOOOOOOOOXXOXOOXOOOOOXOOOOXXOOOXOOOXXOOXOXXOOOOOOOOOOXOOOXOOOXOXXXOXOOOXOXXXOXXOXOOOXOXXXXOOXOXXOXOXXOXXXXOOOOXOOXOOOOXXOOOOXOOXXOXXOOXOOOXOOOOOXOOOOXOOXOXXOOOXOXOOXOXOOXOXOOOOXOOOXXOXOOOX...

output:

1

result:

ok single line: '1'

Test #150:

score: 0
Accepted
time: 96ms
memory: 41000kb

input:

1000 77
XXOXOOOXOXXXOOXXOXXOOOOOOXOOOOOXXOOXXXOXOOXXXOOOOOOOOXXXXOOOXOOOOOOOXOOOXXOXXOXOXOOOXOOOXOOXOOXXXOOOOOXOOOOOOOOOOXXOXOOXOOOOOXOOOOXXOOOXOOOXXOOXOXXOOOOOOOOOOXOOOXOOOXOXXXOXOOOXOXXXOXXOXOOOXOXXXXOOXOXXOXOXXOXXXXOOOOXOOXOOOOXXOOOOXOOXXOXXOOXOOOXOOOOOXOOOOXOOXOXXOOOXOXOOXOXOOXOXOOOOXOOOXXOXOOOX...

output:

0

result:

ok single line: '0'

Test #151:

score: 0
Accepted
time: 104ms
memory: 41392kb

input:

1000 78
OXOXOOXXXXOXOOOXXXXOOXOXOXXXXOOOXOOOXXXOOOXXXXXOXXXXOXOOXXXOOOOXOXOOOOXOXOOXOOXOOOOXOOOXOOXOXXXOOXXXXXXOOOXOXXOOXOXXOXOXOOOXXOOXOXOOXXXXOOOXXOOOOXXXOXOOXOOXOOOXOXXXOOXOXXOOXXOOXXXXXOXOXXOOXXOXXOXOOOXOOXXOXOOXOXXOXOXXOOXOOOXXOOOOOOOOXXXXOXXOXXXXXOOOXOXOXXOXOXOXXXXOOOXXOXXXOXXOOOXOOOOXXXXOXOXO...

output:

0

result:

ok single line: '0'

Test #152:

score: 0
Accepted
time: 103ms
memory: 41472kb

input:

1000 78
XXOOOXOXOXXXXOXOXOOXOOOXOOXOOXOXXOOXXXOXOXOXOXOXXOOXOXOOXOXXOXXXXOOOOXXOXOXOXXOOOOXXXXXXXOXOXOOXXXXOOOOXXOOOOOXXOOOOXXOOXOOOOXXXXOOOOOOXXXOOOOOOOOOOXOOXOOOXXXOOOOXXOOXOOXOOOOOOOOXOXOXXOXOOXXOOOXOOXOOOXXXXOOOOXXOOOXXOOOXXXOOOOXOOOOXXOOXXOOXXOOOOXXXOXOXXXOOOOXXXOXXXOXXOXOXOOXOXXOOXXXOOXXOOXOOX...

output:

1

result:

ok single line: '1'

Test #153:

score: 0
Accepted
time: 99ms
memory: 41256kb

input:

1000 78
XXOOOXOXOXXXXOXOXOOXOOOXOOXOOXOXXOOXXXOXOXOXOXOXXOOXOXOOXOXXOXXXXOOOOXXOXOXOXXOOOOXXXXXXXOXOXOOXXXXOOOOXXOOOOOXXOOOOXXOOXOOOOXXXXOOOOOOXXXOOOOOOOOOOXOOXOOOXXXOOOOXXOOXOOXOOOOOOOOXOXOXXOXOOXXOOOXOOXOOOXXXXOOOOXXOOOXXOOOXXXOOOOXOOOOXXOOXXOOXXOOOOXXXOXOXXXOOOOXXXOXXXOXXOXOXOOXOXXOOXXXOOXXOOXOOX...

output:

0

result:

ok single line: '0'

Test #154:

score: 0
Accepted
time: 115ms
memory: 41956kb

input:

1000 79
OXXXXXXXXXOOXXXXXOOXXXOXXXXXXXXOXXOOXOXXXXXXXXXXXXXXXXXOXOOXXXXOXXOXXXXXOXXXXXXXOXXOOOXXXXOOXXXXOXXXOXOXXXXXXXOXOXXXOXXXXOXOOXOOOXXXOOXXXXXXXXXXXXXXXXXXOXXXXXXXXOXXXXOOXXXOOXXXXXXXXXXXXOXXOOXXXXXXXOOOOOXXOXXXOOXOXXXXXXXXXXXXXXXXXOXXXXOXXXXXXXOXOXOOOXXXXXXXXXXOXXXOXOOXXXXOXXOXXXXXXXXOXXXXOXOX...

output:

0

result:

ok single line: '0'

Test #155:

score: 0
Accepted
time: 120ms
memory: 41868kb

input:

1000 79
XOOOOOOOXXOXOOOXOOXOOOOOOOOXXXOXOXOOXOOOXXOOOOOOXOXXOOOXXOXOXXXOXOOOOOOOOOOOXOOXOOXOXOOXOOXOXXOOXOOOOOOOOOXOXXXOXOOXOOXOXOXOXXOXOOOOXOXXOXOOOXXXOXOOOOXOOOOOOOXOOOOOOXOOXOOOOOOXOOOOXOOOXOXOOOOXXOXXOOXOXOOXXOXOXOOXOOXOOXXOXXXOXOOOOXXOXXXOXXOOOOXOXOXOXOXOOOXXXOOOOOOOOOOOOOXOOXOOOOOOOOXOOXOOXOOO...

output:

1

result:

ok single line: '1'

Test #156:

score: 0
Accepted
time: 110ms
memory: 41728kb

input:

1000 79
XOOOOOOOXXOXOOOXOOXOOOOOOOOXXXOXOXOOXOOOXXOOOOOOXOXXOOOXXOXOXXXOXOOOOOOOOOOOXOOXOOXOXOOXOOXOXXOOXOOOOOOOOOXOXXXOXOOXOOXOXOXOXXOXOOOOXOXXOXOOOXXXOXOOOOXOOOOOOOXOOOOOOXOOXOOOOOOXOOOOXOOOXOXOOOOXXOXXOOXOXOOXXOXOXOOXOOXOOXXOXXXOXOOOOXXOXXXOXXOOOOXOXOXOXOXOOOXXXOOOOOOOOOOOOOXOOXOOOOOOOOXOOXOOXOOO...

output:

0

result:

ok single line: '0'

Test #157:

score: 0
Accepted
time: 153ms
memory: 50528kb

input:

1000 98
OOOOOOOXOOOOOOOOOOOXOOXOOOXOOXOOOOOOOOOOOXOOOOOOOOOXOOXOOOOOOOOOOOOOOOOXXXOOOXOOOOXOOOOOOOOOOXOOOXXXXOXOOOOXOXOOOOXOOOOXXOOOXXOXOOOOOXOOOOXOOOOOXOOOOXOOOOOOXOOOOXOOOOOOOOXOXOOOOOOOOXXXOOOOXOOOOOOXOOXOOOOOOOOOOOOOOOOOOXOOXOOOOOOOOOOXXOOOOOXXOOXOOOOOOOOOOOOXOOOXXOXXOOOOXOOXOXXOOOOOOOOOOOOOXXOO...

output:

0

result:

ok single line: '0'

Test #158:

score: 0
Accepted
time: 139ms
memory: 50468kb

input:

1000 98
OOOXOOOOOXOXOXXOOOOOXOOOOXOXOOOOOOOXOOXOOXOOOOXOXOXXOXXOOXOXXOOXOOXOOXOOXOXOOOXOXOOOOXXOOOXOOOXOOXOOXOOOOOOOOXOXOOOOOOOXOOXOOXOOOOOOOXOOOOOXXXOOXOOXXXOOOOOXOXXOXXXOXXOXOOOOOXOXOOOOOOOXXOOOOXXXXOOOXOOXOOOOOOOXOXOOOXXOOXXOOXOOOOXOOXOOXOXOOXOXOOOOXXXXXXOOOXXOOOXXXOOXOXOOXXOOOXXOOOOXOXXOOOOXOOXX...

output:

1

result:

ok single line: '1'

Test #159:

score: 0
Accepted
time: 136ms
memory: 50360kb

input:

1000 98
OOOXOOOOOXOXOXXOOOOOXOOOOXOXOOOOOOOXOOXOOXOOOOXOXOXXOXXOOXOXXOOXOOXOOXOOXOXOOOXOXOOOOXXOOOXOOOXOOXOOXOOOOOOOOXOXOOOOOOOXOOXOOXOOOOOOOXOOOOOXXXOOXOOXXXOOOOOXOXXOXXXOXXOXOOOOOXOXOOOOOOOXXOOOOXXXXOOOXOOXOOOOOOOXOXOOOXXOOXXOOXOOOOXOOXOOXOXOOXOXOOOOXXXXXXOOOXXOOOXXXOOXOXOOXXOOOXXOOOOXOXXOOOOXOOXX...

output:

0

result:

ok single line: '0'

Test #160:

score: 0
Accepted
time: 126ms
memory: 51040kb

input:

1000 99
OOXOOOOXXOOOXXXXXOOOOOOXOXXOXXOOOOXXXXOOXOXOOOXOXOOOXOOOXOXXOXOOXOXXXXXOOXXOOXXXOOXXXXXOXXXOOXXOOXOOOOOOOXXOOXOXOXXOXXXOOOOXOXXOXOOXOOOOXOOOOOOXOOXOXOXOOXOXXOOXOOXXXOOXXOXOXXXXXOXOOOOOOXOXOOXOXXOOOOOXOOOOOOOXXXXOXXOXXOOOOXXXOXXXOOOXXOXOXOOXXXOOOXXXXXOXOXXXXOOXOXXXXOXXXOOOOOOXXOXOXOXOOOOXOOOX...

output:

0

result:

ok single line: '0'

Test #161:

score: 0
Accepted
time: 132ms
memory: 51048kb

input:

1000 99
OXOXXOOOXOOXXXOOOOOOXXOXXOXOXOXOXOOXXXXOOOOXOXXXXOOOXXXXXXOXOXXXXXOOXOOXOXXXXXXXOOXXXXOOXXOOXXOXOOOOOOOXOXXXXXXXXOXOOOOXXOOOXXXOOOOXOOXXXXXOOOOXXOOXXXXOOOXXOOXOXOOOXXOOXXOOXXXOXOOXXOOOXXXXOOOOXXXXXOOXOOXXOOOXOXOXOXXOXOOOXOOXOOOXXOOOOXOXOOOXXXXXOOOXOXXXXOOOXXOXOOOOOOXXXXXXXXXXXOXOXXXXOOOXOOOO...

output:

1

result:

ok single line: '1'

Test #162:

score: 0
Accepted
time: 125ms
memory: 50944kb

input:

1000 99
OXOXXOOOXOOXXXOOOOOOXXOXXOXOXOXOXOOXXXXOOOOXOXXXXOOOXXXXXXOXOXXXXXOOXOOXOXXXXXXXOOXXXXOOXXOOXXOXOOOOOOOXOXXXXXXXXOXOOOOXXOOOXXXOOOOXOOXXXXXOOOOXXOOXXXXOOOXXOOXOXOOOXXOOXXOOXXXOXOOXXOOOXXXXOOOOXXXXXOOXOOXXOOOXOXOXOXXOXOOOXOOXOOOXXOOOOXOXOOOXXXXXOOOXOXXXXOOOXXOXOOOOOOXXXXXXXXXXXOXOXXXXOOOXOOOO...

output:

0

result:

ok single line: '0'

Test #163:

score: 0
Accepted
time: 132ms
memory: 51496kb

input:

1000 100
XXXXXXOOXOOXXOXXXXXXXXXXOXXOOXXXXXOOXXXXXXOXXOXXXXOXXOXXOXXOXXOXXXXOXXOXXXOXXXXXOXXXXXXOXXXXXXXOXXXXOXXXXXOOXXXXXOXXXXXXXXXXXXXXXXXXOXOXOOXXOXXOXXOOXXXXOXXXXOXXXXXXOOXOXXOOOOXXXXXOXXXXXXXOXXXXXXXXXXXXXXXXOXXXXXXXXXOXOXXOXOXXOOOXXXOXXOXXXXOOOXXOXOXXXOOXXXOXXXOOXXXOXOXXOXXXOXXXXOXOXOXXXOXXXXO...

output:

0

result:

ok single line: '0'

Test #164:

score: 0
Accepted
time: 123ms
memory: 51384kb

input:

1000 100
OOOOXXXOOOOOXXXOOOOOOXXOOXXOXXOXOXOXOXOOXOOXOOOXOOXOOOOOXOOOOOOOOOXXOOXXOOOOXOXOOOOXOOOOOXOOOXOOOOOOOOOXXXOOOOOOXOOOXXOXOOOOXOXOXOXXOXOXOXXXOOOXOXOOOXOOOXXOOOXXOOOXOXXXOOXOXXOOXXOXOXXOOOXOOOXOOOOXXXXOOOOXOXOXOXOOXOXOOOOOOXOXOXXXXOOXXOOXOXOOXOOOOOOXOXXXOXOXOOOOXOOXOXOXOOXOOXOOOOOOOOXOOOXOOXO...

output:

1

result:

ok single line: '1'

Test #165:

score: 0
Accepted
time: 130ms
memory: 51452kb

input:

1000 100
OOOOXXXOOOOOXXXOOOOOOXXOOXXOXXOXOXOXOXOOXOOXOOOXOOXOOOOOXOOOOOOOOOXXOOXXOOOOXOXOOOOXOOOOOXOOOXOOOOOOOOOXXXOOOOOOXOOOXXOXOOOOXOXOXOXXOXOXOXXXOOOXOXOOOXOOOXXOOOXXOOOXOXXXOOXOXXOOXXOXOXXOOOXOOOXOOOOXXXXOOOOXOXOXOXOOXOXOOOOOOXOXOXXXXOOXXOOXOXOOXOOOOOOXOXXXOXOXOOOOXOOXOXOXOOXOOXOOOOOOOOXOOOXOOXO...

output:

0

result:

ok single line: '0'

Test #166:

score: 0
Accepted
time: 178ms
memory: 64964kb

input:

1000 182
OOOOXOOOOXOOXOOOOOOOOOXOXXOOOOOOOXOXOOXXOOOOOOOOOOOOOXXOOOOXOOOOOXOOXOOOXOOOOOOOOOOOOOXOOOOOOOXXOOXOOOOOOOOOOOOXXOOXXXXOXXOOOXOOOOOOOXOOOOOOOXOOXXOOOOOOOOOOXXOOOOXXOOOOOOXOOXOXOOOXOOXOOOOOOXOOOOOOXOOOOOOOXOOXXXXOOOOOOOOXOOOOOOXOOOOOOOOOXOOOXOOOOXXOOXOOOXOOXXXOXOOOXXOOXOOXXXXOOOXXOXOOOOXOOOO...

output:

0

result:

ok single line: '0'

Test #167:

score: 0
Accepted
time: 172ms
memory: 64820kb

input:

1000 182
OOXOXOXOOOOXOOOOXXOOOOOOOOXXOXOOXOXOXOOOOOOXOOOOOXOOOOOXXXOXOOXOOOXOOOXOOOOOOOOOOOOOOXXXOXOXOOXOOOXOOOXXOXOOOXOOOXOOOOXOXOXXXOXOOXXOOOXXOXOOXOOXOXOXOOOOXOOOOOXOOXXOXXXOXOXXOXOOXOOXOXXXXOXOXXXOOXXOOOOOXXOOOOXOXXOOOOOOOOXXOXXOXOOOOXOXOOOOOOXOXXXXOOOOOOOOXOXOOOOOXOOXOOOXXOXOOOOOOXOOOXOOXOOXOOO...

output:

1

result:

ok single line: '1'

Test #168:

score: 0
Accepted
time: 166ms
memory: 64888kb

input:

1000 182
OOXOXOXOOOOXOOOOXXOOOOOOOOXXOXOOXOXOXOOOOOOXOOOOOXOOOOOXXXOXOOXOOOXOOOXOOOOOOOOOOOOOOXXXOXOXOOXOOOXOOOXXOXOOOXOOOXOOOOXOXOXXXOXOOXXOOOXXOXOOXOOXOXOXOOOOXOOOOOXOOXXOXXXOXOXXOXOOXOOXOXXXXOXOXXXOOXXOOOOOXXOOOOXOXXOOOOOOOOXXOXXOXOOOOXOXOOOOOOXOXXXXOOOOOOOOXOXOOOOOXOOXOOOXXOXOOOOOOXOOOXOOXOOXOOO...

output:

0

result:

ok single line: '0'

Test #169:

score: 0
Accepted
time: 191ms
memory: 65224kb

input:

1000 183
XXXXOOXXXXOXOXOOOOXOOXOXOOXOXXOXOXXXOXOOXOXXOOOOXOOOOOOOOOXXOXOXXXOXXOXOOOOXXOXXOOOXOXXXXXXOOOOOOOOXXOOOXOXXXOOOOOXOXOOOOXXOXXOXOOXXOXXOXXOXXXOXOXOOOXOXXXOOOXOXOOXXXXOOOOXOXXOOOXOXOXOOOOXOXOOXOXXOXOXXOXXXOOXXXOXXXOXOOOXXOOOXOXXOXXXOOXOXOOOOOXXXXOXXXXXOOXOOXXXXOOXOOXXXXOOOOOOXOOXXXOXOXOXXXXX...

output:

0

result:

ok single line: '0'

Test #170:

score: 0
Accepted
time: 189ms
memory: 65212kb

input:

1000 183
OOOOOXXOOXXXOXOXXOXOXOOOXOOOOOXXOXXXOXXOOXXOOXOOOXXOXOXOOXXOXXOXOOXXOXOXXOXXOOXXOOOOOXOOXXXOOXXXXXXOXOOOXOXXOOOXXXOXXXOOXOXOOXXOOOOXXOXOOXOOXXXOOXXOOOXOXXOOXOXOOOXOXXXOXXXXOOXOXXXOOXOXXOXOXXXXXXOXXXXXOOOOOXXOXXOXXXXOOXXOXOXXXOXXXOOOOXXXXXXXXOOOOOOOXOXOXOOXXOOOOXXXOOXOOOXOXXXOXOOXXOXXOXOXOOX...

output:

1

result:

ok single line: '1'

Test #171:

score: 0
Accepted
time: 197ms
memory: 64984kb

input:

1000 183
OOOOOXXOOXXXOXOXXOXOXOOOXOOOOOXXOXXXOXXOOXXOOXOOOXXOXOXOOXXOXXOXOOXXOXOXXOXXOOXXOOOOOXOOXXXOOXXXXXXOXOOOXOXXOOOXXXOXXXOOXOXOOXXOOOOXXOXOOXOOXXXOOXXOOOXOXXOOXOXOOOXOXXXOXXXXOOXOXXXOOXOXXOXOXXXXXXOXXXXXOOOOOXXOXXOXXXXOOXXOXOXXXOXXXOOOOXXXXXXXXOOOOOOOXOXOXOOXXOOOOXXXOOXOOOXOXXXOXOOXXOXXOXOXOOX...

output:

0

result:

ok single line: '0'

Test #172:

score: 0
Accepted
time: 181ms
memory: 65460kb

input:

1000 184
XXOXOXXXXOXXXXXXOXXXXXOXXXXXXXXXXXXXXXXXXXXXXOXXXOXXXOXXXXOXXOOXXXXXXXXXOOXXXXXXXXXXXXOXXXXOOXOXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXOXOXXXXOOXXXXXXXXOXXXOXXXXXXXXOXXXXXXOXXXXXXXOXXXXXXXXOXOXXXXXOXXXXXXXXXXXOXXXXXXXXXOXXXXXXXXXXXOOOXXXXXXXOXXOXXXXXXXXXXXXXXXXXXXXXOOXXXXOXOXXXXXXXXXXXXXOXOOOXXXXXXX...

output:

0

result:

ok single line: '0'

Test #173:

score: 0
Accepted
time: 188ms
memory: 65444kb

input:

1000 184
OXXOXOOOXOOXOOOOOOOOOOXOXOXOOXXXOOOOOOOOOOOXOXXXOOOOOOOOOXOOOOOXXOXXOOOXOXOOOOXOOXOOOXOOOOXXOOXOOOOOXOOOOXOOOOOOXOOOXXOOOOOOOOOOXXOXXOOOOOOXXOOOOOXXOOXOOOOOOOOOXOOOOOOXXXXOOOOOOOXOOOOXXXOXOXXOXOOXXOOOOOOOXOOOOOOOOXOXOOOOOOXOXXOXOOXOOOOOXOOOOOOOOOOXXOOXOOOOOOOOOOXOOOOOOOOOXXOXOOXOOOOOXXXOOXO...

output:

1

result:

ok single line: '1'

Test #174:

score: 0
Accepted
time: 190ms
memory: 65608kb

input:

1000 184
OXXOXOOOXOOXOOOOOOOOOOXOXOXOOXXXOOOOOOOOOOOXOXXXOOOOOOOOOXOOOOOXXOXXOOOXOXOOOOXOOXOOOXOOOOXXOOXOOOOOXOOOOXOOOOOOXOOOXXOOOOOOOOOOXXOXXOOOOOOXXOOOOOXXOOXOOOOOOOOOXOOOOOOXXXXOOOOOOOXOOOOXXXOXOXXOXOOXXOOOOOOOXOOOOOOOOXOXOOOOOOXOXXOXOOXOOOOOXOOOOOOOOOOXXOOXOOOOOOOOOOXOOOOOOOOOXXOXOOXOOOOOXXXOOXO...

output:

0

result:

ok single line: '0'

Test #175:

score: 0
Accepted
time: 185ms
memory: 71184kb

input:

1000 211
XOXOOOOOOOOXOOXXOOOOOOOOOOOOOOXXXXOOOOXOOOOOOXOOXOOOOOOOXOOOXOOOXOXOOOOOOOOOOXOXOXOOOOOOOXOOXOOOOOOOOOXXOOXOOOOOOOOOOOXOOOOOOOOXOXOOOOOOOOOOOOOOOOOOOOOOOXOXOOXOXXXOOXOOOOOOOOOOOOOXOXXOXOXOOOXOOOXOOOOOOOOXOOOXOOOOOOXOOOXOOXOOOOOOXXOXOOOOOOOOOOXOOOOOOOOOXOOOOXOOOOOOXXOOOOOOOOOOOOOXOOOXOXOOXOO...

output:

0

result:

ok single line: '0'

Test #176:

score: 0
Accepted
time: 186ms
memory: 71012kb

input:

1000 211
XXOOOXOOOOOOOOOOOOOXOOXOXOOOXOXOXXOOOOXXXOOOXOXOOOOOOXOOOOOXOOOXXOOOOOOOOOOOXXOXOXXOOOOOOXXXXXOXOXOOOXOXOOOXOXXOOOOXOOOOOXOOOOXOXOOOOOOOOOOXOXXOXOOOOXOXOOOOXXXOOOXOOOOOXOXOXOOOOOOXOOXOOOOOOOOOOOOOXXOXOOOOXOOOOXXXXOOOXOXOOXOOOOXXOXXXOOOXOOOXOXOXXOXOXOOOOXXXOXOXOOXOXOOXOOXOXOOOOOXXOOOOOXOOXOX...

output:

1

result:

ok single line: '1'

Test #177:

score: 0
Accepted
time: 172ms
memory: 71148kb

input:

1000 211
XXOOOXOOOOOOOOOOOOOXOOXOXOOOXOXOXXOOOOXXXOOOXOXOOOOOOXOOOOOXOOOXXOOOOOOOOOOOXXOXOXXOOOOOOXXXXXOXOXOOOXOXOOOXOXXOOOOXOOOOOXOOOOXOXOOOOOOOOOOXOXXOXOOOOXOXOOOOXXXOOOXOOOOOXOXOXOOOOOOXOOXOOOOOOOOOOOOOXXOXOOOOXOOOOXXXXOOOXOXOOXOOOOXXOXXXOOOXOOOXOXOXXOXOXOOOOXXXOXOXOOXOXOOXOOXOXOOOOOXXOOOOOXOOXOX...

output:

0

result:

ok single line: '0'

Test #178:

score: 0
Accepted
time: 198ms
memory: 71056kb

input:

1000 212
XOOXOXXOXXOOXOOOOXXXOOXXXOOXOOXOOXOOOOOOXOOXOXOXOXXOOXXXXOXXOOOXOOXXOOOXOXOXOXXOOXXOOOOOOOXOXOXXOXXXXOOOXOXXOXOXXOOXOOOOOXOXOOOOOOXOOOXOOXXXOOXXOOXOXOXOOOOXXXXXXOXXOXOOOXOXXOXXXXXXXOOXXXXOXOXOXOOXXXXOOXXOXXXXXXXOOXXXXXXXXXXXXXXOXXOOOXOXOOXOXOOOXXOOXOOXOOOXOOOXXXOOOXOXOXXXOXXXOXOXOXXXXXOOOOX...

output:

0

result:

ok single line: '0'

Test #179:

score: 0
Accepted
time: 190ms
memory: 71160kb

input:

1000 212
XXXXOOXOXOOOXXOXXOOOXXXXXXXOXOOXOOOXXXXXXXOOOXXOXOXOXOXXXXOOXXOOOXOXXOOOOXXXOXOOXOXOXXXOOOXXOXXXXXOXXXOOOXXOOOOOOXOOXXOXXOOOXXOXOXOOXXXOXOXXXOOOOXXXOOOOOXOOOOXXOXXOOXOOOXXXXXOXOXXOXOXOXOXOOOOXXXOOXOXXXOXXOXXXXXXOOXXXXOXOOOXOXOOOOXXXXOOOXOXXXXXXOXXOOOXOXXOXOOOOOXXOOOXOXXOXXOOXXOXOOXXOXOOXOOO...

output:

1

result:

ok single line: '1'

Test #180:

score: 0
Accepted
time: 194ms
memory: 71164kb

input:

1000 212
XXXXOOXOXOOOXXOXXOOOXXXXXXXOXOOXOOOXXXXXXXOOOXXOXOXOXOXXXXOOXXOOOXOXXOOOOXXXOXOOXOXOXXXOOOXXOXXXXXOXXXOOOXXOOOOOOXOOXXOXXOOOXXOXOXOOXXXOXOXXXOOOOXXXOOOOOXOOOOXXOXXOOXOOOXXXXXOXOXXOXOXOXOXOOOOXXXOOXOXXXOXXOXXXXXXOOXXXXOXOOOXOXOOOOXXXXOOOXOXXXXXXOXXOOOXOXXOXOOOOOXXOOOXOXXOXXOOXXOXOOXXOXOOXOOO...

output:

0

result:

ok single line: '0'

Test #181:

score: 0
Accepted
time: 182ms
memory: 71224kb

input:

1000 213
XOXXXXXXXXXXXOXXOOXOXXXOOXXXOXXOXXOXXXXXXXXXXXXXXXXXXXXXXXOXXXOXXXXXXXXXXXXXOXXXOXXXXXXXXXXOXXXOXXXXOXOOOXXOXXXOXXXXOXXXXXXOXOOXOXXXXXXOXXXXOOXOXXOOOXXXXXOOXXXXXXXOXXXXOXOXXXXXXOXXXXXOXOXXXXXXOXOXXXOXXOXXOOXXXXOOOOXXOXXXOOXXXOXXXXXOXXXXXXXOOOXXXOXXOXXXOXXXXOXXXXXXXOXXOXOOXXOOXXOOXXOOXXOXXXO...

output:

0

result:

ok single line: '0'

Test #182:

score: 0
Accepted
time: 194ms
memory: 71072kb

input:

1000 213
XOOOOOXOOXOXXOXXOXOOOOOOOOOOOXOXOOOOOOXOXOOOOXOXOOXOXXOXOOXOOXXXXOOXOOOXOOXOOOOOOXOOXXOOXOOXXOOOXXOXXOOOOOOOXOOOXOOXOOOXOOXOXOXOXOOOXOXOOOOOOOOXOXOXOOOOOOOXOXOXOXOOXOOOOXOOXXOXXOXOOXXOOOOOOOOOOOOXOOOOOXOOOOOOOOOOXXXOOOOOOXOOOXOXXOXOOOOOOXOXOOXOXOOXOOOXOXOXOXOXOOOXXXOOOOOXOOOOXXXOOOOXOOXXXOO...

output:

1

result:

ok single line: '1'

Test #183:

score: 0
Accepted
time: 192ms
memory: 71160kb

input:

1000 213
XOOOOOXOOXOXXOXXOXOOOOOOOOOOOXOXOOOOOOXOXOOOOXOXOOXOXXOXOOXOOXXXXOOXOOOXOOXOOOOOOXOOXXOOXOOXXOOOXXOXXOOOOOOOXOOOXOOXOOOXOOXOXOXOXOOOXOXOOOOOOOOXOXOXOOOOOOOXOXOXOXOOXOOOOXOOXXOXXOXOOXXOOOOOOOOOOOOXOOOOOXOOOOOOOOOOXXXOOOOOOXOOOXOXXOXOOOOOOXOXOOXOXOOXOOOXOXOXOXOXOOOXXXOOOOOXOOOOXXXOOOOXOOXXXOO...

output:

0

result:

ok single line: '0'

Test #184:

score: 0
Accepted
time: 232ms
memory: 108168kb

input:

1000 395
OOOOOOOXXXOOOOOXOOOOOOOOOXOOOOOOOXXOXXOOOOXOXOOOXXOOOOXOOOOOOOOOXOOOOOXXOXOOOOOOXOXOOXXOXOOOOOOOOOXOOXXOXXXOOOOOOOOOOXOOOOOOOOOOOOOOXOXXOOXOXOXOOXOXOOOOOOOOOOOXXOOOOXOOXOOOOXOXOOOOOXOOOOXXOXOOOOOOXOOOOOOOXOXXOXOXXXOXOOOOOOOOXOOOXOOXOOOXOOOOOOOOOOOOOOOXOOOOOXXOXOOXOOXXOXOXOOOOOOOOOXOOOOOXOOO...

output:

0

result:

ok single line: '0'

Test #185:

score: 0
Accepted
time: 225ms
memory: 108240kb

input:

1000 395
OOOXOOOXOOOOXOOOXXOOOXXOOOOXOOOOXOOOXOOOXXXXXOOOOXXXOXOOOOXOOOOOOOXOOXXXXXOOOOOXXOXOXOXXOOXOOOXOOOXOOOXOXXOXOOOOXOXXOXOOOOOOOXOOXXXXOOXXOOOOXOOXOXOOOOOOOXXOXXOXXXXOOXOXOXOOOXOOXXOXOOOXOOOXOXOXOOOOOOXOOOOOOOXOOOXOOOXXOXXOOOXXOXXOXOOXXXOOXXOOXOOXXOOOOOOOXOOOOOOOXXOXOOXOXXOOOXOOXXOOXXOXOOXXOXO...

output:

1

result:

ok single line: '1'

Test #186:

score: 0
Accepted
time: 233ms
memory: 107836kb

input:

1000 395
OOOXOOOXOOOOXOOOXXOOOXXOOOOXOOOOXOOOXOOOXXXXXOOOOXXXOXOOOOXOOOOOOOXOOXXXXXOOOOOXXOXOXOXXOOXOOOXOOOXOOOXOXXOXOOOOXOXXOXOOOOOOOXOOXXXXOOXXOOOOXOOXOXOOOOOOOXXOXXOXXXXOOXOXOXOOOXOOXXOXOOOXOOOXOXOXOOOOOOXOOOOOOOXOOOXOOOXXOXXOOOXXOXXOXOOXXXOOXXOOXOOXXOOOOOOOXOOOOOOOXXOXOOXOXXOOOXOOXXOOXXOXOOXXOXO...

output:

0

result:

ok single line: '0'

Test #187:

score: 0
Accepted
time: 253ms
memory: 108120kb

input:

1000 396
XXXOXOOXOOXOXOOOXXOXOOXOXOOXOOXOXXXXXOOOOXXXXOXXOXOOXXOXOXOXXOXOOOOOOOXOXOXOOXOOXOXXOXXOOXOXOXOXOOOXXXOXOOXXXOOXXXOXOOOOXOOOXOXXOXXOOXOXXOOOXOOOXXOXOOOXXXOXXXOXXOXXOXXOXXOOXXXOXXXOOOXXOXXOXOOXXOXOXOXOOXOOOXXXXOOXXOOOOXOOXXXOXXOOXOXXOXXOXOOOOXOOXXOXXXOXOOOOXXOXOOXXXXOXXXOOOXXOOXOOOOOOOOXOXXX...

output:

0

result:

ok single line: '0'

Test #188:

score: 0
Accepted
time: 246ms
memory: 108160kb

input:

1000 396
OXXXOXXOOXOXXXOXOOXOXOXOXOOXXXXXOOOXXXXOXOXXXXXXOXOXOOXXOXOOXOXOXXXXXOXOOXOXOXOXXOXXOOOXOXOOXXXXXXXXXOXOXXXOXOOXOOXOXXXOXOOXOXOOOXOOOXOOXXXOOOOXOXXOXXOXXXOXXXOOXXXOXOXXOOOOXOXOXOXXOOOOOXXXOXXOOOXXOXOOXOXOOOXOXOXXOOXOXOOOXOOXXOOXOXOXOOXXOXXOXXOOXOOOOOOXOOOXXOXOXOXOOXOOXXXOOOOOXXOXXOOOOXXOOOX...

output:

1

result:

ok single line: '1'

Test #189:

score: 0
Accepted
time: 241ms
memory: 108308kb

input:

1000 396
OXXXOXXOOXOXXXOXOOXOXOXOXOOXXXXXOOOXXXXOXOXXXXXXOXOXOOXXOXOOXOXOXXXXXOXOOXOXOXOXXOXXOOOXOXOOXXXXXXXXXOXOXXXOXOOXOOXOXXXOXOOXOXOOOXOOOXOOXXXOOOOXOXXOXXOXXXOXXXOOXXXOXOXXOOOOXOXOXOXXOOOOOXXXOXXOOOXXOXOOXOXOOOXOXOXXOOXOXOOOXOOXXOOXOXOXOOXXOXXOXXOOXOOOOOOXOOOXXOXOXOXOOXOOXXXOOOOOXXOXXOOOOXXOOOX...

output:

0

result:

ok single line: '0'

Test #190:

score: 0
Accepted
time: 252ms
memory: 108592kb

input:

1000 397
XXXOXXOXXOXXXXXXXXXXXXXXOXXXXOXXXXXXOOXXXOOXOXXXXXOXOXXXOXXXXXXXXXOXXXXXOOXOXXOXXOOOXXOXXXXXOXXOOXXOXXOXXXXXXXXXXXOXOXXXOOOXOXXXXXXOOXXXXXXXXOXXXXXXXXXOXXOXOXXXXXXXXXOXXXOXXXXXOXXXXXXXXOXXOXXXXOXXXXXXOXXXXXXXXXXXXXOXXXOXXXXXXXXXXXXXOXOXXXXXXXXOXXOXXXXXXXXOXXXXXOXXXXXOXXXXXOXXXXOXXOXXOOXXXXX...

output:

0

result:

ok single line: '0'

Test #191:

score: 0
Accepted
time: 231ms
memory: 108620kb

input:

1000 397
OXOXXOOOOOOOXOXOOOOOXXXOOXXOXOOOOXOOOXOXXOOXOOXXXXOXOOOOOXXOOXXOOXXOOOXOOOOXOXXOOOOXOXOOXOOOXOXOXOOOXOOOOOOXOXOOOOOOXXOOOXOXOOOXOOXOOXOOXOOXXOOOOOOOOOOXXOXXOOOOOXOXXOOOOOXXOXOOXOOOXXXOOOOOOXXXOOOXXXOXOXXOXOOOOOOXXOOXOOOOXOOOXOOXOOOOOOOXXXXOXOXXXOXOOOOOOXXOOOOOOXOOXXOOOOOXOOXOOXXOOOOOOOOOXXO...

output:

1

result:

ok single line: '1'

Test #192:

score: 0
Accepted
time: 232ms
memory: 108428kb

input:

1000 397
OXOXXOOOOOOOXOXOOOOOXXXOOXXOXOOOOXOOOXOXXOOXOOXXXXOXOOOOOXXOOXXOOXXOOOXOOOOXOXXOOOOXOXOOXOOOXOXOXOOOXOOOOOOXOXOOOOOOXXOOOXOXOOOXOOXOOXOOXOOXXOOOOOOOOOOXXOXXOOOOOXOXXOOOOOXXOXOOXOOOXXXOOOOOOXXXOOOXXXOXOXXOXOOOOOOXXOOXOOOOXOOOXOOXOOOOOOOXXXXOXOXXXOXOOOOOOXXOOOOOOXOOXXOOOOOXOOXOOXXOOOOOOOOOXXO...

output:

0

result:

ok single line: '0'

Test #193:

score: 0
Accepted
time: 332ms
memory: 206428kb

input:

1000 777
OOOOOOOXOOOOOXOOOXOOOXOOOOXOXOOOOOOOOXOOOOOOXXOOXOOXXOOOXOOXOOXOOXOOOOOOOOOXOOOOXOOOXOOOOOXOXXOOXOOOOXXOOOOOOOOXOOOOOXOXOXOOXOOOOOOOOOXOOOOXXOOXOOOOOOOOOOXOOOOXOOXXOOXXOOOOXXOXOXOOOOOOOOOOOXOOXOXOXOOOOOOOXOXOOOOOOXOOOOOXOOOOOOXOOOOOOXXOOXOOOOXOOOOOXOOOOOOXXOOOOOOOOXOOOOOOOOOOOXOXOOOXOOOOOOO...

output:

0

result:

ok single line: '0'

Test #194:

score: 0
Accepted
time: 348ms
memory: 206448kb

input:

1000 777
OOOXOOXOXOXOOXXOOOXOOOOOXXXOXXOXXOOOOXOOXOXOOXOOXOXXOOOXOOXXXOXOOOOXOXXXOOOOOXOXOOOOOOOXXOOOOOXOXXXOOOXXOOXOOXOOOXOOXXXOOXOOXOOXXOOOXOOOOOXXOXOOOXOOXOOOOOOOOOOOOXOOXOXXOOOXXXOOOOOOXXOXXOOOOXOOOOXXOOOOXOOOOXOOOXOOOOOOXXXXOXXXOOOOXXOOOXXOOXOOOOXXOXXXOOOOOXXOXXOOOOOOOOXOOOOOOXXXXOXOOXXOXXOOOXO...

output:

1

result:

ok single line: '1'

Test #195:

score: 0
Accepted
time: 336ms
memory: 206504kb

input:

1000 777
OOOXOOXOXOXOOXXOOOXOOOOOXXXOXXOXXOOOOXOOXOXOOXOOXOXXOOOXOOXXXOXOOOOXOXXXOOOOOXOXOOOOOOOXXOOOOOXOXXXOOOXXOOXOOXOOOXOOXXXOOXOOXOOXXOOOXOOOOOXXOXOOOXOOXOOOOOOOOOOOOXOOXOXXOOOXXXOOOOOOXXOXXOOOOXOOOOXXOOOOXOOOOXOOOXOOOOOOXXXXOXXXOOOOXXOOOXXOOXOOOOXXOXXXOOOOOXXOXXOOOOOOOOXOOOOOOXXXXOXOOXXOXXOOOXO...

output:

1

result:

ok single line: '1'

Test #196:

score: 0
Accepted
time: 357ms
memory: 206864kb

input:

1000 778
XOXOXXOXXXOXOXOXOOXXOXOXXXXOXXOOXOOXXXXOOXOXOOOOOOXOOOXXXXOXOXXOXXOXOOOOXOOXOOOXXXXXOOXXXXOXXXOXXOXXOXOOOOOOOXXOOXXXOOOOXXOXOOXXOOXOXXOOOOOOXOXOOOOOOXOXXXXXOOOXXOXOXOOXXXXXOXXOXOOOOXXXOOXXOOXXXOXOXXXOOOXXOXXXOXXOXOXOXOOXOXOOOXXXXOOOOOOXXXXXOOOOXXXXOOOXOXXXXXXXOOOOOXOOOXXXOOXXXXXOOXOXOXXOXXX...

output:

0

result:

ok single line: '0'

Test #197:

score: 0
Accepted
time: 359ms
memory: 206864kb

input:

1000 778
XXOXOXXXOOXXOXOOXXOXXXOOOXOOOXXXOXOOXXOXOOOOOXOXXOXOOOXXXOOOOXOOOXOOOOXXOOXXOOOXXXXXOOXXXOXOOOOOXXOXOOXOXXXXXXXOXOXOOXOOOOOOOXXOOOOOXOXOOOOXXXXXOXOOXOXXOXOXOXOOXXXOXOXOXOOXOOOXXOXXOOXXOOXXXOOXXOOOOXOXOOXOOXXOXXXXXXOOXXXXOOXOOXOOXOOXXOOOOXXXXOXOXOOOXXOOOOXOOOXXXXOOOXXOOXOXXXOXXOXOOOOOOOOOXOX...

output:

1

result:

ok single line: '1'

Test #198:

score: 0
Accepted
time: 362ms
memory: 206740kb

input:

1000 778
XXOXOXXXOOXXOXOOXXOXXXOOOXOOOXXXOXOOXXOXOOOOOXOXXOXOOOXXXOOOOXOOOXOOOOXXOOXXOOOXXXXXOOXXXOXOOOOOXXOXOOXOXXXXXXXOXOXOOXOOOOOOOXXOOOOOXOXOOOOXXXXXOXOOXOXXOXOXOXOOXXXOXOXOXOOXOOOXXOXXOOXXOOXXXOOXXOOOOXOXOOXOOXXOXXXXXXOOXXXXOOXOOXOOXOOXXOOOOXXXXOXOXOOOXXOOOOXOOOXXXXOOOXXOOXOXXXOXXOXOOOOOOOOOXOX...

output:

0

result:

ok single line: '0'

Test #199:

score: 0
Accepted
time: 356ms
memory: 207008kb

input:

1000 779
XXOXXXXXOOXXXXXXXXXXXXXXXOXXXXXXOXOXXOXXXXXXOOOOXOXOXXXXXOXXXOXXXXOOOXXXXXXXXXXOXXXXOOXXXXOXXXXXXXXOXXOXXXOXXXXXXXXOXXXXXXOXXOXXOXXOXXXXXXXOXXXXXXXXXXXOOXXXXOXXXXXXXXXXXXXXOXXXXXXXOXXOOXXXXXXXOXOXXXXXOXXOXXXXOXXXXXXXXXXXXXOXOXXXXXXOXOXOOXOXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXOXXOXOXXXXXXXXX...

output:

0

result:

ok single line: '0'

Test #200:

score: 0
Accepted
time: 347ms
memory: 206964kb

input:

1000 779
OXOOOOOOOOOOXOOOXXXOOOOOXXOOXOXOOOXOOOOXOOOOOXOOOXOXOXOOOXOOOXXOXXOOOXOOOOOXXOXOOOOOOOXOOOXXXOOOXXOOXXOOXOOOOOOXXOOXXXXXOOOOOOOOOOOOXOOOOOXXXOOOOOOOOOOXOOOXOOOOOOOOOOOXXXOXXOOXXXXOXOOOOOOOOOOOOXOOXOOOXXOXXXOOXXXOXOOOOOXXXOXOXOXOOXOOOXXXXXXOOXXOOOOOOOXOOOOXXOXOOOXOOXOXXXOOOOXOOXXXOOOXXOOXXXO...

output:

1

result:

ok single line: '1'

Test #201:

score: 0
Accepted
time: 356ms
memory: 206968kb

input:

1000 779
OXOOOOOOOOOOXOOOXXXOOOOOXXOOXOXOOOXOOOOXOOOOOXOOOXOXOXOOOXOOOXXOXXOOOXOOOOOXXOXOOOOOOOXOOOXXXOOOXXOOXXOOXOOOOOOXXOOXXXXXOOOOOOOOOOOOXOOOOOXXXOOOOOOOOOOXOOOXOOOOOOOOOOOXXXOXXOOXXXXOXOOOOOOOOOOOOXOOXOOOXXOXXXOOXXXOXOOOOOXXXOXOXOXOOXOOOXXXXXXOOXXOOOOOOOXOOOOXXOXOOOXOOXOXXXOOOOXOOXXXOOOXXOOXXXO...

output:

0

result:

ok single line: '0'

Test #202:

score: 0
Accepted
time: 405ms
memory: 263296kb

input:

1000 998
OOXOXOOOOOOOOOOOXOOXOOOOXXOOOOOOOXXOOOOOOOXOOOOOOOOOXOOOOOOOOOOOOOOOXOOOXXXXXOOXOOOOOOOOXOOOOOOOOOOXOOOXOOOOOOOXOXOXOOXOXOOXXOOOOOOOOOOOOXOOOXOOOOOOOOOOOXOOOOOOOXOOOOOOOXOXOOOXXOOOXOOOOOOOOXXOOOXOXOXOOXOXOOOOOOOOOOOXOOXOOXOOOXOOOOOOOOOOOOOOOOOXOOOOOXOOOOOOOOOOOOOOOOOXOOOOOOXOXOXXXOOOOOOOOOX...

output:

0

result:

ok single line: '0'

Test #203:

score: 0
Accepted
time: 380ms
memory: 263464kb

input:

1000 998
OXXOOOOOXXOOOOOOXXOOOXOOOOXOOOOOOOXOOOXXOOOOXOOOOXOXOOOXXXOXXXXOOOOOXOXOOOOOXOOOXOOOXXOXXOXOOOXXOXXXXXOOOOOXOXXOXOOOOOOOOXOOXOOOOOOOOXOOOXXOXOOOOXOXOOOXXXXOXXOOOOXOOOOXOXXOOXOOOOOXOOOOXOOXOOOXXOOOXOOOOXXOOOOXOXOXOXOXOOXXXOXXOOOOOOOOOXXOOOXOOOOOXOXOOXXOXXXOXOOOOOOXOOOOXOXOOOOOOOOOXOXOOOXOOOO...

output:

1

result:

ok single line: '1'

Test #204:

score: 0
Accepted
time: 386ms
memory: 263568kb

input:

1000 998
OXXOOOOOXXOOOOOOXXOOOXOOOOXOOOOOOOXOOOXXOOOOXOOOOXOXOOOXXXOXXXXOOOOOXOXOOOOOXOOOXOOOXXOXXOXOOOXXOXXXXXOOOOOXOXXOXOOOOOOOOXOOXOOOOOOOOXOOOXXOXOOOOXOXOOOXXXXOXXOOOOXOOOOXOXXOOXOOOOOXOOOOXOOXOOOXXOOOXOOOOXXOOOOXOXOXOXOXOOXXXOXXOOOOOOOOOXXOOOXOOOOOXOXOOXXOXXXOXOOOOOOXOOOOXOXOOOOOOOOOXOXOOOXOOOO...

output:

1

result:

ok single line: '1'

Test #205:

score: 0
Accepted
time: 398ms
memory: 263928kb

input:

1000 999
OOOXXOOXXOOXOOOOXXXOXXOXOOXXOOXOXXXOXXXOXXXXOXOOXXOXOXXXOOOXXXOXOXXOXOOOXXOXXOXOXOXXOOXXOOOXOOXXXXOOOXOXOXOXOXOOXOXOOOOXOOXOOOOXXOOOXXXOXXOOOXOXXOOOXXXXOOXXXOOOOXOOXOXOOXXXXXOOOXOXXOXOOXXXXOXOOOXXXOOXXOXOXXOXOOOOXOOOXXXOXXOOOOOXXOOOXXXOXOXOXXOXXXOOXXOOOOOOOOOOXOOXXXXOOOXOOXOOOOXOOOOOXOOXXOO...

output:

1

result:

ok single line: '1'

Test #206:

score: 0
Accepted
time: 411ms
memory: 263824kb

input:

1000 999
OXXXXXOOOXOXOOOXOXOXOOXOOXXOOXOXXXXOOXXXXOOOOXOOOOXXXXXOXXOXOXOXXOOXOOXXXOOOOOXOXOXXXOOOXXXXXOXXOOXXXXOXOOXOOXOOOXXOOXXXOXOOOOOOOOXXOXOXXOOXOOXXXOOOXOXXOOXXOXXOOOXXXOXOOXXOXOXXXXXXXOXXOXXXOXXOXOXOOOXXOXXXXXXXXOOOXXXOOXXXXXXOOXXOOOOOOOOXXOOOXOOXOOOXXOOOOXOXOXXOXXOXXOOOOXXXOOXXXOXOXXOXXXOOOXX...

output:

1

result:

ok single line: '1'

Test #207:

score: 0
Accepted
time: 402ms
memory: 263796kb

input:

1000 999
OXXXXXOOOXOXOOOXOXOXOOXOOXXOOXOXXXXOOXXXXOOOOXOOOOXXXXXOXXOXOXOXXOOXOOXXXOOOOOXOXOXXXOOOXXXXXOXXOOXXXXOXOOXOOXOOOXXOOXXXOXOOOOOOOOXXOXOXXOOXOOXXXOOOXOXXOOXXOXXOOOXXXOXOOXXOXOXXXXXXXOXXOXXXOXXOXOXOOOXXOXXXXXXXXOOOXXXOOXXXXXXOOXXOOOOOOOOXXOOOXOOXOOOXXOOOOXOXOXXOXXOXXOOOOXXXOOXXXOXOXXOXXXOOOXX...

output:

1

result:

ok single line: '1'

Test #208:

score: 0
Accepted
time: 426ms
memory: 264188kb

input:

1000 1000
XXXXXXXXOOXXOXXOXXXOOOXXOXOXOXXXXXXXXXOXXXXXXOXXOOXOXXXXXXXXXXXXXXXXXXOXXOOXXXXXXXXXXXOXXXXOOXOXXXXXXXXXOXOXOXXOXXXXOOXOXXOXXOOOXXXXXXXXXOXXXXOXXXXXOXOXXXXXXXXXXXXXXXXOXXXXXXXXOXXXOXXXXXXOXXOXXXXXXXXXXOXXXXXOXOXXXOOXXXOOXXXXXXXXXXXOOXXOXXXXXXOXXXXXXXXXXXXXXOXXXXOXOXXXXXOXXXXXXXXXXOXXOXXXXX...

output:

1

result:

ok single line: '1'

Test #209:

score: 0
Accepted
time: 398ms
memory: 264064kb

input:

1000 1000
OOOOOOXXOXOOXXXOOOOXOOXOOXOOOOOOOOOXXXOOOOOXOXXXOOOOXXXXOOOXOXXOOOOOXOOXOOXXOOOOOOOXOOOOXOXOOXOXOOOOXOOXXOXXOOOOOOOXXXOOOXOOOOOOXOOXXOOXOOOOXOXOOOXOOOOOXOOXXXXXXOOOXXOOOXXXOOOXOXOOXOOOOOOOOOXXOXXXXOOXOOOOOXOXOXOXOOOXOOOOOOXOOXOXOOXOOXOOXXOOOOOOXOOXOOOOXOOOXXOXXOOOOXOXOXXOOXOOXOXOXXOXOOOOXO...

output:

1

result:

ok single line: '1'

Test #210:

score: 0
Accepted
time: 400ms
memory: 264108kb

input:

1000 1000
OOOOOOXXOXOOXXXOOOOXOOXOOXOOOOOOOOOXXXOOOOOXOXXXOOOOXXXXOOOXOXXOOOOOXOOXOOXXOOOOOOOXOOOOXOXOOXOXOOOOXOOXXOXXOOOOOOOXXXOOOXOOOOOOXOOXXOOXOOOOXOXOOOXOOOOOXOOXXXXXXOOOXXOOOXXXOOOXOXOOXOOOOOOOOOXXOXXXXOOXOOOOOXOXOXOXOOOXOOOOOOXOOXOXOOXOOXOOXXOOOOOOXOOXOOOOXOOOXXOXXOOOOXOXOXXOOXOOXOXOXXOXOOOOXO...

output:

1

result:

ok single line: '1'