Computer Science, asked by syedthasleem29, 2 months ago

Find the number
0
You are given a string S of length N . The string S consists of digits from 1-9. Consider the string inde
You need to divide the string into blocks such that the ith block contains the elements from the ind-
min(N, (i + X)) (both inclusive). A number is valid if it is formed by choosing exactly one digit from
the digits in the order of their block number.
For example:
If the given string is '123456789' and X=3, the blocks formed are [123]. [456], [789]. Few valid numbe
but 124 and 396 are invalid.
kth
number if all th
Among all the valid numbers that can be formed, your task is to determine the K
are sorted in ascending order.
Input format
• First line: Three space-separated integers N, X, and K.
• Second line: String S consisting of digits (1-9).
Output format
• Print the
kth
valid number​

Answers

Answered by tejas9193
1

Answer:

\huge{\red{\mathfrak{\sf{Question\:2}}}}

{ }

\Large{\bf{\blue{Given\::}}}

\footnotesize{\sf{By\:adding\:8\:in\:one\:number\:and\:divide\:its}}\footnotesize{\sf{result\:with\:2\:we\:get\:the\:answer\:10}}

{ }

\Large{\bf{\blue{Find\::}}}

\footnotesize{\sf{Show\:this\:in\:equation\:form}}

{ }

\Large{\bf{\blue{Solution\::}}}

\footnotesize{\sf{Let\:say\:number\:is\:x}}

\sf{By\:adding\:8\:in\:one\:number\:\rightarrow\:x\:+\:8}

\sf{Divide\:its\:result\:with\:2\:\rightarrow\:(x\:+\:8)\:/\:2}

\sf{We\:get\:10}

\sf{Equation\:\rightarrow\:(x\:+\:8)\:/\:2\:=\:10}

\:\Box\:{\bold{\pink{\bf{(x\:+\:8)\:/\:2\:=\:10}}}}\:\sf{is\:the\:required\:equation}

{ }

\bf{Solving}

\:\:\:\:\:\:\:\:\:\Longrightarrow\sf{x\:+\:8\:=\:20}

\:\:\:\:\:\:\:\:\:\Longrightarrow\sf{x\:=\:12}

\:\:\:\:\:\:{\bold{\purple{†}}}{\sf{\underline{\bold{(x\:+\:8)\:/\:2\:=\:10\:and\:number\:is\:12}}}}

\:\:\:\:\:\:\:\:\:\:\:\:\:{\bold{━━━━━━━━━━━━━━━}}

\huge{\red{\mathfrak{\sf{Question\:3}}}}

{ }

\Large{\bf{\blue{Given\::}}}

\footnotesize{\sf{2x \:+ \:3\: =\: 5}}

{ }

\Large{\bf{\blue{Find\::}}}

\footnotesize{\sf{Write\: this\: in \:statement\: form}}

{ }

\Large{\bf{\blue{Solution\::}}}

\:\:\:\:\:\:\:\:\::\:\Longrightarrow{\sf{2x\:+\:3\:=\:5}}

\:\:\:\:\:\:\:\:\::\:\Longrightarrow{\sf{2x\:=\:5\:-\:3}}

\:\:\:\:\:\:\:\:\::\:\Longrightarrow{\sf{2x\:=\:2}}

\:\:\:\:\:\:\:\:\::\:\Longrightarrow\sf{x\:=\:}{\bold{1}}

\:\:\:\:\:\:\:\:\:\:{\bold{\purple{†}}}{\sf{\underline{\:When\:you\:add\:3\:from\:2x\:,\:you\:left\:with\:5}}}

\:\:\:\:\:\:\:\:\:\:\:\:\:{\bold{━━━━━━━━━━━━━━━}}

\huge{\red{\mathfrak{\sf{Question\:4}}}}

{ }

\Large{\bf{\blue{Given\::}}}

\footnotesize{\sf{x\: +\: 6 \:=\: 15}}

{ }

\Large{\bf{\blue{Find\::}}}

\footnotesize{\sf{Value\:of\:x}}

{ }

\Large{\bf{\blue{Solution\::}}}

\:\:\:\:\:\:\:\:\::\:\Longrightarrow{\sf{x\:+\:6\:=\:15}}

\:\:\:\:\:\:\:\:\::\:\Longrightarrow{\sf{x\:=\:15\:-\:6}}

\:\:\:\:\:\:\:\:\::\:\Longrightarrow{\sf{x\:=\:9}}

\:\:\:\:\:\:\:\:\:\:{\bold{\purple{†}}}{\sf{\underline{\:So,\:the\:value\:of\:x\:is\:9}}}

\:\:\:\:\:\:\:\:\:\:\:\:\:{\bold{━━━━━━━━━━━━━━━}}

\huge{\red{\mathfrak{\sf{Question\:5}}}}

{ }

\Large{\bf{\blue{Given\::}}}

\footnotesize{\sf{Ravi\:and\:Arjun\:=\:3\::\:7}}

\footnotesize{\sf{Its\:addition\:=\:100}}

\Large{\bf{\blue{Find\::}}}

\footnotesize{\sf{Numbers\:of\:marbles\:of\:both}}

\Large{\bf{\blue{Solution\::}}}

\small\sf{Let\:Ravi\:and\:Arjun\:have\:3x\:and\:7x\:marbles\:respectively}

\bf{\underline{According\:to\:the\:question}}

\:\:\:\:\:\:\:\:\::\:\Longrightarrow{\sf{3x\:+\:7x\:=\:100}}

\:\:\:\:\:\:\:\:\::\:\Longrightarrow{\sf{10x\:=\:100}}

\:\:\:\:\:\:\:\:\::\:\Longrightarrow{\sf{x\:100\:\div\:10}}

\:\:\:\:\:\:\:\:\::\:\Longrightarrow{\sf{x\:=\:10}}

\sf{\bold{Hence,}}

\therefore{\sf{Ravi\:have\:=\:3x\:=\:3\:\times\:10}}

\:\:\:\:\:\:\:\:\::\:\Longrightarrow{\bf{\:30\:marbles}}

\therefore{\sf{Arjun\:have\:=\:7x\:=\:7\:\times\:10}}

\:\:\:\:\:\:\:\:\::\:\Longrightarrow{\bf{\:70\:marbles}}

{ }

\:\:\:\:\:\:\:\:\:\:{\bold{\purple{†}}}{\sf{\underline{\bold{\:So,\:Ravi\:have\:30\:marbles}}}}

\:\:\:\:\:\:\:\:\:\:{\bold{\purple{†}}}{\sf{\underline{\bold{\:And\:Arjun\:have\:70\:marbles}}}}

Similar questions