现在的位置: 首页 > 综合 > 正文

460A Vasya and Socks

2018年01月11日 ⁄ 综合 ⁄ 共 210字 ⁄ 字号 评论关闭
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    int s = n;
    int day = 1,c = 0;
    while(s--){
        if(day % m == 0){
                s++;
            //cout<<day<<endl;
        }
        day++;
        c++;
    }
    printf("%d\n",c);
    return 0;
}

抱歉!评论已关闭.