Time Limit: 1000MS | Memory Limit: 65536K | |
Total Submissions: 10150 | Accepted: 5061 |
#include<iostream> #include<cstdio> using namespace std; int main() { int s,d; while(cin>>s>>d) { if(4*s<d&&10*s-2*d>0) cout<<10*s-2*d<<endl; else if(3*s<2*d&&2*s-d>0) cout<<8*s-4*d<<endl; else if(2*s<3*d&&s>d) cout<<6*s-6*d<<endl; else if(s<4*d&&s>3*d) cout<<3*s-9*d<<endl; else cout<<"Deficit"<<endl; } return 0; }
原文:http://blog.csdn.net/fanerxiaoqinnian/article/details/37963201