using namespace std;
int main ()
{
long long h,m,s,H,M,S,a,b;
cin>>h>>m>>s>>H>>M>>S;
a=h*3600+m*60+s;
b=H*3600+M*60+S;
cout << b-a;
return 0;
}
25-masala
#include
#include
#include
using namespace std;
int main () {
string n;
cin >>n;
int q=0,k=86400;
for (char c:n)
q=(q*10+(c-48))%k;
int h,m,s;
h=q/3600;
q%=3600;
m=q/60;
s=q%60;
printf("%d:%02d:%02d",h,m,s);
return 0;
}
26-masala
#include
using namespace std;
int main () {
int t;
cin >>t;
long long n,q,mod=1e9+7;
for (int i=0;icin >>n;
q=n%mod;
cout<}
return 0;
}
27-masala
#include
using namespace std;
int main()
{
int n,m;
int t;
cin>>t;
while(t--){
cin>>n>>m;
int b=0, k=n-1;
for(int i=0;i//cout<if(k==m||b==m){
cout<}
if(i%2==0)
k--;
else
b++;
}
}
return 0;
}
28-masala
#include
using namespace std;
int main(){
int n , ax, ay , bx, by;
cin >> n;
for(int i = 0; i < n; i++)
{
cin >> ax >> ay >> bx >> by;
cout << 2 * bx - ax <<' '<< 2 * by - ay << endl;
}
return 0;
}
28-masala
#include
using namespace std;
long long divisorsSame(long long n)
{
long long even_div = 0, odd_div = 0;
for (long long i = 1; i <= sqrt(n); i++) {
if (n % i == 0) {
if (n / i == i) {
if (i % 2 == 0) {
even_div++;
}
else {
odd_div++;
}
}
else {
if (i % 2 == 0) {
even_div++;
}
else {
odd_div++;
}
if (n / i % 2 == 0) {
even_div++;
}
else {
odd_div++;
}
}
}
}
return even_div;
}
int main()
{
long long N,n;
cin >>n;
for(long long i=0;icin >>N;
cout << divisorsSame(N)<}
return 0;
}
29-masala
#include
using namespace std;
long long divisorsSame(long long n)
{
long long even_div = 0, odd_div = 0;
for (long long i = 1; i <= sqrt(n); i++) {
if (n % i == 0) {
if (n / i == i) {
if (i % 2 == 0) {
even_div++;
}
else {
odd_div++;
}
}
else {
if (i % 2 == 0) {
even_div++;
}
else {
odd_div++;
}
if (n / i % 2 == 0) {
even_div++;
}
else {
odd_div++;
}
}
}
}
return even_div;
}
int main()
{
long long N,n;
cin >>n;
for(long long i=0;icin >>N;
cout << divisorsSame(N)<}
return 0;
}