#F. 逛游乐场

    Type: Default 1000ms 256MiB

逛游乐场

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目背景

"儿童节" 要到了, 游乐场有降价促销活动. 大明的一家打算去游乐场玩一下.

题目描述

假如说票价是 aa 元,

如果是儿童, 年龄在 6126 \sim 12 之间, 则打半价,

如果年龄在 55 岁及以下, 则不收门票. 成人不打折.

不幸的是, 儿童不能单独进入游乐场, 必须有13岁及以上的大人陪同.

数据格式

输入格式

多组数据, 第一行输入一个整数 tt, 表示 tt 组数据.

接下来每组数据中,

第一行输入两个整数 aa, nn, 表示票价和参观人数.

第二行输入 nn 个人的年龄 bib_i

输出格式

输出 tt 行, 每行一个整数表示需要花多少钱, 如果不能进入游乐场则输出 -1.

样例

2
6 3
5 8 13
10 2
8 5
9
-1

数据范围

  • 1<=t<=1001 <= t <= 100
  • 1<=a,bi,n<=1001 <= a, b_i, n <= 100
  • 所有数据都在 intint 范围内
  • aa 为偶数

[NOI蓝图杯] 六月月赛-入门赛

Not Attended
Status
Done
Rule
Ledo
Problem
6
Start at
2023-6-2 12:00
End at
2023-6-6 0:00
Duration
84 hour(s)
Host
Partic.
99