Under construction

Still being built. Things may change

Junyeong's Grade

Time limit1sMemory limit1024 MB

Summary
Given each rank G_i among N students, the task maps the integer part of G_i times 100 divided by N to a grade from 1 to 9 for each of K subjects.
Level

Easy1 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

Junyeong received his report card after finishing the first semester at Sunrin Internet High School. The school has not finished grade processing yet, so the card shows only his rank and not his grade. Calculating grades is tedious, so let's compute his grade for him.

Sunrin Internet High School has NN students and KK subjects, and every student takes all KK subjects. Junyeong's grade is based on a percentage. The percentage in a subject equals the integer part of his rank in that subject multiplied by 100100 and divided by the number of students. If the percentage in a subject is PP, the conditions for each grade are as follows.

GradeCondition
Grade 10≤P≤40 \leq P \leq 4
Grade 24<P≤114 < P \leq 11
Grade 311<P≤2311 < P \leq 23
Grade 423<P≤4023 < P \leq 40
Grade 540<P≤6040 < P \leq 60
Grade 660<P≤7760 < P \leq 77
Grade 777<P≤8977 < P \leq 89
Grade 889<P≤9689 < P \leq 96
Grade 996<P≤10096 < P \leq 100

In subject ii (1≤i≤K1 \leq i \leq K), Junyeong ranked GiG_i. Given G1,G2,⋯ ,GKG_1, G_2, \cdots, G_K, find the grades D1,D2,⋯ ,DKD_1, D_2, \cdots, D_K (1≤Di≤91 \leq D_i \leq 9) that Junyeong received in each subject.

Input

The first line contains the number of students NN and the number of subjects KK, separated by a space.

The second line contains KK integers G1,G2,⋯ ,GKG_1, G_2, \cdots, G_K, separated by spaces.

All numbers in the input are integers.

Output

On the first line, print KK integers D1,D2,⋯ ,DKD_1, D_2, \cdots, D_K (1≤Di≤9)(1 \leq D_i \leq 9), separated by spaces, where each value is Junyeong's grade in the corresponding subject.

Constraints

  • 10≤N≤40010 \leq N \leq 400
  • 1≤K≤161 \leq K \leq 16
  • 1≤Gi≤N1 \leq G_i \leq N (1≤i≤K)(1 \leq i \leq K)

Examples3

  1. Example 1

    Input
    255 5
    30 37 50 7 35
    
    Expected output
    2 3 3 1 3
    
  2. Example 2

    Input
    255 5
    1 1 1 1 1
    
    Expected output
    1 1 1 1 1
    
  3. Example 3

    Input
    100 9
    4 11 23 40 60 77 89 96 100
    
    Expected output
    1 2 3 4 5 6 7 8 9