Cod sursa(job #672213)
Utilizator | Data | 1 februarie 2012 18:58:47 | |
---|---|---|---|
Problema | Energii | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{int g,w,cant,cost,i,min=6000,ok;
ifstream f("energii.in");
f>>g>>w;
for(i=1;i<=g;i++)
{
f>>cant>>cost;
if(w/cant*cost<min)
min=w/cant*cost;
}
ofstream h("energii.out");
h<<min;
return 0;
}