题解 | #过山车#
过山车
https://ac.nowcoder.com/acm/problem/22237
思路
纸上列出来找规律即可,注意数据范围
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
std::ios::sync_with_stdio(false);
std::cin.tie(0);
ll n,k;
cin>>n>>k;
if((!k)||(n == 1)||(n == k)) cout<<0<<' '<<0;
else{
cout<<1<<' ';
if(n >= 3*k) cout<<2*k;
else cout<<n-k;
}
return 0;
}