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;

int main(){

  int m,f,b;

  cin>>m>>f>>b;

  if ( m - b > 0 ){

    cout<<0<<endl;
  }

  else  if ( m + f - b < 0 ){

    cout<<"NA"<<endl;

  }

  else if ( m + f - b >= 0 ){

    cout<< b - m << endl;
  }

  return 0;

}

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

C++: int main(){

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>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;

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

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
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(){
    long int m,f,b,a,sum;
    cin >> m >> f >> b;
    a=m+f;

     if(a>=b){
         if(m>=b){
             cout << "0" << '\n';
         }else{
             sum=b-m;
             cout << sum << '\n'; 
         }
        
    }else if(a<b){
        cout << "NA" << '\n';  
     }

    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 cout << "NA" << endl;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include<bitset>

using namespace std;
#define loop(i,n) for(int i = 0; i < (n); ++i)
#define loops(i,f,n) for(int i = (f); i < (n); ++i)
#define INF 9999999
#define lint long long int
#define VEC vector<int>
#define VEC2 vector<vector<int>>

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	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;
	}
}

C++: #include<cstdio>

int main(void){
    int m, f, b;
    scanf("%d %d %d", &m, &f, &b);
    if(m+f<b){puts("NA");return(0);}
    printf("%d\n", (m>b)?0:b-m);
    return(0);
}

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

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

    cin >> m;
    cin >> f;
    cin >> 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>
#include<algorithm>
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 << m + f - b << endl;
	else cout << "NA\n";
}

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<<f=b-m<<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;
    return 0;
  }
  if (m >= b){
    //自分だけで買える
    cout << 0 << endl;
    return 0;
  }
  cout << b - m << endl;
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    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;
    
}

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<<"NA"<<endl;
      else
        cout<< b-m <<endl;

return 0;
}

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 <bitset>
# include <complex>
#include<limits.h>
#include<random>
#include<deque>
#include<cstdio>
#include<fstream>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 2000100;
const int mod = (int)pow(10, 9) + 7;
const ll INF = 1LL << 60;
#define rep(i,n) for(ll i=(ll)0;i<(ll)n;++i)
#define ALL(x) x.begin(),x.end()
#define pp pair<ll,ll>
#define ppp pair<pp,ll>
#define fi first
#define se second
#define pb push_back
#define fix(n) fixed<<setprecision(n)
#define itr vector<ll>::iterator
#define print(s) cout<<s<<endl
#define inp(s) cin>>s
string yn(bool b) { return (b ? "Yes" : "No"); }
string YN(bool b) { return (b ? "YES" : "NO"); }
ll m, f, b;
int main(){
	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"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
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(void){
    int m,f,b;
    cin >> m >> f >> b;
    if(m>b){
        cout << '0';
    }else if(b-m<=f){
        cout << b-m;
    }else{
        cout << "NA";
    }
    cout << endl;
}

C++: #include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int a, b, c; scanf("%d%d%d", &a, &b, &c);
	
	int ans = std::max(0, c - a);
	if(ans > b) printf("NA\n");
	else printf("%d\n", ans);
	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;
    else cout << max(0,b-m) << endl;
}

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

    cin >> m;
    cin >> f;
    cin >> b;

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


return 0;
}

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