#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef unsigned long long ull;
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define ep emplace_back
#define EL printf("\n")
#define sz(A) (int) A.size()
#define FOR(i,l,r) for (int i=l;i<=r;i++)
#define FOD(i,r,l) for (int i=r;i>=l;i--)
#define fillchar(a,x) memset(a, x, sizeof (a))
#define faster ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const int bs = 1e9;
typedef vector<int> BigInt;
while (a.size() > 1 && a.back() == 0) a.pop_back();
}
BigInt Int(string s) {
BigInt a;
while (s.size()%9) s = '0'+s;
for (int i=0; i<s.size(); i+=9) {
ll b = 0;
FOR(j,i,i+9-1) b = b*10+(s[j]-'0');
a.insert(a.begin(), b);
}
return a;
}
void Print(BigInt a) {
printf("%d", a.size() == 0 ? 0 : a.back());
FOD(i,a.size()-2,0) printf("%09d", a[i]);
EL;
}
BigInt operator + (BigInt a, BigInt b) {
BigInt ans;
int c = 0;
for (int i=0; i<max(a.size(),b.size()); i++) {
if (i < a.size()) c += a[i];
if (i < b.size()) c += b[i];
ans.pb(c%bs);
c /= bs;
}
if (c) ans.pb(c);
return ans;
}
BigInt operator - (BigInt a, BigInt b) {
BigInt ans;
int c = 0;
for (int i=0; i<a.size(); i++) {
c += a[i];
if (i < b.size()) c -= b[i];
if (c < 0)
ans.pb(c+bs), c = -1;
else
ans.pb(c), c = 0;
}
return ans;
}
bool operator < (BigInt a, BigInt b) {
if (a.size() != b.size()) return (a.size() < b.size());
FOD(i,a.size()-1,0)
if (a[i] != b[i]) return (a[i] < b[i]);
return false;
}
BigInt operator * (BigInt a, BigInt b) {
BigInt ans(a.size()+b.size(), 0);
FOR(i,0,a.size()-1) {
int c = 0;
FOR(j,0,b.size()-1) {
ll s = (ll)ans[i+j] + c + (ll)a[i]*b[j];
ans[i+j] = s%bs;
c = s/bs;
}
if (c) ans[i+b.size()] = c;
}
return ans;
}
int main() {
string s;
BigInt a, b;
getline(cin, s);
a = Int(s);
getline(cin, s);
b = Int(s);
Print(a+b);
if (a < b) {
printf("-");
Print(b-a);
} else Print(a-b);
Print(a*b);
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdHlwZWRlZiBsb25nIGxvbmcgbGw7CnR5cGVkZWYgcGFpcjxpbnQsaW50PiBpaTsKdHlwZWRlZiB1bnNpZ25lZCBsb25nIGxvbmcgdWxsOwoKI2RlZmluZSBYIGZpcnN0CiNkZWZpbmUgWSBzZWNvbmQKI2RlZmluZSBwYiBwdXNoX2JhY2sKI2RlZmluZSBtcCBtYWtlX3BhaXIKI2RlZmluZSBlcCBlbXBsYWNlX2JhY2sKI2RlZmluZSBFTCBwcmludGYoIlxuIikKI2RlZmluZSBzeihBKSAoaW50KSBBLnNpemUoKQojZGVmaW5lIEZPUihpLGwscikgZm9yIChpbnQgaT1sO2k8PXI7aSsrKQojZGVmaW5lIEZPRChpLHIsbCkgZm9yIChpbnQgaT1yO2k+PWw7aS0tKQojZGVmaW5lIGZpbGxjaGFyKGEseCkgbWVtc2V0KGEsIHgsIHNpemVvZiAoYSkpCiNkZWZpbmUgZmFzdGVyIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOyBjaW4udGllKE5VTEwpOyBjb3V0LnRpZShOVUxMKTsKCmNvbnN0IGludCBicyA9IDFlOTsKdHlwZWRlZiB2ZWN0b3I8aW50PiBCaWdJbnQ7Cgp2b2lkIFNldChCaWdJbnQgJmEpIHsKCXdoaWxlIChhLnNpemUoKSA+IDEgJiYgYS5iYWNrKCkgPT0gMCkgYS5wb3BfYmFjaygpOwp9CgpCaWdJbnQgSW50KHN0cmluZyBzKSB7CglCaWdJbnQgYTsKCXdoaWxlIChzLnNpemUoKSU5KSBzID0gJzAnK3M7Cglmb3IgKGludCBpPTA7IGk8cy5zaXplKCk7IGkrPTkpIHsKCQlsbCBiID0gMDsK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c2l6ZSgpKSByZXR1cm4gKGEuc2l6ZSgpIDwgYi5zaXplKCkpOwoJRk9EKGksYS5zaXplKCktMSwwKQoJaWYgKGFbaV0gIT0gYltpXSkgcmV0dXJuIChhW2ldIDwgYltpXSk7CglyZXR1cm4gZmFsc2U7Cn0KCkJpZ0ludCBvcGVyYXRvciAqIChCaWdJbnQgYSwgQmlnSW50IGIpIHsKCUJpZ0ludCBhbnMoYS5zaXplKCkrYi5zaXplKCksIDApOwoJU2V0KGEpOwoJU2V0KGIpOwoJRk9SKGksMCxhLnNpemUoKS0xKSB7CgkJaW50IGMgPSAwOwoJCUZPUihqLDAsYi5zaXplKCktMSkgewoJCQlsbCBzID0gKGxsKWFuc1tpK2pdICsgYyArIChsbClhW2ldKmJbal07CgkJCWFuc1tpK2pdID0gcyViczsKCQkJYyA9IHMvYnM7CgkJfQoJCWlmIChjKSBhbnNbaStiLnNpemUoKV0gPSBjOwoJfQoJU2V0KGFucyk7CglyZXR1cm4gYW5zOwp9CgppbnQgbWFpbigpIHsKCgoJc3RyaW5nIHM7CglCaWdJbnQgYSwgYjsKCWdldGxpbmUoY2luLCBzKTsKCWEgPSBJbnQocyk7CglnZXRsaW5lKGNpbiwgcyk7CgliID0gSW50KHMpOwoJUHJpbnQoYStiKTsKCWlmIChhIDwgYikgewoJCXByaW50ZigiLSIpOwoJCVByaW50KGItYSk7Cgl9IGVsc2UgUHJpbnQoYS1iKTsKCVByaW50KGEqYik7CgoJcmV0dXJuIDA7Cn0=
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
^
Main.java:5: error: class, interface, or enum expected
typedef long long ll;
^
Main.java:6: error: class, interface, or enum expected
typedef pair<int,int> ii;
^
Main.java:7: error: class, interface, or enum expected
typedef unsigned long long ull;
^
Main.java:9: error: illegal character: '#'
#define X first
^
Main.java:9: error: class, interface, or enum expected
#define X first
^
Main.java:10: error: illegal character: '#'
#define Y second
^
Main.java:11: error: illegal character: '#'
#define pb push_back
^
Main.java:12: error: illegal character: '#'
#define mp make_pair
^
Main.java:13: error: illegal character: '#'
#define ep emplace_back
^
Main.java:14: error: illegal character: '#'
#define EL printf("\n")
^
Main.java:15: error: illegal character: '#'
#define sz(A) (int) A.size()
^
Main.java:16: error: illegal character: '#'
#define FOR(i,l,r) for (int i=l;i<=r;i++)
^
Main.java:16: error: class, interface, or enum expected
#define FOR(i,l,r) for (int i=l;i<=r;i++)
^
Main.java:16: error: class, interface, or enum expected
#define FOR(i,l,r) for (int i=l;i<=r;i++)
^
Main.java:17: error: illegal character: '#'
#define FOD(i,r,l) for (int i=r;i>=l;i--)
^
Main.java:17: error: class, interface, or enum expected
#define FOD(i,r,l) for (int i=r;i>=l;i--)
^
Main.java:17: error: class, interface, or enum expected
#define FOD(i,r,l) for (int i=r;i>=l;i--)
^
Main.java:18: error: illegal character: '#'
#define fillchar(a,x) memset(a, x, sizeof (a))
^
Main.java:19: error: illegal character: '#'
#define faster ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
^
Main.java:19: error: class, interface, or enum expected
#define faster ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
^
Main.java:19: error: class, interface, or enum expected
#define faster ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
^
Main.java:21: error: class, interface, or enum expected
const int bs = 1e9;
^
Main.java:22: error: class, interface, or enum expected
typedef vector<int> BigInt;
^
Main.java:24: error: class, interface, or enum expected
void Set(BigInt &a) {
^
Main.java:26: error: class, interface, or enum expected
}
^
Main.java:30: error: class, interface, or enum expected
while (s.size()%9) s = '0'+s;
^
Main.java:31: error: class, interface, or enum expected
for (int i=0; i<s.size(); i+=9) {
^
Main.java:31: error: class, interface, or enum expected
for (int i=0; i<s.size(); i+=9) {
^
Main.java:31: error: class, interface, or enum expected
for (int i=0; i<s.size(); i+=9) {
^
Main.java:33: error: class, interface, or enum expected
FOR(j,i,i+9-1) b = b*10+(s[j]-'0');
^
Main.java:34: error: class, interface, or enum expected
a.insert(a.begin(), b);
^
Main.java:35: error: class, interface, or enum expected
}
^
Main.java:37: error: class, interface, or enum expected
return a;
^
Main.java:38: error: class, interface, or enum expected
}
^
Main.java:42: error: class, interface, or enum expected
printf("%d", a.size() == 0 ? 0 : a.back());
^
Main.java:43: error: class, interface, or enum expected
FOD(i,a.size()-2,0) printf("%09d", a[i]);
^
Main.java:44: error: class, interface, or enum expected
EL;
^
Main.java:45: error: class, interface, or enum expected
}
^
Main.java:49: error: class, interface, or enum expected
Set(a);
^
Main.java:50: error: class, interface, or enum expected
Set(b);
^
Main.java:51: error: class, interface, or enum expected
int c = 0;
^
Main.java:52: error: class, interface, or enum expected
for (int i=0; i<max(a.size(),b.size()); i++) {
^
Main.java:52: error: class, interface, or enum expected
for (int i=0; i<max(a.size(),b.size()); i++) {
^
Main.java:52: error: class, interface, or enum expected
for (int i=0; i<max(a.size(),b.size()); i++) {
^
Main.java:54: error: class, interface, or enum expected
if (i < b.size()) c += b[i];
^
Main.java:55: error: class, interface, or enum expected
ans.pb(c%bs);
^
Main.java:56: error: class, interface, or enum expected
c /= bs;
^
Main.java:57: error: class, interface, or enum expected
}
^
Main.java:59: error: class, interface, or enum expected
Set(ans);
^
Main.java:60: error: class, interface, or enum expected
return ans;
^
Main.java:61: error: class, interface, or enum expected
}
^
Main.java:65: error: class, interface, or enum expected
Set(a);
^
Main.java:66: error: class, interface, or enum expected
Set(b);
^
Main.java:67: error: class, interface, or enum expected
int c = 0;
^
Main.java:68: error: class, interface, or enum expected
for (int i=0; i<a.size(); i++) {
^
Main.java:68: error: class, interface, or enum expected
for (int i=0; i<a.size(); i++) {
^
Main.java:68: error: class, interface, or enum expected
for (int i=0; i<a.size(); i++) {
^
Main.java:70: error: class, interface, or enum expected
if (i < b.size()) c -= b[i];
^
Main.java:71: error: class, interface, or enum expected
if (c < 0)
^
Main.java:73: error: class, interface, or enum expected
else
^
Main.java:75: error: class, interface, or enum expected
}
^
Main.java:77: error: class, interface, or enum expected
return ans;
^
Main.java:78: error: class, interface, or enum expected
}
^
Main.java:82: error: class, interface, or enum expected
FOD(i,a.size()-1,0)
^
Main.java:84: error: class, interface, or enum expected
return false;
^
Main.java:85: error: class, interface, or enum expected
}
^
Main.java:89: error: class, interface, or enum expected
Set(a);
^
Main.java:90: error: class, interface, or enum expected
Set(b);
^
Main.java:91: error: class, interface, or enum expected
FOR(i,0,a.size()-1) {
^
Main.java:93: error: class, interface, or enum expected
FOR(j,0,b.size()-1) {
^
Main.java:95: error: class, interface, or enum expected
ans[i+j] = s%bs;
^
Main.java:96: error: class, interface, or enum expected
c = s/bs;
^
Main.java:97: error: class, interface, or enum expected
}
^
Main.java:99: error: class, interface, or enum expected
}
^
Main.java:101: error: class, interface, or enum expected
return ans;
^
Main.java:102: error: class, interface, or enum expected
}
^
Main.java:108: error: class, interface, or enum expected
BigInt a, b;
^
Main.java:109: error: class, interface, or enum expected
getline(cin, s);
^
Main.java:110: error: class, interface, or enum expected
a = Int(s);
^
Main.java:111: error: class, interface, or enum expected
getline(cin, s);
^
Main.java:112: error: class, interface, or enum expected
b = Int(s);
^
Main.java:113: error: class, interface, or enum expected
Print(a+b);
^
Main.java:114: error: class, interface, or enum expected
if (a < b) {
^
Main.java:116: error: class, interface, or enum expected
Print(b-a);
^
Main.java:117: error: class, interface, or enum expected
} else Print(a-b);
^
Main.java:118: error: class, interface, or enum expected
Print(a*b);
^
Main.java:120: error: class, interface, or enum expected
return 0;
^
Main.java:121: error: class, interface, or enum expected
}
^
90 errors