Type: Default 1000ms 256MiB

数据统计

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

你到一个部落中心小镇当统计员,每个部落用不同进制数来汇报他们的人数,你要计算出总数,并用10进制数向上汇报。

Input Format

第一行:一个整数n( 0<n<100),表示共有n个部落。 下面有n行,每行两个用1个空格隔开的整数:bi ci,表示每个部落用bi(2<=bi<=10 )进制数,记录的人数是ci (不超过3位数)。

Output Format

一个整数n

Sample

input

3
3 20
5 10
8 11

output

20

Hint

保证0<n<100,2bi10,ci10000 < n < 100, 2 \leq bi \leq 10, ci \leq 1000

时间限制:1s1 \text {s}

空间限制:256MB256 \text {MB}

20200820进制问题练习

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
8
Start at
2020-8-20 9:19
End at
2020-8-23 9:19
Duration
72 hour(s)
Host
Partic.
23