feat(codeforces): 1017
This commit is contained in:
parent
375a673932
commit
f366180f50
31 changed files with 857 additions and 1 deletions
43
codeforces/1017/b.cc
Normal file
43
codeforces/1017/b.cc
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#include <bits/stdc++.h> // {{{
|
||||
|
||||
// https://codeforces.com/blog/entry/96344
|
||||
|
||||
#pragma GCC optimize("O2,unroll-loops")
|
||||
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
|
||||
|
||||
using namespace std;
|
||||
|
||||
using i32 = int32_t;
|
||||
using u32 = uint32_t;
|
||||
using i64 = int64_t;
|
||||
using u64 = uint64_t;
|
||||
using f64 = double;
|
||||
using f128 = long double;
|
||||
// }}}
|
||||
|
||||
void solve() {
|
||||
int n, m, l, r;
|
||||
cin >> n >> m >> l >> r;
|
||||
|
||||
int lp = max(l, -m), rp = lp + m;
|
||||
if (rp > r) {
|
||||
rp = r;
|
||||
lp = rp - m;
|
||||
}
|
||||
cout << lp << ' ' << rp << '\n';
|
||||
}
|
||||
|
||||
int main() { // {{{
|
||||
cin.tie(nullptr)->sync_with_stdio(false);
|
||||
cin.exceptions(cin.failbit);
|
||||
|
||||
int tc = 1;
|
||||
cin >> tc;
|
||||
|
||||
for (int t = 0; t < tc; ++t) {
|
||||
solve();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
// }}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue