logo AlgoBeat OnlineJudge
登录 注册

#214822. [ICPC 2023 Tehran R] Cafebazaar' s Applications

内存限制:1024 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

It's the end of the year, and Cafebazaar has released a list, containing the number of users of each of its applications. Now, each application is eager to showcase its success through an advertisement image, which highlights a continuous subset of the application list containing the application itself. Also, for the image to be credible, it should contain at least applications, including itself.

For each application in this list, we need to determine the minimum possible rank this application can achieve within any valid subset, according to the number of users. The rank of an application within a subset is defined by the number of applications in that subset that have more users than it, plus one.

:::align{center} :::

输入格式

The first line of input consists of two integers and (), where represents the total number of applications and represents the minimum number of applications in an advertisement image. The following lines contain information about each application: the line contains , representing the number of users for the application ().

输出格式

In the only line of output print space-separated integers. The integer should be the minimum rank that application can achieve within an advertisement image.

样例

样例输入 1

7 3
15000000
10000000
30000000
20000000
200000
70000000
100000000

样例输出 1

2 3 1 2 3 1 1

样例输入 2

3 2
10
10
10

样例输出 2

1 1 1