/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 424.0 KiB
#2 Wrong Answer 1ms 536.0 KiB
#3 Wrong Answer 2ms 328.0 KiB
#4 Wrong Answer 2ms 700.0 KiB
#5 Wrong Answer 2ms 532.0 KiB
#6 Wrong Answer 4ms 616.0 KiB
#7 Wrong Answer 29ms 1.586 MiB
#8 Wrong Answer 27ms 1.375 MiB
#9 Wrong Answer 29ms 1.414 MiB
#10 Accepted 29ms 2.164 MiB
#11 Wrong Answer 28ms 2.047 MiB

Code

#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>

//using namespace __gnu_pbds;
using namespace std;

typedef long long int ll ;
//typedef __int128 lll;
#define pb push_back
#define pinf   2e18
#define ninf   -2e18
#define PI    acos(-1.0)
#define endl  "\n"
#define F first
#define S second
//template <typename T> using o_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;



int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //inout() ;
    ll t;
    cin>>t;
    while(t --){
    ll n,k;
    cin>>k>>n;
    ll x=n%(k+1);
    n-=x;
    ll a,b;
    a=n/(k+1);
    b=n/(k+1);
    ll ans1=0,ans2=0;
    ans1=(a+x)*b;
    if(x==k)
    {
     b++;
     ans2=a*b;
    }
    
    
    cout<<max(ans1,ans2)<<'\n';
    
    
    }
    

    

    return 0 ;
}

Information

Submit By
Type
Submission
Problem
P1092 Bitwise AND
Language
C++20 (G++ 13.2.0)
Submit At
2024-09-08 07:10:39
Judged At
2024-10-03 12:58:53
Judged By
Score
11
Total Time
29ms
Peak Memory
2.164 MiB