CF81C.Average Score

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

After the educational reform Polycarp studies only two subjects at school, Safety Studies and PE (Physical Education). During the long months of the fourth term, he received nn marks in them. When teachers wrote a mark in the journal, they didn't write in what subject the mark was for, they just wrote the mark.

Now it's time to show the journal to his strict parents. Polycarp knows that recently at the Parent Meeting the parents were told that he received aa Safety Studies marks and bb PE marks ( a+b=na+b=n ). Now Polycarp wants to write a subject's name in front of each mark so that:

  • there are exactly aa Safety Studies marks,
  • there are exactly bb PE marks,
  • the total average score in both subjects is maximum.

An average subject grade is the sum of all marks in it, divided by the number of them. Of course, the division is performed in real numbers without rounding up or down. Polycarp aims to maximize the x1+x2x_{1}+x_{2} , where x1x_{1} is the average score in the first subject (Safety Studies), and x2x_{2} is the average score in the second one (Physical Education).

输入格式

The first line contains an integer nn ( 2<=n<=1052<=n<=10^{5} ), nn is the number of marks in Polycarp's Journal. The second line contains two positive integers a,ba,b ( 1<=a,b<=n1,a+b=n1<=a,b<=n-1,a+b=n ). The third line contains a sequence of integers t1,t2,...,tnt_{1},t_{2},...,t_{n} ( 1<=ti<=51<=t_{i}<=5 ), they are Polycarp's marks.

输出格式

Print the sequence of integers f1,f2,...,fnf_{1},f_{2},...,f_{n} , where fif_{i} ( 1<=fi<=21<=f_{i}<=2 ) is the number of a subject to which the ii -th mark should be attributed. If there are several possible solutions, then print such that the sequence f1,f2,...,fnf_{1},f_{2},...,f_{n} is the smallest lexicographically.

The sequence p1,p2,...,pnp_{1},p_{2},...,p_{n} is lexicographically less than q1,q2,...,qnq_{1},q_{2},...,q_{n} if there exists such jj ( 1<=j<=n1<=j<=n ) that pi=qip_{i}=q_{i} for all 1<=i<j , аnd p_{j}<q_{j} .

输入输出样例

  • 输入#1

    5
    3 2
    4 4 5 4 4
    

    输出#1

    1 1 2 1 2 
  • 输入#2

    4
    2 2
    3 5 4 5
    

    输出#2

    1 1 2 2 
  • 输入#3

    6
    1 5
    4 4 4 5 4 4
    

    输出#3

    2 2 2 1 2 2 

说明/提示

In the first sample the average score in the first subject is equal to 4, and in the second one — to 4.5. The total average score is 8.5.

首页