From be585f9753d0607d30d2866f85a2549c809fe73e Mon Sep 17 00:00:00 2001 From: Hiyabye Date: Sat, 3 Feb 2024 16:41:13 +0900 Subject: [PATCH] Add 04307.cpp --- 04xxx/04307.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 04xxx/04307.cpp diff --git a/04xxx/04307.cpp b/04xxx/04307.cpp new file mode 100644 index 00000000..623dc814 --- /dev/null +++ b/04xxx/04307.cpp @@ -0,0 +1,24 @@ +#include +#include +using namespace std; + +void solve(void) { + int l, n; cin >> l >> n; + + int a = 0, b = 0; + for (int i=0; i> ant; + a = max(a, min(ant, l-ant)); + b = max(b, max(ant, l-ant)); + } + cout << a << " " << b << "\n"; +} + +int main(void) { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + int t; cin >> t; + while (t--) solve(); + return 0; +} \ No newline at end of file