CodeFores contest 263 solutions. A and C solved correctly.