initial commit

This commit is contained in:
ShazidMahsrafi 2023-07-18 00:24:41 +06:00
parent 28ffe7cbfc
commit 34a2cc2f4f
2 changed files with 30 additions and 26 deletions

30
1624B Make AP/1624B.cpp Normal file
View File

@ -0,0 +1,30 @@
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve()
{
int a, b, c;
cin >> a >> b >> c;
if((2*b-c)>0 && (2*b-c)%a==0)
cout << "YES" << endl;
else if((a+c)%(2*b)==0)
cout << "YES" << endl;
else if((2*b-a)>0 && (2*b-a)%c==0)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int TC = 1;
cin >> TC;
cin.ignore();
while (TC--)
solve();
}

View File

@ -1,26 +0,0 @@
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve()
{
int n,x;
cin>>n>>x;
n=n-2;
int f;
if(n%x==0) f=n/x+1;
else f=n/x+2;
cout<<f<<endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int TC = 1;
cin >> TC;
cin.ignore();
while (TC--) solve();
}