Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <map>
- #include <set>
- using namespace std;
- int main() {
- int t;
- cin >> t;
- while (t--) {
- int n, m, X, Y;
- cin >> n >> m >> X >> Y;
- long long ans = 0;
- for (int x = 1; x <= n; ++x)
- for (int y = 1; y <= n; ++y) {
- if (x == X && y == Y)
- continue;
- int cnt = 0;
- cnt += 2 * (n - 1);
- cnt += min(x - 1, y - 1);
- cnt += min(y - 1, n - x);
- cnt += min(n - x, m - y);
- cnt += min(m - y, x - 1);
- if (x == X) {
- if (Y < y)
- cnt -= y;
- else
- cnt -=
- }
- if (y == Y) {
- //
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement