Explain me this small test case

Sample Input

1
2 6
10 3

Your Output

2

The answer should be 3 right
on day 1 they need 2 packets 12 breads 10 are consumed 1 spoilt 1 remaining
on day 2, 1 reaming and 3 need to be eat so one more packet is to be opened
so total should be 3