fork download
  1. #include <iostream>
  2. #include<stdio.h>
  3. #include<memory.h>
  4. #include<limits.h>
  5. #include<string.h>
  6. using namespace std;
  7.  
  8. char str[100005];
  9. int hashmap[300];
  10. int main()
  11. {
  12. int t; cin>>t;
  13. while(t--){
  14. int n ; cin>>n;
  15. if(n==4 || n == 6) cout<<1<<" "<<1<<endl;
  16. else if(n==8|| n==10) cout<<2<<" "<<2<<endl;
  17. else if(n<4 || n%2!=0) cout<<-1<<endl;
  18. else{
  19. cout<<(n+1)/6<<" "<<n/4<<endl;
  20. }
  21.  
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0s 5284KB
stdin
4
4
7
24
998244353998244352
stdout
1 1
-1
4 6
-1