A Base Problem

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

You are given 2 integers x and y, which are in base b. Please print out the sum, and product of x and y in base b.

Input Specification

The first line will contain the integer b (2 \le b \le 10).

The second line will contain the integer x.

The third line will contain the integer y.

x and y will each contain at most 5 digits, and each digit will be in the range [0, b). x and y will not contain leading zeros.

Output Specification

On the first line, output the sum of x and y.

On the second line, output the product of x and y.

Subtasks

Subtask 1 [20%]

b = 10

Subtask 2 [80%]

No further constraints.

Sample Input

10
3
5

Sample Output

8
15

Comments


  • 0
    Parsa  commented on Oct. 2, 2022, 3:50 p.m. edit 3

    oops (edited)


  • -13
    hewmatt10  commented on March 10, 2020, 5:54 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • 0
      greedo7  commented on Dec. 14, 2023, 3:59 p.m.

      :3


  • -13
    hewmatt10  commented on Jan. 20, 2020, 5:55 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -14
    hewmatt10  commented on Jan. 19, 2020, 3:04 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.