Cod sursa(job #1408151)
| Utilizator | Data | 29 martie 2015 20:44:10 | |
|---|---|---|---|
| Problema | Xor Max | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include<iostream>
#include<iomanip>
#include<fstream>
using namespace std;
ifstream in("sda.in");
ofstream out("out.out");
int n;
double C,F,X,S=2,t1,t2,T=0,G=-1;
int main()
{
in>>n;
out<<fixed<<setprecision(9);
in>>fixed>>setprecision(9);
for(int i=1;i<=n;i++)
{
in>>C>>F>>X;
T=0;
S=2;
G=-1;
while(G==-1)
{
t1=X/S;
t2=X/(S+F)+C/S;
if(t2<t1)
{
T+=t2-(X/(S+F));
S+=F;
}
else
{
G=T+t1;
}
}
out<<"Case #"<<i<<": "<<G<<"\n";
}
}