This page is still under construction.

Parts of this page are still being built. What you see may change.

I am happy~

Interview

Time limit2sMemory limit256 MB

Summary
Given the height N, width M, and a seat number K in row-major order, print the row and column of that seat.
Level

Easy2 of 10

Topics
Math, Implementation, Array, Simulation
Solved
No attempts yet

Problem

"I am happy~ I am happy because of Hanwha~"

Wookje hums that song because he is a devoted Hanwha Eagles fan. During summer vacation he packed fried chicken and beer and went to the ballpark. Distracted by the chicken and beer, he lost the ticket that carried his seat location. The only thing he remembers is his seat number K.

You are the manager of the Hanwha Eagles. Moved by the visit of such a fan, you decide to find the lost seat for him. The stand at today's ballpark has height N and width M. Its top left cell is (0, 0) and its bottom right cell is (N-1, M-1). Seat numbering starts at 0 on cell (0, 0) and increases by 1 toward the right. When it reaches the right end of a row, it continues at the leftmost cell of the row directly below.

Given the size of the stand N, M and the seat number K, find the coordinates of Wookje's seat.

Input

The first line contains the height N of the stand, the width M of the stand, and the lost seat number K, separated by single spaces. (1 ≤ N, M ≤ 30,000, 0 ≤ K ≤ N×M-1)

Output

Print the coordinates (n, m) of the cell that seat number K refers to, as two numbers separated by a single space.

Examples2

  1. Example 1

    Input
    3 4 6
    
    Expected output
    1 2
    
  2. Example 2

    Input
    6 4 14
    
    Expected output
    3 2