Start: Dec, 04, 2016 12:00:00
杭州师范大学第十届程序设计竞赛—正式
End: Dec, 04, 2016 17:00:00
Time elapsed:
Time remaining:

Problem_ID: C
Result: Accepted
Time: 1ms
Memory: 1092kB
In contest: 1075

#include<stdio.h>
#include<string.h>
#include<math.h>
int main(){
	int n,m ,i,j,k,sum,t,temp,a;
	scanf("%d",&t);
	while(t--){
		temp=0;
		scanf("%d",&a);
		for(i=1;i<=a;i++){
			if(a%i==7&&a/i%i==1&&a/i/i==0){
				temp=1;
				break;
			}
		}		
		
		if(temp==1)
		    printf("%d\n",i);
		else
			printf("-1\n");
	}

	return 0;
}