Home Web Board ProblemSet Standing Status Statistics
long long输出请使用 %lld服务器的python版本为3.4
Problem B: 五队-长春-Base64

Problem B: 五队-长春-Base64

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 42  Solved: 17
[Submit][Status][Web Board]


Base64 is an encoding standard. Everyone knows that some characters are used for controll or some other purposes and cannot be seen. And when transporting online, visible characters can be more convenient. Base64 is invented to solve this problem.
We take three bytes, and evenly split it to four part,then we use the converting table to convert the four part to four visible characters.
If the bytes at tail are shoter than three, we will add zeros to fill it. And put ‘=’ to show it’s added on purpose. So the number of ‘=’ can only be 0,1 or 2.
To make things easier, we will just give the convertion table in C/C++.The result of encoded string can only contain these characters and ‘=’

static char BASE64_ENCODING_TABLE [64] =  

'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', // 0 - 9

'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', // 10 - 19

'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', // 20 - 29

'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', // 30 - 39

'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', // 40 - 49

'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', // 50 - 59

'8', '9', '+', '/' // 60 - 63


Take ABC for example, the Ascii is 65,66,67, which in Hex is 41,42,43,the binary representation is 01000001,01000010,01000011, we will split it to 00 010000, 00 010100,00 001001,00 000011,so the corresponding encoding result is QUJD. Decoding is just the reversed operation.


There are multiple test cases. You are given some Base64 encoded string,one string per line,strings won’t contain spaces or invisible characters. You are requested to decode them. Process to end of file.It’s guaranteed that the input string is standard encoded string. Which means that the length of input string is the multiple of four.


Print the decoded result in Hex (Uppercase ,2 chars/byte) in one line.

Sample Input


Sample Output



[Submit][Status][Web Board]