Cod sursa(job #296146)

Utilizator mottyMatei-Dan Epure motty Data 4 aprilie 2009 12:38:44
Problema Energii Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.38 kb
#include <stdio.h>
int g,w,suma=0;
int e[1001];
int c[1001];
int v[10001];
void citire()
{
	freopen("energii.in","r",stdin);
	scanf("%d %d",&g,&w);
	for(int i=1;i<=g;i++)
	{
		scanf("%d %d",&e[i],&c[i]);
		suma=suma+e[i];
	}
}
void obtinere()
{
}
void scriere()
{
}
int main()
{
	citire();
	if(suma<w)
	{
		printf("-1");
		return 0;
	}
	obtinere();
	scriere();
}