codeparrot/codecomplex huggingface dataset:
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.io.*;

public class B14G {

    public static void main(String[] args) throws IOException {
        init_io();
        int t = nint();
        while(t-- > 0) {
            int N = nint();
            if (N % 2 != 0) {
                out.println("NO"); continue;
            }
            N /= 2;
            int sqrt = (int)(Math.round(Math.sqrt(N)));
            int sqrt2 = (int)(Math.round(Math.sqrt(N/2)));
            if (sqrt * sqrt == N || sqrt2 * sqrt2 * 2 == N) {
                out.println("YES");
            }
            else {
                out.println("NO");
            }
        }
        out.close();
    }

    static StreamTokenizer in;
    static PrintWriter out;
    static BufferedReader br;

    static int nint() throws IOException {
        in.nextToken();
        return (int) in.nval;
    }

    static void init_io() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        in = new StreamTokenizer(br);
        out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    }
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.io.*;
import java.util.*;
public class B {
    static FastScanner fs;
    public static void main(String[] args) {
        fs=new FastScanner();
        int t = fs.nextInt();
        while (t-->0)
            solve();
    }
    public static void solve() {
        int n = fs.nextInt()*2;
        int sq = (int)Math.sqrt(n);
        int sq2 = (int)Math.sqrt(n/2);
        if (sq*sq==n) System.out.println("YES");
        else if (sq2*sq2==n/2.0 && sq2%2==0) System.out.println("YES");
        else System.out.println("NO");
    }
    static int gcd(int a, int b) {
        if (a==0) return b;
        return gcd(b%a, a);
    }
    static void ruffleSort(int[] a) {
        int n=a.length;//shuffle, then sort
        for (int i=0; i<n; i++) {
            int oi=random.nextInt(n), temp=a[oi];
            a[oi]=a[i]; a[i]=temp;
        }
        Arrays.sort(a);
    }
    static final Random random =new Random();
    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }

    static int[] reverse(int[] a) {
        int n=a.length;
        int[] res=new int[n];
        for (int i=0; i<n; i++) res[i]=a[n-1-i];
        return res;
    }
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author lucasr
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		MyScanner in = new MyScanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		BPhoenixAndPuzzle solver = new BPhoenixAndPuzzle();
		int testCount = Integer.parseInt(in.next());
		for (int i = 1; i <= testCount; i++)
			solver.solve(i, in, out);
		out.close();
	}

	static class BPhoenixAndPuzzle {
		public static MyScanner sc;
		public static PrintWriter out;

		public void solve(int testNumber, MyScanner sc, PrintWriter out) {
			BPhoenixAndPuzzle.sc = sc;
			BPhoenixAndPuzzle.out = out;
			long n = sc.nextLong();
			boolean can = true;
			if (n % 2 != 0) can = false;
			n /= 2;
			while (n > 1 && n % 2 == 0) n /= 2;
			long sq = Math.round(Math.pow(n, 0.5));
			if (sq * sq != n) can = false;

			out.println(can ? "YES" : "NO");
		}

	}

	static class MyScanner {
		private BufferedReader br;
		private StringTokenizer tokenizer;

		public MyScanner(InputStream is) {
			br = new BufferedReader(new InputStreamReader(is));
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

	}
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Solution1515B {
  public static void main(String[] args) {
    InputReader in = new InputReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    Solver1515B solver = new Solver1515B();
    int n = in.nextInt();
    for (int i = 0; i < n; i++) {
      solver.solve(i, in, out);
    }
    out.close();
  }

  static class Solver1515B {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
      int n = in.nextInt();
      boolean f = false;
      if (n % 2 == 0) {
        int s = (int) Math.sqrt(n / 2);
        if (s * s == n / 2) {
          f = true;
        }
      }
      if (n % 4 == 0) {
        int s = (int) Math.sqrt(n / 4);
        if (s * s == n / 4) {
          f = true;
        }
      }
      if (f) {
        out.println("YES");
      } else {
        out.println("NO");
      }
    }
  }

  static class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), 32768);
      tokenizer = null;
    }

    public String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }
  }
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.util.*;import java.io.*;import java.math.*;
public class Main
{
    public static void process()throws IOException
    {
        long n=nl();
        if(n%2==0)
        {
            long a1=(long)Math.sqrt(n);
            long a2=(long)Math.sqrt(n/2);
            if(a1*a1==n || a2*a2*2==n)
                {pn("YES");return;}
        }
        pn("NO");
    }
    
    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        boolean oj = System.getProperty("ONLINE_JUDGE") != null;
        if(oj){sc=new AnotherReader();out=new PrintWriter(System.out);}
        else{sc=new AnotherReader(100);out=new PrintWriter("output.txt");}
        int t=1;
        t=ni();
        while(t-- > 0) {process();}
        out.flush();out.close();  
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static int[] nai(int N)throws IOException{int[]A=new int[N];for(int i=0;i!=N;i++){A[i]=ni();}return A;}
    static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}

