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 <vector>
#include <queue>
#include <set>
#include <string>
#include <stack>
#include <cmath>
#define ll long long
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
using namespace std;
//
const int inf=1e9+7;
const int mod=1e9+7;
//
struct poi{
	int X;int Y;int Z;
	bool operator<(const poi&R)const{
		return X==R.X ? Y==R.Y ? Z<R.Z : Y<R.Y : X<R.X;
	}
};
//
ll GCD(ll a,ll b){
	return (b==0)?(a):(GCD(b,a%b));
}
ll LCM(ll a,ll b){
	return a/GCD(a,b)*b;
}
//
int main(){
	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"<<endll;
	}
	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 if(m>=b)cout<<0<<endl;
	else cout<<b-m<<endl;
}

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

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

    return 0;
}

C++: int main() {
	int a,b,c;
	cin>>a>>b>>c;
	cout<<b-c+a<<endl;
	return 0;
}

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;
	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<algorithm>
#include<queue>
#define lol(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
typedef long long ll;
using namespace std;

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

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

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

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

int main() {
	int m ,f, b;
	cin >> m >> f >> b;
	int x = b-m;
	if(x<0) cout << '0' << endl;
	else if(f>x){
		int y = f-x;
		cout << y << endl;
	}
	else if(m+f<b) cout << "NA" << 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;

return 0;
}

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

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

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 {
    cout << "NA\n";
  }

  return 0;
}

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

using namespace std;

int main()
{
	int m;	// 自分の所持金
	int f;	// 友達の所持金
	int b;	// 本の値段

	cin >> m >> f >> b;

	if (b <= m) {
		// 買える
		cout << 0 << endl;
	} else if (b <= m + f) {
		//　友達に借りれば買える
		cout << b - m << endl;
	} else {
		// 買えない
		cout << "NA" << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
const double PI = acos(-1);
#define rep(i, n) for (int i = 0; i < (int)(n); i++ )
using namespace std;
int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
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;
}

C++: #include <cstdio>

using namespace std;

int main()
{
    int m,f,b;
    scanf( "%d %d %d\n", &m, &f, &b );
    int ret = b - m;
    if( ret < 0 )
    {
        printf("%d\n", 0 );
    }
    else if( f < ret )
    {
        printf("NA\n");
    }
    else
    {
        printf8 "%d\n", ret );
    }
    return 0;
}

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

C++: #include <iostream>

using namespace std;

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

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;
}else if(k<m){
    cout<<0<<endl;
}else{
    cout<<k<<endl;
}

return 0;
}

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

int m,f,b;


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

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

return 0;
}

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

C++: 
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
#define chmin(a, b) ((a) = min((a), (b)))
#define chmax(a, b) ((a) = max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD = 1e9 + 7;
const ll INF = 1e18;
const double pi = acos(-1);
const double eps = 1e-10;

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

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

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