时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
City University of Hong Kong (Dongguan) implements a broad training model. Students do not directly select majors at the beginning of enrollment, and choose majors in the first year, and can freely choose among the four majors offered, which are Intelligent Manufacturing Engineering, Computer Science, Materials Science and Energy Engineering.
City University of Hong Kong (Dongguan) is considering to calculate how many classrooms will be required, so they've just surveyed on undergraduate students' preferred majors, which shows that
students will prefer Intelligent Manufacturing Engineering,
students will prefer Computer Science,
students will prefer Materials Science, and
students will prefer Energy Engineering.
City University of Hong Kong (Dongguan) adopts small-sized classes, so each classroom should meet the following requirements:
-
Capacity of Each classroom is limited to
students.
-
Each classroom is only available for students who prefer the same major.
So, how many classrooms will City University of Hong Kong (Dongguan) use to contain all undergraduate students?
输入描述:
The first line contains a single integer
(
) — the number of test cases.
The first line of each test case contains four integers
and
(
) —representing the number of students who prefer Intelligent Manufacturing Engineering, Computer Science, Materials Science and Energy Engineering, respectively.
输出描述:
For each test case, please print a single integer in a single line which means how many classrooms are required in total to contain all students.
示例1
输入
复制
3
120 0 0 0
30 30 29 31
120 119 121 0
说明
As for the first test case, four classrooms are there for Computer Science students with each contains

students.
As for the second test case, energe engineering major will have two classrooms——one to be full, while the other one contains only one student.