Skip to content

宝石商 (Jeweler)

Unrated
日本語

Language

Contribute a translation
Time limit
2000 ms
Memory limit
1024 MB
Submissions
0
Correct
0
Solved by
0
AC rate
—

Statement

宝石商 (Jeweler):公式問題文 1ページ

宝石商 (Jeweler):公式問題文 2ページ

宝石商 (Jeweler):公式問題文 3ページ

宝石商 (Jeweler):公式問題文 4ページ

宝石商 (Jeweler):公式問題文 5ページ

Examples

Sample input 1
3
3 4 10
5 8 20
6 10 30
3
4 6
1 2
6 8
Sample output 1
60
0
50
Sample input 2
4
10 90 1
40 60 2
10 20 4
80 90 8
3
1 15
1 60
1 100
Sample output 2
5
7
15
Sample input 3
10
55 882 861052753
104 734 331227764
492 694 240198464
481 506 377367203
131 185 327968773
124 129 970226535
92 125 133053911
356 442 758055457
21 759 730522637
259 481 948997757
9
50 287
510 735
158 431
113 768
328 894
783 881
163 692
42 862
43 752
Sample output 3
4303050130
2163001618
3957825141
5678671254
4247422035
861052753
4575390808
5678671254
5678671254

Notes

Tags

No tags yet

Source