QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#312104 | #5514. Maze | Pentagonal | 100 ✓ | 1755ms | 1007900kb | C++17 | 6.9kb | 2024-01-23 13:14:43 | 2024-01-23 13:14:44 |
Judging History
answer
// #pragma GCC target("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimization ("Ofast")
//#pragma GCC -Wnarrowing
//Template {
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
//IO templates
//Note: use endl only for interactive problems or to debug segfaults; use newl for other problems
#define newl "\n"
#define fastIO ios::sync_with_stdio(false); cin.tie(nullptr)
#define fileIO(x) ifstream fin((str) x + (str) ".in"); ofstream fout((str) x + (str) ".out");
// void fileIO(string x) {}
#define flush() fflush(stdout)
#define interact(n) fflush(stdout); cin >> n; if (n == -1) return 0
#define testcases int tt; cin >> tt; fun (i, tt) solve();
#define edgeIO(m) fun (i, m) {int a, b; cin >> a >> b; addEdges(a, b);}
#define WeightedEdgeIO(m) fun (i, m) {int a, b, c; cin >> a >> b >> c; addWeightedEdges(a, b, c);}
#define numberedEdgeIO(m) fun (i, m) {int a, b; cin >> a >> b; addWeightedEdges(a, b, i);}
//types
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_multiset tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long
// #define int long long
#define ld long double
#define str string
#define boolean bool
#define String string
//vector
#define pb push_back
#define append push_back
//pairs
#define mp make_pair
#define p2 pair<int, int>
#define p3 pair<int, p2>
#define m3(x, y, z) mp(x, mp(y, z))
#define ich first
#define ni second.first
#define sanshi second.second
//For loops
#define ahegao(i, a, b) for (int i = a; i < b; i++)
#define baka(i, b, a) for (int i = b; i > a; i--)
#define fun(i, n) for (int i = 1; i <= (n); (i)++)
#define fon(i, n) for (int i = 0; i < (n); (i)++)
#define fur(i, n) for (auto i : (n))
#define oniichan(i, n) for (auto &i : (n))
//Sorts
#define sz(aaa) ((signed) aaa.size())
// #define len(aaa) ((signed) aaa.size())
#define all(a) a.begin(), a.end()
#define Sort(a) sort((a).begin(), (a).end())
#define rSort(a) sort((a).rbegin(), (a).rend())
#define clamp(x, y) (x) = min((int) (x), (int) (y))
#define CLAMP(x, y) (x) = max((int) (x), (int) (y))
//Other stuff
#define pqueue priority_queue
#define elif else if
#define addEdges(a, b) adj[a].pb(b); adj[b].pb(a)
#define addWeightedEdges(a, b, c) adj[a].pb(mp(b, c)); adj[b].pb(mp(a, c))
// #define find find_by_order
#define printLength(x) if (x < INF) cout << x << newl; else cout << -1 << newl;
// #define printVector(a) fur (i, a) cout << i << ' '; cout << newl;
void printVector(vector<int> DontUseThisName) {
fur (i, DontUseThisName) cout << i << ' '; cout << newl;
}
void printVector(vector<p2> DontUseThisName) {
fur (i, DontUseThisName) cout << i.first << ' ' << i.second << newl; cout << newl;
}
void printVector(vector<vector<int>> DontUseThisName) {
fur (i, DontUseThisName) printVector(i); cout << newl;
}
ll max(ll a, signed b) {return max(a, (ll) b);}
ll max(signed a, ll b) {return max((ll) a, b);}
void pv(int a) {cout << a << newl;}
void pv(int a, int b) {printVector({a, b});}
void pv(p2 a) {printVector({a.first, a.second});};
void pv(int a, int b, int c) {printVector({a, b, c});}
void pv(int a, int b, int c, int d) {printVector({a, b, c, d});}
void pv(int a, int b, int c, int d, int e) {printVector({a, b, c, d, e});}
void pv(int a, int b, int c, int d, int e, int f) {printVector({a, b, c, d, e, f});}
// void pv(int a, )
// void printVector(vector<char> DontUseThisName) {
// fur (i, DontUseThisName) cout << i << ' '; cout << newl;
// }
// void printRange(vector<int>::iterator Left, vector<int>::iterator Right) {
// for (auto i = Left; i < Right; i++) cout << *i << ' ';
// cout << newl;
// }
//Constants
const int MOD = 1e9+7; // 998244353
// const int SMALLMOD = 998244353;
const int INF = 2e9+1337;
const ll EXCEED = 2e18+1337;
const ll GRAVITY = 8e18;
//#define vectorIO(n, MikuBondage) fun (j, n) {int i; cin >> i; MikuBondage.pb(i);}
void vectorIO(int n, vector<int> &DontUseThisName) {
fun (j, n) {int i; cin >> i; DontUseThisName.pb(i);}
}
//#define vector2IO(n, MikuBondage) fun (j, n) {int i, ii; cin >> i >> ii; MikuBondage.pb(mp(i, ii));}
void vector2IO(int n, vector<p2> &DontUseThisName) {
fun (j, n) {int i, ii; cin >> i >> ii; DontUseThisName.pb(mp(i, ii));}
}
const int dx[4] = {1, -1, 0, 0}, dy[4] = {0, 0, 1, -1};
#define shortest_path_queue priority_queue<p2, vector<p2>, greater<p2>>
#define printArray(DontUseThisName, NakedLolisGalore, GenshinImpactClimbing) ahegao (j, NakedLolisGalore, GenshinImpactClimbing + 1) cout << DontUseThisName[j] << ' '; cout << newl;
#define print2dArray(SplitComplexProblemsIntoMultipleParts, ScuteSwarm, GenshinImpactClimbing) fun (i, ScuteSwarm) {fun (j, GenshinImpactClimbing) cout << SplitComplexProblemsIntoMultipleParts[i][j] << ' '; cout << newl;}
//}
const int MAX = 7000006;
int n, r, c, r0, c0, rf, cf, res;
bool state[MAX], visited[MAX];
queue<p2> toProcess;
queue<vector<int>> toFill;
inline int toInt(int y, int x) {
return c * (y-1) + x;
}
signed main() {
fastIO;
cin >> r >> c >> n >> r0 >> c0 >> rf >> cf;
fun (i, r) {
fun (j, c) {
char t; cin >> t;
state[toInt(i, j)] = (t == '.');
}
}
toProcess.push({r0, c0});
while (true) {
while (not toProcess.empty()) {
p2 temp = toProcess.front();
toProcess.pop();
int y = temp.first, x = temp.second;
// pv(temp);
// cout << newl;
if (y == 0 or y > r or x == 0 or x > c) continue;
if (visited[toInt(y, x)]) continue;
if (state[toInt(y, x)]) {
visited[toInt(y, x)] = true;
// visited2[toInt(y, x)] = true;
fon (i, 4) toProcess.push({y + dy[i], x + dx[i]});
// cout << "GOOD";
}
else {
toFill.push({y, x, n-1});
}
}
if (visited[toInt(rf, cf)]) {
cout << res << newl;
return 0;
}
res++;
if (n == r and n == c) {
cout << 1 << newl;
return 0;
}
while (not toFill.empty()) {
vector<int> temp = toFill.front();
toFill.pop();
int y = temp[0], x = temp[1];
if (y == 0 or y > r or x == 0 or x > c) continue;
if (visited[toInt(y, x)]) continue;
visited[toInt(y, x)] = true;
if (state[toInt(y, x)]) toProcess.push({y, x});
if (temp[2] == 0) {
fon (i, 4) toProcess.push({y + dy[i], x + dx[i]});
} else {
ahegao (i, -1, 2) ahegao (j, -1, 2) toFill.push({y+i, x+j, temp[2] - 1});
}
}
}
}
詳細信息
Subtask #1:
score: 8
Accepted
Test #1:
score: 8
Accepted
time: 1ms
memory: 5652kb
input:
31 32 1 25 22 5 3 ################################ ################################ .############################### .############################### ##..###############.############ ###.###############.############ #####.########################## ###.#.########################## ###.##############...
output:
26
result:
ok single line: '26'
Test #2:
score: 0
Accepted
time: 1ms
memory: 5572kb
input:
31 32 1 31 5 18 30 ................................ ..........................#..... ................................ .................#.............. ................................ ................................ ....#........................... ................................ ....................
output:
0
result:
ok single line: '0'
Test #3:
score: 0
Accepted
time: 1ms
memory: 5824kb
input:
31 32 1 7 10 1 32 .#...#.####...#.####..###..####. .#.##.#..#.###.#.#####.#..#..##. .#.#######.########..#.#....#.#. ####.##########.####.#..###...## ####.##....####.####..####.##.## ##.###..#####..#.###..#.##.#.#.# ####.###...##.........###.#.#### .##..##.##.######....##.#####.## ####.#.###.##.#......
output:
5
result:
ok single line: '5'
Test #4:
score: 0
Accepted
time: 1ms
memory: 5592kb
input:
31 32 1 18 18 1 18 #################.############## ################################ ################################ ################################ ################################ ################################ ###############.################ ################################ #################...
output:
15
result:
ok single line: '15'
Test #5:
score: 0
Accepted
time: 1ms
memory: 5576kb
input:
1 1000 1 1 597 1 432 ..........................................................#..........................................................................................................................................#................................................................#...................
output:
0
result:
ok single line: '0'
Test #6:
score: 0
Accepted
time: 0ms
memory: 5636kb
input:
1 1000 1 1 354 1 826 #############################################################.#########################################################################################################################################################################################################################...
output:
463
result:
ok single line: '463'
Test #7:
score: 0
Accepted
time: 0ms
memory: 5576kb
input:
1 4 1 1 4 1 3 #...
output:
0
result:
ok single line: '0'
Test #8:
score: 0
Accepted
time: 0ms
memory: 5632kb
input:
1 45 1 1 8 1 20 #######.####.#####..#####################.###
output:
9
result:
ok single line: '9'
Test #9:
score: 0
Accepted
time: 0ms
memory: 5592kb
input:
3 13 1 1 5 2 3 .....##.....# .#....##.##.. ......#......
output:
0
result:
ok single line: '0'
Test #10:
score: 0
Accepted
time: 0ms
memory: 5808kb
input:
1 2 1 1 1 1 2 ..
output:
0
result:
ok single line: '0'
Test #11:
score: 0
Accepted
time: 0ms
memory: 5552kb
input:
1 148 1 1 91 1 89 .####.#.###...#..####..####.###..#...#.##.#####.######.#.#....#...####..##.#.#.##...##...#.##.#.#####.#####...#.#.###.#.#...##...###..#...##..##.###
output:
1
result:
ok single line: '1'
Test #12:
score: 0
Accepted
time: 1ms
memory: 5632kb
input:
2 84 1 1 11 1 62 .#..#.##.#.#.##.#.##.#.#...######.#.###...##.#####....##.##.#..###.###.##...##.#...# .#....##.#.#..#...#....##..###..#.##.#...###.#.#.###...##.#....#...##.#..####.#.###.
output:
20
result:
ok single line: '20'
Test #13:
score: 0
Accepted
time: 1ms
memory: 5856kb
input:
1 59 1 1 6 1 20 #.###.########.###..##.####.###.##.##########.########..#.#
output:
11
result:
ok single line: '11'
Test #14:
score: 0
Accepted
time: 1ms
memory: 5544kb
input:
31 32 1 31 5 18 30 ................................ ..#...####.######..##.#.####.##. ..#.#.####.#####.##..######..#.. .##.####.#.#.#...##.##########.. ..#...###.#####...####.#####.##. .#..###....#.#.#.##..###.#..#.#. .#.###..###.###.#####.#.#######. ..#...#.####.########...#..####. ..#..#.##...........
output:
0
result:
ok single line: '0'
Test #15:
score: 0
Accepted
time: 1ms
memory: 5828kb
input:
31 32 1 17 32 11 7 ................................ .#.##.#..#.###.#######.#.###.##. .#.#######.#########.#.#....#.#. .###.##########.####.#..###.#.#. .######.#..##########.####.##.#. .#.###..######.#.###..#.##.#.#.. .###.###.#.##........######.###. .##.###.##.######....##.#####.#. .#####.###.####.....
output:
2
result:
ok single line: '2'
Test #16:
score: 0
Accepted
time: 0ms
memory: 5792kb
input:
31 32 1 7 11 13 25 ................................ .##############################. .##############################. .##############################. .##############################. .##############################. .#########.####.###############. .##############################. .################...
output:
11
result:
ok single line: '11'
Test #17:
score: 0
Accepted
time: 6ms
memory: 5636kb
input:
244 245 1 226 133 105 7 .####.##################################################.###.#############.########.#######.#########################################.################.####.#################.######################################.###########.######.#####.######. .####.######.#####.#####.#####...
output:
163
result:
ok single line: '163'
Test #18:
score: 0
Accepted
time: 0ms
memory: 5604kb
input:
1 46212 1 1 39597 1 10273 #########################################.########################.##############################################################################################.##################.########.####################.##########################################.####################...
output:
28589
result:
ok single line: '28589'
Test #19:
score: 0
Accepted
time: 3ms
memory: 5856kb
input:
244 245 1 226 133 105 7 ..................................................#...............................................................................................#........................................................#......................................... .................................
output:
0
result:
ok single line: '0'
Test #20:
score: 0
Accepted
time: 6ms
memory: 5840kb
input:
244 245 1 214 117 83 245 .##..#.###.##.#.###.#..#####....#..##.##..##.##.#.###.#.##.####.###.....#.#...###.#.###..##.#.##.####..##..#..##....#.###.##.#########.#.#.##.##.#.####.##.##.##.#.##.##..##.##.#..#.#...##..##..#..#..#..####.#.###.##.#..#.#####....##.##.##.#.##.. #.###.##.#..###...###########...
output:
45
result:
ok single line: '45'
Test #21:
score: 0
Accepted
time: 7ms
memory: 5940kb
input:
244 245 1 15 226 207 34 ########################################################################################################################################################################.############################################################################ ##############################...
output:
340
result:
ok single line: '340'
Test #22:
score: 0
Accepted
time: 3ms
memory: 5580kb
input:
1 60000 1 1 59085 1 9263 .........................................................................................................................................................................................................................................................#............................
output:
496
result:
ok single line: '496'
Test #23:
score: 0
Accepted
time: 3ms
memory: 5728kb
input:
1 60000 1 1 57861 1 18234 ##################.###########.##################.###################################################################.#################.#####.##########################################################################.###########################.#########.##################....
output:
39210
result:
ok single line: '39210'
Test #24:
score: 0
Accepted
time: 0ms
memory: 6112kb
input:
244 245 1 226 133 105 7 ..................................................................................................................................................................................................................................................... ..#...#.#..####..####.......##...
output:
2
result:
ok single line: '2'
Test #25:
score: 0
Accepted
time: 0ms
memory: 5900kb
input:
244 245 1 214 117 83 245 ..................................................................................................................................................................................................................................................... ..###.##.#..###...###########...
output:
8
result:
ok single line: '8'
Test #26:
score: 0
Accepted
time: 0ms
memory: 5812kb
input:
244 245 1 15 226 207 34 ..................................................................................................................................................................................................................................................... .#############################...
output:
44
result:
ok single line: '44'
Test #27:
score: 0
Accepted
time: 17ms
memory: 6076kb
input:
387 387 1 335 36 90 357 ##########.##########.#######.#########.####.##########################.#################.##############################################################.######################.###################.##.###########.#####################.############.##################.#.#########...
output:
384
result:
ok single line: '384'
Test #28:
score: 0
Accepted
time: 0ms
memory: 5664kb
input:
2 30695 1 1 15156 1 6032 #..####.##..##..##.##.##..######.##.#.###.###########...####.#.###.#.###.#..###.#.###....###.#####..#...##.##.######.####.#######.######..#...#.#.##....##.##.#..#.#######.#.####.#.#####.##......###.#.#...#..#####.#.###.#####.############..###.#.#####.#...#.##...#..#.###..##....
output:
4487
result:
ok single line: '4487'
Test #29:
score: 0
Accepted
time: 7ms
memory: 6120kb
input:
387 387 1 55 282 267 35 .......................................................................................................................................................................................................................................................................................
output:
0
result:
ok single line: '0'
Test #30:
score: 0
Accepted
time: 15ms
memory: 6184kb
input:
387 387 1 287 270 56 102 #.#####.###..#..#.##..######...####..####.###..####.....#######.##..##..#.###.#..#..##.##.#...#.#.#.#.####.##...#.##..#.#.#..####.##.##.###......#.####..#####.####..##.#.#.#####..####.####.###.###..#.....#######.###.###.##..#.##..#...###..############.#.###.#..##.##..####.##...
output:
66
result:
ok single line: '66'
Test #31:
score: 0
Accepted
time: 16ms
memory: 5792kb
input:
387 387 1 182 105 119 379 ##########################.######################################################################################################################################################################################################.################################################...
output:
312
result:
ok single line: '312'
Test #32:
score: 0
Accepted
time: 6ms
memory: 5672kb
input:
1 150000 1 1 113832 1 2038 .............................................................................#......................................................................................................................................................................................................
output:
1092
result:
ok single line: '1092'
Test #33:
score: 0
Accepted
time: 9ms
memory: 7992kb
input:
1 150000 1 1 6957 1 130571 ####.##########################################################################.################################################################################.################################################.###############################################################...
output:
122389
result:
ok single line: '122389'
Test #34:
score: 0
Accepted
time: 10ms
memory: 6604kb
input:
387 387 1 55 282 267 35 .......................................................................................................................................................................................................................................................................................
output:
11
result:
ok single line: '11'
Test #35:
score: 0
Accepted
time: 13ms
memory: 6448kb
input:
387 387 1 287 270 56 102 ......................................................................................................................................................................................................................................................................................
output:
35
result:
ok single line: '35'
Test #36:
score: 0
Accepted
time: 3ms
memory: 5932kb
input:
387 387 1 369 107 192 382 .....................................................................................................................................................................................................................................................................................
output:
21
result:
ok single line: '21'
Test #37:
score: 0
Accepted
time: 180ms
memory: 7332kb
input:
1224 1225 1 106 825 1167 186 ##################################.#######.##..##.#.####.############.######.################.###################.#########.###########################.#####.####################.###############################.#######################.#######.########################.###...
output:
1112
result:
ok single line: '1112'
Test #38:
score: 0
Accepted
time: 5ms
memory: 5760kb
input:
16 10623 1 16 1171 14 2438 ###.#....#.##..#.#.#.#.##.#.#..#.###..###.#..#...##..#.###..#...##.####.#......##...#..#..###...#..#####.#..##.#.###.#...#.##..#####.#######.....#.....#######.##.#....#.#...###..##..####.####.#.###.#####.#.##.###...#.....##.###.#.#.......#.###.##.#.###########.##.......##....
output:
185
result:
ok single line: '185'
Test #39:
score: 0
Accepted
time: 5ms
memory: 5656kb
input:
1 184339 1 1 58622 1 95339 .....#.....#.##.#.....#................#.....#.....#.#........#......................##.......#..#.....#....#.....##......#.................#............##.#....#..##......#...#.............#.......##.#............#.#....#....#...#...#..##.#...................#..#....##..#...
output:
5653
result:
ok single line: '5653'
Test #40:
score: 0
Accepted
time: 20ms
memory: 5920kb
input:
185 1158 1 170 697 18 48 #########.########.###.####.##########.################.#.##.#######.##.##.########.#.#############.####..###.##.####.###..###.####.#################.##..#######.#.###..#.#####..#.#.##.#.####.#.###########.####.###################..#####.############.###.#####.###..######..#...
output:
453
result:
ok single line: '453'
Test #41:
score: 0
Accepted
time: 13ms
memory: 5704kb
input:
2 121141 1 1 84070 2 47224 ########.#.######.#.#####.##.###.##.####.#...####..#...#.#####.##.###.#.#######.##.##.######.###.#####.#####.####...#..#####.###########.####...#.########..##..####.###.###.####.###.#.###..####..###.##.####.##.#######.#..######.#.#....###.##.##.###.####...#.#.#.##.##.###.#...
output:
23385
result:
ok single line: '23385'
Test #42:
score: 0
Accepted
time: 19ms
memory: 5952kb
input:
6 123737 1 3 116020 4 86192 ...#..#..#.............#.#.##.##...#..#...#...#...........#..#...#......##......#.#...#..#.##..#####..........#.#.....#.#.####......#....#.....##.##.####...........#.#.##..###.....#.#.#...#.#..#..#.#.#..#..#....#..#.......#...#...#...#.#.##..#..#..##......#..#...#...#.......
output:
1725
result:
ok single line: '1725'
Test #43:
score: 0
Accepted
time: 24ms
memory: 7976kb
input:
5 160357 1 1 41933 1 68874 ##########.###.##.#.#####..#.#####.###..##.#############################.#############.##.#####.##########.##########.###.############..########.#####.#.######.###..####.####.##########.#####.###.##########..#.#######.##.###.#..#.###############.##############.###.###..###...
output:
20843
result:
ok single line: '20843'
Test #44:
score: 0
Accepted
time: 57ms
memory: 12468kb
input:
1224 1225 1 520 1165 390 755 .............................#....................................................................................................................................................................................................................................................
output:
0
result:
ok single line: '0'
Test #45:
score: 0
Accepted
time: 136ms
memory: 9772kb
input:
1224 1225 1 1155 1123 435 159 ###....#.#.##.##.####.##.###.##########.##.####.#.#..##.##..#..####...#..#.....#####....####.###.#####...#..#..#....###.#....#....#.##.#.....##...##.#...##...####.####..#.#####.##..#.##.##.#.###.#..##.##.##..###.##..#.....#############.#####.#.##...##.#.####.#########.#...
output:
276
result:
ok single line: '276'
Test #46:
score: 0
Accepted
time: 130ms
memory: 9564kb
input:
1224 1225 1 533 1130 900 376 ############################################################.###############################.########################.######################################################################.###############################################################.##################...
output:
1015
result:
ok single line: '1015'
Test #47:
score: 0
Accepted
time: 40ms
memory: 8604kb
input:
1 1500000 1 1 32769 1 947728 .................................................................................................................................................#................................................................................................................................
output:
9041
result:
ok single line: '9041'
Test #48:
score: 0
Accepted
time: 55ms
memory: 8452kb
input:
1 1500000 1 1 1314999 1 652665 ##########################################################################################.###################################################.#############################################################################################.################################...
output:
655757
result:
ok single line: '655757'
Test #49:
score: 0
Accepted
time: 115ms
memory: 12444kb
input:
1224 1225 1 969 785 150 464 ...................................................................................................................................................................................................................................................................................
output:
37
result:
ok single line: '37'
Test #50:
score: 0
Accepted
time: 83ms
memory: 10708kb
input:
1224 1225 1 1155 1123 435 159 .................................................................................................................................................................................................................................................................................
output:
49
result:
ok single line: '49'
Test #51:
score: 0
Accepted
time: 147ms
memory: 7604kb
input:
1224 1225 1 533 1130 900 376 ..................................................................................................................................................................................................................................................................................
output:
407
result:
ok single line: '407'
Subtask #2:
score: 19
Accepted
Test #52:
score: 19
Accepted
time: 0ms
memory: 5636kb
input:
3 6 2 2 1 3 3 ...### ..##.. #..###
output:
0
result:
ok single line: '0'
Test #53:
score: 0
Accepted
time: 1ms
memory: 5676kb
input:
4 24 4 3 4 3 3 ..#...##.#...###...###.# .##.#..##.##.##..#.####. #.......#.#.#...#.#####. ######....######.#...#.#
output:
0
result:
ok single line: '0'
Test #54:
score: 0
Accepted
time: 1ms
memory: 5636kb
input:
2 136 2 1 133 2 45 #############################################.##################.#.#######.##############.#################.##############.##.######.### ####.########.###############.####.###..####.#.###.#################.##..##############.###.############################################
output:
41
result:
ok single line: '41'
Test #55:
score: 0
Accepted
time: 1ms
memory: 5640kb
input:
31 32 31 6 13 22 29 ................................ ................................ ..............................## ......#......................... ................................ ................................ ............#................... ................................ ...................
output:
0
result:
ok single line: '0'
Test #56:
score: 0
Accepted
time: 1ms
memory: 5812kb
input:
31 32 31 17 32 22 6 ...##.#...#...###.##.#.##.###.## ###...#.#..#..#.#.##..##.####### ###.#.#.###.######.#.#..###..### ..#.#.##....#.#.###.########.... ####.#.#.#############.###.#.### #..###.#######.##.#.###.##.####. #####.###..###...##.###..##...#. .##.#.###..####...#####..#..#.## .....####.#....#...
output:
1
result:
ok single line: '1'
Test #57:
score: 0
Accepted
time: 1ms
memory: 5884kb
input:
31 32 31 31 1 28 28 ################################ ##########################.##### #.####################.######### ################################ ################################ .############################### ################################ ################################ ################...
output:
1
result:
ok single line: '1'
Test #58:
score: 0
Accepted
time: 1ms
memory: 5568kb
input:
2 500 2 2 127 2 384 #..##..#####...##...##.#...#..#.##...###.##.###.##..##.#.####.#..##...#######.##.###.#####..#..####.#####...#....##..######.##....####..####..##.....####..#..##.#.####...#.##.##.##..######..#.##.#.##..#######..#.###.##.#.####.#.#..#.#..#...#########.###.#.##.###.##.#...##....###....
output:
76
result:
ok single line: '76'
Test #59:
score: 0
Accepted
time: 1ms
memory: 5896kb
input:
10 77 6 6 3 1 51 ..###...#.#..#.##........##........#...##....#...#.#.....#........##......#.. ##.........#.#....#.#.##.##......#.#..#..#.........#...#..#..##..#....#.###.. .......##...##....#......#...#..#.#####............#....#........#.#........# ..#......#...##.....#...##..#.#..##..##..#...##.....
output:
2
result:
ok single line: '2'
Test #60:
score: 0
Accepted
time: 1ms
memory: 5848kb
input:
3 86 3 2 57 1 6 ####...##########.################.#.#.#.#########.###########################.##..### #.#####.######.##.#################.##.############.####..#######.########.########### ##.#####.##.##.########.##.#####.################################.############.#######
output:
16
result:
ok single line: '16'
Test #61:
score: 0
Accepted
time: 0ms
memory: 5652kb
input:
12 50 4 10 13 3 13 #.########.####.####.#.######.######.#####.#####.# ####..########.######..#.#.##..##.##...###.##..### #.##########.#.#########.####.####.###.#####.##.#. .######.#####.#.###############.#.####.####..##... ###########.##.###.#####.##.########..#...##.####. #########.#######.##..####...
output:
2
result:
ok single line: '2'
Test #62:
score: 0
Accepted
time: 0ms
memory: 5528kb
input:
4 52 3 2 33 3 39 ....#.............#...............#....##...##....#. #..#....................#..#.....#.##..#....#.#..#.. .#..........#.....................#...............#. .#...#.....##......#..#......##.....................
output:
0
result:
ok single line: '0'
Test #63:
score: 0
Accepted
time: 1ms
memory: 5636kb
input:
16 49 2 1 43 7 40 ##########################################.###### ####.############.############################### ################################################# ################################################# ##.####.######################################### ################################...
output:
3
result:
ok single line: '3'
Subtask #3:
score: 16
Accepted
Test #64:
score: 16
Accepted
time: 1ms
memory: 5712kb
input:
35 60 20 3 60 2 44 .#....##.#.###..##.#.#....#.....#..#..#.##.#..#....###.####. #.#......#.####..####...#...#......#........####....##.#.### .#..#.....#.####..#.##..#.#.#...#.##..#.#..#######....#..##. .#.#...##..#.##.......#......##......####...##.##..##.#....# #...#.......#..#..#...#.#####.##.###....
output:
1
result:
ok single line: '1'
Test #65:
score: 0
Accepted
time: 2ms
memory: 5840kb
input:
63 602 3 10 463 3 402 #.#.#..#..######.#.##.##.#########.###.##.##..#..####.#...#########..###..####.######.###.##.#.....############.####.########.#.########.##.######.###..#####.###..##.#..#..##..##.###..##.###.#######...#.##.##.#.#.##...##...####.###.##.#.#.....#####.##.#..#.##..#...######.#####....
output:
9
result:
ok single line: '9'
Test #66:
score: 0
Accepted
time: 0ms
memory: 7448kb
input:
45 1194 5 4 632 37 206 ...#..#............#..........#..##....##......#...##..#..#.............#...#...........##....#.........#.#.##..........#......#..........#.....#...........#........#.#.................#................#..........##.......................#.....#..........#........#........#......
output:
0
result:
ok single line: '0'
Test #67:
score: 0
Accepted
time: 3ms
memory: 5764kb
input:
244 245 244 28 168 222 200 ...#...................................................................................................................................................................#..............................................................#.............. ..............................
output:
0
result:
ok single line: '0'
Test #68:
score: 0
Accepted
time: 20ms
memory: 6156kb
input:
244 245 244 175 140 70 11 ##.##....###.###..######..###.#.#####.##..#.#####.#.###.###.....#....###.#####.##..#.###.####.#..##.####...#.#####.###.##..#######.##.##...#..####.#...#####.##.###.#....##..####.###.#.#####..#.#.##.###.#..#.##.####..#.#.#...#######.######.##.#.. #..#..##.####.###.###..........
output:
1
result:
ok single line: '1'
Test #69:
score: 0
Accepted
time: 15ms
memory: 5928kb
input:
244 245 244 241 52 100 202 #######.###################################################################################################################################################################.######################################################################### ###########################...
output:
1
result:
ok single line: '1'
Test #70:
score: 0
Accepted
time: 9ms
memory: 5980kb
input:
62 967 62 41 1 29 386 ####.######.####.#####...##.##..##.####..######.##...######....#.#..#...#.#.###.##.###...######..#.#.####.###.##.###.#...###..##..####.####.#.#...###..#.#..#..###.....#####.##..##.####..##......#.####.##.#...##..###.#....#..##.###.#..#####.#..#.#.#.##..#..#.#..##.##.####...#.#....
output:
6
result:
ok single line: '6'
Test #71:
score: 0
Accepted
time: 10ms
memory: 9996kb
input:
202 595 58 71 324 182 516 ..#.###....#.##......#............#...#.###....................#....#....#...#.##.........#.....#....#.#.......###.#........#####..#.......###......#......#.......#...##..........#.#.....#.#.................#.#...#..#.#.......#.#.##...#.#..#......#.....#.......#.#..#..#.......
output:
0
result:
ok single line: '0'
Test #72:
score: 0
Accepted
time: 0ms
memory: 6008kb
input:
387 387 387 100 184 358 250 ................#...........................................................................................................................................#......................................................................................................................
output:
0
result:
ok single line: '0'
Test #73:
score: 0
Accepted
time: 2ms
memory: 5644kb
input:
387 387 387 133 20 329 125 #..##.##..###.##.##..######..#####.#.#####..#####.####.#....##.#.#.#.#.##.##..##.###....#.#..#.#.##...###########..##..#.##..##.######.##.#.#####.###.##.#....#..##.##.##.#####..#.##.##.####..#.###.##.##.#.#....###...#.#.###.##..####..##.##.#.#.#.#.###....#.###.#.#..#.###.#...
output:
1
result:
ok single line: '1'
Test #74:
score: 0
Accepted
time: 2ms
memory: 5848kb
input:
387 387 387 201 41 238 340 ###########################################################################.#####################################################################################################################################################################################################...
output:
1
result:
ok single line: '1'
Test #75:
score: 0
Accepted
time: 28ms
memory: 24784kb
input:
601 723 26 258 272 578 200 #.#.....#..#.##.##.##.......#.......#...#..#.....##...##.##..###.....#.....#.#.#....###...#.#....#...##..#..#.####...#..#..#.......#..##.....###...#.#.#....#....####..###.#.##..##....##.....##.#..#.##.#.#....#......#...##.....##.......#..#.#...#..#..##...#...#....####.##.#...
output:
0
result:
ok single line: '0'
Test #76:
score: 0
Accepted
time: 78ms
memory: 61688kb
input:
103 12319 67 96 7020 42 1423 ..##.###......#...#...#.........#........#....#..#...##.......#..###......###...#...##..#.##.##......##..#....#..............#.#......#.#...#...#..#..##.#..#....#.........###...#.....#..#..###...#.......#..#...##...#..####.##.#.##..##...#..#..####...#.......#.#....#..#.#...
output:
0
result:
ok single line: '0'
Test #77:
score: 0
Accepted
time: 58ms
memory: 12308kb
input:
1224 1225 1224 582 110 326 1104 ..................................................................................#...........................................................................................................................................................#................................
output:
0
result:
ok single line: '0'
Test #78:
score: 0
Accepted
time: 491ms
memory: 14668kb
input:
1224 1225 1224 1024 851 437 463 ##..#.###.####..##..#...#.#...##.#.#.########.#.#####..##..##.###..##..##..##.#...#.##.##.#####..###########.#.##...#.###########.####..####...#......##...###..#.#.####.#####.#.####.####.##..#.######..#.#.##.#.#.#.####....#...###.##...#..#..#####..#.#####.#...##.##......
output:
1
result:
ok single line: '1'
Test #79:
score: 0
Accepted
time: 449ms
memory: 8244kb
input:
1224 1225 1224 188 85 758 1157 #####.##.########################################################################################################################################################.###############################################################.###########################################...
output:
1
result:
ok single line: '1'
Test #80:
score: 0
Accepted
time: 84ms
memory: 74736kb
input:
72 20833 72 41 567 6 17116 ##.....##.##..#..###....###.#..##..#.#...#......#.#..###.#..#.#.#..##..#.##.......#...#.###..##.#.#..#....#....##..........#..#...##...#........#..#.#.##.###.#.###....###.#....#.#...#....#.##..#.#.##.#######.#...##....#.#.......##..#..#...##.##.........#..#....#..###.##......
output:
0
result:
ok single line: '0'
Test #81:
score: 0
Accepted
time: 95ms
memory: 75860kb
input:
114 13157 114 100 43 54 9728 .....#.....##.##....##.#..###.###.#..#.#...#....#.##.....#..#.#.###................###...#..#..#.##.#...#..#.##........#...#.#..##...#..###..##.#.....#.#.....#.....##.....#.##..#.#....#..#.##..#..##..#.###.##...#.#.#.#..##...#...#...#.##.##.#.#....#..#.#.........#....##....
output:
0
result:
ok single line: '0'
Subtask #4:
score: 19
Accepted
Dependency #2:
100%
Accepted
Test #82:
score: 19
Accepted
time: 2ms
memory: 5676kb
input:
2 2234 2 1 330 1 953 #######.##############################################################################.#######################.############.#############.##################.#####################################.###########.##########################################################.#############...
output:
300
result:
ok single line: '300'
Test #83:
score: 0
Accepted
time: 11ms
memory: 5900kb
input:
2 30000 2 2 1567 2 22320 #####.##...##..#.##..###..########.##.###.##.#.##...#.#.....#...##.###..#####.#.##.#####...#####..#######.....##....####..#....#.#.....#.#..####..####....######.###.#...#..####..####.##.##.###..#..#...###.########..####.##.#####...##########.#.##..####.###.##.#...##.#..#..##...
output:
6458
result:
ok single line: '6458'
Test #84:
score: 0
Accepted
time: 14ms
memory: 5740kb
input:
15 4000 15 14 2553 11 1177 #....####.##....##.#..####.##.#####....#.######..##...###..####.#..#.######.####.##.#..####.######.##....##.#.##.......###.##.#..####....##..####.#.#####.#.###..##.#.##.############...###.##.#...##..#.#####..##..##################..#####.####.....#..##.#######.##..##.#.#.#...
output:
73
result:
ok single line: '73'
Test #85:
score: 0
Accepted
time: 11ms
memory: 5696kb
input:
24 2500 24 2 1260 23 1965 ###..##.###.#..##.###..#.#..#....#...#####.#.#####...###.#....#.##.##.###.####..####..#.###..###..##.#.....#.#...#.###.##..##..#####.##.##...##.#......#######...#.#.####.#......#####.#.##.#####..##......#.#.#.#.#####.#####...###.#.#..#####..#.##...#.##.####.####.#.#.##..#.#...
output:
25
result:
ok single line: '25'
Test #86:
score: 0
Accepted
time: 18ms
memory: 5692kb
input:
39 1538 39 8 1 30 1398 #####.###.###.#...##..#....##.#######.#.###.####.......#..###..#####......#.####.###..##.#..##...#.#####.##.#..##.##########.##.#####..###...#..##.#########.###.#.##.#..#.#####.####..#.#.###.....##......#######..##..#####.#.#####..###.######...#.#.##.##...#.##....#.#.###...#.#...
output:
32
result:
ok single line: '32'
Subtask #5:
score: 5
Accepted
Dependency #4:
100%
Accepted
Test #87:
score: 5
Accepted
time: 24ms
memory: 5760kb
input:
13 10513 3 10 3868 13 183 .....##########.#...#....########.####..#.############..###..#..#.####.##########.###....#.#.##.##.#########.#...#..#########.###..###..######.#####..##..#...###.##..##.##.########.....###.##.#.####..####.#...#####.###.##..##.#.##.#.##.###..###.###.#####.##.##.###.##..#####...
output:
720
result:
ok single line: '720'
Test #88:
score: 0
Accepted
time: 24ms
memory: 5724kb
input:
2 75000 2 2 64107 2 2578 .###..##.######...######.#.#####..###...##...#########.##.###.....###...##.##.##..########..####.#.#########.#......#####..#.##.######..#.##########.##.#####.#.#..#.#.#.##..####.##.##.######.......#..######.##.##..#.#...#..#...#.#..#.#.##..#####.###.#.#.#..##.##..###..#####....
output:
19250
result:
ok single line: '19250'
Test #89:
score: 0
Accepted
time: 33ms
memory: 5788kb
input:
21 7142 21 19 909 10 6297 ###..##..#.....#.####..#######.###.#.###..###.##.####.#####.#.####..###.#.##...#.....##########...#####.#...##........#.########.##.#.###.####.##.##.##.###.##.#.#...##.##..##.#...#..#.##.#..###...##.##.#####.#.###..#.#.#.#.#.###..##..#..#.#.#...#.#.##....#.#.###...###.###.....
output:
210
result:
ok single line: '210'
Test #90:
score: 0
Accepted
time: 45ms
memory: 6004kb
input:
33 4545 33 13 795 29 4232 .#.#......#.#..#..#.#.#####.#.#..##.#.###############.###.###......#..##.##..###...##.###..#####.###.##.##...##...##.###.####....#.##.#.#....#.##...#.#####..#####.####.####.##.##..##.##....##..#.####...#####.##..#..#.#...####.#######.#.#..#.##...###.#.#...#..##.#####.##.###...
output:
90
result:
ok single line: '90'
Test #91:
score: 0
Accepted
time: 47ms
memory: 5856kb
input:
53 2830 53 11 2624 46 123 .#.#.#######...###...###.###.#.##...#####..#######..#####.###..#####.##..#.######.#####.####.##..#.#.###.########......#...###.#...#..##.##.###...#.##....#.###.#.##..#####.##.####..##..#.#.##.#..#####..###.###.##.##.####.....##.###.#..##..###.#####.############.####.#####.#...
output:
43
result:
ok single line: '43'
Test #92:
score: 0
Accepted
time: 32ms
memory: 5892kb
input:
84 1785 84 48 353 12 1389 ####.##....##.#.#..#.##.##.#.##.##.#####.#..###.#.#.##.#..#.#.##.#.#.#...#........##.#..######.#....#.##.######..#.###..###...#..#.##..#....#.#.##############.#.###.##.#..##.###.####.#.###.####.##.#..#.#.##..#######.######.#..##.####.#.#.#.#..##.#...#.....##.########....##....
output:
12
result:
ok single line: '12'
Subtask #6:
score: 19
Accepted
Dependency #1:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #5:
100%
Accepted
Test #93:
score: 19
Accepted
time: 8ms
memory: 7900kb
input:
13 15064 3 7 12096 2 13762 #.###.##.#.#..##..#.##.#.##...##....#.#..#.###.#.####.#.#....#..####.....###...............######.#.#####.#..#####.#.#####....###.#....###.##..###.#.#...#.....###.##.#...#####.#.......#.##..###.######.#..#.#.#..#....##.#..#.....#.#.#.####..#...#.######.#...##..##.#.#.....#...
output:
129
result:
ok single line: '129'
Test #94:
score: 0
Accepted
time: 99ms
memory: 6024kb
input:
53 6324 24 23 714 24 6040 ####.####.#####..#########.######.##.#.#####.#..#..#...####.#####.###.####.####...##########..#######.###.###.#######..#####.########.##.####.######.######..######.##############.#######.#.#...#.####..#######.#...##..#######.#.##.#..#.###..#######.#.###.###############.####...
output:
195
result:
ok single line: '195'
Test #95:
score: 0
Accepted
time: 42ms
memory: 5908kb
input:
3 254000 2 1 85641 2 123859 #########.###.####..##################..######.##.###########.##....######..#####.###########.###.###.####.#.#####.##..#.###.####..#####.##.##..######.##.#########.######..#..#.##..###########.#######..#.####.####.#.###...##.###.##.##.#####.####..########.##.#.##.###.####...
output:
13367
result:
ok single line: '13367'
Test #96:
score: 0
Accepted
time: 197ms
memory: 8464kb
input:
22 45590 10 13 26636 19 11699 #.######.##.########.###.##.##.###.####..###..#.####.#..###.######.######...#####.#.####.##########.#####.#####..#.#.####.#.#######.####..#.###.#.#####.###########.####.########.##.###..############################.##..########.#.####.#.###.####.#.###.######..###.####.#...
output:
1212
result:
ok single line: '1212'
Test #97:
score: 0
Accepted
time: 20ms
memory: 7952kb
input:
37 35344 13 35 16837 35 17654 ..##.#.#..##..##..###.##...#.#.#...###..#.#.#####..###########.#.###.#..#.#.#.#.##.###.##...####.#...###.....##.##.###.........####.#..###.###..#...#.###.##.#.#...#.####..#....##.##.##...####.##..##.##..##...#.#.#.####.##.#.#.##.#.#.##..#...#...##.###.#...#...##....#..#...
output:
40
result:
ok single line: '40'
Test #98:
score: 0
Accepted
time: 231ms
memory: 8668kb
input:
45 33333 45 22 1605 29 16084 .##.#.....#.###.#.#.#...#..####..##...###.#...#.##.###.##.##.#..########.#.#####.###.#.####..###...###.#.###.###.###..##....###.##.####..#######..##.###..##..#.#.##.#########.#.##.#.##......#..#.##.##.##...#..##.####.##..####..#..#.####...#######..##..##..####.###..##.#....
output:
283
result:
ok single line: '283'
Test #99:
score: 0
Accepted
time: 434ms
memory: 9292kb
input:
72 20833 72 67 6155 26 19037 .######...##...#.#.######.#.#..##..#.######.#..##..##..##.###.#######.#.#.######..#########.#######..##.######..#.##.#.#.###.......##..#..#..###.##.#.##..##.#...#..#..##...########.#######.##..###..#.########.#######.##..##.##.#...#.###.#.##.#..#.#####..#####..##..#.##.....
output:
163
result:
ok single line: '163'
Test #100:
score: 0
Accepted
time: 445ms
memory: 9724kb
input:
114 13157 114 2 8260 28 869 .###..####.#..##..##..##..#...#..#.##.####.#.##..##.#.#..####..##.#...###..###...##.##...##..###....######..##.#######..#..####.###.####.#...#.#######.##..#..#.##...######...#####.#.###.#..#####.#..######.#.#..#..#.#####..#.#..#####..####..##.##.####.######.#####.####..##...
output:
61
result:
ok single line: '61'
Test #101:
score: 0
Accepted
time: 463ms
memory: 9668kb
input:
181 8287 181 137 5084 21 272 ..#####...####.#.##.#.####.##...#.######....#...#.#.#..#.##.#.##.#.#.###.#.##..#.####.#...##....##..#......#....##..####.#########......###.##.###########..#..#.#####.###.###....####.#.###...###.#......#..####.#.#########..#.#.######.#.####..##...####.#######..##.#...#.#...
output:
26
result:
ok single line: '26'
Test #102:
score: 0
Accepted
time: 356ms
memory: 39412kb
input:
45 33333 45 29 8688 9 28980 .#...#..#....#..#....#.#.#.......#.##...........#.....#.....#......####....#...#.###....#.#.#..#..#.#....#...##.#...#.#...#...#....#...##....##.......#........#......##..#.#..#...#...###.###.....#..#.....#.#...#..###.##...#.#.#.#..#..#..#......#...#.#...##.....##.#..###.#...
output:
23
result:
ok single line: '23'
Subtask #7:
score: 8
Accepted
Dependency #6:
100%
Accepted
Test #103:
score: 8
Accepted
time: 337ms
memory: 10904kb
input:
1732 1732 1 1134 183 293 1667 ############################################.##############.##################.###############.#######################.########.###################.#############.#.#############.############################################################.##.############################...
output:
1564
result:
ok single line: '1564'
Test #104:
score: 0
Accepted
time: 121ms
memory: 8284kb
input:
34 48391 20 10 35471 20 29746 .##..###.####.#.##...#########..#..##.####..###.#######.##.#.######.#.######.#####.#...##.###..#.####.#####.#.#.###.########...##.####...###########.######.#.##################.##..####.##.#####.##.####.#.##.#####...####..#...##..####.##..#####..###.#.#.###..###..###.#....
output:
246
result:
ok single line: '246'
Test #105:
score: 0
Accepted
time: 109ms
memory: 79448kb
input:
191 9036 8 139 8514 84 2476 ...#.#..........#...##..##....#..#......#.#..#.#.........###...#..#.....#..#..........#..#...#......#...##....##.#..#..##.#..#................#..#.#........#....#..........##.#.#....#.#......#..##.#...#..#...#.#.#......#................#.#.....#.......##............#...##...
output:
0
result:
ok single line: '0'
Test #106:
score: 0
Accepted
time: 110ms
memory: 10484kb
input:
771 2770 40 431 2092 692 1929 ##############################################################################################################################.##########################################.####################################################################################################...
output:
7
result:
ok single line: '7'
Test #107:
score: 0
Accepted
time: 124ms
memory: 16904kb
input:
1732 1732 1 902 98 138 1552 .........................................................................#.........................................................................................................................................................................................................
output:
0
result:
ok single line: '0'
Test #108:
score: 0
Accepted
time: 237ms
memory: 11780kb
input:
1732 1732 1 872 409 1099 1344 #.#.###.####.##..#.###.#.#########....#####.##..####.#.#.######....#.#.#..##.##.#.#.#.######..#.##.#..##.####.....#.#.####..#..#.#.#...##.#...#....#####..##.###.#..##.###.##..##.#.#...#.#..#.#######..#.#.##..##....#..###..####.####.###.#....###.######.###....#.#.....#.....
output:
214
result:
ok single line: '214'
Test #109:
score: 0
Accepted
time: 129ms
memory: 11796kb
input:
1732 1732 1 1497 303 842 638 ########################################################################################.##############################################################################################################################################################.#######################...
output:
891
result:
ok single line: '891'
Test #110:
score: 0
Accepted
time: 115ms
memory: 16700kb
input:
1732 1732 1732 456 181 1566 1525 ..............................................................................................................................................................................................................................................................................
output:
0
result:
ok single line: '0'
Test #111:
score: 0
Accepted
time: 23ms
memory: 7900kb
input:
1732 1732 1732 1054 882 115 1413 #######.#..#.###.##.###.#.##.....#..#..#.##..####..#######.#..##.#..##..#.##..#......#.#..######.#.#..#..#.##.###...###############.#.##..#####.##..###.#.####.########.####..#..##########.##...#..#.##..#..#..####.##..###..#.#..####.######.#.###.##.#...#.####.########...
output:
1
result:
ok single line: '1'
Test #112:
score: 0
Accepted
time: 23ms
memory: 7832kb
input:
1732 1732 1732 1384 1517 1391 163 ##################################################################################################################################.#######################################################################################################################################...
output:
1
result:
ok single line: '1'
Test #113:
score: 0
Accepted
time: 109ms
memory: 12532kb
input:
1 3000000 1 1 373836 1 2935057 .............................................................................#..................................................................................................................................................................................................
output:
25447
result:
ok single line: '25447'
Test #114:
score: 0
Accepted
time: 119ms
memory: 11424kb
input:
1 3000000 1 1 80444 1 1787839 ####################################################################################################################################################################.##############################.##########################################################################...
output:
1690196
result:
ok single line: '1690196'
Test #115:
score: 0
Accepted
time: 892ms
memory: 10748kb
input:
57 52631 57 46 47146 41 2625 ###.....##.##..##.#.#.#.#.###..##..###...#..#####.#.###.###..##.#..######.#.##..###.##.#####..#######...#..##..######.###.##.#.######..##.##..####.#.#.##.##.####..#########.#.######..##...#####..###...##..##.######.#.###..#####..#.#...####.####.##...##...####..#...####.....
output:
699
result:
ok single line: '699'
Test #116:
score: 0
Accepted
time: 436ms
memory: 9416kb
input:
90 33333 90 10 31119 60 18659 #.##.#######.#.#.##.##..###..#...#..#......#..####.#.#######.#.####..###.#.#.##.#.##.#..#.#.###.#.##..#...##..####.#.##.#.#.#.###....##..#..#...#..####....##..######.....#.####..####...####..#.#.#...####......#.##.##.######.#####.#.#..#...####...##.#.##..##.#.###.###......
output:
128
result:
ok single line: '128'
Test #117:
score: 0
Accepted
time: 448ms
memory: 10016kb
input:
144 20833 144 26 3250 75 9451 ####.#.#..#.#.#.#.######.#..####....#..##.#####....##.#...##....##..#.#..##.#.###..####..##.#....#...#.#.#####.#.#.###..#.####..##..##.#...#####.....#.#.##...#..########.###...#######..#..#.#.##.#.#.#..######.#.##..#....#..#..#....###...###.#.###..#.###.....##..#.#.####...
output:
41
result:
ok single line: '41'
Test #118:
score: 0
Accepted
time: 928ms
memory: 13336kb
input:
228 13157 228 167 12504 80 525 ##.##..#.##..##.....#.###########..#######..##..###..#.....##.###.#.######.#.###.#######..##..#.#..##....#.....#######..#####..#.#.#...#.##....###.#.###########..#.####..#.###.###########...###.###..#####.#..##.###.####.##.####.#####..##...##.#..#..####.##.#....####......
output:
51
result:
ok single line: '51'
Test #119:
score: 0
Accepted
time: 135ms
memory: 17152kb
input:
1732 1732 1 902 98 138 1552 ...................................................................................................................................................................................................................................................................................
output:
24
result:
ok single line: '24'
Test #120:
score: 0
Accepted
time: 207ms
memory: 14604kb
input:
1732 1732 1 1140 1484 1239 196 ................................................................................................................................................................................................................................................................................
output:
104
result:
ok single line: '104'
Test #121:
score: 0
Accepted
time: 360ms
memory: 11504kb
input:
1732 1732 1 320 975 1066 1240 .................................................................................................................................................................................................................................................................................
output:
794
result:
ok single line: '794'
Subtask #8:
score: 6
Accepted
Dependency #7:
100%
Accepted
Test #122:
score: 6
Accepted
time: 691ms
memory: 17612kb
input:
2449 2449 1 221 573 1987 2242 ###########.##.################.##.############.##############.##################.##########.##########.#########.#########.######.############################.###.########.####.##########.#########.##############.#.#######.#############.########.#######################...
output:
2243
result:
ok single line: '2243'
Test #123:
score: 0
Accepted
time: 845ms
memory: 13720kb
input:
423 7339 400 202 2322 164 6231 ############.###.################.######.#.#############################.#########.####.###################.############.############.##########################################.########################.##.###################.##################.#########################...
output:
10
result:
ok single line: '10'
Test #124:
score: 0
Accepted
time: 1149ms
memory: 16256kb
input:
562 6516 8 549 2863 319 196 #.###...##.#.#...#...#.#...##.##.####.#.#.####.###.#.#.#..###..####.#....#...#.#.#.####..#...##....#....##.....#.#..###.####.......#.#...#.##..#..#.#.##..#..###..#..###......#...##.##..####.....##...####...#########..####.##.###...#.###..#.#...##...#.######..##....##..##....
output:
135
result:
ok single line: '135'
Test #125:
score: 0
Accepted
time: 136ms
memory: 11704kb
input:
33 180735 1 30 144349 3 160285 .##..#.#.#..#.##..###.###.##########.####.########.##..####.####.####..###################.######.####..####.######.##.###.###.########.##.###.####.#.#.#####.###########.#.#####..#.###.###.############.#.###....##..###.###.########.#..#.####.####.##.#######..####.#.#.#...
output:
9056
result:
ok single line: '9056'
Test #126:
score: 0
Accepted
time: 213ms
memory: 29060kb
input:
2449 2449 1 2367 2132 373 1253 #..................................................................#...............................................................................................................................................................................#............................
output:
0
result:
ok single line: '0'
Test #127:
score: 0
Accepted
time: 507ms
memory: 17316kb
input:
2449 2449 1 1319 1761 2366 1093 #.###..####.#.##.#.#######.#.##.##...#.##.###...###.###.#....###.....#.#.#.####.####.####.##.##.##.#.###.######..###.#.#..#####.#..######.#.#.#.#.###..#..#.#...######..#.###..##..####..#######.##...#..#######....###.#...##..######.##.###...#.###.#####.#.#.###..#....#....
output:
284
result:
ok single line: '284'
Test #128:
score: 0
Accepted
time: 695ms
memory: 17240kb
input:
2449 2449 1 474 22 2171 1860 #############.###############################.#########################.#######################################################################################################################################################################################################...
output:
3156
result:
ok single line: '3156'
Test #129:
score: 0
Accepted
time: 237ms
memory: 28276kb
input:
2449 2449 2449 103 250 969 1546 ................................#...................................................................................................................................................................................................................................#..........
output:
0
result:
ok single line: '0'
Test #130:
score: 0
Accepted
time: 45ms
memory: 10180kb
input:
2449 2449 2449 2333 1437 1154 109 #.#.##.#....####..###.##.##.#.##.#....###..##.#..##.#.##.#######.###..#.#.#.#.#.####...##..#.##########....#.######.#.##.#..#####.##.#.....#.####...#..###.##...#..#.##.....##.##....#####.##...##.##.#.#..#.##.#######..########.###.#...#..#..#####.#..######..######..#...
output:
1
result:
ok single line: '1'
Test #131:
score: 0
Accepted
time: 39ms
memory: 11724kb
input:
2449 2449 2449 1201 1533 2370 35 #############################################################################################################.###################################################################.#########################################################################################...
output:
1
result:
ok single line: '1'
Test #132:
score: 0
Accepted
time: 152ms
memory: 15376kb
input:
1 6000000 1 1 2195469 1 368116 ................................................................................................................................................................................................................................................#...............................
output:
18302
result:
ok single line: '18302'
Test #133:
score: 0
Accepted
time: 289ms
memory: 14792kb
input:
1 6000000 1 1 2514105 1 5002744 .################################################################################################.#####################################.#############################.########.###########################################.###############.#################################...
output:
2463413
result:
ok single line: '2463413'
Test #134:
score: 0
Accepted
time: 1596ms
memory: 15872kb
input:
72 83333 72 56 23691 13 70663 #####.....#.##...#########.##.####..###.#.#####.....#####...#.#..####.#####.#..###.#....##.######.#.###..##.#.#######.##.##.##.#..##..##..#######.######...##.#.#.####.####.###.######.#.#.#...###..#..#.#.#..#####.#..#.#.#.##..#.#.#....#.....##..#.##.###..##...#.#####.......
output:
592
result:
ok single line: '592'
Test #135:
score: 0
Accepted
time: 1468ms
memory: 15040kb
input:
114 52631 114 27 7458 105 40769 .###.#.#..#######.#...####.#####..#.#####..#####.##.#..#..#.#.#..#.#.#######..#####..#.#...#.###.#..##.########.####.##.##.#.....#.###.#####.#...##..##..##.###......#.#.##.##.#######..#.##.##.##.....###...#.#.#.#####.###..#.#####.###...##.###...#..#.#..#######.##.#.#....
output:
273
result:
ok single line: '273'
Test #136:
score: 0
Accepted
time: 1659ms
memory: 16812kb
input:
181 33149 181 120 7874 65 28546 .###..#.######.###.##.###.#.#####.###.....#####.##.#.#.#######.#.#..#######..#...#####..####..##..##..#.###.#.####....########.#########.#.##.#######.###.#.###..#..##...#####...###.##.#...#####.#.#####.#.###..#..#.#.####.#.##...#.###.###.#####..###.####.#.#.###.####.....
output:
109
result:
ok single line: '109'
Test #137:
score: 0
Accepted
time: 1335ms
memory: 16704kb
input:
288 20833 288 248 12159 178 19038 .#####.#######.##.####...##..##.#....##.#.##.##.####..######..#..#.#.#####..#####.#..#...########.#..##########.##.##.#.####.#..#.####.###.##..##.##..##.#.##.##..######....###.#.####..#.##.####.#..######.#.#...#.#...####..###.#....#.#....#.#...##..######.....#.#.#.#...
output:
24
result:
ok single line: '24'
Test #138:
score: 0
Accepted
time: 1151ms
memory: 333148kb
input:
57 105263 57 3 7864 32 66457 ....#...#...#..#.#..#...##..###...#.....##..#.#...#.#.#.#..........##....#..#.....##....#.#..#.....###....#...#.##...##...#....##..##.....#..##.#.#.#...#..#.#.##.......###.#.###..###.....#.....#........#...#..........#.#..#...####.#.#.....###..#..#...#.##..#.#..#...........
output:
6
result:
ok single line: '6'
Test #139:
score: 0
Accepted
time: 247ms
memory: 181648kb
input:
72 83333 72 8 22180 36 50149 ....#....#..##....###......##..#.....##...#.#....##...#.####..####.##..###.#.###.......######......#....###..##.##.#..###.###...#...#..#....#.###.....#.##..#.##........##.....#####......#..##.......#.##.#....#.........#..........#.....#.##.#....#.#....###.....#.###.#.#.....
output:
0
result:
ok single line: '0'
Test #140:
score: 0
Accepted
time: 384ms
memory: 287020kb
input:
114 52631 114 48 45448 25 5761 ..#...#.#......#....#...#..#.###...#..#.#...#####.##..#.#..#....#...##.#....##.....#..###...#.#.#.##..#....#..##.###.##.#.#.....#...#...###.#......##.###.#.#.###...#.#..#.#..#..............###.....##....#...#..#......#..#.#..##.#..#..##.....###.#.#.#.....#..##..###.......
output:
0
result:
ok single line: '0'
Test #141:
score: 0
Accepted
time: 1755ms
memory: 1007900kb
input:
181 33149 181 71 14607 15 1097 #......##..##..##.###.#..#.#..#..#...#...##.#...###...#.#.....#.....##....#.###.#..####.#.########.####.....##.###......#.....#.#...#.#...###..#.###.....#......#.#...####...#.......#....#........#..#..##.#.....#.......#...###.#...##.#.....##.##.#.......#.##.##...#...#....
output:
1
result:
ok single line: '1'
Test #142:
score: 0
Accepted
time: 442ms
memory: 22336kb
input:
2449 2449 1 2367 2132 373 1253 ................................................................................................................................................................................................................................................................................
output:
43
result:
ok single line: '43'
Test #143:
score: 0
Accepted
time: 471ms
memory: 19124kb
input:
2449 2449 1 1366 1852 2224 451 ................................................................................................................................................................................................................................................................................
output:
179
result:
ok single line: '179'
Test #144:
score: 0
Accepted
time: 379ms
memory: 17304kb
input:
2449 2449 1 474 22 2171 1860 ..................................................................................................................................................................................................................................................................................
output:
291
result:
ok single line: '291'
Extra Test:
score: 0
Extra Test Passed