Codechef Problems: Time Penalty (WAPEN)

 Problem Statement: 

You are participating in CodeChef Starters 173, which has a time penalty of 10 minutes for every incorrect submission you make.
That is, the total penalty for a problem equals the number of minutes from the start of the contest till your submission receives the AC verdict, plus 10 minutes for every incorrect submission made before that.

You solved a problem X minutes after the start of the contest, and made Y incorrect submissions while doing so.
What's the total time penalty for this problem?

Input Format

  • The first and only line of input will contain two space-separated integers X and Y — the number of minutes after which you solved the problem, and the number of wrong submissions you made.

Output Format

Output a single integer: the total time penalty for the problem.

Constraints

  • 1X150
  • 0Y10

Solution: 

Given, 
    X - Time from the start of the contest 
    Y - Number of Incorrect Submissions 

To find - Total Time Penalty for the problem 
Total time penalty = time to solve the problem + Incorrect submission penalty 
                              = X + ( 10 * Y ) 

Code Solution: 

#include <bits/stdc++.h>

using namespace std;

int main() {
    int x, y;
    cin >> x >> y;

    cout << x + 10 * y << endl;
    return 0;
}

Comments

Popular posts from this blog

Codechef Problems: Triangles (TRIANGLE7)

Codechef problems : New Year Resolution (NYRES)

Codechef Problems: Selling Sandwiches (SANDWSHOP)