#include<iostream>
using namespace std;
int main(){
int t,s,x,i;
cin>>t;
if(t<=3500) cout<<t;
else{
for(i=3600;i<=200000;i+=100){
if(i>=3600&&i<=5000){
x = (i-3500)*0.97;
if((i-x)==t) {
cout<<i; break;
}
}
else if(i>5000&&i<=8000){
x = 1500*0.03+(i-3500-1500)*0.1;
if((i-x)==t) {
cout<<i; break;
}
}
else if(i>8000&&i<=12500){
x = 1500*0.03+(4500-1500)*0.1+(i-4500-3500)*0.2;
if((i-x)==t) {
cout<<i; break;
}
}
else if(i>12500&&i<=47500){
x = 1500*0.03+(4500-1500)*0.1+(9000-4500)*0.2+(i-3500-9000)*0.25;
if((i-x)==t) {
cout<<i; break;
}
}
else if(i>47500&&i<=102500){
x = 1500*0.03+(4500-1500)*0.1+(9000-4500)*0.2+(35000-9000)*0.25+(i-3500-35000)*0.3;
if((i-x)==t) {
cout<<i; break;
}
}
else if(i>102500&&i<=182500){
x = 1500*0.03+(4500-1500)*0.1+(9000-4500)*0.2+(35000-9000)*0.25+(55000-35000)*0.3+(i-3500-55000)*0.35;
if((i-x)==t) {
cout<<i; break;
}
}
else if(i>182500){
x = 1500*0.03+(4500-1500)*0.1+(9000-4500)*0.2+(35000-9000)*0.25+(55000-35000)*0.3+(80000-55000)*0.35+(i-3500-80000)*0.45;
if((i-x)==t) {
cout<<i; break;
}
}
}
}
}
原文:http://www.cnblogs.com/whitehouse2016/p/6532740.html