303476: CF673A. Bear and Game
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Bear and Game
题意翻译
题面: Bear Limak喜欢看体育比赛,今天他要在电视上看一场总时长为 $90$ 分钟且没有休息的比赛 这场比赛的每一分钟可以是有趣的,也可以是无聊的。如果连着 $15$ 分钟都是无聊的话,Bear Limak就会立马把电视关掉(傲娇)。 现在你知道这场比赛有 $n$ 个有趣的分钟,分别为第 $t_1,t_2,...,t_n$ 分钟,你的任务就是计算Bear Limak看比赛的时间 输入: 第一行:整数 $n\ (1<=n<=90)$ 第二行, $n$ 个整数 $t_i\ (1<=t_i<=90)$ 输出: Bear Limak即将观看比赛的分钟数 注: $t_i$ 输入顺序从小到大题目描述
Bear Limak likes watching sports on TV. He is going to watch a game today. The game lasts $ 90 $ minutes and there are no breaks. Each minute can be either interesting or boring. If $ 15 $ consecutive minutes are boring then Limak immediately turns TV off. You know that there will be $ n $ interesting minutes $ t_{1},t_{2},...,t_{n} $ . Your task is to calculate for how many minutes Limak will watch the game.输入输出格式
输入格式
The first line of the input contains one integer $ n $ ( $ 1<=n<=90 $ ) — the number of interesting minutes. The second line contains $ n $ integers $ t_{1},t_{2},...,t_{n} $ ( $ 1<=t_{1}<t_{2}<...\ t_{n}<=90 $ ), given in the increasing order.
输出格式
Print the number of minutes Limak will watch the game.
输入输出样例
输入样例 #1
3
7 20 88
输出样例 #1
35
输入样例 #2
9
16 20 30 40 50 60 70 80 90
输出样例 #2
15
输入样例 #3
9
15 20 30 40 50 60 70 80 90
输出样例 #3
90