Time Penalty Unlike a usual CodeChef Starters cont...
Creado el: 12 de febrero de 2025
Creado el: 12 de febrero de 2025
Time Penalty
Unlike a usual CodeChef Starters contest, Starters 173 has a time penalty for every wrong submission.
You are participating in CodeChef Starters 173, which has a time penalty of
10
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
10 minutes for every incorrect submission made before that.
You solved a problem
X
X minutes after the start of the contest, and made
Y
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
X and
Y
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.
23
3+2×10=23.
Sample 2:
Input
Output
58 0
58
import java.util.;
import java.lang.;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
}
}
Below is a sample Java solution that reads the inputs, computes the total penalty, and prints the result:
javaimport java.util.*; import java.lang.*; import java.io.*; class Codechef { public static void main (String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); // Minutes after which the problem was solved int Y = sc.nextInt(); // Number of incorrect submissions // Each wrong submission adds 10 minutes to the penalty int totalPenalty = X + (Y * 10); System.out.println(totalPenalty); } }
Explanation:
X and Y, from standard input.X + 10 * Y:
X = minutes after which you solved the problem.Y * 10 = penalty time added for the Y incorrect submissions.