fork(3) download
  1. #include <bits/stdc++.h>
  2. #define sll(n) (n)=scn()
  3. #define sll2(m,n) sll((m)),sll((n))
  4. #define sll3(m,n,o) sll((m)),sll((n)),sll((o))
  5. #define sll4(m,n,o,p) sll((m)),sll((n)),sll((o)),sll((p))
  6. #define sdd(n) scanf("%lf",&(n))
  7. #define sdd2(m,n) scanf("%lf%lf",&(m),&(n))
  8. #define sdd3(m,n,o) scanf("%lf%lf%lf",&(m),&(n),&(o))
  9. #define sdd4(m,n,o,p) scanf("%lf%lf%lf%lf",&(m),&(n),&(o),&(p))
  10. #define pll(n) printf("%lld ",(n))
  11. #define plln(n) printf("%lld\n",(n))
  12. //#define ps(s) printf("%s",s)
  13. //#define psn(s) printf("%s\n",s)
  14. #define nln printf("\n")
  15. #define cln cout<<"\n"
  16. #define clr(dp,x) memset(dp,x,sizeof(dp))
  17. #define pb push_back
  18. #define mp make_pair
  19. #define s(a) sort(a.begin(),a.end())
  20. #define sa(a,n) sort(a,a+(n))
  21. #define vecll vector<int64_t>
  22. #define vecs vector<string>
  23. #define vecpll vector<pair<int64_t,int64_t> >
  24. #define pii pair <int64_t , int64_t >
  25. #define plpl pair <int64_t , pair <int64_t , int64_t > >
  26. #define ppll pair < pair <int64_t , int64_t > , int64_t >
  27. #define pplpl pair < pair <int64_t , int64_t >, pair <int64_t , int64_t > >
  28. //#define rep(i, begin, end) for (__typeof(end) i = (begin); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
  29. #define rep(i,a,n) for(int64_t i=a;i<n;++i)
  30. #define repr(i,b,a) for(int64_t i=b;i>=a;--i)
  31. #define rep1(it,v) for(auto &it:(v))
  32. #define all(c) (c).begin(),(c).end()
  33. #define fast_IO ios_base::sync_with_stdio(false);cin.tie(0);
  34. #define while_tc int64_t testkase;sll(testkase);while(testkase-->0)
  35. #define while_tc_ int64_t testkase;cin>>testkase;while(testkase-->0)
  36. #define adjlw vector<vecpll > /// ( connected to , weight ) - adjlw adj(MAXN)
  37. #define adjl vecll ///connected to - adjl adj[MAXN]
  38. #define ispow2(n) (n&&(!(n&(n-1)))) ///check if its perfect power of 2
  39. #define ff first
  40. #define ss second
  41. #define bit(mask) __builtin_popcount(mask)
  42. #define lsb(x) __builtin_ffl(x)-1
  43. #define pi 3.1415926535897932384626433832795
  44. typedef int64_t ll;
  45. ll INF=1000000000000000;
  46. ll MOD=1000000007;
  47. ll MOD2 = MOD*MOD;
  48. typedef unsigned long long int ull; /// specifier - llu
  49. using namespace std;
  50.  
  51. inline ll fastmul(ll e, ll n){ll x=0,p=e;while(n>0){if(n&1)x=x+p;p<<=1;n>>=1;}return x;}
  52. inline ll fastmul(ll e, ll n, ll m){e%=m,n%=m;ll x=0,p=e;while(n>0){if(n&1){x=x+p;if(x>=m)x-=m;}p=p<<1;if(p>=m)p-=m;n>>=1;}return x;}
  53. inline ll power(ll e, ll n){ll x=1,p=e;while(n>0){if(n&1)x=fastmul(x,p);p=fastmul(p,p);n>>=1;}return x;}
  54. inline ll power(ll e, ll n, ll m){ll x=1,p=e;while(n>0){if(n&1)x=fastmul(x,p,m);p=fastmul(p,p,m);n>>=1;}return x;}
  55. inline ll InverseEuler(ll a, ll m){return (a==1? 1 : power(a, m-2, m));}
  56. inline ll lcm(ll a, ll b){return (a*(b/__gcd(a,b)));}
  57. inline ll InverseEuclid(ll a, ll m){ll m0=m,t,q,x0=0,x1=1;if(m==1)return 0;while (a>1){q=a/m;t=m;m=a%m;a=t;t=x0;x0=x1-q*x0;x1=t;}return(x1<0?x1+m0:x1);}
  58. //inline ll CRT(){ll M=1,ans=0;rep(i,0,n)M*=num[i];rep(i,0,n)ans=(ans%M+(rem[i]%M*(M/num[i])*(InverseEuclid(M/num[i],num[i]))%M)%M)%M;return ans;}
  59.  
  60.  
  61. ll movex8[]={-1,-1,-1,0,0,1,1,1};
  62. ll movey8[]={-1,0,1,-1,1,-1,0,1};
  63.  
  64. ll movex4[]={1,-1,0,0};
  65. ll movey4[]={0,0,1,-1};
  66.  
  67. #ifndef ONLINE_JUDGE
  68. inline int getchar_unlocked() { return getchar(); }
  69. #endif
  70. inline ll scn()
  71. {
  72. ll n = 0, c = getchar_unlocked(),t=0;
  73. if (c == EOF) return EOF;
  74. while(c < '0' || c > '9') { if(c==45)t=1; c = getchar_unlocked(); }
  75. while(c >= '0' && c <= '9')n = (n<<3) + (n<<1) + c - '0', c = getchar_unlocked();
  76. if(t==0)return n; else return -n;
  77. }
  78.  
  79.  
  80.  
  81. int main()
  82. {
  83. //freopen("input.txt","r",stdin);
  84. //freopen("output.txt","w",stdout);
  85. //fast_IO
  86. ll n, m;
  87. while(sll2(n, m), n!=EOF, m!=EOF)
  88. {
  89. if (n>m)
  90. plln(n - m);
  91. else
  92. plln(m - n);
  93. }
  94. return 0;
  95. }
  96.  
Success #stdin #stdout 0s 15224KB
stdin
Standard input is empty
stdout
Standard output is empty