eolymp
bolt
Try our new interface for solving problems
Problems

Canaries

published at 3/8/24, 9:12:52 am

include <bits/stdc++.h>

define ll long long int

define ld long double

using namespace std; int main(){

ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll n, k;
cin>>n>>k;
if(n%k == 0){
    cout<<n/k<<' '<<n - (k-1);
    return 0;
}
cout<<n/k+1<<' '<<n - (k-1);

} //TECHNOBLADE NEVER DIES

published at 4/23/24, 8:21:58 am

// Online C++ compiler to run C++ program online

include <iostream>

using namespace std; int main() { int n,k,a,b; cin>>n>>k; a=n-k+1; ;

if(n%k==0){ b=n/k;

   cout<<b;

}else{ b=n/k; cout<<b+1; } cout<<" "<<a; return 0; }