Author: Apoorv Dixit
Tester: Prashant Singh
Editorial: Shivendra Tripathi
Difficulty:
Cakewalk
Prerequisite:
Array
Explanation & Algorithm:
Here in this problem, we are given Chef’s previous year rating. So to calculate the final rating after giving n number of contests in the present year we will simply keep on adding each contest rating in the initially given rating.
Solution:
Setter's Code
#include< iostream >
#define ii long long int
using namespace std;
int main()
{
ii initial,n,sum,x;
cin>>initial>>n;
sum=initial;
for(ii i=0;i<n;i++)
{
cin>>x;
sum+=x;
}
cout<<sum;
}