From 7f4f056688d34421f209c34ebe83ba862f43c899 Mon Sep 17 00:00:00 2001 From: Shobhit Srivastava <78103690+Shobhit403@users.noreply.github.com> Date: Fri, 14 May 2021 10:13:18 +0530 Subject: [PATCH] Create DAY 95 --- Shobhit403/DAY 95 | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Shobhit403/DAY 95 diff --git a/Shobhit403/DAY 95 b/Shobhit403/DAY 95 new file mode 100644 index 000000000..256888e6a --- /dev/null +++ b/Shobhit403/DAY 95 @@ -0,0 +1,37 @@ +#include +using namespace std; +typedef long long int ll; +int main() +{ + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int t; + cin>>t; + while(t--) + { + int n; + cin>>n; + int a[n]; + for(int i=0;i>a[i]; + } + sort(a,a+n); + ll sump1=a[n-1]; + ll sump2=a[n-3]+a[n-2]; + for(int i=n-4;i>=0;i-=2) + { + sump1+=a[i]; + } + for(int i=n-5;i>=0;i-=2) + { + sump2+=a[i]; + } + if(sump1>sump2) + cout<<"first"<