about summary refs log tree commit diff
path: root/codechef/brkbks.lua
blob: 88dc15bd4be5f8b7bc8ece7d0c4b2ea10d81b04c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env lua
local read = io.read
local print = print

for t = 1, read('*n') do
    local s, w1, w2, w3 = read('*n', '*n', '*n', '*n')
    if w1 + w2 + w3 <= s then
        print(1)
    elseif w1 + w2 <= s or w2 + w3 <= s then
        print(2)
    else
        print(3)
    end
end