Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include <cstdio>
int main(){
long t; scanf("%ld", &t);
while(t--){
long n; scanf("%ld", &n);
printf("%ld\n", n > 2 ? (n - 2) : 0);
}
return 0;
}
Copy The Code &
Try With Live Editor
Input
1
3
3
Output
1
Demonstration
Codeforces Solution-B. Party-Solution in C, C++, Java, Python