#include <iostream>
#include <math.h>
int main( )
{
int square = 1 ;
int square_count = 1 ;
int rice_count = 1000 ;
while ( square <= rice_count)
{
std:: cout << square_count << " squares have been used. " << square << " rices count." << std:: endl ;
square_count++ ;
if ( square == 1 )
{
square++ ;
}
else
{
square = square * square;
}
}
return 0 ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWF0aC5oPgoKaW50IG1haW4oKQp7CiAgICBpbnQgc3F1YXJlID0gMTsKICAgIGludCBzcXVhcmVfY291bnQgPSAxOwogICAgaW50IHJpY2VfY291bnQgPSAxMDAwOwogICAgd2hpbGUoc3F1YXJlIDw9IHJpY2VfY291bnQpCiAgICB7CiAgICAgICAgc3RkOjpjb3V0IDw8IHNxdWFyZV9jb3VudCA8PCAiIHNxdWFyZXMgaGF2ZSBiZWVuIHVzZWQuICIgPDwgc3F1YXJlIDw8ICIgcmljZXMgY291bnQuIiA8PCBzdGQ6OmVuZGw7CiAgICAgICAgc3F1YXJlX2NvdW50Kys7CiAgICAgICAgaWYgKHNxdWFyZSA9PSAxKQogICAgICAgIHsKICAgICAgICAgICAgc3F1YXJlKys7CiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICAgIHNxdWFyZSA9IHNxdWFyZSAqIHNxdWFyZTsKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gMDsKfQo=