QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22339. Xúc xắc của bò

Statistics

Bessie thích trò chơi bàn cờ và nhập vai nên thuyết phục Farmer John chở đến cửa hàng sở thích, nơi cô mua ba xúc xắc. Các xúc xắc công bằng có lần lượt $S1$, $S2$, $S3$ mặt, $(2 \le S1 \le 20; 2 \le S2 \le 20; 2 \le S3 \le 40)$.

Bessie gieo liên tục để tìm tổng của ba xúc xắc xuất hiện thường xuyên nhất.

Biết số mặt mỗi xúc xắc, hãy xác định tổng thường gặp nhất. Nếu có nhiều tổng như vậy, báo tổng nhỏ nhất.

Dữ liệu vào

  • Dòng 1: ba số nguyên $S1$, $S2$, $S3$ cách nhau bởi khoảng trắng.

Dữ liệu ra

  • Dòng 1: tổng nguyên nhỏ nhất trong các tổng xuất hiện nhiều nhất khi xét mọi tổ hợp gieo có thể.

Ví dụ

Dữ liệu vào 1

3 2 3

Dữ liệu ra 1

5

Ghi chú

Dưới đây là mọi kết quả có thể.

1 1 1 -> 3  1 2 1 -> 4  2 1 1 -> 4  2 2 1 -> 5  3 1 1 -> 5  3 2 1 -> 6 1 1 2 -> 4  1 2 2 -> 5  2 1 2 -> 5  2 2 2 -> 6  3 1 2 -> 6  3 2 2 -> 7 1 1 3 -> 5  1 2 3 -> 6  2 1 3 -> 6  2 2 3 -> 7  3 1 3 -> 7  3 2 3 -> 8

5 và 6 xuất hiện nhiều nhất, mỗi tổng năm lần, nên đáp án là 5.

Nhiệm vụ con

Điểm: 70

Tác giả bài toán: Rob Kolstad, 2008

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.