Codeforces Round #567 (Div. 2) A.Chunga-Changa

Posted huangdf

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Codeforces Round #567 (Div. 2) A.Chunga-Changa相关的知识,希望对你有一定的参考价值。

原文链接:传送

 1 #include"algorithm"
 2 #include"iostream"
 3 #include"cmath"
 4 using namespace std;
 5 long long x,y,z,ans;
 6 int main(){
 7     while(cin>>x>>y>>z){
 8        ans=0;
 9        long long s=0,i=0,j=0;
10        s=(x+y)/z;
11        cout<<s<<" ";
12        i=x%z;
13        j=y%z;
14     if((i+j)>=z){
15         if(i>j) cout<<z-i<<endl;
16         else cout<<z-j<<endl;
17     }
18     else {
19         cout<<0<<endl;
20     }
21     
22     }
23     return 0;    
24     
25 }

以上是关于Codeforces Round #567 (Div. 2) A.Chunga-Changa的主要内容,如果未能解决你的问题,请参考以下文章

Codeforces Round #430 (Div. 2)

Codeforces Round #436 E. Fire(背包dp+输出路径)

[ACM]Codeforces Round #534 (Div. 2)

Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) A. Fraction

Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) B. Maxim Buys an Apartment

Codeforces Round #726 (Div. 2) B. Bad Boy(贪心)