{"problem":{"name":"A. Santa Claus and a Place in a Class","description":{"content":"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 work","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF748A"},"statements":[{"statement_type":"Markdown","content":"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).\n\nThe 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.\n\n<center>![image](https://espresso.codeforces.com/38e9d8d86203cc5f115f553f0b81d1cf486c006f.png) The picture illustrates the first and the second samples.</center>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!\n\n## Input\n\nThe 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.\n\n## Output\n\nPrint 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.\n\n[samples]\n\n## Note\n\nThe 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.\n\nIn 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.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"圣诞老人是第一个到达圣诞奥林匹克竞赛的人，他也将是第一个坐在桌旁的人！教室中有 #cf_span[n] 排，每排有 #cf_span[m] 张桌子，每张桌子有两个座位。排从左到右编号为 #cf_span[1] 到 #cf_span[n]，每排中的桌子从黑板开始编号为 #cf_span[1] 到 #cf_span[m]。注意，排是垂直于黑板的方向排列的，而非平行于黑板（见图）。\n\n主办方将所有座位从 #cf_span[1] 编号到 #cf_span[2nm]。编号按排进行（即第一排的所有座位先编号，然后是第二排，依此类推）；在每排中，从离黑板最近的桌子（即第一张桌子）开始编号；每张桌子，左侧的座位编号在右侧座位之前。\n\n圣诞老人知道自己的座位编号为 #cf_span[k]。请帮他确定他应该坐在第几排、第几张桌子，以及是在左侧还是右侧！\n\n仅一行包含三个整数 #cf_span[n]、#cf_span[m] 和 #cf_span[k]（#cf_span[1 ≤ n, m ≤ 10 000]，#cf_span[1 ≤ k ≤ 2nm]）——分别表示排数、每排的桌子数和圣诞老人的座位编号。\n\n请输出两个整数：排号 #cf_span[r]、桌子号 #cf_span[d]，以及一个字符 #cf_span[s]，表示圣诞老人的座位在桌子的哪一侧。若圣诞老人应坐在左侧，则 #cf_span[s] 为 \"_L_\"；若在右侧，则为 \"_R_\"。\n\n第一个和第二个样例见图。绿色座位对应第一个例子中圣诞老人的座位，蓝色座位对应第二个例子中圣诞老人的座位。\n\n在第三个样例中，有两排，每排四张桌子，圣诞老人的座位编号为 4。因此，他的座位在第一排的第二张桌子的右侧。\n\n## Input\n\n仅一行包含三个整数 #cf_span[n]、#cf_span[m] 和 #cf_span[k]（#cf_span[1 ≤ n, m ≤ 10 000]，#cf_span[1 ≤ k ≤ 2nm]）——分别表示排数、每排的桌子数和圣诞老人的座位编号。\n\n## Output\n\n请输出两个整数：排号 #cf_span[r]、桌子号 #cf_span[d]，以及一个字符 #cf_span[s]，表示圣诞老人的座位在桌子的哪一侧。若圣诞老人应坐在左侧，则 #cf_span[s] 为 \"_L_\"；若在右侧，则为 \"_R_\"。\n\n[samples]\n\n## Note\n\n第一个和第二个样例见图。绿色座位对应第一个例子中圣诞老人的座位，蓝色座位对应第二个例子中圣诞老人的座位。在第三个样例中，有两排，每排四张桌子，圣诞老人的座位编号为 4。因此，他的座位在第一排的第二张桌子的右侧。","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n, m, k \\in \\mathbb{Z}^+ $ with $ 1 \\leq n, m \\leq 10{,}000 $ and $ 1 \\leq k \\leq 2nm $.  \nEach lane has $ m $ desks, each desk has 2 working places (left and right), numbered left before right.  \nPlaces are numbered lane by lane (lane 1 first, then lane 2, etc.), within a lane desk by desk from blackboard forward, and at each desk left before right.\n\n**Constraints**  \n$ 1 \\leq n, m \\leq 10{,}000 $, $ 1 \\leq k \\leq 2nm $\n\n**Objective**  \nFind the lane $ r $, desk $ d $, and side $ s \\in \\{ \\text{L}, \\text{R} \\} $ such that:  \n- $ r = \\left\\lceil \\frac{k}{2m} \\right\\rceil $  \n- Let $ p = (k - 1) \\bmod (2m) + 1 $ (1-indexed position within the lane)  \n- $ d = \\left\\lceil \\frac{p}{2} \\right\\rceil $  \n- $ s = \\begin{cases} \n\\text{L} & \\text{if } p \\text{ is odd} \\\\\n\\text{R} & \\text{if } p \\text{ is even}\n\\end{cases} $","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF748A","tags":["implementation","math"],"sample_group":[["4 3 9","2 2 L"],["4 3 24","4 3 R"],["2 4 4","1 2 R"]],"created_at":"2026-03-03 11:00:39"}}