【Codeforces Round #389】Codeforces 752A Santa Claus and a Place in a Class
来源:互联网 发布:中小型网络规划与设计 编辑:程序博客网 时间:2024/05/20 20:18
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! InputThe only line contains three integers n, m and k (1 ≤ n, m ≤ 10 000,
1 ≤ k ≤ 2nm) — the number of lanes, the number of desks in each lane
and the number of Santa Claus’ place. OutputPrint 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.
模拟。
#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int main(){ int m,n,k,x; scanf("%d%d%d",&n,&m,&k); x=(k+1)/2; printf("%d %d ",(x-1)/m+1,(x%m)?x%m:m); if (k&1) printf("L\n"); else printf("R\n");}
- 【Codeforces Round #389】Codeforces 752A Santa Claus and a Place in a Class
- Codeforces Round #389 (Div. 2)A. Santa Claus and a Place in a Class(水题)
- 【codeforces 752A】Santa Claus and a Place in a Class
- 748 A. Santa Claus and a Place in a Class codeforces
- Codeforces 748A-Santa Claus and a Place in a Class
- 【codeforces 748A】Santa Claus and a Place in a Class
- Santa Claus and a Place in a Class (Codeforces-748A)
- CF # 389 Santa Claus and a Place in a Class
- CF # 389 Santa Claus and a Place in a Class
- 748A. Santa Claus and a Place in a Class
- A. Santa Claus and a Place in a Class
- A. Santa Claus and a Place in a Class
- Codeforces Round #389 (Div. 2):Santa Claus and a Palindrome
- 【codeforces 752D】Santa Claus and a Palindrome
- Codeforces 752D Santa Claus and a Palindrome map应用
- Codeforces Round #389 (Div. 2) D. Santa Claus and a Palindrome 回文串+贪心+数据结构、字符串
- Codeforces 748 D Santa Claus and a Palindrome
- 【Codeforces Round #389】Codeforces 752C Santa Claus and Robot
- Linux网络编程 五种I/O 模式及select、epoll理解
- Linux 2038年相关
- pthread_cond_signal虚假唤醒(spurious wakeup)
- 实例教程:1小时学会Python
- 安装aria2实现下载机功能
- 【Codeforces Round #389】Codeforces 752A Santa Claus and a Place in a Class
- 【深入Java字符串】(5)Java 字符串编码
- 看看源码怎么处理,Java中Hashtable,Hashmap,ConcurrentHashMap,Key Value为null时
- 关于httpclient 连接失效引发的问题
- VB6.0代码中,有关字符串
- 总结
- 注解配置好处
- C#多线程解决界面卡死问题的完美解决方案
- 关于Android minSdkVersion和targetSdkVersion