Solution:
#include<iostream> #include<cstdio> using namespace std; int main() { int testcase,i,num_range,j; cin>>testcase; for(i=1; i<=testcase; i++) { cin>>num_range; cout<<"Case "<<i<<":"; for(j=1; j<=num_range; j++) { if(num_range%j==0) { cout<<" "<<j<<" "; } } cout<<endl; } return 0; }