SRM485 DIv2 Easy(250) MicrowaveSelling
int attract( int n ) { int c = 0; for ( ; n%10==9; n/=10 ) c++; return c; } class MicrowaveSelling{public: int mostAttractivePrice( int minPrice, int maxPrice ) { int ans = 0; int att = -1; for ( int i=maxPrice; i>=minPrice; i-- ) if ( attract(i) > att ) ans = i, att = attract(i); return ans; }};