F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

zhx's submissions

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 2584    Accepted Submission(s): 777


Problem Description
As one of the most powerful brushes, zhx submits a lot of code on many oj and most of them got AC.
One day, zhx wants to count how many submissions he made on $n$ ojs. He knows that on the $i^{th}$ oj, he made $a_i$ submissions. And what you should do is to add them up.
To make the problem more complex, zhx gives you $n$ $B-base$ numbers and you should also return a $B-base$ number to him.
What's more, zhx is so naive that he doesn't carry a number while adding. That means, his answer to $5 + 6$ in $10-base$ is $1$. And he also asked you to calculate in his way.
 

Input
Multiply test cases(less than $1000$). Seek $EOF$ as the end of the file.
For each test, there are two integers $n$ and $B$ separated by a space. ($1 \leq n \leq 100$, $2 \leq B \leq 36$)
Then come n lines. In each line there is a $B-base$ number(may contain leading zeros). The digits are from $0$ to $9$ then from $a$ to $z$(lowercase). The length of a number will not execeed 200.
 

Output
For each test case, output a single line indicating the answer in $B-base$(no leading zero).
 

Sample Input
2 3 2 2 1 4 233 3 16 ab bc cd
 

Sample Output
1 233 14
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-23 23:25:18, Gzip enabled