407924: GYM102944 A Ann Arbor

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Ann Arbortime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Lots of bubble tea shops are opening in Ann Arbor! You are the owner of the most recently opened downtown bubble tea shop. Since it is too competitive for most tea shops to survive, you have decided to promote your brand by offering a free cup of bubble tea to every $$$k$$$-th customer on each day.

For example, if $$$k = 10$$$ and on day $$$1$$$ you got $$$14$$$ customers and on day $$$2$$$ you got $$$33$$$ customers, then you gave away $$$4$$$ free cups: the 10th customer on day 1 and the 10th, 20th, and the 30th customers on day 2 each get one free cup.

You want to make sure that at least one customer gets a free drink each day. Write a program that given a log of visiting customers on the first $$$D$$$ days, validates that on each day someone got a free drink, or, If not, outputs the first day that, sadly, no customer gets a free drink.

Input

The first line in each input file contains two integers $$$k$$$ and $$$D$$$ ($$$1\le k, D\le 1000$$$). The next line contains $$$D$$$ non-negative integers $$$a_1, a_2, \ldots, a_D$$$, where $$$a_i$$$ ($$$0\le a_i\le 2000$$$) represents the number of visiting customers on day $$$i$$$.

Output

If on any day some customer gets a free drink, output awesome. Otherwise, output the smallest positive integer $$$i$$$, such that on day $$$i$$$ no customer gets a free drink.

ExamplesInput
10 5
14 33 5 58 74
Output
3
Input
10 5
22 71 79 94 50
Output
awesome
Input
10 5
59 100 93 14 8
Output
5

加入题单

上一题 下一题 算法标签: