五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

CF 460A - Vasya and Socks

2023-07-25 16:31 作者:您是打尖兒還是住店呢  | 我要投稿

原文

Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws them away. Every m-th day (at days with numbers m,?2m,?3m,?...) mom buys a pair of socks to Vasya. She does it late in the evening, so that Vasya cannot put on a new pair of socks before the next day. How many consecutive days pass until Vasya runs out of socks? Input The single line contains two integers n and m (1?≤?n?≤?100; 2?≤?m?≤?100), separated by a space. Output Print a single integer — the answer to the problem.

翻譯結(jié)果

Vasya 有 n 雙襪子。 每天早上,瓦夏必須穿上一雙襪子才能去上學(xué)。 晚上回家后,瓦夏脫下用過(guò)的襪子并扔掉。 每個(gè)第m天(在數(shù)字為m、?2m、?3m、?...的日子)媽媽都會(huì)給Vasya買(mǎi)一雙襪子。 她在晚上很晚的時(shí)候做這件事,這樣瓦夏就無(wú)法在第二天之前穿上一雙新襪子。 連續(xù)多少天 Vasya 的襪子就會(huì)用完? 輸入 單行包含兩個(gè)整數(shù) n 和 m (1?≤?n?≤?100; 2?≤?m?≤?100),用空格分隔。 輸出 打印一個(gè)整數(shù)——問(wèn)題的答案。

--------------------------------

循環(huán)遍歷即可,只是每當(dāng)是m的倍數(shù)的時(shí)候n++一下,

下面是代碼:



CF 460A - Vasya and Socks的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
敦煌市| 涞源县| 汉源县| 秀山| 鞍山市| 商河县| 雷山县| 绥芬河市| 盐亭县| 恩平市| 越西县| 洪洞县| 威信县| 南郑县| 嘉黎县| 布拖县| 凤凰县| 遂川县| 太仆寺旗| 南澳县| 福安市| 崇明县| 西盟| 昭通市| 扎鲁特旗| 皋兰县| 栾川县| 潞城市| 平塘县| 台南市| 永州市| 康保县| 淮阳县| 交口县| 元谋县| 分宜县| 定西市| 甘谷县| 青阳县| 罗定市| 伊吾县|