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 <math.h>
#include <cmath>
#include <stdio.h>
#include <cstring>
#include <string.h>
#include <string>
#include <sstream>
#include <iomanip>

using namespace std;

int main (void)
{
	long 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;
		}
	}
}

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

typedef long long ll;
using namespace std;

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 cout << max(0,b-m) << endl;

	return 0;

}

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

using namespace std;

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

	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;

	return 0;
}

C++: import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);

		int a,f,b;

		a = stdIn.nextInt();
		f = stdIn.nextInt();
		b = stdIn.nextInt();

		if(a > b) {
			System.out.println(0);
		}else if(a + f < b) {
			System.out.println("NA");
		}else {
			System.out.println(b -a);
		}
	}

}

C++: #include <bits/stdc++.h>
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>
#include<cmath>

using namespace std;
int main()
{
    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;
        }
    }
    return 0;
}

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

}

C++: # include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
#include <stdio.h>
#include<time.h>
#include <stdlib.h>
#include <cstdint>
#include <cfenv>

//#include <bits/stdc++.h>
using namespace std;
using LL = int;
using ULL = unsigned long long;
long long MOD = 1000000000 + 7;
constexpr long long INF = numeric_limits<LL>::max();
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr<<#x<<": "<<x<<'\n'
typedef pair<LL, LL> Pll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
struct Fll { LL first, second, third, fourd; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Mfor(i,mf) for(LL i=mf-1;i>=0;i--)
LL h, w, n, m, k, t, s, q, last, cnt, sum, ans, dp[10000][4], a[2000000], b[2000000];
string str, ss;
bool f[1100][1100];
char c;
int di[4][2] = { { 0,1 },{ 1,0 },{ 0,-1 },{ -1,0 } };
struct Edge { LL to, cost; };
vector<Edge>vec[200000];
vector<LL>v;
map<Pll, LL>ma;
set<LL>st;
void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}
int main() {
	cin >> n >> m >> s;
	if(n+m>=s)
	cout<<max(s-n,(LL)0)<<endl;
	else 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) 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(){
    int m, f, b;
    cin>>m>>f>>b;
    if(m>=b){
        cout<<"0"<<endl;
    }else if(m<b&&m+f>=b){
        cout<<b-m<<endl;
    }else{
        cout<<"NA"<<endl;
    }
}

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

#define FOR( i, m, n )   for( int i = m; i < n; i++ )
#define REP( i, n )      FOR( i, 0, n )
#define ALL( a )         (a).begin(), (a).end()

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 <bits/stdc++.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;
typedef long long ll;


int main(){
	
	int m,f,b;
	cin>>m>>f>>b;
	if(b-m<=0){
		cout<<0<<endl;
	}
	if(b-m>0 && b-m<=f){
		cout<<b-m<<endl;
	}
	if(b-m>0 && b-m>f){
		cout<<"NA"<<endl;
	}
	/*int a,b;
	cin>>a>>b;
	cout<<(a+b)/2<<endl;*/
	
	/*random_device rnd;
	mt19937 mt(rnd());
	uniform_int_distribution<> rnd3(1, 3);
	
	string p1, p2, p3, p4;
	cin >> p1 >> p2 >> p3 >> p4;
	
	int t = rnd()%3;
	
	if(t == 0){
		cout << "1:" << p1 << ',' << p2 << endl;
		cout << "2:" << p3 << ',' << p4 << endl;
	}
	if(t == 1){
		cout << "1:" << p1 << ',' << p3 << endl;
		cout << "2:" << p2 << ',' << p4 << endl;
	}
	if(t == 2){
		cout << "1:" << p1 << ',' << p4 << endl;
		cout << "2:" << p2 << ',' << p3 << endl;
	}*/
	
	/*
	switch(type){
		case 0:
			cout << "1:" << p1 << ',' << p2 << endl;
			cout << "2:" << p3 << ',' << p4 << endl;
			break;
		case 1:
			cout << "1:" << p1 << ',' << p3 << endl;
			cout << "2:" << p2 << ',' << p4 << endl;
			break;
		case 2:
			cout << "1:" << p1 << ',' << p4 << endl;
			cout << "2:" << p2 << ',' << p3 << endl;
			break;
	}
	*/
	
	
	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((m+f)>=b){
        cout<<b-m<<endl;
    }
    else if((m+f)<b){
        cout<<"NA"<<endl;
    }
    }

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;
	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
int main()
{
    int m, f, b;
    scanf("%d%d%d", &m, &f, &b);
    printf(b > m + f ? "NA\n" : "%d\n", max(0, b - m));
}

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

C++: import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);

		int a,f,b;

		a = stdIn.nextInt();
		f = stdIn.nextInt();
		b = stdIn.nextInt();

		if(a > b) {
			System.out.println("0");
		}else if(a + f < b) {
			System.out.println("NA");
		}else {
			System.out.println(b -a);
		}
	}

}

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;
}