Advertisement
sebasvp2005

Untitled

Oct 28th, 2024
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. #define ll long long int
  5.  
  6. int pot(int a,int b){
  7. int base=a;
  8. for(int i=0;i<b;i++){
  9. base*=a;
  10. }
  11. return base;
  12. }
  13.  
  14. void solve(){
  15. ll n;cin>>n;
  16. vector<int>st;
  17. for(int i=0;i<=54;i++){
  18. for(int j=0;j<=36;j++){
  19. for(int k=0;k<=18;k++){
  20. for(int l=0;l<=18;l++)st.push_back(pot(2,i)*pot(3,j)*pot(5,k)*pot(7,l));
  21. }
  22. }
  23. }
  24. sort(st.begin(),st.end());
  25. st.erase(unique(st.begin(), st.end()));
  26.  
  27. auto it=lower_bound(st.begin(),st.end(),n);
  28. cout<<(it-st.begin())<<'\n';
  29. }
  30.  
  31.  
  32. int main() {
  33. cin.tie(0);
  34. ios_base::sync_with_stdio(0);
  35.  
  36. int t=1; cin>>t;
  37. while(t--)solve();
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement