A. Book Reading

Codeforces
IDCF884A
Time2000ms
Memory256MB
Difficulty
implementation
English · Original
Chinese · Translation
Formal · Original
Recently Luba bought a very interesting book. She knows that it will take _t_ seconds to read the book. Luba wants to finish reading as fast as she can. But she has some work to do in each of _n_ next days. The number of seconds that Luba has to spend working during _i_\-th day is _a__i_. If some free time remains, she can spend it on reading. Help Luba to determine the minimum number of day when she finishes reading. **It is guaranteed that the answer doesn't exceed _n_.** **Remember that there are 86400 seconds in a day.** ## Input The first line contains two integers _n_ and _t_ (1 ≤ _n_ ≤ 100, 1 ≤ _t_ ≤ 106) — the number of days and the time required to read the book. The second line contains _n_ integers _a__i_ (0 ≤ _a__i_ ≤ 86400) — the time Luba has to spend on her work during _i_\-th day. ## Output Print the minimum day Luba can finish reading the book. **It is guaranteed that answer doesn't exceed _n_**. [samples]
最近,卢巴买了一本非常有趣的书。她知道阅读这本书需要 $t$ 秒。卢巴希望尽可能快地读完这本书。 但在接下来的 $n$ 天中,她每天都有工作要做。在第 $i$ 天,卢巴需要花费 $a_i$ 秒用于工作。如果还有空闲时间,她可以用来阅读。 请帮助卢巴确定她完成阅读的最早是第几天。 *保证答案不超过 $n$。* *请注意,一天有 86400 秒。* 第一行包含两个整数 $n$ 和 $t$($1 ≤ n ≤ 100$,$1 ≤ t ≤ 10^6$)——天数和阅读书籍所需的时间。 第二行包含 $n$ 个整数 $a_i$($0 ≤ a_i ≤ 86400$)——卢巴在第 $i$ 天用于工作的时长。 请输出卢巴完成阅读的最早一天。 *保证答案不超过 $n$。* ## Input 第一行包含两个整数 $n$ 和 $t$($1 ≤ n ≤ 100$,$1 ≤ t ≤ 10^6$)——天数和阅读书籍所需的时间。第二行包含 $n$ 个整数 $a_i$($0 ≤ a_i ≤ 86400$)——卢巴在第 $i$ 天用于工作的时长。 ## Output 请输出卢巴完成阅读的最早一天。*保证答案不超过 $n$。* [samples]
**Definitions** Let $C = 86400$ be a constant representing the total capacity of a unit. Let $n, t \in \mathbb{Z}$ be given such that: * $1 \le n \le 100$ * $1 \le t \le 10^6$ Let $A = (a_1, a_2, \dots, a_n)$ be a sequence of integers where: * $0 \le a_i \le C$ for all $1 \le i \le n$ **Objective** Find the minimum integer $k \in \{1, \dots, n\}$ such that: $$ \sum_{i=1}^{k} (C - a_i) \ge t $$
Samples
Input #1
2 2
86400 86398
Output #1
2
Input #2
2 86400
0 86400
Output #2
1
API Response (JSON)
{
  "problem": {
    "name": "A. Book Reading",
    "description": {
      "content": "Recently Luba bought a very interesting book. She knows that it will take _t_ seconds to read the book. Luba wants to finish reading as fast as she can. But she has some work to do in each of _n_ nex",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF884A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Recently Luba bought a very interesting book. She knows that it will take _t_ seconds to read the book. Luba wants to finish reading as fast as she can.\n\nBut she has some work to do in each of _n_ nex...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "最近,卢巴买了一本非常有趣的书。她知道阅读这本书需要 $t$ 秒。卢巴希望尽可能快地读完这本书。\n\n但在接下来的 $n$ 天中,她每天都有工作要做。在第 $i$ 天,卢巴需要花费 $a_i$ 秒用于工作。如果还有空闲时间,她可以用来阅读。\n\n请帮助卢巴确定她完成阅读的最早是第几天。\n\n*保证答案不超过 $n$。*\n\n*请注意,一天有 86400 秒。*\n\n第一行包含两个整数 $n$ 和 $t$($...",
      "is_translate": true,
      "language": "Chinese"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**\nLet $C = 86400$ be a constant representing the total capacity of a unit.\nLet $n, t \\in \\mathbb{Z}$ be given such that:\n*   $1 \\le n \\le 100$\n*   $1 \\le t \\le 10^6$\n\nLet $A = (a_1, a_2,...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments