Main.cpp: In function 'void work()':
Main.cpp:14:12: error: 'n' was not declared in this scope
14 | cin >> n >> m;
| ^
Main.cpp:14:17: error: 'm' was not declared in this scope
14 | cin >> n >> m;
| ^
Main.cpp:27:12: error: 'q' was not declared in this scope
27 | cin >> q;
| ^
Main.cpp:33:12: error: 'b' was not declared in this scope
33 | if(b.size() > M)
| ^
Main.cpp: In function 'int main()':
Main.cpp:51:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
51 | freopen("boardgame.inp", "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:52:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
52 | freopen("boardgame.out", "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~