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<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/






int M, F, B;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> M >> F >> B;

    int d = M - B;
    if (0 <= d) {
        // 足りた
        printf("0\n");
        return;
    }

    if (0 <= d + F) {
        // 借りれば足りる
        printf("%d\n", -d);
        return;
    }

    // 足りない
    printf("NA\n");
}

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


	return 0;
}

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

}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
    int m,f,b;
    cin >> m >> f >> b;
    if(m + f < b){
        cout << "NA" << endl;
    }else{
        cout << max(0,b-m) << 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(b >= (m + f)) cout << "NA";
  else cout << b - m;

  return 0;
}

C++: /*----------------------------------------------------------*\
|m, f, bが与えられる											|
|		↓													|
|場合分け													|
|i) 手持ちだけで足りる場合									|
|	→ m >= b(mがb以上である)									|
|	→ m, bの値によらず'0'を出力								|
|ii) 手持ちだけでは足りないが、Aくんから借りれば買える場合		|
|	→ m + f >= b(m + fがb以上である)							|
|	→ b - mを出力(→不足金額を出力)							|
|iii) 手持ちとAくんの所持金を合わせても買えない場合			|
|	→ m + f < b(m + fがb未満である)							|
|	→ m, f, bの値によらず"NA"を出力							|
|		↓													|
|	return 0;												|
\----------------------------------------------------------*/

#include <iostream>
using namespace std;

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

C++: 
#include<set>
using namespace std;
#include<iostream>
int	main(){
	/*
	while(true){
	
	int A,B,C,D,E,F,G,H,I,J,answer;
		
	cin >> A;
	if(A == 0) return 0;
	cin >> B >> C >> D >> E >> F >> G >> H >> I >> J;
	answer = A - B - C - D-E-F-G-H-I-J;
	cout << answer << endl;

	}
	*/
	/*
	int A,B,C,D,E,F;

	cin >> A, B, C, D;
	if(A < B, C, D){ 
	cout << B + C + D << endl;
	}
	
	else if(B < A, C, D){
	cout << A + C + D << endl;
	}

	else if(C < A && C < B && C < D){
	cout << A + B + D << endl;
	}

	else if(D < A && D < B && D < C){
	cout << A + B + C << endl;
	}

	if(E < F){
	cout << F << endl;
	}

	else{
	cout << E << endl;
	}
	
	return 0;
}*/
	/*
	int N, M;
	cin >> N >> M;
	cout << N + M << endl << N - M << endl << N * M << endl << N / M << endl;
}*/

/*int N, M; 
	cin >> N >> M;
	cout << N % M << endl;
}*/

/*	int N;
	cin >> N;
	cout << -(N % 2)+1 ;
}*/

	/*int A, B, C, D, E ;
	cin >> A >> B >> C >> D >> E;
	cout << (A + B + C + D + E) / 5 ;
}*/

	/*int A, B, C, D ;
	cin >> A >> B >> C >> D;
	cout << (A + B + C + D) / 60 << endl << (A + B + C + D) % 60 << endl;
	*/

/*	int A,B;
	cin >> A >> B;
	cout << ( A + B ) / 2 << endl;*/

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

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


	if ( m + f < b ){
	cout << "NA" << endl;
	}

}

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

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

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

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

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

 }

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

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
ll A,B,C;
int main() {
	cin>>A>>B>>C;
	if(A>=C)cout<<0<<endl;
	else if((A+B)>C)cout<<C-A<<endl;
	else cout<<"NA"<<endl;


	return 0;
}

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

int main(){
  int m,j,b;
  cin >> m>> j>> b;
  if(m >= b){
      cout << 0<<endl;
  }else if(m+j>=b){
      cout << b-m  <<endl;
  }else{
      cout <<"NA" <<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>
using namespace std;
int m,f,b,k;
int main(){
cin>>m>>f>>b;
k=b-m;
if(k<0){
    k=-(k);
}
if(f<k){
    cout<<"NA"<<endl;
}
if(k<m){
    cout<<0<<endl;
}else{
    cout<<k<<endl;
}

return 0;
}