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>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
typedef vector<string> vstr;
typedef pair<ll, ll> pll;
typedef vector<pll> vp;
typedef map<ll, ll> mll;
typedef map<string, ll> mstrll;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fir first
#define sec second
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep,)(__VA_ARGS__)
#define each(i, n) for(auto&& i: n)
#define out(x) cout << (x)
#define indent() cout << '\n'
#define print(x) cout << (x) << '\n'
#define debug(x) cerr << #x << ": " << (x) << '\n'
ll gcd(ll a, ll b){return b != 0 ? gcd(b, a % b) : a;}
ll lcm(ll a, ll b){return a / gcd(a, b) * b;}
const ll INF = 1e16;
const ll MOD = 1e9 + 7;
ll a, b, c, n, m, x, y, z, w, h, ans, cnt, mx, mn;
string s, t;
ll dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
//vll dx = {-1, 0, 1, -1, 1, -1, 0, 1}, dy = {-1, -1, -1, 0, 0, 1, 1, 1};
string alphabet = "abcdefghijklmnopqrstuvwxyz";

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(cin >> n >> m >> x){
        if(n + m >= x){
            print(max(0LL, x - n));
        }else{
            print("NA");
        }
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define repr(i,n) for(int i=(n)-1;0<=i;--i)
#define each(e,v) for(auto&& e:(v))
#define all(v) begin(v),end(v)
#define dump(x) cerr<<#x<<": "<<(x)<<endl
#define INF 100000000
#define IINF 9999999999999;
using vint = vector<int>;
using ll = long long;
using vll = vector<ll>;
template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }

// 1

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

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

C++: #include <iostream>
using namespace std;
int main(){
    
int m; //自分の金額
int f;　//A君の金額
int b;//本の値段

    if (m >= b){
      cout << "0" << endl;
    }

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



    

return 0;
}

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

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

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

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

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

C++: #include <stdio.h>

int main(void) {

	int a, b, c;

	scanf("%d %d %d", &a, &b, &c);

	if (a >= c) {
		printf("0\n");
	}
	else if ((a + b) <= c) {

		printf("NA\n");
	}
	else {
		printf("%d\n", c - a);

	}
	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 << m << endl;  // 自分で購入するとき
	else cout << f - m  << endl;  // 友達から借りたとき

	return 0;
}

C++: #include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>

using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007
#define P pair<ll, ll>


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

C++: #include<bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)
#define lpin(a,i,n) for(int i=0;i<n;i++){cin>>a[i];}
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;
    
  return 0;
}

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

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

	else cout << 0 << endl ;

	return 0 ;
}

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

C++: /*
　　　　 ∧＿∧　にっぽんちゃちゃちゃ
　／＼（　・∀・）／ヽ
（ ●　と　　　つ　● ）　にっぽんちゃちゃちゃ
　＼/⊂、 ノ　　＼ノ
　　　　　し'
*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define MOD 1000000007
#define INF 9223372036854775807

signed main()
{
  int x=0,y=0,z=0,w=0;
std::cin >> x>>y>>z;
if(z<=x)std::cout << 0 << '\n';
else if(z>x){
  if(z<=x+y)std::cout << z-x << '\n';
  else std::cout << "NA" << '\n';
}
}

C++: #include <algorithm>
#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;
}