General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
99936991 Practice:
Mr_Knowbody
1141A - 34 GNU C++11 Wrong answer on test 1 15 ms 0 KB 2020-11-29 23:35:14 2020-11-29 23:35:14
→ Source
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) v.begin(),v.end()
#define endll "\n"
 
#define fin             freopen("input.txt","r",stdin);
#define fout            freopen("output.txt","w",stdout);
 
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m;
    cin >> n >> m;
    int c=0;
 
    for(int i=0;i<=25;i++){
        for(int j=0;j<=25;j++){
            if((ll)n*pow(2,i)*pow(3,j)==m){
                cout << i+j << endl;
                return 0;
            }
        }
    }
    cout << -1 << endl;
    return 0;
}
 
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details