#include <iostream>
#include<cmath>
#include<ctime>
#include<string>
#include <iomanip>
#include <fstream>
using namespace std;
int compute_profit(int quantity);
int main()
{
int quantity = 1000;
cout << "Quantity " << setw(9) << "Profit-per-item (in $)"<<endl;
for ( ; quantity <= 10000; quantity+=1000)
{
cout<<quantity<< setw(9)<<compute_profit(quantity)<<endl;
}
}
int compute_profit(int quantity)
{
int profit = 0;
if (quantity < 1000)
profit += quantity; // * 1
else
{
profit += 1000;
quantity -= 1000;
if (quantity < 4000)
profit += quantity * 2;
else
{
profit += 8000; // 4000 * 2
quantity -= 4000;
profit += quantity * 5;
}
}
return profit;
}