Задача A-Слонові походи
Кондаков Олександр
var
x1,y1,x2,y2,n,t,i:longint;
begin
readln(t);
for i:=1 to t do
begin
readln(n,x1,y1,x2,y2);
if (x1=x2) and (y1=y2) then writeln(0) else
if abs(x1-x2)=abs(y1-y2) then writeln(1) else
if (abs(x1-x2)+abs(y1-y2)) mod 2 = 0 then writeln(2) else
writeln('no move');
end;
end.
Задача B-Доміно своїми руками
Сорока Діма
var n:int64;
begin
read(n);
write((n*(n+1)*(n+2))div 2);
end.
Задача C-Цікава послідовність
Шумейко Максим
#include<iostream>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
int main()
{
long long n,a,i,s=2;
cin>>n;
for(int j=0;j<n;j++)
{
cin>>a; s=1;i=1;
while(s<a)
{
s=s+i;
i++;
}
if(s==a)cout<<"1"<<" ";else cout<<"0"<<" ";
}
}