/* my general mistakes that costed me a lot * check for overflows * check and mod and use int type variables where possible to avoid tles * while multiplying two variables whose value can exceed integer limt make sure to typecase them * use scanf when you are not working with the best possible optimisation * return a value from a function that has a return type sometimes the compiler may give the correct answer but there will be problem in the judge * be very cautious about uninitiaalised variables , infact never keep them or handle them properly *never use inbuilt log function or pow function it fucking ruins everything */ #include using namespace std; #define ff first #define ss second #define mp make_pair #define pb push_back #define ll long long int #define pp pair #define ve vector #define mod 1000000007 #define mn 100010 int dx[]={-1,-1,+0,+1,1,+1,+0,-1}; // anticlockwise starting from up! int dy[]={+0,-1,-1,-1,0,+1,+1,+1}; /************************************CODE BEGINS HERE************************/ int main() { string s; int a[30]; memset(a,0,sizeof(a)); for(int i=0;i<26;i++) { cin>>a[i]; } cin>>s; int mx=0; int l=s.length(); for(int i=0;i