# Help me in solving ATTENDU problem

### My issue

I am not sure where my logic is going wrong but the commands written in comments is working fine

### My code

``````#include <iostream>
using namespace std;

int main()
{
int t;
cin>>t;
while(t--)
{
int c=0,n;
cin>>n;
string a;
cin>>a;
for(int i=0;i<n;i++)
{
if(a[i]=='1')
c++;}
if((c/120)*100>=75|| ((120-n)*100)/120+c/120>=75)
//int j=120-n+c;
//float per=(j*100)/120;
// if(per>=75)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}

return 0;
}

``````

Problem Link: ATTENDU Problem - CodeChef

@codestar05
This is my code i have written in much simpler way . hope u will get it.

``````#include <iostream>
using namespace std;

int main() {
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
int cnt=0;
string s;
cin>>s;
for(int i=0;i<n;i++)
{
if(s[i]=='1')
cnt++;
}
cnt+=(120-n);
if(cnt>=90)
cout<<"YES";
else
cout<<"NO";
cout<<endl;
}
return 0;
}
``````

@dpcoder_007
In your program why have you taken greater than 90
Could also tell me why is my program going wrong

@codestar05
cozz 75% of 120 will be 90 so to have atleast 75% attendance u have to go atleast 90 times.
and U are mistaking it in calculating the percentage of attendance .

@dpcoder_007
Thank you