n =int(input())for _ inrange(n):
a, b =map(int,input().split())if a > b:
a, b = b, a
print(a, b)
B. Different String
n =int(input())for _ inrange(n):
ss =input()if ss == ss[0]*len(ss):print("NO")else:print("YES")for i inrange(len(ss)-1):if ss[i]!= ss[i+1]:print(ss[:i]+ss[i+1]+ss[i]+ss[i+2:])break
C. Clock and Strings
t =int(input())for _ inrange(t):
a, b, c, d =map(int,input().split())if a > b:
a, b = b, a
if a<c<b:if d>b or d<a:print('YES')else:print('NO')elif a<d<b:if c>b or c<a:print('YES')else:print('NO')else:print('NO')
D. Binary Cut
t =int(input())for _ inrange(t):
ss =input()
ans =1
j =0for i inrange(len(ss)-1):if ss[i]=='1'and ss[i+1]=='0':
ans +=1if ss[i]=='0'and ss[i+1]=='1':
ans +=1
j =1print(ans-j)
E. Find the Car
#include<iostream>#include<algorithm>usingnamespace std;typedeflonglong ll;const ll N =1e5+5;voidsolve(){
ll a[N]={0}, b[N]={0};
ll n, k, q, d;
cin >> n >> k >> q;for(int i=1; i<=k; i++) cin >> a[i];for(int i=1; i<=k; i++) cin >> b[i];while(--q){
cin >> d;
ll y =upper_bound(a, a+k, d)- a;
ll x = y-1;
cout <<(ll)b[x]+(d-a[x])*(b[y]-b[x])/(a[y]-a[x])<<' ';}cin >> d;
ll y =upper_bound(a, a+k, d)- a;
ll x = y-1;
cout <<(ll)b[x]+(d-a[x])*(b[y]-b[x])/(a[y]-a[x])<<"\n";}intmain(){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);int t;
cin >> t;while(t--)solve();}
F. Circle Perimeter
from math import isqrt
t =int(input())for _ inrange(t):
ans =0
r =int(input())for i inrange(r+1):
j = isqrt((r+1)**2- i**2)if i**2+ j**2==(r+1)**2:
j -=1while(r**2<= i**2+ j**2):
ans +=1
j -=1if j <0:breakprint(ans*4-4)