Ticket Battle: Hridoy vs Kamona

Ticket Battle: Hridoy vs Kamona

Time Limit: 1.0 s

Memory Limit: 256.0 MB

Description

Hridoy and Kamona are hosting a big concert event for their favorite band. They have a limited number of VIP tickets to give away.

Hridoy has A VIP tickets in his collection.

Kamona has B VIP tickets ready to distribute.

They give away tickets in this order:

  • Hridoy will hand out tickets first (because he’s more competitive and loves being in charge 😆).

  • If Hridoy runs out of tickets, Kamona will start handing out hers.

After giving away exactly X tickets, how many do Hridoy and Kamona still have left?

Input

  • First Line T (1 ≤ T ≤ \(10^5\)), the number of test cases.
  • Each Test case contains Three integers value A , B , X
    • A (1 ≤ A ≤ \(10^9\)) - Number of tickets Hridoy initially has.
    • B (1 ≤ B ≤ \(10^9\)) - Number of tickets Kamona initially has.
    • X (1 ≤ X ≤ \(10^9\)) - Total number of tickets to be given away.

Output

  • Print the remaining tickets for Hridoy and Kamona on a single line by separated by a space.

Sample

Input Output
2
2 3 1
2 2 4
1 3
0 0

Information

ID
1187
Difficulty
1
Category
Math Click to Show
Tags
# Submissions
129
Accepted
53
Accepted Ratio
41%
Uploaded By

Related

In following contests:

Brain Booster #9