From b965673a2db6d683ec7e743930209f21f7a7bbc9 Mon Sep 17 00:00:00 2001 From: hrahul2605 Date: Thu, 1 Oct 2020 12:52:42 +0530 Subject: [PATCH 1/2] CF 1372B --- Codeforces/1372B.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Codeforces/1372B.cpp diff --git a/Codeforces/1372B.cpp b/Codeforces/1372B.cpp new file mode 100644 index 00000000..f35f409a --- /dev/null +++ b/Codeforces/1372B.cpp @@ -0,0 +1,53 @@ +// author : hrahul2605 +#include + +#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); +#define ll long long +#define int long long +#define f first +#define se second +#define LB lower_bound +#define UB upper_bound +#define pb push_back +#define mp make_pair +#define vll vector +#define vi vector +#define vc vector +#define vs vector +#define pll pair +#define vpll vector +#define pie 3.14159265358979323846264338327950288 +const unsigned int MOD = 1000000007; + +using namespace std; + +int32_t main() +{ + IOS;int T;T=1; + cin>>T; + while(T--) + { + ll n,a,b;cin>>n; + ll m = n - 1 ; + if(!(n%2)){ + a = b = n / 2 ; + } else { + for(int i = 3; i <= sqrt(n) ; i += 2){ + if(n%i == 0){ + ll x = max ( n - i , i ) , y = min ( n - i , i ); + if(x % y == 0) + m = min(x , m ) ; + ll z = n / i; + x = max ( n - z , z ) , y = min ( n - z , z ); + if(x % y == 0) + m = min(x , m ) ; + } + } + + a = m ; b = n - m; + } + cout< Date: Thu, 1 Oct 2020 12:56:05 +0530 Subject: [PATCH 2/2] CF 1372A --- Codeforces/1372A.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Codeforces/1372A.cpp diff --git a/Codeforces/1372A.cpp b/Codeforces/1372A.cpp new file mode 100644 index 00000000..da2ae42c --- /dev/null +++ b/Codeforces/1372A.cpp @@ -0,0 +1,37 @@ +// author : hrahul2605 +#include + +#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); +#define ll long long +#define int long long +#define f first +#define se second +#define LB lower_bound +#define UB upper_bound +#define pb push_back +#define mp make_pair +#define vll vector +#define vi vector +#define vc vector +#define vs vector +#define pll pair +#define vpll vector +#define pie 3.14159265358979323846264338327950288 +const unsigned int MOD = 1000000007; + +using namespace std; + +int32_t main() +{ + IOS;int T;T=1; + cin>>T; + while(T--) + { + ll n;cin>>n; + for(int i=0;i