A10720 | Santa Claus and a Place in a Class
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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 $2nm$ . 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!
The organizers numbered all the working places from $1$ to $2nm$ . 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!
输入格式
The only line contains three integers $n$ , $m$ and $k$ ( $1<=n,m<=10000$ , $1<=k<=2nm$ ) — the number of lanes, the number of desks in each lane and the number of Santa Claus' place.
输出格式
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.
输入输出样例
输入 #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.
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.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted