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, 11:50 a.m. edit 3

    oops (edited)


  • -12
    hewmatt10  commented on March 10, 2020, 1:54 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


    • 1
      greedo7  commented on Dec. 14, 2023, 10:59 a.m.

      :3


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

    This comment is hidden due to too much negative feedback. Click here to view it.


  • -13
    hewmatt10  commented on Jan. 18, 2020, 10:04 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.