The 10th Blue Bridge Cup java-c group-maximum rainfall

1. Problem description:

Total score for this question: 15 points
Due to the years of drought in the land of sand, the mage Xiao Ming is preparing to cast a mysterious spell of his own to pray for rain. This spell requires 49 spell charms in his hand, with 49 numbers from 1 to 49 written on them. The spell lasts for 7 weeks, and Xiao Ming uses a spell talisman every day. The spell talisman cannot be reused. Every week, the energy produced by Xiao Ming's spells is the median of the numbers on the 7 spell symbols this week. After 7 weeks of casting the spell, the rain request will be successful, and the rainfall is the median energy of 7 weeks. Due to the drought for too long, Xiao Ming hopes that the amount of rainfall for this rain request will be as large as possible. What is the maximum value?
[Answer Submission]
This is a question that fills in the blanks with the result. You only need to calculate the result and submit it. The result of this question is an integer. Only fill in this integer when submitting the answer, and fill in the extra content will not be scored.

2. Thinking analysis:

I feel that this is a question of the ability to think about problems. At the beginning, I didn’t have any ideas. I looked at the blogs written on the Internet. I felt that the more important thing is to arrange the big numbers backwards, so starting from the seventh week, the largest The four numbers are arranged at the back, the sixth week...the fourth week is also similar. In the end, it can be arranged like the following, just take the middle number 34, and no matter what the arrangement is, the median should be the largest. It is necessary to make the largest 16 numbers go to the back, and the smallest number among the largest 16 numbers is 34, and the smallest number is the median (my understanding)

27 28 29 30 31 32 33
20 21 22 23 24 25 26
13 14 15 16 17 18 19
10 11 12 34 35 36 37
7 8 9 38 39 40 41
4 5 6 42 43 44 45
1 2 3 46 47 48 49

Guess you like

Origin blog.csdn.net/qq_39445165/article/details/115007857