This page is still under construction.

Parts of this page are still being built. What you see may change.

ISBN 1-3-Sum

Interview

Time limit1sMemory limit128 MB

Summary
Given the last three digits of an ISBN starting with 9780921418, compute the 1-3-sum and print it.
Level

Easy2 of 10

Topics
Math, Implementation, Simulation
Solved
No attempts yet

Problem

The International Standard Book Number (ISBN) is a 13-digit code that identifies a book. These codes have a special property that lets you detect whether the number was written down correctly.

The 1-3-sum of a 13-digit number is obtained by multiplying its digits alternately by 1 and 3 and then adding the results. Counting from the first digit, the odd-positioned digits are multiplied by 1 and the even-positioned digits by 3.

For example, the 1-3-sum of the number 97809214189489780921418948 is computed as

9⋅1+7⋅3+8⋅1+0⋅3+9⋅1+2⋅3+1⋅1+4⋅3+1⋅1+8⋅3+9⋅1+4⋅3+8⋅1=1209\cdot1 + 7\cdot3 + 8\cdot1 + 0\cdot3 + 9\cdot1 + 2\cdot3 + 1\cdot1 + 4\cdot3 + 1\cdot1 + 8\cdot3 + 9\cdot1 + 4\cdot3 + 8\cdot1 = 120

The special property of an ISBN is that its 1-3-sum is always a multiple of 10.

Write a program that computes the 1-3-sum of a 13-digit number. To reduce the amount of typing, you may assume that the first ten digits are always 97809214189780921418, exactly as in the example above. Your program reads the last three digits and prints the 1-3-sum.

Input

The last three digits are given on three separate lines, one digit per line. Each digit is an integer between 00 and 99 inclusive.

Output

Print the 1-3-sum in the format The 1-3-sum is X, where X is the computed 1-3-sum.

Examples4

  1. Example 1

    Input
    9
    4
    8
    
    Expected output
    The 1-3-sum is 120
    
  2. Example 2

    Input
    0
    0
    0
    
    Expected output
    The 1-3-sum is 91
    
  3. Example 3

    Input
    9
    9
    9
    
    Expected output
    The 1-3-sum is 136
    
  4. Example 4

    Input
    1
    2
    3
    
    Expected output
    The 1-3-sum is 101