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++: #define _USE_MATH_DEFINES
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=0;i<b;i++)
#define REP(i,a,b) for(int i=0;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define Yes(f) cout <<(f?"Yes":"No")<<endl//fが真の場合Yesを出力、偽の場合Noを出力
#define yes(f) cout <<(f?"yes":"no")<<endl
#define YES(f) cout <<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v),greater<int>())

using namespace std;

const int mod=1e9+7;



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

C++: # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
# include <bitset>
# include <random>
# include <chrono>
# include <cstdlib>
# include <tuple>
# include <array>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using D = double;
constexpr int INF = 2147483647;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr double HDINF = 50000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
typedef pair<LL, LL> pii;
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_num(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define RALL(qpqpq)           (qpqpq).rbegin(),(qpqpq).rend()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define RFOR(i,tptpt,ypypy)  for(LL i=(tptpt);i>=(ypypy);i--)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

int m, f, b;

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

C++: #include<iostream>;

using namespace std;

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

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

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

#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, init, n) for(int i = init; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define fi first
#define se second

using namespace std;
using ll = long long int;
using P = pair<int, int>;
using T = tuple<int, int, int>;
using edge = struct
{
    int to, cost;
};

const int MOD = 1e9 + 7;
const int iINF = 1e9;
const long long int llINF = 1e18;
const double PI = acos(-1.0);

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int m, f, b;
    cin >> m >> f >> b;

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

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
    int m,f,b;
    cin>>m>>f>>b;
    if(b-m>f){
        cout<<"NA"<<endl;
    }else{
        cout<<max(b-m,0)<<endl;
    }
    return 0;// Your code here!
    
}

C++: #include<set>
#include<iostream>
#include<ctime>
#include<string>
#include<cstdlib>
#include<algorithm>
#include<random>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<functional>
#include<string.h>
#include<limits.h>
using namespace std;

signed main() {
	int a, b, c; cin >> a >> b >> c;
	if (a + b < c)puts("NA");
	else cout << max(0, c - a) << endl;
}

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

C++: #include <bits/stdc++.h>
#include <typeinfo>
#include <cxxabi.h>
#ifdef LOCAL
  #include "dbgtoki.hpp"
  #define DUMP(i) DEB dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i)  
#else
  #define DUMP(i)  
#endif

#define GETTYPE(i) 
#define TOSTRING(x) #x
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a):i<(b);i++)
#define SSTR( x ) static_cast< std::ostringstream & >( \
        ( std::ostringstream() << std::dec << x ) ).str()
#define ALL(s) (s).begin(), (s).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()) , v.end());
using namespace std;
typedef long long unsigned int llu;
typedef long long ll;

int main (){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int m,f,b;
  while(cin >> m >> f >> b){
    if(m + f < b) cout << "NA" << endl;
    else cout << max(b-m,0) << endl;
  }
  return 0;
}

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

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

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

C++: #include <stdio.h>

int main(void){
	
	int temochi,a,nedan;
	int ans1,ans2;
	
	scanf("%d %d %d",&temoci,&a,&nedan);
	
	ans1 = temochi+a;
	if(ans1<nedan){
		printf("NA\n");
	}else{
		ans2 = nedan-temochi;
		if(ans2<=0){
			printf("0\n");
		}else{
			printf("%d\n",ans2);
		}
	}
	
	return 0;
}

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

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

int m,f,b;


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

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

return 0;
}