Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ios>
- #include <new>
- #include <cstdio>
- #include <cmath>
- #include <cstring>
- #include <cctype>
- #include <cstdlib>
- #include <climits>
- #include <ctime>
- #include <assert.h>
- #include <istream>
- #include <ostream>
- #include <iostream>
- #include <iomanip>
- #include <algorithm>
- #include <vector>
- #include <string>
- #include <numeric>
- #include <fstream>
- #include <sstream>
- #include <map>
- #include <set>
- #include <list>
- #include <stack>
- #include <queue>
- #include <deque>
- #include <locale>
- #include <memory>
- #include <valarray>
- #include <complex>
- #include <limits>
- #include <bitset>
- #include <iterator>
- #include <utility>
- #include <exception>
- #include <functional>
- #include <streambuf>
- #include <typeinfo>
- #include <cxxabi.h>
- #include <tr1/cstdio>
- #include <tr1/cstdlib>
- #include <tr1/cmath>
- #include <tr1/climits>
- #include <tr1/cfenv>
- #include <tr1/cstdarg>
- #include <tr1/ctgmath>
- #include <tr1/cstdbool>
- #include <tr1/ctime>
- #include <tr1/cstdint>
- #include <tr1/cwchar>
- #include <tr1/cwctype>
- #include <tr1/cinttypes>
- #include <ext/algorithm>
- #include <ext/functional>
- #include <ext/new_allocator.h>
- #include <ext/pod_char_traits.h>
- #include <ext/vstring.h>
- #include <ext/stdio_filebuf.h>
- #include <ext/atomicity.h>
- #include <ext/concurrence.h>
- #include <ext/iterator>
- #include <ext/numeric>
- #include <ext/stdio_sync_filebuf.h>
- #include <ext/pool_allocator.h>
- #include <ext/array_allocator.h>
- #include <ext/debug_allocator.h>
- #include <ext/malloc_allocator.h>
- #include <ext/throw_allocator.h>
- #include <ext/bitmap_allocator.h>
- #include <ext/enc_filebuf.h>
- #include <ext/memory>
- #include <ext/rope>
- #include <ext/typelist.h>
- #include <ext/cast.h>
- #include <ext/mt_allocator.h>
- #include <ext/extptr_allocator.h>
- #include <ext/slist>
- #include <ext/type_traits.h>
- #include <debug/bitset>
- #include <debug/string>
- #include <debug/deque>
- #include <debug/set>
- #include <debug/map>
- #include <debug/list>
- #include <debug/vector>
- #include <tr1/functional>
- #include <tr1/array>
- #include <tr1/memory>
- #include <tr1/tuple>
- #include <tr1/utility>
- #include <tr1/type_traits>
- #include <tr1/regex>
- #include <tr1/random>
- #include <tr1/unordered_set>
- #include <tr1/unordered_map>
- #include <ext/rb_tree>
- #include <ext/numeric_traits.h>
- #include <ext/codecvt_specializations.h>
- #define inf (~0U >> 1)
- #define pi (2.0 * acos(0.0))
- #define lowbit(x) ((x) & (-(x)))
- #define clr(ar) memset(ar, 0, sizeof(ar))
- #define torad(x) (((1.0 * x * pi) / 180.0))
- #define read() freopen("lol.txt", "r+", stdin)
- #define fromras(x) (((x * 180.0) / (1.0 * pi)))
- #define write() freopen("lol.txt", "w+", stdout)
- #define dbg(x) std::cout << #x << " = " << x << endl
- #define twopow(x) ((((x & (x - 1)) == 0) && (x != 0)) ? (true) : (false))
- #define mod(n, m) ((n >= 0) ? (n % m) : ((abs(n) % m) == 0) ? 0 : (m - (abs(n) % m)))
- using namespace std;
- int main(){
- int n, m;
- while (scanf("%d %d", &n, &m)) cout << mod(n, m) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement