明明多个几秒就能场上AK了。自闭。

  A:签到。

#include<iostream> 
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
#define ll long long
char getc(){char c=getchar();while ((c<'A'||c>'Z')&&(c<'a'||c>'z')&&(c<'0'||c>'9')) c=getchar();return c;}
int gcd(int n,int m){return m==0?n:gcd(m,n%m);}
int read()
{
    int x=0,f=1;char c=getchar();
    while (c<'0'||c>'9') {if (c=='-') f=-1;c=getchar();}
    while (c>='0'&&c<='9') x=(x<<1)+(x<<3)+(c^48),c=getchar();
    return x*f;
}
int T,l,r,d;
signed main()
{
/*#ifndef ONLINE_JUDGE
    freopen("a.in","r",stdin);
    freopen("a.out","w",stdout);
    const char LL[]="%I64d\n";
#endif*/
    T=read();
    while (T--)
    {
        l=read(),r=read(),d=read();
        if (d<l) cout<<d<<endl;
        else cout<<1ll*(r/d+1)*d<<endl;
    }
    return 0;
    //NOTICE LONG LONG!!!!!
}
View Code

相关文章:

  • 2021-09-04
  • 2021-06-26
  • 2021-05-30
  • 2021-10-15
  • 2022-12-23
  • 2021-08-28
  • 2021-12-22
  • 2021-06-02
猜你喜欢
  • 2022-12-23
  • 2021-09-20
  • 2021-06-18
  • 2021-05-28
  • 2021-09-18
  • 2021-07-21
  • 2021-09-09
相关资源
相似解决方案