HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


50966 - TVSH

Section problems

• 50821 - Derivative of an array
• 50808 - Total Distance Traveled
• 50452 - Multiplication Table
• 50456 - nth Digit of a Number
• 50817 - The Knight Move
• 50463 - Drawing a Triangle
• 50537 - esreveR Triangle
• 50385 - From m to n
• 50966 - TVSH
• 503013 - DNA
• 50970 - Marbles
• 50943 - Word Game
• 50971 - Belote Game
• 50942 - Win or Lose
• 50894 - ASCII Codes
• 50886 - Even or Odd
• 50897 - Prime Number

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.

TVSH

After the new TVSH (Value Added Tax) regulation, government is planning some changes now. There will be three types of taxes

  1. Medical expenses: 6%
  2. Educational expenses: 10%
  3. Others: 20%

Question: Write a program that gets the type and amount of n expenses, and then it calculates the total tax to be paid.

Input specification
You will be first given one integer(n). Then, in the following n lines, you will be given 2 integers (information for each expense):

  • the type: an integer between 1 and 3 ( 1 is Medical expense, etc.)
  • and the amount (base price before tax is added) an integer between 1 and 10,000

where 0 ≤ n ≤ 10,000.

Output specification
Show one number (with two digits after the floating point): total amount of tax to be paid.

Sample Input I
2
1 1000
3 500

Sample Input II
6
3 2000
2 1100
2 400
3 900
1 1900
3 500

Sample Output I
160

Sample Output II
944

Explanation for sample 1: The tax for the first item is 60leke and the tax for the second item is 100leke. So, the total amount of tax to be paid is 160leke.

Для отправки решений необходимо выполнить вход.

www.contester.ru