# 【Codeforces gym 102388】SUFE ICPC Team Formation Test，签到题BDG

#### B Stars

/*

*/
#include<bits/stdc++.h>
using namespace std;
int gcd(int a, int b){return !b?a:gcd(b,a%b);}
int main(){
int T;  cin>>T;
while(T--){
int x1, y1, x2, y2;
cin>>x1>>y1>>x2>>y2;
cout<<gcd(abs(x2-x1),abs(y2-y1))+1<<"\n";
}
return 0;
}


#### D. Secret Messages

题意：对一个字符串交换带小写每个字符加一并反转输出

#include<bits/stdc++.h>
using namespace std;
int main(){
int T;  cin>>T;
while(T--){
string s;  cin>>s;
string t = s;
for(int i = 0; i < t.size(); i++){
t[i] = tolower(t[i]);
if(t[i]+13<='z')t[i]+=13;
else{
t[i] = 'a'+(t[i]+13-'z')-1;
}
}
for(int i = 0; i < s.size(); i++){
if(islower(s[i]))t[i] = toupper(t[i]);
else if(isupper(s[i]))t[i] = tolower(t[i]);
}
reverse(t.begin(),t.end());
cout<<t<<"\n";
continue;
for(int i = 0; i < t.size(); i++){
cout<<(int)t[i]<<" ";
}
cout<<"\n";
}
return 0;
}


#### G. Snails

题意：蜗牛在地下n米，每天爬a米掉b米，求多少天能到地上。

#include<bits/stdc++.h>
using namespace std;
int main(){
int T;  cin>>T;
while(T--){
string s;  cin>>s;
string t = s;
for(int i = 0; i < t.size(); i++){
t[i] = tolower(t[i]);
if(t[i]+13<='z')t[i]+=13;
else{
t[i] = 'a'+(t[i]+13-'z')-1;
}
}
for(int i = 0; i < s.size(); i++){
if(islower(s[i]))t[i] = toupper(t[i]);
else if(isupper(s[i]))t[i] = tolower(t[i]);
}
reverse(t.begin(),t.end());
cout<<t<<"\n";
continue;
for(int i = 0; i < t.size(); i++){
cout<<(int)t[i]<<" ";
}
cout<<"\n";
}
return 0;
}

ps.
SUFE2019ICPC组队
ZUST2020南京站选拔


01-17 510
08-10 1341
05-12 1043
09-06 388
11-21 1042
11-03 3309
09-12 1203
01-09 2192
11-02 577
04-02 4215
04-29 967
12-11 5635
03-11 1090