CF-520B
kaziamir
c_cpp
2 years ago
292 B
7
Indexable
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
if(m<n){
cout<<n-m<<endl;
}
else{
int ct =0;
while(m<n){
m*=2;
ct++;
}
ct+=(m-n);
cout<<ct<<endl;
}
return 0;
}
Editor is loading...