#include<bits/stdc++.h> using namespace std; int main(){ int m,a,i; cin>>m; for(i=1;i<=m;i++){ cin>>a; cout<<(a/3)*90+(a-a/3)/2*70+40<<endl; } }