CF976B.Lara Croft and the New Game

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You might have heard about the next game in Lara Croft series coming out this year. You also might have watched its trailer. Though you definitely missed the main idea about its plot, so let me lift the veil of secrecy.

Lara is going to explore yet another dangerous dungeon. Game designers decided to use good old 2D environment. The dungeon can be represented as a rectangle matrix of nn rows and mm columns. Cell (x,y)(x,y) is the cell in the xx -th row in the yy -th column. Lara can move between the neighbouring by side cells in all four directions.

Moreover, she has even chosen the path for herself to avoid all the traps. She enters the dungeon in cell (1,1)(1,1) , that is top left corner of the matrix. Then she goes down all the way to cell (n,1)(n,1) — the bottom left corner. Then she starts moving in the snake fashion — all the way to the right, one cell up, then to the left to the cell in 22 -nd column, one cell up. She moves until she runs out of non-visited cells. nn and mm given are such that she always end up in cell (1,2)(1,2) .

Lara has already moved to a neighbouring cell kk times. Can you determine her current position?

输入格式

The only line contains three integers nn , mm and kk ( 2<=n,m<=1092<=n,m<=10^{9} , nn is always even, 0<=k<nm0<=k<n·m ). Note that kk doesn't fit into 3232 -bit integer type!

输出格式

Print the cell (the row and the column where the cell is situated) where Lara ends up after she moves kk times.

输入输出样例

  • 输入#1

    4 3 0
    

    输出#1

    1 1
    
  • 输入#2

    4 3 11
    

    输出#2

    1 2
    
  • 输入#3

    4 3 7
    

    输出#3

    3 2
    

说明/提示

Here is her path on matrix 44 by 33 :

首页