/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}
   
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int numTests = in.nextInt();
            for (int test = 0; test < numTests; test++) {
                int n = in.nextInt();
                boolean can = false;
                if (n % 2 == 0 && isSquare(n / 2)) {
                    can = true;
                }
                if (n % 4 == 0 && isSquare(n / 4)) {
                    can = true;
                }
                out.println(can ? "YES" : "NO");
            }
        }

        private boolean isSquare(int n) {
            int x = (int) Math.sqrt(n);
            while (x * x > n) {
                --x;
            }
            while (x * x < n) {
                ++x;
            }
            return x * x == n;
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.io.*;
import java.util.*;

/*
polyakoff
*/

public class Main {

    static FastReader in;
    static PrintWriter out;
    static Random rand = new Random();
    static final int oo = (int) 1e9 + 10;
    static final long OO = (long) 1e18 + 10;
    static final int MOD = (int) 1e9 + 7;

    static boolean isSq(int x) {
        int sq = (int) Math.sqrt(x);
        return sq * sq == x;
    }

    static void solve() {
        int n = in.nextInt();
        if ((n % 2 == 0 && isSq(n / 2)) || (n % 4 == 0 && isSq(n / 4)))
            out.println("YES");
        else
            out.println("NO");

    }

    public static void main(String[] args) {
        in = new FastReader();
        out = new PrintWriter(System.out);

        int t = 1;
        t = in.nextInt();
        while (t-- > 0) {
            solve();
        }

        out.flush();
        out.close();
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        FastReader() {
            this(System.in);
        }
        FastReader(String file) throws FileNotFoundException {
            this(new FileInputStream(file));
        }
        FastReader(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String next() {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(nextLine());
            }
            return st.nextToken();
        }
        String nextLine() {
            String line;
            try {
                line = br.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }
    }
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
//I'm Whiplash99
import java.io.*;
import java.util.*;
public class B
{
    public static void main(String[] args) throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

        int i,N;

        int T=Integer.parseInt(br.readLine().trim());
        StringBuilder sb=new StringBuilder();

        while (T-->0)
        {
            N=Integer.parseInt(br.readLine().trim());

            boolean flag=false;
            int sqrt=(int) Math.sqrt(N/2);
            if(sqrt*sqrt==N/2&&N%2==0) flag = true;

            sqrt=(int) Math.sqrt(N/4);
            if(sqrt*sqrt==N/4&&N%4==0) flag = true;

            sb.append(flag?"YES\n":"NO\n");
        }
        System.out.println(sb);
    }
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.io.*;
import java.util.*;

public class b {
	public static void main(String[] args) throws Exception {
		
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));	
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		StringTokenizer st = new StringTokenizer(f.readLine());

		int T = Integer.parseInt(st.nextToken());
		
		for (int t = 0; t < T; t++) {
			st = new StringTokenizer(f.readLine());
			int n = Integer.parseInt(st.nextToken());
			int sqrt = (int)Math.sqrt(n);
			int sqrt2 = (int)Math.sqrt(n/2);
			if (sqrt*sqrt == n && sqrt%2 == 0) {
				out.println("YES");
			} else if (2*sqrt2*sqrt2 == n) {
				out.println("YES");
			} else {
				out.println("NO");
			}
		}
		
		out.close();
	}
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class B {
    public static void main(String[] args) throws IOException {
//        Scanner scan = new Scanner(System.in);
        BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
//        int t = scan.nextInt();
        int t= Integer.parseInt(br.readLine());
        while (t-->0)
        {
            String[] s1= br.readLine().split(" ");
            int n= Integer.parseInt(s1[0]);
//            Integer[] a= new Integer[n];
//            String[] s2= br.readLine().split(" ");
//            long sum=0;
//            for (int i=0;i<n;i++){
//                a[i]= Integer.parseInt(s2[i]);
//                sum+= Math.abs(a[i]);
//            }

            int x= 1;
            boolean ans=true;
            while (n%2==0){
                x*=2;
                n/=2;
            }
            if (x==1) ans= false;
            int z= (int)Math.sqrt(n);
            if (z*z!=n) ans= false;

            if (ans) System.out.println("YES");
            else System.out.println("NO");
        }
    }
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
/*==========================================================================*/
/*
*		AUTHOR:    RonWonWon    
*		CREATED:   02.05.2021 19:58:57
*		EMAIL:     rachitpts.2454@gmail.com                                  
*/
/*==========================================================================*/
import java.io.*;
import java.util.*;

public class B {
	
	public static void main(String[] args) {
        FastScanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        int t = in.nextInt(), tt = 0;
        while(t-->0) { 
        	int n = in.nextInt();
        	if(n%2!=0) out.println("NO");
        	else{
        		n/=2;
        		if(Math.sqrt(n)==Math.ceil(Math.sqrt(n))) out.println("YES");
        		else{
        			if(n%2!=0) out.println("NO");
        			else{
        				n/=2;
            		if(Math.sqrt(n)==Math.ceil(Math.sqrt(n))) out.println("YES");
            		else out.println("NO");
        			}
        		}
    	    }
    		//tt++; out.println("Case #"+tt+": "+ans);
        }
        out.flush();
	}
	
	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		
		String next() {
			while(!st.hasMoreTokens())
				try { st = new StringTokenizer(br.readLine()); }
				catch(IOException e) {}
			return st.nextToken();
		}
		
		String nextLine(){
			try{ return br.readLine(); } 
			catch(IOException e) { } return "";
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		
		long nextLong() {
			return Long.parseLong(next());
		}
		
		int[] readArray(int n) {
			int a[] = new int[n];
			for(int i=0;i<n;i++) a[i] = nextInt();
			return a;
		}
	}

	static final Random random = new Random();

	static void ruffleSort(int[] a){
		int n = a.length;
		for(int i=0;i<n;i++){
			int j = random.nextInt(n), temp = a[j];
			a[j] = a[i]; a[i] = temp;
		}
		Arrays.sort(a); 	
	}
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main
{
	PrintWriter out = new PrintWriter(System.out);
	BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer tok = new StringTokenizer("");
    String next() throws IOException {
        if (!tok.hasMoreTokens()) { tok = new StringTokenizer(in.readLine()); }
        return tok.nextToken();
    }
    int ni() throws IOException { return Integer.parseInt(next()); }
    long nl() throws IOException { return Long.parseLong(next()); }
    
    long mod=1000000007;
    
    void solve() throws IOException {
        for (int tc=ni();tc>0;tc--) {
            long n=ni();
            long q=1;
            long p=1;
            boolean f=false;
            while (true) {
                if (p*2==n || p*4==n) { f=true; break; }
                q++;
                p=q*q;
                if (p>n) break;
            }
            if (f) out.println("YES");
            else out.println("NO");
        }
        out.flush();
    }
    
    int gcd(int a,int b) { return(b==0?a:gcd(b,a%b)); }
    long gcd(long a,long b) { return(b==0?a:gcd(b,a%b)); }
    long mp(long a,long p) { long r=1; while(p>0) { if ((p&1)==1) r=(r*a)%mod; p>>=1; a=(a*a)%mod; } return r; }
    
    public static void main(String[] args) throws IOException {
        new Main().solve();
    }
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.io.*;
import java.util.*;

public class B {

	public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

	public static void main(String[] args) throws IOException {
		readInput();
		out.close();
	}

	static boolean sq(long x) {
		long l = 1;
		long r = (int)Math.sqrt(1e16)+1;
		while (l+1<r) {
			long m = (l+r)>>1;
			if (m * m > x) r = m;
			else l = m;
		}
		return l*l == x;
	}
	
	static boolean solve(long x) {
		if ((x&1)==1) return false;
		if ((x & (x-1)) == 0) return true;
		long num = 2;
		while (num < x && x % num == 0) {
			if (sq(x/num)) return true;
			num*=2;
		}
		return false;
	}
	
	public static void readInput() throws IOException {
		// br = new BufferedReader(new FileReader(".in"));
		// out = new PrintWriter(new FileWriter(".out"));
		int t = Integer.parseInt(br.readLine());
		while (t-->0) {
			int x = Integer.parseInt(br.readLine());
			out.println(solve(x) ? "YES":"NO");
		}
	}
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.util.*;
import java.io.*;
public class B {

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int T = sc.nextInt();
		while(T-->0) {
			int n = sc.nextInt();
			if(n % 2 == 0 && issq(n/2)) {
				System.out.println("YES");
			}
			else if(n % 4 == 0 && issq(n/4)) {
				System.out.println("YES");
			}
			else {
				System.out.println("NO");
			}
		}

	}

	static boolean issq(long x) {
		long rx = (long)Math.sqrt(x);
		return rx * rx == x;
	}
	
	static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
		public FastScanner() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch(IOException e) {
				throw new RuntimeException(e);
			}
		}
	}

}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear

import java.util.*;
import java.io.*;

public class two {

	public static void main(String[] args) throws IOException, FileNotFoundException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader in = new BufferedReader(new FileReader("two"));

		HashSet<Integer> good = new HashSet<>();
		int i=1;
		for (; i<= (int)(1e9);) {
			i <<= 1;
			good.add(i);
		}
		
		for (i=3; i*i*2 <= (int)(1e9); i++) {
			good.add(i*i*2);
		}
		
		int beg = 4;
		for (i=3; beg + i*4 <= (int)(1e9); i+=2) {
			good.add(beg + i*4);
			beg += i*4;
		}
		
		int t = Integer.parseInt(in.readLine());
		while (t-- > 0) {
			int n = Integer.parseInt(in.readLine());
			if (good.contains(n)) {
				System.out.println("YES");
			}
			else {
				System.out.println("NO");
			}
			
		}

	}
}