#include using namespace std; #define ll long long void solve() { int a, b; cin >> a >> b; if(abs(a) != a && a%b != 0) cout << abs(b) - abs(a%b) << endl; else cout << abs(a%b) << endl; } int main(){ ios::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); // int t; // cin >> t; // while(t--){ // solve(); // } solve(); return 0; }