Go: package main

import "fmt"

func main() {
	var m, a, book int
	fmt.Scan(&m, &a, &book)

	if nokori := m - book; nokori < 0 {
		if nokori = nokori + a; nokori < 0 {
			fmt.Println("NA")
		} else {
			fmt.Println(a - nokori)
		}
	} else {
		fmt.Println(0)
	}
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <functional>
#include <string>
#include <stack>
#include <set>
#include <sstream>
#include <iomanip>
#include <limits>
#include <cstring>

using namespace std;
using ll = long long;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<double, double >pd;
typedef pair<string, string> sP;
typedef pair<ll, P> PP;
typedef pair<P, P> PPP;

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll INF = 1 << 30;
const ll INF2 = 9e18;
const double INF3 = 9e14;
const double eps = 1e-10;
const double PI = 3.14159265358979323846;
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };

#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define pb push_back
#define eb emplace_back
#define fr first
#define sc second




int main() {
	ll m, f, b;
	cin >> m >> f >> b;
	if (b - m > f)cout << "NA" << endl;
	else cout << max(0LL, b - m) << endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
int m,f,n;
cin>>m>>f>>n;
if(m+f<n)cout<<"NA"<<endl;
else{
if(n<=m){
cout<<0<<endl;
}
else{
cout<<n-m<<endl;
}
}

C++: #include <bits/stdc++.h>
using namespace std;


int main() {
    
    int m,f,b,ans;
    cin >> m>> f>>b;
    
    ans = b - m;
    
    if(ans <= f){
        if(ans <0)
        {
            ans = 0;
        }
        cout<< ans << endl;
    }
    else{
        cout << "NA"<<endl;
    }
    
    
    

}

C++: #include "bits/stdc++.h"
using namespace std;

#define ASC(vec) vec.begin(), vec.end()		// 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend()	// 降順ソート 例:sort(DESC(vec));
#define rep(i, n) for(int i = 0; i < n; i++)
#define Rep(i, n) for(int i = 1; i < n; i++)
#define In(vec) rep(i, n) cin>>vec[i];
#define ANS(s) cout << s << endl
#define inc(a, b) cin >> a >> b;

const int mod = 1000000007;
const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;

int main() {
	int m, f, b;
	cin >> m >> f >> b;

	if (b > m + f) cout << "NA" << endl;
	else {
		cout << max(b - m, 0) << endl;
	}
}

C++: #include<stdio.h>
int main(void)
{
	int m,f,b;
	scanf("%d %d %d",&m,&f,&b);
	if(m>=b){
		printf("%d\n",0);
	}
	else if(m+f<b){
		printf("NA\n");
	}
	else if(m+f>=b){
		printf("%d\n",b-m);
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int m, f, b;
    cin >> m >> f >> b;

    if (m >= b) {
        cout << 0 << endl;
    }
    else if ((m + f) < b) {
        cout << "NA" << endl;
    }
    else {
        cout << (b - m) << endl;
    }
}

C++: #include<iostream>
using namespace std;
int main(){
	int a, b,c;
	cin >> a >> b>>c;
	if (a>c){
		cout << 0 << endl;
	}
	else if (a + b < c){
		cout << "NA" << endl;
	}
	else {
		cout << c - a << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
using namespace std;
signed main() {
  int me,a,book;
  cin>>me>>a>>book;
  if (me >= book) {
    cout << 0 << endl;
  } else if (me+a >= book) {
    cout << book-me << endl;
  } else {
    cout << "NA" << endl;
  }
}

C++: #include<iostream>
int main() {
	int MO, OTOMO, KIN;
	std::cin >> MO >> OTOMO >> KIN;
	if (MO >= KIN) {
		std::cout << 0 << std::endl;
	}
	if (MO < KIN) {
		if (MO + OTOMO >= KIN) {
			std::cout << KIN - MO << std::endl;
		}
	}
	if (MO + OTOMO < KIN) {
		std::cout << "NA" << std::endl;
	}
}

C++: //============================================================================
// Name        : AOJ.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <algorithm>

using namespace std;

int main() {
	auto i=0;
	int m,f,b;
	cin>>m>>f>>b;
	if(m>=b){
		i=0;
		cout <<i<< endl;
	}else if((m+f)-b<0){
		cout <<"NA"<< endl;
	}else {
		cout <<b-m<< endl;

	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int m,f,b;
    cin >> m >> f >> b;
    if(m >= b){
        cout << 0 << endl;
    }else if(m + f >= b){
        cout << b - m << endl;
    }else{
        cout << "NA" << endl;
    }
}

C++: #include <iostream>
using namespace std;
int main(void){
       int a,b,c;
       cin>>a>>b>>c;
       if(a < b && a+b >= c && a < c){
           cout<<c-a<<endl;
       }
       else if(a > b && a+b >= c && a < c){
           cout<<c-a<<endl;
       }
       else if(a == b && a+b >= c && a < c){
           cout<<c-a<<endl;
       }
       else if(a>=c){
           cout<<"0"<<endl;
       }
       else if(a+b < c){
           cout<<"NA"<<endl;
       }
       
       
       return 0;
    
}

C++: #include<iostream>
using namespace std;
 
int main(){
  int m,f,b;
  cin>>m>>f>>b;

  if(b<=m+f)

   if(b<=m) cout<< 0 <<endl;
    else
    cout<<b-m<<endl;

  else
   cout<<"NA"<<endl;

  return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int m, f, b;
    cin >> m >> f >> b;
    if(m >= b){
        cout << 0 << endl;
    } else if((b - m) <= f){
        cout << (b - m) << endl;
    } else {
        cout << "NA" << endl;
    }
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#include <iterator>
#include <iomanip>
#include <sstream>
#define INF 2000000000
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
#define sym cout<<"---------"<<endl;
#define ll long long
#define PL pair<long long, long long>
#define P pair<int,int>
#define mk make_pair
#define en endl
#define WHITE 0
#define BLACK 2
#define GRAY 1
#define RE return 0
#define int ll

int have,a,book;

signed main(){
  cin>>have>>a>>book;
  if(have>=book){
    cout<<0<<en;
    RE;
  }else if(book>a+have){
    cout<<"NA"<<en;
    RE;
  }else{
    cout<<book-have<<en;
  }
  RE;
}

C++: #include<iostream>
using namespace std;

int main() {
	int m, f, b;
	cin >> m >> f >> b;
	
	if (m >= b) cout << 0 << endl;
	else if (m + f >= b)cout << b - m << endl;
	else cout << "NA" << endl;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int m,f,b;
    cin>>m>>f>>b;
    if(m>b){
        cout<<"0"<<endl;
    }else if(m+f<b){
        cout<<"NA"<<endl;
    }else{
        cout<<f-((m+f)-b)<<endl;
    }
}

C++: #include <iostream>
using namespace std;
int main(void){
    int m,f,b;
    cin >> m >> f >> b;
    int x=b-m;
    if(x<=0){
        cout << "0" << endl;
    }
    else if(x>0){
        int y=f-x;
        if(y>=0){
            cout << x << endl;
        }
        else{
            cout << "NA" << endl;
        }
    }
}

C++: #include <iostream>
using namespace std;

int main(){
	int a ,b ,c;
	cin >> a >> b >> c;
	if(a + b < c){
		cout << "NA" << endl;
		return 0;
	}
	if(a >= c){
		cout << 0 << endl;
		return 0;
	}
	cout << c-a << endl;
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main(){
  int m,f,b;
  cin>>m>>f>>b;
  if(b<=m)cout<<0;
  else if(f-(b-m)>=0)cout <<(b-m);
  else cout<<"NA";
  cout <<endl;
  
  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
 
int main(){
    int a,b,c;scanf("%d%d%d",&a,&b,&c);
    if(a+b<c)puts("NA");
    else printf("%d\n",max(0,c-a));
}

C++: 
#include<iostream>
using namespace std;

int m,f,b,Y;


int main(){
Y=0;    
cin>>m>>f>>b;

 if (m+f<b)
   Y=NA;
 else
   Y=b-m;
cout<<Y<<endl;

return 0;
}