2 solutions

  • 3
    @ 2025-5-14 18:42:12
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a,b,c;
    	cin>>a>>b>>c;
    	int t=b/c*c;
    	if(t>=a)
    	{
    		cout<<t;	
    	} 
    	else
    	{
    		cout<<-1;
    	}
    	return 0;
    }
    
    
    • 1
      @ 2025-9-21 16:09:51
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
      	int a,b,c;
      	cin>>a>>b>>c;
      	int t=b/c*c;
      	if(t>=a)
      	{
      		cout<<t;	
      	} 
      	else
      	{
      		cout<<-1;
      	}
      	return 0;
      }
      
      
      • 1

      Information

      ID
      2446
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      1
      Tags
      (None)
      # Submissions
      93
      Accepted
      42
      Uploaded By