#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main (int argc, char *argv[])
{
float ATK = argc > 1 ? atof(argv[1]) : 11606.65;
float FACTOR = argc > 2 ? atof(argv[2]) : 0.0192;
int BAL = argc > 3 ? atoi(argv[3]) : 90;
float MIN = argc > 4 ? atof(argv[4]) : 0.0;
float MAX = argc > 5 ? atof(argv[5]) : 12000.0;
float STEP = argc > 6 ? atof(argv[6]) : 0.1;
cout << " ATK:" << ATK;
cout << " FACTOR:" << FACTOR;
cout << " BAL:" << BAL;
cout << " MIN:" << MIN;
cout << " MAX:" << MAX;
cout << " STEP:" << STEP << endl;
vector<int> exp_damage;
int i;
while(cin >> i)
exp_damage.push_back (i);
cout << "origin size:" << exp_damage.size() << endl;
std::sort (exp_damage.begin(), exp_damage.end());
vector<int>::iterator it;
it = std::unique (exp_damage.begin(), exp_damage.end());
exp_damage.resize( std::distance(exp_damage.begin(),it) );
cout << "unique size:" << exp_damage.size() << endl;
int pre = *exp_damage.begin(); // 前一個數字
for( it = exp_damage.begin(); it != exp_damage.end(); ++it) {
cout << *it << " [ " << *it-pre << " ]\n" ;
pre = *it;
}
float add_attack,bal_0,bal_1;
vector<int> theo_damage(((100-BAL)*2+1)*((100-BAL)*2+1),0);
vector<float> output;
for( add_attack = MIN; add_attack <= MAX; add_attack += STEP) {
it = theo_damage.begin();
for( bal_0 = float(BAL)/100; bal_0 <= 1.0; bal_0 += 0.005) {
for( bal_1 = float(BAL)/100; bal_1 <= 1.0; bal_1 += 0.005 ) {
*it = floor( (ATK*bal_0 + add_attack*bal_1) * FACTOR );
++it;
}
}
int flag = 0;
for( unsigned int i = 0; i < exp_damage.size(); i++ ) {
it = find (theo_damage.begin(), theo_damage.end(), exp_damage[i]);
if( it == theo_damage.end() ) {
flag = 1;
break;
}
}
if( flag == 0 )
output.push_back(add_attack);
}
i = 0;
for(float f=STEP; f < 0.99; i++)
f = f * 10;
cout << fixed;
cout.precision(i);
for( unsigned int i=0; i<output.size(); ++i )
cout << output[i] << " ";
return 0;
}