Logo
(追記) (追記ここまで)

26310번 - Finalists 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 (추가 시간 없음) 1024 MB130969374.400%

문제

Frank is trying his best to win a slot in Asia Pacific to the World Finals. But he could not find the selection rules to estimate his chance. Last night, Frank’s coach found the following document.

=====================================================================
World Finals team selection rules from Asia Pacific (2022 cycle)
Due to COVID-19 outbreak, this year's Asia Pacific rules will
again be quite different from those of usual years. The plan
for having an Asia Pacific semi-final contest (play-off contest)
has been cancelled and postponed to the next year.
Only the following six regionals will be held this year.
Ho Chi Minh, Vietnam
Jakarta, Indonesia
Manila, Philippines
Seoul, Korea
Taoyuan, Taiwan
Yokohama, Japan
We have set a team participation rule. This rule is a special one
for this year (2022 cycle) only.
Teams from a hosting country (Indonesia, Japan, Korea, Philippines,
Taiwan and Vietnam) can only join the regional held in their own
country. Universities from non-hosting countries should choose a
regional. Note that all teams from a single university have to join
the same regional.
World Finals team selection rules are as follows.
Apply Steps A1 through A4 below in this order.
A1. Define the site score of a regional as follows.
0.56 * number of universities in regional
+ 0.24 * number of teams in regional
+ 0.14 * number of universities in preliminary contests
+ 0.06 * number of teams in preliminary contests
+ 0.3 * number of foreign teams
Only teams or universities solving at least one problem are counted.
A2. Sort our six regionals according to their site scores.
A3. Let N be the number of World Finals slots given from the ICPC
Headquarters. Until the sum of the number of allocated slots
reaches N, allocate slots to regionals, one by one, in the
descending order of their site scores. When all six regionals
are allocated one slot each, continue from the regional with the
highest site score in the round robin fashion.
A4. For each regional, let M be the number of slots allocated to the
regional through the step A3. Select the M highest ranked
universities. The team with the highest rank in the university
is automatically selected.
=====================================================================

Assume that the document is the final selection rules for teams from Asia Pacific. Given N and the necessary numbers to calculate the site scores, please write a program to compute the number of slots allocated to Taiwan.

입력

There are seven lines in the inputs. The first line contains $N,ドル the number of World Finals slots given from the ICPC Headquarters. Each of the following six lines consists of one string $s$ and five non-negative integers $p_t , p_u, r_t , r_u, f$. The string and the numbers are separated by spaces. $s$ is a country hosting a regional contest. $p_t$ is the number of teams solving at least one problem in the preliminary contests hosted by the country $s$. $p_u$ is the number of universities solving at least one problem in the preliminary contests hosted by the country $s$. $r_t$ is the number of teams solving at least one problem in the regional contest hosted by the country $s$. $r_u$ is the number of universities solving at least one problem in the regional contest hosted by the country $s$. $f$ is the number of foreign teams solving at least one problem in the regional hosted by the country $s$.

출력

Output the number of slots allocated to Taiwan.

제한

  • $N$ is at least 6ドル$ and at most 50ドル$.
  • Each line has a distinct $s$.
  • $s$ is among the following countries: Vietnam, Indonesia, Philippines, Korea, Taiwan, and Japan.
  • 0ドル ≤ p_u ≤ p_t ≤ 5000$
  • 0ドル ≤ r_u ≤ r_t ≤ 300$
  • 0ドル ≤ f ≤ 30$
  • You may assume that distinct regional contests have different site scores.
  • The size of an input file is no more than 64 kilobytes.

예제 입력 1

17
Japan 500 95 40 30 5
Vietnam 400 50 150 40 20
Indonesia 700 25 80 35 20
Taiwan 200 30 100 35 1
Korea 600 100 100 70 0
Philippines 50 10 40 15 15

예제 출력 1

3

예제 입력 2

16
Japan 500 95 40 30 5
Taiwan 200 30 100 35 1
Indonesia 700 25 80 35 20
Philippines 50 10 40 15 15
Korea 600 100 100 70 0
Vietnam 400 50 150 40 20

예제 출력 2

2

노트

The document in the problem statement is not official. Please refer to Prof. CJ Hwang’s blog https://icpcasia.wp.txstate.edu/ for the official rules.

출처

ICPC > Regionals > Asia Pacific > Taiwan > Taiwan Online Programming Contest > TOPC 2022 F번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /