Please Fill out the Feedback Form for Code Radius

Total Prize Money : PRIZEPOOL | CodeChef Solution Week 1

2 min read

 


Problem

In a coding contest, there are prizes for the top rankers. The prize scheme is as follows:
  • Top 10 participants receive rupees X each.
  • Participants with rank 11 to 100 (both inclusive) receive rupees Y each.
Find the total prize money over all the contestants.

Input Format

First line will contain T, number of test cases. Then the test cases follow.
Each test case contains of a single line of input, two integers X and Y - the prize for top 10 rankers and the prize for ranks 11 to 100 respectively.

Output Format

For each test case, output the total prize money over all the contestants.

Constraints

Sample

Input
4
1000 100
1000 1000
80 1
400 30
Output
19000
100000
890
6700

Explanation

Test Case 1: Top 10 participants receive rupees 1000 and next 90 participants receive rupees 100 each. So, total prize money = 10 . 1000 + 90 . 100 = 19000.
Test Case 2: Top 10 participants receive rupees 1000 and next 90 participants receive rupees 1000 each. So, total prize money = 10 . 1000 + 90 . 1000 = 100000.
Test Case 3: Top 10 participants receive rupees 80 and next 90 participants receive rupee 1 each. So, total prize money = 10 . 80 + 90 . 1 = 890.
Test Case 4: Top 10 participants receive rupees 400 and next 90 participants receive rupees 30 each. So, total prize money = 10 . 400 + 90 . 30 = 6700.

Solution

cpp
#include <iostream> using namespace std; // Solution from : Code Radius [ https://radiuscode.blogspot.com/ ] int main() { int txP; cin>>txP; for(int index=0;index<txP;index++) { int xx,yx; cin>>xx>>yx; cout<<10*xx+90*yx<<endl; } return 0; }
Please First Try to Solve Problem by Yourself.

You may like these posts

  • Problem In mathematics, the degree of polynomials in one variable is the highest power of the variable in the algebraic expression with non-zero coefficient.Chef has a polynomial…
  • ProblemAlice and Bob are meeting after a long time. As usual they love to play some math games. This times Alice takes the call and decides the game. The game is very simple, Alice…
  •  ProblemChef is a big fan of Coldplay. Every Sunday, he will drive to a park taking M minutes to reach there, and during the ride he will play a single song on a loop. Today, …
  • ProblemIf Give an integer N . Write a program to obtain the sum of the first and last digits of this number. Please Share this article... Input Format The first line contains a…
  •  ProblemChefland has 2 different types of coconut, type A and type B. Type A contains only x_a milliliters of coconut water and type B contains only x_b grams of coconut pulp.…
  • ProblemYou and your friend are playing a game with hoops. There are N hoops (where N is odd) in a row. You jump into hoop 1, and your friend jumps into hoop N. Then you jump into h…

Post a Comment