SP92 CUTSQRS - Cutting off Squares

Description

Two players take it in turns to cut off squares from a rectangle. If the lengths of the sides of the rectangle are _a_ and _b_ (a

Input Format

An integer t denoting the number of test cases, (t

Output Format

For each test case, output the number of characters Michael has to write down (excluding spaces).