Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include <cstdio>
#include <iostream>
int main(){
int n, a, b; scanf("%d %d %d", &n, &a, &b);
printf("%d\n", std::min(n - a,b + 1));
return 0;
}
Copy The Code &
Try With Live Editor
Input
3 1 1
Output
2
Demonstration
Codeforces Solution-A. The number of positions-Solution in C, C++, Java, Python