Codechef Problems : Food Costs (FOODCOST)
Problem Statement:
Solution:
Given,
X : Price of Mess food for a day
Y : Price of food at fancy restaurant at a day
6 : days in a week when chef eats food at mess (non-Sunday)
1 : days in a week when chef eats food at fancy restaurant (Sunday)
to find: total cost of food per week
total cost of food per week = food cost of mess + food cost of restaurant
= 6 * X + 1 * Y
Code Solution:
#include <bits/stdc++.h>
using namespace std;
int main() {
int x, y;
cin >> x >> y;
cout << 6 * x + y << endl;
return 0;
}
Comments
Post a Comment