Distributed Fault Detection in Formation of Multi-Agent Systems with Attack Impact Analysis