CF748A.Santa Claus and a Place in a Class

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

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

题目描述

Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his place at a desk! In the classroom there are n lanes of m desks each, and there are two working places at each of the desks. The lanes are numbered from 1 to n from the left to the right, the desks in a lane are numbered from 1 to m starting from the blackboard. Note that the lanes go perpendicularly to the blackboard, not along it (see picture).

The organizers numbered all the working places from 1 to 2_nm_. The places are numbered by lanes (i. e. all the places of the first lane go first, then all the places of the second lane, and so on), in a lane the places are numbered starting from the nearest to the blackboard (i. e. from the first desk in the lane), at each desk, the place on the left is numbered before the place on the right.

The picture illustrates the first and the second samples.

Santa Clause knows that his place has number k. Help him to determine at which lane at which desk he should sit, and whether his place is on the left or on the right!

圣诞老人是第一个来到圣诞奥林匹克竞赛现场的人,他将第一个入座!教室中共有 nn 列课桌,每列有 mm 张课桌,每张课桌上有两个座位。列从左到右编号为 11 至 nn,每列中的课桌则从黑板开始向后编号为 11 至 mm。注意:这些列是垂直于黑板方向排列的,而非平行于黑板(参见图示)。

组织者将所有座位从 11 编号至 2nm2nm。编号方式为:先按列编号(即先编完第 11 列的所有座位,再编第 22 列的所有座位,依此类推);在每一列中,从离黑板最近的课桌开始编号(即从该列第 11 张课桌开始);在每张课桌上,左侧座位编号在前,右侧座位编号在后。


图示展示了样例 1 和样例 2 的情形。

圣诞老人知道自己的座位编号为 kk。请帮他确定自己应坐在第几列、第几张课桌,以及座位是在左侧还是右侧!

输入格式

The only line contains three integers n, m and k (1 ≤ n, m ≤ 10 000, 1 ≤ k ≤ 2_nm_) — the number of lanes, the number of desks in each lane and the number of Santa Claus' place.

唯一的一行包含三个整数 nn、mm 和 kk(1 ≤ n, m ≤ 10 0001 ≤ n, m ≤ 10\,000,1 ≤ k ≤ 2nm1 ≤ k ≤ 2nm)——分别表示车道数、每条车道中的课桌数以及圣诞老人的位置编号。

输出格式

Print two integers: the number of lane r, the number of desk d, and a character s, which stands for the side of the desk Santa Claus. The character s should be "L", if Santa Clause should sit on the left, and "R" if his place is on the right.

输出两个整数:车道号 rr、课桌号 dd,以及一个字符 ss,表示圣诞老人所坐的课桌侧边。若圣诞老人应坐在左侧,则字符 ss 为 "L";若其座位在右侧,则 ss 为 "R"。

输入输出样例

  • 输入#1

    4 3 9

    输出#1

    2 2 L
  • 输入#2

    4 3 24

    输出#2

    4 3 R
  • 输入#3

    2 4 4

    输出#3

    1 2 R

说明/提示

The first and the second samples are shown on the picture. The green place corresponds to Santa Claus' place in the first example, the blue place corresponds to Santa Claus' place in the second example.

In the third sample there are two lanes with four desks in each, and Santa Claus has the fourth place. Thus, his place is in the first lane at the second desk on the right.

第一和第二个样例如图所示。绿色位置对应第一个样例中圣诞老人的位置,蓝色位置对应第二个样例中圣诞老人的位置。

在第三个样例中,共有两条通道,每条通道有四张桌子,而圣诞老人位于第四个位置。因此,他的位置在第一条通道中,从右往左数第二张桌子处。

输入解题思路,AI测评打分。不知道怎么写?

首页