결승 진출팀
시간 제한3초메모리 제한1024 MB
월드 파이널 슬롯 수 N과 여섯 지역의 통계가 주어질 때, 사이트 점수 규칙에 따라 대만 지역에 배정되는 슬롯 수를 구합니다.
문제
Frank는 아시아 태평양 지역에서 세계 결선 진출권을 얻으려고 최선을 다하고 있다. 하지만 자신의 가능성을 가늠할 선발 규칙을 찾지 못했다. 어젯밤 Frank의 코치가 다음 문서를 찾았다.
=====================================================================
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.
=====================================================================
이 문서가 아시아 태평양 지역 팀에 적용되는 최종 선발 규칙이라고 가정하자. 과 사이트 점수를 계산하는 데 필요한 수가 주어졌을 때, 타이완에 배정되는 슬롯 수를 구하는 프로그램을 작성하라.
입력
입력은 7줄이다. 첫 줄에는 ICPC 본부가 주는 세계 결선 슬롯 수 이 주어진다. 이어지는 여섯 줄에는 문자열 와 음이 아닌 정수 다섯 개 , , , , 가 공백으로 구분되어 주어진다.
는 지역 대회를 개최하는 국가다. 는 국가 가 개최한 예선에서 문제를 최소 하나 푼 팀 수다. 는 국가 가 개최한 예선에서 문제를 최소 하나 푼 대학 수다. 는 국가 가 개최한 지역 대회에서 문제를 최소 하나 푼 팀 수다. 는 국가 가 개최한 지역 대회에서 문제를 최소 하나 푼 대학 수다. 는 국가 가 개최한 지역 대회에서 문제를 최소 하나 푼 외국 팀 수다.
출력
타이완에 배정되는 슬롯 수를 출력한다.
제한
- 은 6 이상 50 이하이다.
- 각 줄의 는 서로 다르다.
- 는 베트남, 인도네시아, 필리핀, 한국, 타이완, 일본 중 하나다.
- 서로 다른 지역 대회의 사이트 점수는 서로 다르다고 가정해도 된다.
- 입력 파일의 크기는 64킬로바이트를 넘지 않는다.
힌트
문제에 나온 문서는 공식 문서가 아니다. 공식 규칙은 CJ Hwang 교수의 블로그 https://icpcasia.wp.txstate.edu/를 참고하라.