SP8330 GNTFNTN - Giant fountain

Description

The Dystopian government has installed a giant fountain in front of the parliament building. The fountain consists of N levels stacked one on top of the other and is situated on top of a large tank of infinite capacity. The levels of the fountain are numbered 1 to N from top to bottom. The top l $ _{1} $ levels are identical with capacity c $ _{1} $ , the next l $ _{2} $ levels identical with capacity c $ _{2} $ ,... the final l $ _{K} $ levels with capacity c $ _{K} $ . Here l $ _{1} $ + l $ _{2} $ + ... l $ _{K} $ = N. When water is added to level i beyond its capacity, the excess water overflows to level i+1. Water overflowing from level N is collected in the tank. Water is added to the levels in the following fashion. First, w $ _{1} $ amount of water is added to each level i such that s $ _{1} $

Input Format

The first line of the input contains T ( The first line of the description of a test case contains space separated integers N (

Output Format

For each test case output a space separated pair of integers : The total amount of water that has overflowed to the tank and the number of levels of the fountain that are completely filled.