2 solutions

  • 2
    @ 2025-7-9 11:50:33
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int x,y;
    	cin>>x>>y;
    	for(int i=1000;i>=1;i--){
    		if(i%x!=0&&i%y!=0){
    			cout<<i;
    			return 0;
    		}
    	}
    	return 0;
    }
    
    
    
    • -2
      @ 2025-11-15 11:10:33

      #include<bits/stdc++.h> using namespace std; int main() { int a,b,c; cin>>a>>b; for(int i=1;i<=1000;i++) { if(i%a!=0&&i%b!=0) { c=i; } } cout<<c; return 0; }

       
      
      • 1

      Information

      ID
      2840
      Time
      1000ms
      Memory
      64MiB
      Difficulty
      4
      Tags
      # Submissions
      54
      Accepted
      27
      Uploaded By