Created
July 11, 2014 10:58
-
-
Save kdxu/cbd502eac68f1810f851 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<sstream> | |
#include<string> | |
#include<cmath> | |
#include<cstdio> | |
#include<vector> | |
#include<map> | |
#include<set> | |
#include<queue> | |
#include<deque> | |
#include<algorithm> | |
#include<functional> | |
#include<numeric> | |
#define rep(i,b) for(int i = 0 ;i < b ; i++) | |
using namespace std; | |
int main(){ | |
//int max = 0; | |
//int n; | |
while(1){ | |
int x,y,s; | |
cin >> x >> y >> s; | |
if(x==0&&y==0&&s==0){break;} | |
int result=0; | |
//5%の税込み価格リスト | |
int dict[2001]; | |
for(int i=0;i<(2000+1);i++){dict[i]=-1;} | |
dict[1] = 1; | |
dict[0] = 0; | |
for(int i=2;i<(1000);i++){ | |
float a=i*(100+x)/100; | |
int b=int(a); | |
//cout << b << endl; | |
dict[b]=i; | |
} | |
//入ってないところ埋める | |
/* | |
for(int i=1;i<(s*s+1);i++){ | |
if(dict[i]==-1){dict[i]=dict[i-1]; | |
//if(i<s*5){cout << i << endl;} | |
} | |
}*/ | |
for(int i=1;i<(s/2+1);i++){ | |
float a=float(i);//商品1 | |
float b=float(s)-a;//商品2 | |
//int a=i;int b=s-a; | |
//cout << "a="<<a<< " b=" << b << " "; | |
//if(dict[i]==-1||dict[s-1]==-1){continue;} | |
a = dict[i]; | |
//cout << "dicta=" << a <<" "; | |
a *= (100+y); | |
a/=100; | |
//cout << a << " "; | |
//b | |
b=dict[s-i]; | |
//cout << "dictb=" << b <<" "; | |
b= b*(100+y); | |
b/=100; | |
//cout << b << " " ; | |
int c=int(a)+int(b); | |
// cout << c << endl; | |
result = max(result,c); | |
} | |
cout << result << endl; | |
} | |
//cout << max << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment