4 solutions

  • 3
    @ 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;
    }
    
    
    
    • 1
      @ 2026-8-10 14:07:31

      #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; }

      • 0
        @ 2026-9-11 20:00:17

        #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;
        

        }

        • -4
          @ 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
          3
          Tags
          # Submissions
          95
          Accepted
          51
          Uploaded By