var a, b, s, k: integer;
begin
read(a,b);
if not ((0<=b) and (b<=a)) then
writeln('Неверные данные')
else begin
s := 0;
k := 0;
while s > b do begin
k := k+1;
s := s-k;
end;
writeln(s)
end
end.
|
#include
using namespace std;
int main(){
int a, b, s, k;
cin >> a >> b;
if (!(0<=b && b<=a))
cout << "Неверные данные";
else {
s = 0;
k = 0;
while (s > b) {
k = k+1;
s = s-k;
}
cout << s;
}
return 0;
}
|
a = int(input())
b = int(input())
if not 0<=b<=a:
print("Неверные данные")
else:
s = 0
k = 0
while s > b:
k = k+1
s = s-k
print(s)
|