#include <iostream> // milliardc.cpp
using namespace std;
int main() // rextester.com/QZEGM92902
{ srand(time(NULL));
int h2=1000000000, h1=0, f=0, t=0, a=0;
int comp = rand() % h2;
int human = rand() % h2;
while (f<1)
{ cout<<endl<<t<<" "<<comp<<" "<<human;
if(comp < human)
{ cout << " MORE";
a=comp; comp=(comp+h2)/2; h1=a;}
else if(comp > human)
{ cout << " less";
a=comp; comp=(h1+comp)/2; h2=a;}
else { cout <<" win by "<<t<<" steps "; f=1;}
t++; }system("pause");}
