diff --git a/1284A.cpp b/1284A.cpp new file mode 100644 index 0000000..59cca94 --- /dev/null +++ b/1284A.cpp @@ -0,0 +1,33 @@ +#include +using namespace std; + +int main() +{ + int n,m; //sizes of vectors + cin>>n>>m; + vector s(n),t(m); //two vectors of string types of sizes n and m + + for(int i=0;i>s[i]; + + for(int i=0;i>t[i]; + + int q; //no. of queries + cin>>q; + + while(q--) //loop running till q queries + { + long long int y; //year + cin>>y; + + int i = (y-1)%n; //string number of vector s corresponding to given year + int j = (y-1)%m; //string number of vector t corresponding to given year + + string ans = s[i]+t[j]; //concatenation of both strings + + cout<