正文
增加 2 行删除 2 行
22 行未改动2324252627282930313233342 行未改动22 行未改动signed main(){cin >> n >> m >> a >> b >> x >> y;yyc = min(a, x) - 1, lby = max(a, x);_yyc = min(b, y) - 1, _lby = max(b, y);cnt = lby - yyc + _lby - _yyc - 2;for(int i = 1; i <= yyc; ++i) ans = (ans + qstp(yyc - i + 1 + cnt, mod - 2)) % mod;for(int i = lby; i < n; ++i) ans = (ans + qstp(i - lby + 1 + cnt, mod - 2)) % mod;for(int i = 1; i <= _yyc; ++i) ans = (ans + qstp(_yyc - i + 1 + cnt, mod - 2)) % mod;for(int i = _lby; i < m; ++i) ans = (ans + qstp(i - _lby + 1 + cnt, mod - 2)) % mod;cout << (ans + 1) % mod;return 0;2 行未改动22 行未改动2324252627282930313233342 行未改动22 行未改动signed main(){cin >> n >> m >> a >> b >> x >> y;yyc = min(a, x) - 1, lby = max(a, x);_yyc = min(b, y) - 1, _lby = max(b, y);cnt = lby - yyc + _lby - _yyc - 2;for(int i = 1; i <= yyc; ++i) ans = (ans + qstp(yyc - i + 1 + cnt, mod - 2)) % mod;for(int i = lby; i < n; ++i) ans = (ans + qstp(i - lby + 1 + cnt, mod - 2)) % mod;for(int i = 1; i <= _yyc; ++i) ans = (ans + qstp(_yyc - i + 1 + cnt, mod - 2)) % mod;for(int i = _lby; i < m; ++i) ans = (ans + qstp(i - _lby + 1 + cnt, mod - 2)) % mod;cout << (ans + 1) % mod;return 0;2 行未改动