CF-520B
c_cpp
a month ago
292 B
1
Indexable
Never
#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; }
#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; }