eolymp
bolt
Try our new interface for solving problems
Problems

CheckSum

CheckSum

Your task is to find a way to calculate a checksum for given text message. The following restrictions must be fulfilled: \begin{enumerate} \item The checksum is a two-byte non negative integer. \item If we consider the initial text message as a very long binary number (the first byte of the message is treated as the most significant byte of the binary number) and append to it the found two-byte checksum, then a new long binary number leaves a reminder \textbf{0} when divided by a given number \textbf{D}. \item If several integers satisfy previous condition, the checksum is minimal from such numbers. \item Number \textbf{D} equals \textbf{34943}. \end{enumerate} \textbf{Input} In the input file it is given a non empty text string which contains no more than \textbf{1024} ASCII characters. \textbf{Output} Output the calculated checksum as two hexadecimal numbers separated by one space. Each hexadecimal number must consists of exactly two digits.
Time limit 0.1 seconds
Memory limit 64 MiB
Input example #1
Hello, World!
Output example #1
68 41