Skip to content

Instantly share code, notes, and snippets.

@pureexe
Created August 5, 2013 09:21
Show Gist options
  • Select an option

  • Save pureexe/6154571 to your computer and use it in GitHub Desktop.

Select an option

Save pureexe/6154571 to your computer and use it in GitHub Desktop.
#include<iostream>
using namespace std;
int main()
{
int i,x,isMember,upper,n,sum=0;
cin >>isMember>>upper>>n;
for(i=0;i<n;i++)
{
cin >>x;
sum+=x;
}
if(isMember==1)
sum=sum*9/10;
cout << sum <<"\n";
if(sum>=upper)
cout << "FREE\n";
else
{
cout << n*15 <<"\n";
sum+=15*n;
}
cout << sum;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment