Untitled
unknown
plain_text
16 days ago
971 B
5
Indexable
Never
#include<stdio.h> #include<math.h> int main() { int days, affected, people, high, low; scanf("%d", &days); while(days--) { int count; high = 0; low = 0; scanf("%d", &affected); for (int i = 1; i <= affected;i++) { scanf("%d", &people); count = 0; if(people<2) { low++; } else { for (int j = 2; j <= sqrt(people); j++) { if (people % j == 0) { count++; } } if(count>0) { low++; } else { high++; } } } printf("%d %d\n", high, low); } return 0; }
Leave a Comment