#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } void solve() { long long n; cin >> n; if (n < 0) { n = -n; } if (n == 1) { cout << "Yes\n"; cout << "0\n"; return; } cout << "No\n"; n %= 100; long long num = n * n * n * n + 4; int ans = 0; while (num % 10 == 0) { num /= 10; ans++; } cout << ans << "\n"; } int main() { fast_io(); int t; cin >> t; for (; t--;) { solve(); } }