Source Code
#include<bits/stdc++.h>

#define int long long
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(),x.end()

const double eps=1e-7,PI=3.1415926;
const int N=1e6+10;

using namespace std;

int n,q,m,k,x,y,a[N],mx=-1,mn=1e9,sum,b[N];
string s,s1,s2;
map < int , int > mp;
vector < int > vec;
int32_t main(){
    cin>>n>>k;
    for (int i=0;i<n;i++){
        cin>>x>>y;
        sum+=(k/(x*x))*y;
    }
    cout<<sum<<endl;
    return 0;
}
Copy
Number of the Beast BabaVoss
GNU G++17
4 ms
720 KB
Wrong Answer