那个用例的下一次方是28位的哦
对宇宙最严谨的描述应该就是宇宙其实是不严谨的
#include <stdio.h> void foo( unsigned long long l, unsigned long long r, unsigned long long w ) { unsigned count = 0; for( unsigned long long t=1; t<=r; t*=w ) { if( t >= l ) { ++count; printf( "%llu ", t ); } if( t*w/w != t ) break; } if( count == 0 ) printf( "-1" ); putchar( '\n' ); } int main( void ) { unsigned t; scanf( "%u", &t ); while( t-- ) { unsigned long long l, r, w; scanf( "%llu%llu%llu", &l, &r, &w ); foo( l, r, w ); } }