My issue
this is the code for Make N Zero
include <bits/stdc++.h>
define ll long long
define pll pair<long long ,long long >
using namespace std;
int main() {
// your code goes here
ll t; cin >> t;
while (t–) {
ll n; cin >> n;
ll d4 = n % 4;
ll d3 = n % 3;
if (d3 == 0 || d4 == 0 || d4 == 3) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
return 0;
}
can someone explain in which testcase my code is not passing i am not able to understand where i am going wrong.
My code
#include <bits/stdc++.h>
#define ll long long
#define pll pair<long long ,long long >
using namespace std;
int main() {
// your code goes here
ll t; cin >> t;
while (t--) {
ll n; cin >> n;
ll d4 = n % 4;
ll d3 = n % 3;
if (d3 == 0 || d4 == 0 || d4 == 3) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
return 0;
}
Problem Link: Make N Zero Practice Coding Problem - CodeChef