NOIP2016:pencil

#include
#include
#include
using namespace std;
int a[5],b[5];
int main(){
	freopen("pencil.in","r",stdin);
	freopen("pencil.out","w",stdout);
	int i,j,k,m,n,sum=0,prize=2147483647;
	scanf("%d",&n);
	for(i=1;i<=3;i++){
		scanf("%d%d",&a[i],&b[i]);
	}
	for(i=1;i<=3;i++){
		if(n%a[i]==0){
			sum=n/a[i];
		}else{
		sum=n/a[i]+1;}
		if(b[i]*sum

你可能感兴趣的:(NOIP)